40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import { http } from "@/utils/http";
|
|
import { baseUri } from "@/api/utils";
|
|
|
|
// 获取服务端信息
|
|
export const getServer = () => {
|
|
return http.request<any>("get", baseUri("/server"));
|
|
};
|
|
|
|
// 更新服务端信息
|
|
export const updateServer = (data?: object) => {
|
|
return http.request<any>("post", baseUri("/server"), { data });
|
|
};
|
|
|
|
// 获取全局配置
|
|
export const getGlobalConfig = () => {
|
|
return http.request<any>("get", baseUri("/setting/server"));
|
|
};
|
|
|
|
// 更新全局配置
|
|
export const updateGlobalSetting = (data?: object) => {
|
|
return http.request<any>("post", baseUri("/setting/server-global"), { data });
|
|
};
|
|
|
|
// 获取当前主机的公网IP
|
|
export const getPublicIP = () => {
|
|
return http.request<any>("get", baseUri("/setting/public-ip"));
|
|
};
|
|
|
|
// 获取服务端重启规则
|
|
export const getServerRestartRule = () => {
|
|
return http.request<any>("get", baseUri("/setting/restart-rule"));
|
|
};
|
|
|
|
// 重启服务端
|
|
export const restartServer = (data?: object) => {
|
|
return http.request<any>("post", baseUri("/server/control-server"), {
|
|
data
|
|
});
|
|
};
|