2022-09-15 10:44:43 +08:00
|
|
|
import http from '@/api';
|
2023-01-06 18:53:25 +08:00
|
|
|
import { ReqPage, ResPage } from '../interface';
|
2022-09-15 10:44:43 +08:00
|
|
|
import { Setting } from '../interface/setting';
|
|
|
|
|
|
|
|
export const getSettingInfo = () => {
|
|
|
|
return http.post<Setting.SettingInfo>(`/settings/search`);
|
|
|
|
};
|
2022-09-09 17:17:02 +08:00
|
|
|
|
|
|
|
export const updateSetting = (param: Setting.SettingUpdate) => {
|
2022-12-22 15:03:43 +08:00
|
|
|
return http.post(`/settings/update`, param);
|
2022-09-09 17:17:02 +08:00
|
|
|
};
|
2022-09-08 18:47:15 +08:00
|
|
|
|
|
|
|
export const updatePassword = (param: Setting.PasswordUpdate) => {
|
2022-12-22 15:03:43 +08:00
|
|
|
return http.post(`/settings/password/update`, param);
|
2022-09-08 18:47:15 +08:00
|
|
|
};
|
2022-09-13 18:45:03 +08:00
|
|
|
|
2023-01-29 16:38:34 +08:00
|
|
|
export const updatePort = (param: Setting.PortUpdate) => {
|
|
|
|
return http.post(`/settings/port/update`, param);
|
|
|
|
};
|
|
|
|
|
2022-09-29 16:15:59 +08:00
|
|
|
export const handleExpired = (param: Setting.PasswordUpdate) => {
|
2022-12-13 18:54:28 +08:00
|
|
|
return http.post(`/settings/expired/handle`, param);
|
2022-09-29 16:15:59 +08:00
|
|
|
};
|
|
|
|
|
2022-09-13 18:45:03 +08:00
|
|
|
export const syncTime = () => {
|
2022-12-22 15:03:43 +08:00
|
|
|
return http.post<string>(`/settings/time/sync`, {});
|
2022-09-13 18:45:03 +08:00
|
|
|
};
|
2022-09-14 23:27:17 +08:00
|
|
|
|
|
|
|
export const cleanMonitors = () => {
|
|
|
|
return http.post(`/settings/monitor/clean`, {});
|
|
|
|
};
|
|
|
|
|
|
|
|
export const getMFA = () => {
|
|
|
|
return http.get<Setting.MFAInfo>(`/settings/mfa`, {});
|
|
|
|
};
|
|
|
|
|
2022-12-07 17:28:14 +08:00
|
|
|
export const loadDaemonJsonPath = () => {
|
|
|
|
return http.get<string>(`/settings/daemonjson`, {});
|
|
|
|
};
|
|
|
|
|
2022-09-14 23:27:17 +08:00
|
|
|
export const bindMFA = (param: Setting.MFABind) => {
|
|
|
|
return http.post(`/settings/mfa/bind`, param);
|
|
|
|
};
|
2023-01-06 18:53:25 +08:00
|
|
|
|
2023-01-29 16:38:34 +08:00
|
|
|
export const loadBaseDir = () => {
|
|
|
|
return http.get<string>(`/settings/basedir`);
|
|
|
|
};
|
|
|
|
|
2023-01-06 18:53:25 +08:00
|
|
|
// snapshot
|
|
|
|
export const snapshotCreate = (param: Setting.SnapshotCreate) => {
|
|
|
|
return http.post(`/settings/snapshot`, param);
|
|
|
|
};
|
2023-01-09 22:55:10 +08:00
|
|
|
export const snapshotDelete = (param: { ids: number[] }) => {
|
|
|
|
return http.post(`/settings/snapshot/del`, param);
|
|
|
|
};
|
|
|
|
export const snapshotRecover = (param: Setting.SnapshotRecover) => {
|
|
|
|
return http.post(`/settings/snapshot/recover`, param);
|
|
|
|
};
|
|
|
|
export const snapshotRollback = (param: Setting.SnapshotRecover) => {
|
|
|
|
return http.post(`/settings/snapshot/rollback`, param);
|
|
|
|
};
|
2023-01-06 18:53:25 +08:00
|
|
|
export const searchSnapshotPage = (param: ReqPage) => {
|
|
|
|
return http.post<ResPage<Setting.SnapshotInfo>>(`/settings/snapshot/search`, param);
|
|
|
|
};
|
2023-01-09 22:55:10 +08:00
|
|
|
|
|
|
|
// upgrade
|
|
|
|
export const loadUpgradeInfo = () => {
|
|
|
|
return http.get<Setting.UpgradeInfo>(`/settings/upgrade`);
|
|
|
|
};
|
2023-01-30 21:05:20 +08:00
|
|
|
export const loadUpgradeInfoByOSS = () => {
|
|
|
|
return http.get<Setting.UpgradeInfo>(`/settings/upgrade/byoss`);
|
|
|
|
};
|
|
|
|
export const upgrade = (version: string) => {
|
|
|
|
return http.post(`/settings/upgrade`, { version: version });
|
|
|
|
};
|