2022-09-22 16:16:04 +08:00
|
|
|
import http from '@/api';
|
2022-11-28 13:50:53 +08:00
|
|
|
import { ResPage } from '../interface';
|
2022-09-22 16:16:04 +08:00
|
|
|
import { App } from '../interface/app';
|
|
|
|
|
|
|
|
export const SyncApp = () => {
|
|
|
|
return http.post<any>('apps/sync', {});
|
|
|
|
};
|
|
|
|
|
|
|
|
export const SearchApp = (req: App.AppReq) => {
|
|
|
|
return http.post<App.AppResPage>('apps/search', req);
|
|
|
|
};
|
2022-09-23 16:33:55 +08:00
|
|
|
|
|
|
|
export const GetApp = (id: number) => {
|
|
|
|
return http.get<App.AppDTO>('apps/' + id);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const GetAppDetail = (id: number, version: string) => {
|
2022-10-07 15:49:39 +08:00
|
|
|
return http.get<App.AppDetail>(`apps/detail/${id}/${version}`);
|
2022-09-23 16:33:55 +08:00
|
|
|
};
|
2022-09-26 16:32:40 +08:00
|
|
|
|
|
|
|
export const InstallApp = (install: App.AppInstall) => {
|
|
|
|
return http.post<any>('apps/install', install);
|
|
|
|
};
|
|
|
|
|
2022-11-08 14:34:41 +08:00
|
|
|
export const ChangePort = (params: App.ChangePort) => {
|
|
|
|
return http.post<any>('apps/installed/port/change', params);
|
|
|
|
};
|
|
|
|
|
2022-11-28 13:50:53 +08:00
|
|
|
export const SearchAppInstalled = (search: App.AppInstallSearch) => {
|
|
|
|
return http.post<ResPage<App.AppInstalled>>('apps/installed', search);
|
2022-09-26 16:32:40 +08:00
|
|
|
};
|
2022-09-26 18:20:21 +08:00
|
|
|
|
2022-12-04 19:20:36 +08:00
|
|
|
export const GetAppPort = (key: string) => {
|
|
|
|
return http.get<number>(`apps/installed/loadport/${key}`);
|
|
|
|
};
|
|
|
|
|
2022-11-18 16:14:23 +08:00
|
|
|
export const CheckAppInstalled = (key: string) => {
|
|
|
|
return http.get<App.CheckInstalled>(`apps/installed/check/${key}`);
|
|
|
|
};
|
|
|
|
|
2022-12-01 19:25:02 +08:00
|
|
|
export const AppInstalledDeleteCheck = (appInstallId: number) => {
|
|
|
|
return http.get<App.AppInstallResource[]>(`apps/installed/delete/check/${appInstallId}`);
|
|
|
|
};
|
|
|
|
|
2022-11-28 13:50:53 +08:00
|
|
|
export const GetAppInstalled = (search: App.AppInstalledSearch) => {
|
2022-10-28 17:04:57 +08:00
|
|
|
return http.post<App.AppInstalled[]>('apps/installed', search);
|
|
|
|
};
|
|
|
|
|
2022-09-26 18:20:21 +08:00
|
|
|
export const InstalledOp = (op: App.AppInstalledOp) => {
|
|
|
|
return http.post<any>('apps/installed/op', op);
|
|
|
|
};
|
2022-09-29 18:16:56 +08:00
|
|
|
|
|
|
|
export const SyncInstalledApp = () => {
|
|
|
|
return http.post<any>('apps/installed/sync', {});
|
|
|
|
};
|
2022-10-07 15:49:39 +08:00
|
|
|
|
|
|
|
export const GetAppService = (key: string | undefined) => {
|
2022-12-02 10:31:07 +08:00
|
|
|
return http.get<App.AppService[]>(`apps/services/${key}`);
|
2022-10-07 15:49:39 +08:00
|
|
|
};
|
2022-10-12 18:57:22 +08:00
|
|
|
|
|
|
|
export const GetAppBackups = (info: App.AppBackupReq) => {
|
|
|
|
return http.post<ResPage<App.AppBackup>>('apps/installed/backups', info);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const DelAppBackups = (req: App.AppBackupDelReq) => {
|
|
|
|
return http.post<any>('apps/installed/backups/del', req);
|
|
|
|
};
|
2022-10-13 18:56:53 +08:00
|
|
|
|
|
|
|
export const GetAppUpdateVersions = (id: number) => {
|
|
|
|
return http.get<any>(`apps/installed/${id}/versions`);
|
|
|
|
};
|
2022-12-09 17:16:07 +08:00
|
|
|
|
|
|
|
export const GetAppDefaultConfig = (key: string) => {
|
|
|
|
return http.get<string>(`apps/installed/conf/${key}`);
|
|
|
|
};
|