Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Waiting to run
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Waiting to run
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Waiting to run
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
let settings = {}
|
|
|
|
const get_all_settings = async () => {
|
|
settings = await fetch(routes.settings_get(), {
|
|
method: 'POST',
|
|
body: `{"token":"${localStorage.getItem("token")}"}`
|
|
}).then(data => data.json()).then(jsondata => {
|
|
return jsondata.settings
|
|
}).catch((error) => {
|
|
notification(`Ошибка на сервере: ${error}`, "error")
|
|
})
|
|
|
|
get_ssh_status()
|
|
get_ssh_keys()
|
|
get_ssh_port()
|
|
get_ssh_server()
|
|
|
|
get_telnet_enabled_status()
|
|
get_telnet_port()
|
|
|
|
get_ftp_enabled_status()
|
|
|
|
get_dns_enabled_status()
|
|
get_dns_server()
|
|
get_local_domains()
|
|
|
|
get_wifi_status()
|
|
get_wifi_name()
|
|
get_wifi_channel()
|
|
}
|
|
|
|
const set_all_settings = async () => {
|
|
settings = await fetch(routes.settings_set(), {
|
|
method: 'POST',
|
|
body: `{"token":"${localStorage.getItem("token")}","settings":${JSON.stringify(settings)}}`
|
|
}).then(res => res.json()).then(jsondata => {
|
|
notification("Настройки сохранены", "success")
|
|
return jsondata.settings
|
|
}).catch((error) => {
|
|
notification(`Ошибка на сервере: ${error}`, "error")
|
|
})
|
|
}
|