mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-30 16:01:06 +00:00
* fix: 删除 PHP 和 Node.js 运行环境的提示信息优化 * fix: 代码优化 * fix: 代码优化 --------- Co-authored-by: zhoujunhong <1298308460@qq.com>
70 lines
2.3 KiB
Go
70 lines
2.3 KiB
Go
import http from '@/api';
|
|
import { ResPage, ReqPage } from '../interface';
|
|
import { Runtime } from '../interface/runtime';
|
|
import { TimeoutEnum } from '@/enums/http-enum';
|
|
import { App } from '@/api/interface/app';
|
|
|
|
export const SearchRuntimes = (req: Runtime.RuntimeReq) => {
|
|
return http.post<ResPage<Runtime.RuntimeDTO>>(`/runtimes/search`, req);
|
|
};
|
|
|
|
export const CreateRuntime = (req: Runtime.RuntimeCreate) => {
|
|
return http.post<Runtime.Runtime>(`/runtimes`, req);
|
|
};
|
|
|
|
export const DeleteRuntime = (req: Runtime.RuntimeDelete) => {
|
|
return http.post<any>(`/runtimes/del`, req);
|
|
};
|
|
|
|
export const RuntimeDeleteCheck = (runTimeId: number) => {
|
|
return http.get<App.AppInstallResource[]>(`runtimes/installed/delete/check/${runTimeId}`);
|
|
};
|
|
|
|
export const GetRuntime = (id: number) => {
|
|
return http.get<Runtime.RuntimeDTO>(`/runtimes/${id}`);
|
|
};
|
|
|
|
export const UpdateRuntime = (req: Runtime.RuntimeUpdate) => {
|
|
return http.post<any>(`/runtimes/update`, req);
|
|
};
|
|
|
|
export const GetNodeScripts = (req: Runtime.NodeReq) => {
|
|
return http.post<Runtime.NodeScripts[]>(`/runtimes/node/package`, req);
|
|
};
|
|
|
|
export const OperateRuntime = (req: Runtime.RuntimeOperate) => {
|
|
return http.post<any>(`/runtimes/operate`, req);
|
|
};
|
|
|
|
export const GetNodeModules = (req: Runtime.NodeModuleReq) => {
|
|
return http.post<Runtime.NodeModule[]>(`/runtimes/node/modules`, req);
|
|
};
|
|
|
|
export const OperateNodeModule = (req: Runtime.NodeModuleReq) => {
|
|
return http.post<any>(`/runtimes/node/modules/operate`, req, TimeoutEnum.T_10M);
|
|
};
|
|
|
|
export const SearchPHPExtensions = (req: ReqPage) => {
|
|
return http.post<ResPage<Runtime.PHPExtensions>>(`/runtimes/php/extensions/search`, req);
|
|
};
|
|
|
|
export const ListPHPExtensions = (req: Runtime.PHPExtensionsList) => {
|
|
return http.post<Runtime.PHPExtensions[]>(`/runtimes/php/extensions/search`, req);
|
|
};
|
|
|
|
export const CreatePHPExtensions = (req: Runtime.PHPExtensionsCreate) => {
|
|
return http.post<any>(`/runtimes/php/extensions`, req);
|
|
};
|
|
|
|
export const UpdatePHPExtensions = (req: Runtime.PHPExtensionsUpdate) => {
|
|
return http.post<any>(`/runtimes/php/extensions/update`, req);
|
|
};
|
|
|
|
export const DeletePHPExtensions = (req: Runtime.PHPExtensionsDelete) => {
|
|
return http.post<any>(`/runtimes/php/extensions/del`, req);
|
|
};
|
|
|
|
export const SyncRuntime = () => {
|
|
return http.post(`/runtimes/sync`, {});
|
|
};
|