mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-10-17 16:00:43 +00:00
* feat: add node selection reports * Merge dev-v2 and resolve PR conflicts --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
51 lines
1.8 KiB
Go
51 lines
1.8 KiB
Go
import http from '@/api';
|
|
import { Dashboard } from '../interface/dashboard';
|
|
|
|
export const loadOsInfo = () => {
|
|
return http.get<Dashboard.OsInfo>(`/dashboard/base/os`);
|
|
};
|
|
|
|
export const loadQuickOption = () => {
|
|
return http.get<Array<Dashboard.QuickJump>>(`/dashboard/quick/option`);
|
|
};
|
|
export const changeQuick = (quicks: Array<Dashboard.QuickJump>) => {
|
|
return http.post(`/dashboard/quick/change`, { quicks: quicks });
|
|
};
|
|
export const loadAppLauncher = () => {
|
|
return http.get<Array<Dashboard.AppLauncher>>(`/dashboard/app/launcher`);
|
|
};
|
|
export const loadAppLauncherOption = (filter: string) => {
|
|
return http.post<Array<Dashboard.AppLauncherOption>>(`/dashboard/app/launcher/option`, { filter: filter });
|
|
};
|
|
export const changeLauncherStatus = (key: string, val: string) => {
|
|
return http.post(`/dashboard/app/launcher/show`, { key: key, value: val });
|
|
};
|
|
|
|
export const loadBaseInfo = (ioOption: string, netOption: string, currentNode?: string) => {
|
|
return http.get<Dashboard.BaseInfo>(
|
|
`/dashboard/base/${ioOption}/${netOption}`,
|
|
{},
|
|
currentNode ? { headers: { CurrentNode: currentNode } } : {},
|
|
);
|
|
};
|
|
|
|
export const loadCurrentInfo = (ioOption: string, netOption: string, currentNode?: string) => {
|
|
return http.get<Dashboard.CurrentInfo>(
|
|
`/dashboard/current/${ioOption}/${netOption}`,
|
|
{},
|
|
currentNode ? { headers: { CurrentNode: currentNode } } : {},
|
|
);
|
|
};
|
|
|
|
export const loadTopCPU = () => {
|
|
return http.get<Array<Dashboard.Process>>(`/dashboard/current/top/cpu`);
|
|
};
|
|
|
|
export const loadTopMem = () => {
|
|
return http.get<Array<Dashboard.Process>>(`/dashboard/current/top/mem`);
|
|
};
|
|
|
|
export const systemRestart = (operation: string) => {
|
|
return http.post(`/dashboard/system/restart/${operation}`);
|
|
};
|