mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 04:32:56 +00:00
Added delete endpoint for enterprise config ID
This commit is contained in:
parent
86f52550e2
commit
f4b203863c
@ -1,7 +1,7 @@
|
|||||||
use std::env;
|
use std::env;
|
||||||
use std::sync::OnceLock;
|
use std::sync::OnceLock;
|
||||||
use log::info;
|
use log::info;
|
||||||
use rocket::get;
|
use rocket::{delete, get};
|
||||||
use sys_locale::get_locale;
|
use sys_locale::get_locale;
|
||||||
use crate::api_token::APIToken;
|
use crate::api_token::APIToken;
|
||||||
|
|
||||||
@ -70,6 +70,29 @@ pub fn read_enterprise_env_config_id(_token: APIToken) -> String {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[delete("/system/enterprise/config/id")]
|
||||||
|
pub fn delete_enterprise_env_config_id(_token: APIToken) -> String {
|
||||||
|
//
|
||||||
|
// When we are on a Windows machine, we try to read the enterprise config from
|
||||||
|
// the Windows registry. In case we can't find the registry key, or we are on a
|
||||||
|
// macOS or Linux machine, we try to read the enterprise config from the
|
||||||
|
// environment variables.
|
||||||
|
//
|
||||||
|
// The registry key is:
|
||||||
|
// HKEY_CURRENT_USER\Software\github\MindWork AI Studio\Enterprise IT
|
||||||
|
//
|
||||||
|
// In this registry key, we expect the following values:
|
||||||
|
// - delete_config_id
|
||||||
|
//
|
||||||
|
// The environment variable is:
|
||||||
|
// MINDWORK_AI_STUDIO_ENTERPRISE_DELETE_CONFIG_ID
|
||||||
|
//
|
||||||
|
get_enterprise_configuration(
|
||||||
|
"delete_config_id",
|
||||||
|
"MINDWORK_AI_STUDIO_ENTERPRISE_DELETE_CONFIG_ID",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
#[get("/system/enterprise/config/server")]
|
#[get("/system/enterprise/config/server")]
|
||||||
pub fn read_enterprise_env_config_server_url(_token: APIToken) -> String {
|
pub fn read_enterprise_env_config_server_url(_token: APIToken) -> String {
|
||||||
//
|
//
|
||||||
|
@ -79,6 +79,7 @@ pub fn start_runtime_api() {
|
|||||||
crate::environment::get_config_directory,
|
crate::environment::get_config_directory,
|
||||||
crate::environment::read_user_language,
|
crate::environment::read_user_language,
|
||||||
crate::environment::read_enterprise_env_config_id,
|
crate::environment::read_enterprise_env_config_id,
|
||||||
|
crate::environment::delete_enterprise_env_config_id,
|
||||||
crate::environment::read_enterprise_env_config_server_url,
|
crate::environment::read_enterprise_env_config_server_url,
|
||||||
crate::file_data::extract_data,
|
crate::file_data::extract_data,
|
||||||
crate::file_data::read_pdf,
|
crate::file_data::read_pdf,
|
||||||
|
Loading…
Reference in New Issue
Block a user