[ui] Add auto-mount on first launch functionality #52
This commit is contained in:
@@ -199,29 +199,6 @@ void mgmt_app_config::set_api_user(std::string_view api_user) {
|
|||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
void mgmt_app_config::set_hidden(bool hidden) { hidden_ = hidden; }
|
|
||||||
|
|
||||||
void mgmt_app_config::set_launch_only(bool launch_only) {
|
|
||||||
launch_only_ = launch_only;
|
|
||||||
}
|
|
||||||
|
|
||||||
void mgmt_app_config::set_mount_location(provider_type prov,
|
|
||||||
std::string_view name,
|
|
||||||
std::string_view location) {
|
|
||||||
if (name.empty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
recur_mutex_lock lock(mtx_);
|
|
||||||
if (locations_[prov][std::string{name}] == std::string{location}) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
locations_[prov][std::string{name}] = std::string{location};
|
|
||||||
|
|
||||||
save();
|
|
||||||
}
|
|
||||||
|
|
||||||
void mgmt_app_config::set_auto_start(bool auto_start) {
|
void mgmt_app_config::set_auto_start(bool auto_start) {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
@@ -323,14 +300,37 @@ void mgmt_app_config::set_auto_start(provider_type prov, std::string_view name,
|
|||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mgmt_app_config::set_hidden(bool hidden) { hidden_ = hidden; }
|
||||||
|
|
||||||
|
void mgmt_app_config::set_launch_only(bool launch_only) {
|
||||||
|
launch_only_ = launch_only;
|
||||||
|
}
|
||||||
|
|
||||||
|
void mgmt_app_config::set_mount_location(provider_type prov,
|
||||||
|
std::string_view name,
|
||||||
|
std::string_view location) {
|
||||||
|
if (name.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
recur_mutex_lock lock(mtx_);
|
||||||
|
if (locations_[prov][std::string{name}] == std::string{location}) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
locations_[prov][std::string{name}] = std::string{location};
|
||||||
|
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
|
||||||
auto mgmt_app_config::to_json() const -> nlohmann::json {
|
auto mgmt_app_config::to_json() const -> nlohmann::json {
|
||||||
nlohmann::json data;
|
nlohmann::json data;
|
||||||
data[JSON_AUTO_START] = auto_start_;
|
|
||||||
data[JSON_API_PASSWORD] = api_password_;
|
data[JSON_API_PASSWORD] = api_password_;
|
||||||
data[JSON_API_PORT] = api_port_;
|
data[JSON_API_PORT] = api_port_;
|
||||||
data[JSON_API_USER] = api_user_;
|
data[JSON_API_USER] = api_user_;
|
||||||
data[JSON_MOUNT_LOCATIONS] = map_to_json(locations_);
|
data[JSON_AUTO_START] = auto_start_;
|
||||||
data[JSON_MOUNT_AUTO_START] = map_to_json(mount_auto_start_);
|
data[JSON_MOUNT_AUTO_START] = map_to_json(mount_auto_start_);
|
||||||
|
data[JSON_MOUNT_LOCATIONS] = map_to_json(locations_);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
} // namespace repertory::ui
|
} // namespace repertory::ui
|
||||||
|
Reference in New Issue
Block a user