1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 14:08:06 +08:00

feat: Standardized interface name capitalization (#7770)

This commit is contained in:
zhengkunwang 2025-01-24 22:38:10 +08:00 committed by GitHub
parent 6a8e41937d
commit 90354451d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
138 changed files with 686 additions and 699 deletions

View File

@ -31,7 +31,7 @@ func Init() {
global.Dir.RecycleBinDir, _ = fileOp.CreateDirWithPath(true, "/.1panel_clash")
global.Dir.SSLLogDir, _ = fileOp.CreateDirWithPath(true, path.Join(baseDir, "1panel/log/ssl"))
loadLocalDir()
//loadLocalDir()
}
func loadLocalDir() {

View File

@ -3,123 +3,119 @@ import { ResPage } from '../interface';
import { App } from '../interface/app';
import { TimeoutEnum } from '@/enums/http-enum';
export const SyncApp = (req: App.AppStoreSync) => {
export const syncApp = (req: App.AppStoreSync) => {
return http.post('apps/sync/remote', req);
};
export const SyncLocalApp = (req: App.AppStoreSync) => {
export const syncLocalApp = (req: App.AppStoreSync) => {
return http.post('apps/sync/local', req);
};
export const GetAppListUpdate = () => {
return http.get<App.AppUpdateRes>('apps/checkupdate');
};
export const SearchApp = (req: App.AppReq) => {
export const searchApp = (req: App.AppReq) => {
return http.post<App.AppResPage>('apps/search', req);
};
export const GetApp = (key: string) => {
export const getAppByKey = (key: string) => {
return http.get<App.AppDTO>('apps/' + key);
};
export const GetAppTags = () => {
export const getAppTags = () => {
return http.get<App.Tag[]>('apps/tags');
};
export const GetAppDetail = (appID: number, version: string, type: string) => {
export const getAppDetail = (appID: number, version: string, type: string) => {
return http.get<App.AppDetail>(`apps/detail/${appID}/${version}/${type}`);
};
export const GetAppDetailByID = (id: number) => {
export const getAppDetailByID = (id: number) => {
return http.get<App.AppDetail>(`apps/details/${id}`);
};
export const InstallApp = (install: App.AppInstall) => {
export const installApp = (install: App.AppInstall) => {
return http.post<any>('apps/install', install);
};
export const ChangePort = (params: App.ChangePort) => {
export const changePort = (params: App.ChangePort) => {
return http.post<any>('apps/installed/port/change', params);
};
export const SearchAppInstalled = (search: App.AppInstallSearch) => {
export const searchAppInstalled = (search: App.AppInstallSearch) => {
return http.post<ResPage<App.AppInstallDto>>('apps/installed/search', search);
};
export const ListAppInstalled = () => {
export const listAppInstalled = () => {
return http.get<Array<App.AppInstalledInfo>>('apps/installed/list');
};
export const GetAppPort = (type: string, name: string) => {
export const getAppPort = (type: string, name: string) => {
return http.post<number>(`apps/installed/loadport`, { type: type, name: name });
};
export const GetAppConnInfo = (type: string, name: string) => {
export const getAppConnInfo = (type: string, name: string) => {
return http.post<App.DatabaseConnInfo>(`apps/installed/conninfo`, { type: type, name: name });
};
export const CheckAppInstalled = (key: string, name: string) => {
export const checkAppInstalled = (key: string, name: string) => {
return http.post<App.CheckInstalled>(`apps/installed/check`, { key: key, name: name });
};
export const AppInstalledDeleteCheck = (appInstallId: number) => {
export const appInstalledDeleteCheck = (appInstallId: number) => {
return http.get<App.AppInstallResource[]>(`apps/installed/delete/check/${appInstallId}`);
};
export const GetAppInstalled = (search: App.AppInstalledSearch) => {
export const getAppInstalled = (search: App.AppInstalledSearch) => {
return http.post<App.AppInstalled[]>('apps/installed/search', search);
};
export const InstalledOp = (op: App.AppInstalledOp) => {
export const installedOp = (op: App.AppInstalledOp) => {
return http.post<any>('apps/installed/op', op, TimeoutEnum.T_40S);
};
export const SyncInstalledApp = () => {
export const syncInstalledApp = () => {
return http.post<any>('apps/installed/sync', {});
};
export const GetAppService = (key: string | undefined) => {
export const getAppService = (key: string | undefined) => {
return http.get<App.AppService[]>(`apps/services/${key}`);
};
export const GetAppUpdateVersions = (req: App.AppUpdateVersionReq) => {
export const getAppUpdateVersions = (req: App.AppUpdateVersionReq) => {
return http.post<any>(`apps/installed/update/versions`, req);
};
export const GetAppDefaultConfig = (key: string, name: string) => {
export const getAppDefaultConfig = (key: string, name: string) => {
return http.post<string>(`apps/installed/conf`, { type: key, name: name });
};
export const GetAppInstallParams = (id: number) => {
export const getAppInstallParams = (id: number) => {
return http.get<App.AppConfig>(`apps/installed/params/${id}`);
};
export const UpdateAppInstallParams = (req: any) => {
export const updateAppInstallParams = (req: any) => {
return http.post<any>(`apps/installed/params/update`, req);
};
export const IgnoreUpgrade = (req: any) => {
export const ignoreUpgrade = (req: any) => {
return http.post<any>(`apps/installed/ignore`, req);
};
export const GetIgnoredApp = () => {
export const getIgnoredApp = () => {
return http.get<App.IgnoredApp>(`apps/ignored/detail`);
};
export const UpdateInstallConfig = (req: App.AppConfigUpdate) => {
export const updateInstallConfig = (req: App.AppConfigUpdate) => {
return http.post(`apps/installed/config/update`, req);
};
export const GetAppStoreConfig = () => {
export const getAppStoreConfig = () => {
return http.get<App.AppStoreConfig>(`apps/store/config`);
};
export const UpdateAppStoreConfig = (req: App.AppStoreConfig) => {
export const updateAppStoreConfig = (req: App.AppStoreConfig) => {
return http.post(`apps/store/update`, req);
};
export const SyncCutomAppStore = (req: App.AppStoreSync) => {
export const syncCutomAppStore = (req: App.AppStoreSync) => {
return http.post(`/custom/app/sync`, req);
};

View File

@ -5,87 +5,87 @@ import { ResPage } from '../interface';
import { TimeoutEnum } from '@/enums/http-enum';
import { ReqPage } from '@/api/interface';
export const GetFilesList = (params: File.ReqFile) => {
export const getFilesList = (params: File.ReqFile) => {
return http.post<File.File>('files/search', params, TimeoutEnum.T_5M);
};
export const GetUploadList = (params: File.SearchUploadInfo) => {
export const getUploadList = (params: File.SearchUploadInfo) => {
return http.post<ResPage<File.UploadInfo>>('files/upload/search', params);
};
export const GetFilesTree = (params: File.ReqFile) => {
export const getFilesTree = (params: File.ReqFile) => {
return http.post<File.FileTree[]>('files/tree', params);
};
export const CreateFile = (form: File.FileCreate) => {
export const createFile = (form: File.FileCreate) => {
return http.post<File.File>('files', form);
};
export const DeleteFile = (form: File.FileDelete) => {
export const deleteFile = (form: File.FileDelete) => {
return http.post<File.File>('files/del', form);
};
export const BatchDeleteFile = (form: File.FileBatchDelete) => {
export const batchDeleteFile = (form: File.FileBatchDelete) => {
return http.post('files/batch/del', form);
};
export const ChangeFileMode = (form: File.FileCreate) => {
export const changeFileMode = (form: File.FileCreate) => {
return http.post<File.File>('files/mode', form);
};
export const CompressFile = (form: File.FileCompress) => {
export const compressFile = (form: File.FileCompress) => {
return http.post<File.File>('files/compress', form, TimeoutEnum.T_10M);
};
export const DeCompressFile = (form: File.FileDeCompress) => {
export const deCompressFile = (form: File.FileDeCompress) => {
return http.post<File.File>('files/decompress', form, TimeoutEnum.T_10M);
};
export const GetFileContent = (params: File.ReqFile) => {
export const getFileContent = (params: File.ReqFile) => {
return http.post<File.File>('files/content', params);
};
export const SaveFileContent = (params: File.FileEdit) => {
export const saveFileContent = (params: File.FileEdit) => {
return http.post<File.File>('files/save', params);
};
export const CheckFile = (path: string) => {
export const checkFile = (path: string) => {
return http.post<boolean>('files/check', { path: path });
};
export const UploadFileData = (params: FormData, config: AxiosRequestConfig) => {
export const uploadFileData = (params: FormData, config: AxiosRequestConfig) => {
return http.upload<File.File>('files/upload', params, config);
};
export const ChunkUploadFileData = (params: FormData, config: AxiosRequestConfig) => {
export const chunkUploadFileData = (params: FormData, config: AxiosRequestConfig) => {
return http.upload<File.File>('files/chunkupload', params, config);
};
export const RenameRile = (params: File.FileRename) => {
export const renameRile = (params: File.FileRename) => {
return http.post<File.File>('files/rename', params);
};
export const ChangeOwner = (params: File.FileOwner) => {
export const changeOwner = (params: File.FileOwner) => {
return http.post<File.File>('files/owner', params);
};
export const WgetFile = (params: File.FileWget) => {
export const wgetFile = (params: File.FileWget) => {
return http.post<File.FileWgetRes>('files/wget', params);
};
export const MoveFile = (params: File.FileMove) => {
export const moveFile = (params: File.FileMove) => {
return http.post<File.File>('files/move', params, TimeoutEnum.T_5M);
};
export const DownloadFile = (params: File.FileDownload) => {
export const downloadFile = (params: File.FileDownload) => {
return http.download<BlobPart>('files/download', params, { responseType: 'blob', timeout: TimeoutEnum.T_40S });
};
export const ComputeDirSize = (params: File.DirSizeReq) => {
export const computeDirSize = (params: File.DirSizeReq) => {
return http.post<File.DirSizeRes>('files/size', params, TimeoutEnum.T_5M);
};
export const FileKeys = () => {
export const fileKeys = () => {
return http.get<File.FileKeys>('files/keys');
};
@ -101,30 +101,30 @@ export const clearRecycle = () => {
return http.post<any>('files/recycle/clear');
};
export const SearchFavorite = (params: ReqPage) => {
export const searchFavorite = (params: ReqPage) => {
return http.post<ResPage<File.Favorite>>('files/favorite/search', params);
};
export const AddFavorite = (path: string) => {
export const addFavorite = (path: string) => {
return http.post<any>('files/favorite', { path: path });
};
export const ReadByLine = (req: File.FileReadByLine) => {
export const readByLine = (req: File.FileReadByLine) => {
return http.post<any>('files/read', req);
};
export const RemoveFavorite = (id: number) => {
export const removeFavorite = (id: number) => {
return http.post<any>('files/favorite/del', { id: id });
};
export const BatchChangeRole = (params: File.FileRole) => {
export const batchChangeRole = (params: File.FileRole) => {
return http.post<any>('files/batch/role', params);
};
export const GetRecycleStatus = () => {
export const getRecycleStatus = () => {
return http.get<string>('files/recycle/status');
};
export const GetPathByType = (pathType: string) => {
export const getPathByType = (pathType: string) => {
return http.get<string>(`files/path/${pathType}`);
};

View File

@ -1,15 +1,15 @@
import { Group } from '../interface/group';
import http from '@/api';
export const GetGroupList = (type: string) => {
export const getGroupList = (type: string) => {
return http.post<Array<Group.GroupInfo>>(`/core/groups/search`, { type: type });
};
export const CreateGroup = (params: Group.GroupCreate) => {
export const createGroup = (params: Group.GroupCreate) => {
return http.post<Group.GroupCreate>(`/core/groups`, params);
};
export const UpdateGroup = (params: Group.GroupUpdate) => {
export const updateGroup = (params: Group.GroupUpdate) => {
return http.post(`/core/groups/update`, params);
};
export const DeleteGroup = (id: number) => {
export const deleteGroup = (id: number) => {
return http.post(`/core/groups/del`, { id: id });
};

View File

@ -2,42 +2,38 @@ import http from '@/api';
import { HostTool } from '../interface/host-tool';
import { TimeoutEnum } from '@/enums/http-enum';
export const GetSupervisorStatus = () => {
export const getSupervisorStatus = () => {
return http.post<HostTool.HostTool>(`/hosts/tool`, { type: 'supervisord', operate: 'status' });
};
export const OperateSupervisor = (operate: string) => {
export const operateSupervisor = (operate: string) => {
return http.post<any>(`/hosts/tool/operate`, { type: 'supervisord', operate: operate });
};
export const OperateSupervisorConfig = (req: HostTool.SupersivorConfig) => {
export const operateSupervisorConfig = (req: HostTool.SupersivorConfig) => {
return http.post<HostTool.SupersivorConfigRes>(`/hosts/tool/config`, req);
};
export const GetSupervisorLog = () => {
export const getSupervisorLog = () => {
return http.post<any>(`/hosts/tool/log`, { type: 'supervisord' });
};
export const InitSupervisor = (req: HostTool.SupersivorInit) => {
export const initSupervisor = (req: HostTool.SupersivorInit) => {
return http.post<any>(`/hosts/tool/init`, req);
};
export const CreateSupervisorProcess = (req: HostTool.SupersivorProcess) => {
export const createSupervisorProcess = (req: HostTool.SupersivorProcess) => {
return http.post<any>(`/hosts/tool/supervisor/process`, req);
};
export const OperateSupervisorProcess = (req: HostTool.ProcessReq) => {
export const operateSupervisorProcess = (req: HostTool.ProcessReq) => {
return http.post<any>(`/hosts/tool/supervisor/process`, req, TimeoutEnum.T_60S);
};
export const LoadProcessStatus = () => {
return http.post<Array<HostTool.ProcessStatus>>(`/hosts/tool/supervisor/process/load`, {}, TimeoutEnum.T_40S);
};
export const GetSupervisorProcess = () => {
export const getSupervisorProcess = () => {
return http.get<HostTool.SupersivorProcess[]>(`/hosts/tool/supervisor/process`);
};
export const OperateSupervisorProcessFile = (req: HostTool.ProcessFileReq) => {
export const operateSupervisorProcessFile = (req: HostTool.ProcessFileReq) => {
return http.post<any>(`/hosts/tool/supervisor/process/file`, req, TimeoutEnum.T_60S);
};

View File

@ -2,34 +2,34 @@ import http from '@/api';
import { File } from '../interface/file';
import { Nginx } from '../interface/nginx';
export const GetNginx = () => {
export const getNginx = () => {
return http.get<File.File>(`/openresty`);
};
export const GetNginxConfigByScope = (req: Nginx.NginxScopeReq) => {
export const getNginxConfigByScope = (req: Nginx.NginxScopeReq) => {
return http.post<Nginx.NginxParam[]>(`/openresty/scope`, req);
};
export const UpdateNginxConfigByScope = (req: Nginx.NginxConfigReq) => {
export const updateNginxConfigByScope = (req: Nginx.NginxConfigReq) => {
return http.post(`/openresty/update`, req);
};
export const GetNginxStatus = () => {
export const getNginxStatus = () => {
return http.get<Nginx.NginxStatus>(`/openresty/status`);
};
export const UpdateNginxConfigFile = (req: Nginx.NginxFileUpdate) => {
export const updateNginxConfigFile = (req: Nginx.NginxFileUpdate) => {
return http.post(`/openresty/file`, req);
};
export const BuildNginx = (req: Nginx.NginxBuildReq) => {
export const buildNginx = (req: Nginx.NginxBuildReq) => {
return http.post(`/openresty/build`, req);
};
export const GetNginxModules = () => {
export const getNginxModules = () => {
return http.get<Nginx.NginxBuildConfig>(`/openresty/modules`);
};
export const UpdateNginxModule = (req: Nginx.NginxModuleUpdate) => {
export const updateNginxModule = (req: Nginx.NginxModuleUpdate) => {
return http.post(`/openresty/modules/update`, req);
};

View File

@ -1,6 +1,6 @@
import http from '@/api';
import { Process } from '../interface/process';
export const StopProcess = (req: Process.StopReq) => {
export const stopProcess = (req: Process.StopReq) => {
return http.post<any>(`/process/stop`, req);
};

View File

@ -110,14 +110,14 @@ export const GetSupervisorProcess = (id: number) => {
return http.get<HostTool.ProcessStatus[]>(`/runtimes/supervisor/process/${id}`);
};
export const OperateSupervisorProcess = (req: Runtime.ProcessReq) => {
export const operateSupervisorProcess = (req: Runtime.ProcessReq) => {
return http.post(`/runtimes/supervisor/process`, req, TimeoutEnum.T_60S);
};
export const OperateSupervisorProcessFile = (req: Runtime.ProcessFileReq) => {
export const operateSupervisorProcessFile = (req: Runtime.ProcessFileReq) => {
return http.post<string>(`/runtimes/supervisor/process/file`, req, TimeoutEnum.T_60S);
};
export const CreateSupervisorProcess = (req: Runtime.SupersivorProcess) => {
export const createSupervisorProcess = (req: Runtime.SupersivorProcess) => {
return http.post(`/runtimes/supervisor/process`, req);
};

View File

@ -5,7 +5,7 @@ import { ResPage, SearchWithPage, DescriptionUpdate, ReqPage } from '../interfac
import { Setting } from '../interface/setting';
// license
export const UploadFileData = (params: FormData) => {
export const uploadFileData = (params: FormData) => {
return http.upload('/core/licenses/upload', params);
};
export const SearchLicense = (params: ReqPage) => {

View File

@ -6,15 +6,15 @@ import { TimeoutEnum } from '@/enums/http-enum';
import { deepCopy } from '@/utils/util';
import { Base64 } from 'js-base64';
export const SearchWebsites = (req: Website.WebSiteSearch) => {
export const searchWebsites = (req: Website.WebSiteSearch) => {
return http.post<ResPage<Website.WebsiteRes>>(`/websites/search`, req);
};
export const ListWebsites = () => {
export const listWebsites = () => {
return http.get<Website.WebsiteDTO>(`/websites/list`);
};
export const CreateWebsite = (req: Website.WebSiteCreateReq) => {
export const createWebsite = (req: Website.WebSiteCreateReq) => {
let request = deepCopy(req) as Website.WebSiteCreateReq;
if (request.ftpPassword) {
request.ftpPassword = Base64.encode(request.ftpPassword);
@ -22,324 +22,316 @@ export const CreateWebsite = (req: Website.WebSiteCreateReq) => {
return http.post<any>(`/websites`, request, TimeoutEnum.T_10M);
};
export const OpWebsite = (req: Website.WebSiteOp) => {
export const opWebsite = (req: Website.WebSiteOp) => {
return http.post<any>(`/websites/operate`, req);
};
export const OpWebsiteLog = (req: Website.WebSiteOpLog) => {
export const opWebsiteLog = (req: Website.WebSiteOpLog) => {
return http.post<Website.WebSiteLog>(`/websites/log`, req);
};
export const UpdateWebsite = (req: Website.WebSiteUpdateReq) => {
export const updateWebsite = (req: Website.WebSiteUpdateReq) => {
return http.post<any>(`/websites/update`, req);
};
export const GetWebsite = (id: number) => {
export const getWebsite = (id: number) => {
return http.get<Website.WebsiteDTO>(`/websites/${id}`);
};
export const GetWebsiteOptions = (req: Website.OptionReq) => {
export const getWebsiteOptions = (req: Website.OptionReq) => {
return http.post<any>(`/websites/options`, req);
};
export const GetWebsiteConfig = (id: number, type: string) => {
export const getWebsiteConfig = (id: number, type: string) => {
return http.get<File.File>(`/websites/${id}/config/${type}`);
};
export const DeleteWebsite = (req: Website.WebSiteDel) => {
export const deleteWebsite = (req: Website.WebSiteDel) => {
return http.post<any>(`/websites/del`, req);
};
export const ListDomains = (id: number) => {
export const listDomains = (id: number) => {
return http.get<Website.Domain[]>(`/websites/domains/${id}`);
};
export const DeleteDomain = (req: Website.DomainDelete) => {
export const deleteDomain = (req: Website.DomainDelete) => {
return http.post<any>(`/websites/domains/del/`, req);
};
export const CreateDomain = (req: Website.DomainCreate) => {
export const createDomain = (req: Website.DomainCreate) => {
return http.post<any>(`/websites/domains`, req);
};
export const UpdateDomain = (req: Website.DomainUpdate) => {
export const updateDomain = (req: Website.DomainUpdate) => {
return http.post<any>(`/websites/domains/update`, req);
};
export const GetNginxConfig = (req: Website.NginxScopeReq) => {
export const getNginxConfig = (req: Website.NginxScopeReq) => {
return http.post<Website.NginxScopeConfig>(`/websites/config`, req);
};
export const UpdateNginxConfig = (req: Website.NginxConfigReq) => {
export const updateNginxConfig = (req: Website.NginxConfigReq) => {
return http.post<any>(`/websites/config/update`, req);
};
export const SearchDnsAccount = (req: ReqPage) => {
export const searchDnsAccount = (req: ReqPage) => {
return http.post<ResPage<Website.DnsAccount>>(`/websites/dns/search`, req);
};
export const CreateDnsAccount = (req: Website.DnsAccountCreate) => {
export const createDnsAccount = (req: Website.DnsAccountCreate) => {
return http.post<any>(`/websites/dns`, req);
};
export const UpdateDnsAccount = (req: Website.DnsAccountUpdate) => {
export const updateDnsAccount = (req: Website.DnsAccountUpdate) => {
return http.post<any>(`/websites/dns/update`, req);
};
export const DeleteDnsAccount = (req: Website.DelReq) => {
export const deleteDnsAccount = (req: Website.DelReq) => {
return http.post<any>(`/websites/dns/del`, req);
};
export const SearchAcmeAccount = (req: ReqPage) => {
export const searchAcmeAccount = (req: ReqPage) => {
return http.post<ResPage<Website.AcmeAccount>>(`/websites/acme/search`, req);
};
export const CreateAcmeAccount = (req: Website.AcmeAccountCreate) => {
export const createAcmeAccount = (req: Website.AcmeAccountCreate) => {
return http.post<Website.AcmeAccount>(`/websites/acme`, req, TimeoutEnum.T_10M);
};
export const DeleteAcmeAccount = (req: Website.DelReq) => {
export const deleteAcmeAccount = (req: Website.DelReq) => {
return http.post<any>(`/websites/acme/del`, req);
};
export const SearchSSL = (req: ReqPage) => {
export const searchSSL = (req: ReqPage) => {
return http.post<ResPage<Website.SSLDTO>>(`/websites/ssl/search`, req);
};
export const ListSSL = (req: Website.SSLReq) => {
export const listSSL = (req: Website.SSLReq) => {
return http.post<Website.SSLDTO[]>(`/websites/ssl/search`, req);
};
export const CreateSSL = (req: Website.SSLCreate) => {
export const createSSL = (req: Website.SSLCreate) => {
return http.post<Website.SSLCreate>(`/websites/ssl`, req, TimeoutEnum.T_10M);
};
export const DeleteSSL = (req: Website.DelReq) => {
export const deleteSSL = (req: Website.DelReq) => {
return http.post<any>(`/websites/ssl/del`, req);
};
export const GetWebsiteSSL = (websiteId: number) => {
return http.get<Website.SSL>(`/websites/ssl/website/${websiteId}`);
};
export const GetSSL = (id: number) => {
export const getSSL = (id: number) => {
return http.get<Website.SSL>(`/websites/ssl/${id}`);
};
export const ApplySSL = (req: Website.SSLApply) => {
return http.post<Website.SSLApply>(`/websites/ssl/apply`, req);
};
export const ObtainSSL = (req: Website.SSLObtain) => {
export const obtainSSL = (req: Website.SSLObtain) => {
return http.post<any>(`/websites/ssl/obtain`, req);
};
export const UpdateSSL = (req: Website.SSLUpdate) => {
export const updateSSL = (req: Website.SSLUpdate) => {
return http.post<any>(`/websites/ssl/update`, req);
};
export const GetDnsResolve = (req: Website.DNSResolveReq) => {
export const getDnsResolve = (req: Website.DNSResolveReq) => {
return http.post<Website.DNSResolve[]>(`/websites/ssl/resolve`, req, TimeoutEnum.T_5M);
};
export const GetHTTPSConfig = (id: number) => {
export const getHTTPSConfig = (id: number) => {
return http.get<Website.HTTPSConfig>(`/websites/${id}/https`);
};
export const UpdateHTTPSConfig = (req: Website.HTTPSReq) => {
export const updateHTTPSConfig = (req: Website.HTTPSReq) => {
return http.post<Website.HTTPSConfig>(`/websites/${req.websiteId}/https`, req);
};
export const PreCheck = (req: Website.CheckReq) => {
export const preCheck = (req: Website.CheckReq) => {
return http.post<Website.CheckRes[]>(`/websites/check`, req);
};
export const UpdateNginxFile = (req: Website.NginxUpdate) => {
export const updateNginxFile = (req: Website.NginxUpdate) => {
return http.post<any>(`/websites/nginx/update`, req);
};
export const ChangeDefaultServer = (req: Website.DefaultServerUpdate) => {
export const changeDefaultServer = (req: Website.DefaultServerUpdate) => {
return http.post<any>(`/websites/default/server`, req);
};
export const GetRewriteConfig = (req: Website.RewriteReq) => {
export const getRewriteConfig = (req: Website.RewriteReq) => {
return http.post<Website.RewriteRes>(`/websites/rewrite`, req);
};
export const UpdateRewriteConfig = (req: Website.RewriteUpdate) => {
export const updateRewriteConfig = (req: Website.RewriteUpdate) => {
return http.post<any>(`/websites/rewrite/update`, req);
};
export const UpdateWebsiteDir = (req: Website.DirUpdate) => {
export const updateWebsiteDir = (req: Website.DirUpdate) => {
return http.post<any>(`/websites/dir/update`, req);
};
export const UpdateWebsiteDirPermission = (req: Website.DirPermissionUpdate) => {
export const updateWebsiteDirPermission = (req: Website.DirPermissionUpdate) => {
return http.post<any>(`/websites/dir/permission`, req);
};
export const GetProxyConfig = (req: Website.ProxyReq) => {
export const getProxyConfig = (req: Website.ProxyReq) => {
return http.post<Website.ProxyConfig[]>(`/websites/proxies`, req);
};
export const OperateProxyConfig = (req: Website.ProxyReq) => {
export const operateProxyConfig = (req: Website.ProxyReq) => {
return http.post<any>(`/websites/proxies/update`, req);
};
export const UpdateProxyConfigFile = (req: Website.ProxyFileUpdate) => {
export const updateProxyConfigFile = (req: Website.ProxyFileUpdate) => {
return http.post<any>(`/websites/proxies/file`, req);
};
export const ClearProxtCache = (req: Website.WebsiteReq) => {
export const clearProxyCache = (req: Website.WebsiteReq) => {
return http.post(`/websites/proxy/clear`, req);
};
export const GetAuthConfig = (req: Website.AuthReq) => {
export const getAuthConfig = (req: Website.AuthReq) => {
return http.post<Website.AuthConfig>(`/websites/auths`, req);
};
export const OperateAuthConfig = (req: Website.NginxAuthConfig) => {
export const operateAuthConfig = (req: Website.NginxAuthConfig) => {
return http.post<any>(`/websites/auths/update`, req);
};
export const GetPathAuthConfig = (req: Website.AuthReq) => {
export const getPathAuthConfig = (req: Website.AuthReq) => {
return http.post<Website.NginxPathAuthConfig[]>(`/websites/auths/path`, req);
};
export const OperatePathAuthConfig = (req: Website.NginxPathAuthConfig) => {
export const operatePathAuthConfig = (req: Website.NginxPathAuthConfig) => {
return http.post(`/websites/auths/path/update`, req);
};
export const GetAntiLeech = (req: Website.LeechReq) => {
export const getAntiLeech = (req: Website.LeechReq) => {
return http.post<Website.LeechConfig>(`/websites/leech`, req);
};
export const UpdateAntiLeech = (req: Website.LeechConfig) => {
export const updateAntiLeech = (req: Website.LeechConfig) => {
return http.post<any>(`/websites/leech/update`, req);
};
export const GetRedirectConfig = (req: Website.WebsiteReq) => {
export const getRedirectConfig = (req: Website.WebsiteReq) => {
return http.post<Website.RedirectConfig[]>(`/websites/redirect`, req);
};
export const OperateRedirectConfig = (req: Website.WebsiteReq) => {
export const operateRedirectConfig = (req: Website.WebsiteReq) => {
return http.post<any>(`/websites/redirect/update`, req);
};
export const UpdateRedirectConfigFile = (req: Website.RedirectFileUpdate) => {
export const updateRedirectConfigFile = (req: Website.RedirectFileUpdate) => {
return http.post<any>(`/websites/redirect/file`, req);
};
export const ChangePHPVersion = (req: Website.PHPVersionChange) => {
export const changePHPVersion = (req: Website.PHPVersionChange) => {
return http.post<any>(`/websites/php/version`, req);
};
export const GetDirConfig = (req: Website.ProxyReq) => {
export const getDirConfig = (req: Website.ProxyReq) => {
return http.post<Website.DirConfig>(`/websites/dir`, req);
};
export const UploadSSL = (req: Website.SSLUpload) => {
export const uploadSSL = (req: Website.SSLUpload) => {
return http.post<any>(`/websites/ssl/upload`, req);
};
export const SearchCAs = (req: ReqPage) => {
export const searchCAs = (req: ReqPage) => {
return http.post<ResPage<Website.CA>>(`/websites/ca/search`, req);
};
export const CreateCA = (req: Website.CACreate) => {
export const createCA = (req: Website.CACreate) => {
return http.post<Website.CA>(`/websites/ca`, req);
};
export const ObtainSSLByCA = (req: Website.SSLObtainByCA) => {
export const obtainSSLByCA = (req: Website.SSLObtainByCA) => {
return http.post<any>(`/websites/ca/obtain`, req);
};
export const DeleteCA = (req: Website.DelReq) => {
export const deleteCA = (req: Website.DelReq) => {
return http.post<any>(`/websites/ca/del`, req);
};
export const RenewSSLByCA = (req: Website.RenewSSLByCA) => {
export const renewSSLByCA = (req: Website.RenewSSLByCA) => {
return http.post<any>(`/websites/ca/renew`, req);
};
export const DownloadFile = (params: Website.SSLDownload) => {
export const downloadFile = (params: Website.SSLDownload) => {
return http.download<BlobPart>(`/websites/ssl/download`, params, {
responseType: 'blob',
timeout: TimeoutEnum.T_40S,
});
};
export const GetCA = (id: number) => {
export const getCA = (id: number) => {
return http.get<Website.CADTO>(`/websites/ca/${id}`);
};
export const GetDefaultHtml = (type: string) => {
export const getDefaultHtml = (type: string) => {
return http.get<Website.WebsiteHtml>(`/websites/default/html/${type}`);
};
export const UpdateDefaultHtml = (req: Website.WebsiteHtmlUpdate) => {
export const updateDefaultHtml = (req: Website.WebsiteHtmlUpdate) => {
return http.post(`/websites/default/html/update`, req);
};
export const DownloadCAFile = (params: Website.SSLDownload) => {
export const downloadCAFile = (params: Website.SSLDownload) => {
return http.download<BlobPart>(`/websites/ca/download`, params, {
responseType: 'blob',
timeout: TimeoutEnum.T_40S,
});
};
export const GetLoadBalances = (id: number) => {
export const getLoadBalances = (id: number) => {
return http.get<Website.NginxUpstream[]>(`/websites/${id}/lbs`);
};
export const CreateLoadBalance = (req: Website.LoadBalanceReq) => {
export const createLoadBalance = (req: Website.LoadBalanceReq) => {
return http.post(`/websites/lbs/create`, req);
};
export const DeleteLoadBalance = (req: Website.LoadBalanceDel) => {
export const deleteLoadBalance = (req: Website.LoadBalanceDel) => {
return http.post(`/websites/lbs/del`, req);
};
export const UpdateLoadBalance = (req: Website.LoadBalanceReq) => {
export const updateLoadBalance = (req: Website.LoadBalanceReq) => {
return http.post(`/websites/lbs/update`, req);
};
export const UpdateLoadBalanceFile = (req: Website.WebsiteLBUpdateFile) => {
export const updateLoadBalanceFile = (req: Website.WebsiteLBUpdateFile) => {
return http.post(`/websites/lbs/file`, req);
};
export const UpdateCacheConfig = (req: Website.WebsiteCacheConfig) => {
export const updateCacheConfig = (req: Website.WebsiteCacheConfig) => {
return http.post(`/websites/proxy/config`, req);
};
export const GetCacheConfig = (id: number) => {
export const getCacheConfig = (id: number) => {
return http.get<Website.WebsiteCacheConfig>(`/websites/proxy/config/${id}`);
};
export const UpdateRealIPConfig = (req: Website.WebsiteRealIPConfig) => {
export const updateRealIPConfig = (req: Website.WebsiteRealIPConfig) => {
return http.post(`/websites/realip/config`, req);
};
export const GetRealIPConfig = (id: number) => {
export const getRealIPConfig = (id: number) => {
return http.get<Website.WebsiteRealIPConfig>(`/websites/realip/config/${id}`);
};
export const GetWebsiteResource = (id: number) => {
export const getWebsiteResource = (id: number) => {
return http.get<Website.WebsiteResource[]>(`/websites/resource/${id}`);
};
export const GetWebsiteDatabase = () => {
export const getWebsiteDatabase = () => {
return http.get<Website.WebsiteDatabase[]>(`/websites/databases`);
};
export const ChangeDatabase = (req: Website.ChangeDatabase) => {
export const changeDatabase = (req: Website.ChangeDatabase) => {
return http.post(`/websites/databases`, req);
};
export const OperateCustomRewrite = (req: Website.CustomRewirte) => {
export const operateCustomRewrite = (req: Website.CustomRewirte) => {
return http.post(`/websites/rewrite/custom`, req);
};
export const ListCustomRewrite = () => {
export const listCustomRewrite = () => {
return http.get<string[]>(`/websites/rewrite/custom`);
};

View File

@ -73,7 +73,7 @@
</div>
</template>
<script lang="ts" setup>
import { CheckAppInstalled, InstalledOp } from '@/api/modules/app';
import { checkAppInstalled, installedOp } from '@/api/modules/app';
import { onMounted, reactive, ref } from 'vue';
import Status from '@/components/status/index.vue';
import { ElMessageBox } from 'element-plus';
@ -117,7 +117,7 @@ const setting = () => {
};
const onCheck = async (key: any, name: any) => {
await CheckAppInstalled(key, name)
await checkAppInstalled(key, name)
.then((res) => {
data.value = res.data;
em('isExist', res.data);
@ -147,7 +147,7 @@ const onOperate = async (operation: string) => {
em('update:maskShow', true);
em('update:loading', true);
em('before');
InstalledOp(operateReq)
installedOp(operateReq)
.then(() => {
em('update:loading', false);
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));

View File

@ -128,7 +128,7 @@
<script lang="ts" setup>
import { File } from '@/api/interface/file';
import { CreateFile, GetFilesList } from '@/api/modules/files';
import { createFile, getFilesList } from '@/api/modules/files';
import { Folder, HomeFilled, Close } from '@element-plus/icons-vue';
import BreadCrumbs from '@/components/bread-crumbs/index.vue';
import BreadCrumbItem from '@/components/bread-crumbs/bread-crumbs-item.vue';
@ -239,7 +239,7 @@ const jump = async (index: number) => {
const search = async (req: File.ReqFile) => {
req.dir = props.dir;
loading.value = true;
await GetFilesList(req)
await getFilesList(req)
.then((res) => {
data.value = res.data.items || [];
req.path = res.data.path;
@ -313,7 +313,7 @@ const createFolder = async (row: any) => {
let addItem = {};
Object.assign(addItem, addForm);
loading.value = true;
CreateFile(addItem as File.FileCreate)
createFile(addItem as File.FileCreate)
.then(() => {
row.isCreate = false;
disBtn.value = false;

View File

@ -24,7 +24,7 @@
import { ref, reactive } from 'vue';
import type { ElForm } from 'element-plus';
import { Rules } from '@/global/form-rules';
import { GetGroupList } from '@/api/modules/group';
import { getGroupList } from '@/api/modules/group';
const loading = ref();
interface DialogProps {
@ -56,7 +56,7 @@ const rules = reactive({
});
const loadGroups = async (groupName: string) => {
const res = await GetGroupList(dialogData.value.groupType);
const res = await getGroupList(dialogData.value.groupType);
groupList.value = res.data;
for (const group of groupList.value) {
if (group.name === groupName) {

View File

@ -43,7 +43,7 @@
v-if="!row.edit"
:disabled="row.isDefault"
type="primary"
@click="deleteGroup($index)"
@click="removeGroup($index)"
>
{{ $t('commons.button.delete') }}
</el-button>
@ -68,7 +68,7 @@
<script lang="ts" setup>
import { ref } from 'vue';
import i18n from '@/lang';
import { CreateGroup, DeleteGroup, GetGroupList, UpdateGroup } from '@/api/modules/group';
import { createGroup, deleteGroup, getGroupList, updateGroup } from '@/api/modules/group';
import { MsgSuccess } from '@/utils/message';
import { Group } from '@/api/interface/group';
import { Rules } from '@/global/form-rules';
@ -95,7 +95,7 @@ const acceptParams = (params: DialogProps): void => {
const emit = defineEmits<{ (e: 'search'): void }>();
const search = () => {
GetGroupList(type.value).then((res) => {
getGroupList(type.value).then((res) => {
data.value = res.data || [];
});
};
@ -108,12 +108,12 @@ const saveGroup = async (formEl: FormInstance, group: Group.GroupInfo) => {
}
group.type = type.value;
if (group.id == 0) {
CreateGroup(group).then(() => {
createGroup(group).then(() => {
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
search();
});
} else {
UpdateGroup(group).then(() => {
updateGroup(group).then(() => {
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
search();
});
@ -124,7 +124,7 @@ const saveGroup = async (formEl: FormInstance, group: Group.GroupInfo) => {
const setDefault = (group: Group.GroupInfo) => {
group.isDefault = true;
group.type = type.value;
UpdateGroup(group).then(() => {
updateGroup(group).then(() => {
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
search();
});
@ -149,11 +149,11 @@ const openCreate = () => {
data.value.unshift(g);
};
const deleteGroup = (index: number) => {
const removeGroup = (index: number) => {
const group = data.value[index];
if (group.id > 0) {
DeleteGroup(group.id).then(() => {
deleteGroup(group.id).then(() => {
data.value.splice(index, 1);
MsgSuccess(i18n.global.t('commons.msg.deleteSuccess'));
});

View File

@ -44,7 +44,7 @@
import i18n from '@/lang';
import { ref } from 'vue';
import { MsgSuccess } from '@/utils/message';
import { UploadFileData } from '@/api/modules/setting';
import { uploadFileData } from '@/api/modules/setting';
import { GlobalStore } from '@/store';
import { UploadFile, UploadFiles, UploadInstance, UploadProps, UploadRawFile, genFileId } from 'element-plus';
import { useTheme } from '@/global/use-theme';
@ -89,7 +89,7 @@ const submit = async () => {
const formData = new FormData();
formData.append('file', file.raw);
loading.value = true;
await UploadFileData(formData)
await uploadFileData(formData)
.then(async () => {
globalStore.isProductPro = true;
const xpackRes = await getXpackSetting();

View File

@ -33,7 +33,7 @@
<script lang="ts" setup>
import { nextTick, onMounted, onUnmounted, reactive, ref } from 'vue';
import { downloadFile } from '@/utils/util';
import { ReadByLine } from '@/api/modules/files';
import { readByLine } from '@/api/modules/files';
import { GlobalStore } from '@/store';
import bus from '@/global/bus';
import hightlight from '@/components/hightlight/index.vue';
@ -188,7 +188,7 @@ const getContent = async (pre: boolean) => {
isLoading.value = true;
emit('update:isReading', true);
const res = await ReadByLine(readReq);
const res = await readByLine(readReq);
logPath.value = res.data.path;
firstLoading.value = false;

View File

@ -136,7 +136,7 @@ import { computeSize, newUUID } from '@/utils/util';
import i18n from '@/lang';
import { UploadFile, UploadFiles, UploadInstance, UploadProps, UploadRawFile, genFileId } from 'element-plus';
import { File } from '@/api/interface/file';
import { BatchDeleteFile, CheckFile, ChunkUploadFileData, GetUploadList } from '@/api/modules/files';
import { batchDeleteFile, checkFile, chunkUploadFileData, getUploadList } from '@/api/modules/files';
import { loadBaseDir } from '@/api/modules/setting';
import { MsgError, MsgSuccess } from '@/utils/message';
import { handleRecoverByUpload } from '@/api/modules/backup';
@ -206,7 +206,7 @@ const search = async () => {
pageSize: paginationConfig.pageSize,
path: baseDir.value,
};
const res = await GetUploadList(params);
const res = await getUploadList(params);
data.value = res.data.items || [];
paginationConfig.total = res.data.total;
};
@ -304,7 +304,7 @@ const onSubmit = async () => {
MsgError(i18n.global.t('commons.msg.fileNameErr'));
return;
}
const res = await CheckFile(baseDir.value + file.raw.name);
const res = await checkFile(baseDir.value + file.raw.name);
if (res.data) {
MsgError(i18n.global.t('commons.msg.fileExist'));
return;
@ -337,7 +337,7 @@ const submitUpload = async (file: any) => {
formData.append('chunkCount', chunkCount.toString());
try {
await ChunkUploadFileData(formData, {
await chunkUploadFileData(formData, {
onUploadProgress: (progressEvent) => {
const progress = Math.round(
((uploadedChunkCount + progressEvent.loaded / progressEvent.total) * 100) / chunkCount,
@ -379,7 +379,7 @@ const onBatchDelete = async (row: File.File | null) => {
i18n.global.t('commons.button.import'),
i18n.global.t('commons.button.delete'),
]),
api: BatchDeleteFile,
api: batchDeleteFile,
params: { paths: files, isDir: false },
});
};

View File

@ -51,6 +51,7 @@ const GlobalStore = defineStore({
(state.themeConfig.theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches),
isDarkGoldTheme: (state) => state.themeConfig.primary === '#F0BE96' && state.isProductPro,
docsUrl: (state) => (state.isIntl ? 'https://docs.1panel.hk' : 'https://1panel.cn/docs'),
isMaster: (state) => state.currentNode === 'local',
},
actions: {
setOpenMenuTabs(openMenuTabs: boolean) {

View File

@ -182,11 +182,11 @@
import { App } from '@/api/interface/app';
import { onMounted, reactive, ref, computed } from 'vue';
import {
GetAppTags,
SearchApp,
SyncApp,
SyncCutomAppStore,
SyncLocalApp,
getAppTags,
searchApp,
syncApp,
syncCutomAppStore,
syncLocalApp,
getCurrentNodeCustomAppConfig,
} from '@/api/modules/app';
import Install from '../detail/install/index.vue';
@ -243,7 +243,7 @@ const search = async (req: App.AppReq) => {
req.pageSize = paginationConfig.pageSize;
req.page = paginationConfig.currentPage;
localStorage.setItem('app-page-size', req.pageSize + '');
await SearchApp(req)
await searchApp(req)
.then((res) => {
apps.value = res.data.items;
paginationConfig.total = res.data.total;
@ -251,7 +251,7 @@ const search = async (req: App.AppReq) => {
.finally(() => {
loading.value = false;
});
GetAppTags().then((res) => {
getAppTags().then((res) => {
tags.value = res.data;
});
};
@ -291,9 +291,9 @@ const sync = async () => {
try {
let res;
if (isProductPro.value && syncCustomAppstore.value) {
res = await SyncCutomAppStore(syncReq);
res = await syncCutomAppStore(syncReq);
} else {
res = await SyncApp(syncReq);
res = await syncApp(syncReq);
}
if (res.message != '') {
MsgSuccess(res.message);
@ -313,7 +313,7 @@ const syncLocal = () => {
taskID: taskID,
};
syncing.value = true;
SyncLocalApp(syncReq)
syncLocalApp(syncReq)
.then(() => {
openTaskLog(taskID);
canUpdate.value = false;

View File

@ -66,7 +66,7 @@
</template>
<script lang="ts" setup>
import { GetApp, GetAppDetail } from '@/api/modules/app';
import { getAppByKey, getAppDetail } from '@/api/modules/app';
import MdEditor from 'md-editor-v3';
import { ref } from 'vue';
import Install from './install/index.vue';
@ -105,7 +105,7 @@ const handleClose = () => {
const getApp = async () => {
loadingApp.value = true;
try {
const res = await GetApp(appKey.value);
const res = await getAppByKey(appKey.value);
app.value = res.data;
app.value.icon = 'data:image/png;base64,' + res.data.icon;
version.value = app.value.versions[0];
@ -118,7 +118,7 @@ const getApp = async () => {
const getDetail = async (id: number, version: string) => {
loadingDetail.value = true;
try {
const res = await GetAppDetail(id, version, 'app');
const res = await getAppDetail(id, version, 'app');
appDetail.value = res.data;
if (appDetail.value.architectures != '') {
architectures.value = appDetail.value.architectures.split(',');

View File

@ -121,7 +121,7 @@
<script lang="ts" setup name="appInstall">
import { App } from '@/api/interface/app';
import { GetApp, GetAppDetail, InstallApp } from '@/api/modules/app';
import { getAppByKey, getAppDetail, installApp } from '@/api/modules/app';
import { Rules, checkNumberRange } from '@/global/form-rules';
import { FormInstance, FormRules } from 'element-plus';
import { onMounted, reactive, ref } from 'vue';
@ -217,7 +217,7 @@ const acceptParams = async (props: InstallRrops) => {
if (props.app.versions != undefined) {
installData.value = props;
} else {
const res = await GetApp(props.app.key);
const res = await getAppByKey(props.app.key);
installData.value.app = res.data;
}
@ -225,17 +225,17 @@ const acceptParams = async (props: InstallRrops) => {
appVersions.value = app.versions;
if (appVersions.value.length > 0) {
req.version = appVersions.value[0];
getAppDetail(appVersions.value[0]);
getDetail(appVersions.value[0]);
}
req.name = props.app.key;
open.value = true;
};
const getAppDetail = async (version: string) => {
const getDetail = async (version: string) => {
loading.value = true;
try {
const res = await GetAppDetail(installData.value.app.id, version, 'app');
const res = await getAppDetail(installData.value.app.id, version, 'app');
req.appDetailId = res.data.id;
req.dockerCompose = res.data.dockerCompose;
isHostMode.value = res.data.hostMode;
@ -286,7 +286,7 @@ const install = () => {
loading.value = true;
const taskID = newUUID();
req.taskID = taskID;
InstallApp(req)
installApp(req)
.then(() => {
handleClose();
openTaskLog(taskID);

View File

@ -110,11 +110,11 @@
<script lang="ts" setup>
import { computed, onMounted, reactive, ref } from 'vue';
import { getRandomStr } from '@/utils/util';
import { GetAppService } from '@/api/modules/app';
import { getAppService } from '@/api/modules/app';
import { Rules } from '@/global/form-rules';
import { App } from '@/api/interface/app';
import { getDBName } from '@/utils/util';
import { GetPathByType } from '@/api/modules/files';
import { getPathByType } from '@/api/modules/files';
interface ParamObj extends App.FromField {
services: App.AppService[];
@ -188,7 +188,7 @@ const handleParams = () => {
form[p.envKey] = p.default;
}
if (p.type == 'text' && p.envKey == 'WEBSITE_DIR') {
GetPathByType('websiteDir').then((res) => {
getPathByType('websiteDir').then((res) => {
form[p.envKey] = res.data;
});
}
@ -228,7 +228,7 @@ const handleParams = () => {
const getServices = async (childKey: string, key: string | undefined, pObj: ParamObj | undefined) => {
pObj.services = [];
await GetAppService(key).then((res) => {
await getAppService(key).then((res) => {
pObj.services = res.data || [];
form[childKey] = '';
if (res.data && res.data.length > 0) {

View File

@ -12,7 +12,7 @@
<script lang="ts" setup>
import i18n from '@/lang';
import { onMounted, ref } from 'vue';
import { SearchAppInstalled } from '@/api/modules/app';
import { searchAppInstalled } from '@/api/modules/app';
import bus from '@/global/bus';
let showButton = ref(false);
@ -37,7 +37,7 @@ const buttons = [
];
const search = () => {
SearchAppInstalled({ update: true, page: 1, pageSize: 100 })
searchAppInstalled({ update: true, page: 1, pageSize: 100 })
.then((res) => {
if (res.data.items) {
buttons[2].count = res.data.items.length;

View File

@ -48,7 +48,7 @@
</template>
<script lang="ts" setup>
import { App } from '@/api/interface/app';
import { InstalledOp } from '@/api/modules/app';
import { installedOp } from '@/api/modules/app';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
import { ref } from 'vue';
@ -118,7 +118,7 @@ const onConfirm = () => {
forceDelete: true,
deleteDB: true,
};
InstalledOp(deleteReq).then(() => {
installedOp(deleteReq).then(() => {
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
open.value = false;
em('close', open);

View File

@ -47,7 +47,7 @@
import { FormInstance } from 'element-plus';
import { onBeforeUnmount, ref } from 'vue';
import { App } from '@/api/interface/app';
import { InstalledOp } from '@/api/modules/app';
import { installedOp } from '@/api/modules/app';
import i18n from '@/lang';
import bus from '@/global/bus';
import TaskLog from '@/components/task-log/index.vue';
@ -97,7 +97,7 @@ const acceptParams = async (app: App.AppInstallDto) => {
};
const submit = async () => {
InstalledOp(deleteReq.value).then(() => {
installedOp(deleteReq.value).then(() => {
handleClose();
taskLogRef.value.openWithTaskID(deleteReq.value.taskID);
bus.emit('update', true);

View File

@ -116,7 +116,7 @@
</template>
<script lang="ts" setup>
import { App } from '@/api/interface/app';
import { GetAppInstallParams, UpdateAppInstallParams, UpdateInstallConfig } from '@/api/modules/app';
import { getAppInstallParams, updateAppInstallParams, updateInstallConfig } from '@/api/modules/app';
import { reactive, ref } from 'vue';
import { FormInstance } from 'element-plus';
import { Rules, checkNumberRange } from '@/global/form-rules';
@ -185,7 +185,7 @@ const editParam = () => {
const get = async () => {
try {
loading.value = true;
const res = await GetAppInstallParams(Number(paramData.value.id));
const res = await getAppInstallParams(Number(paramData.value.id));
const configParams = res.data.params || [];
if (configParams && configParams.length > 0) {
configParams.forEach((d) => {
@ -263,7 +263,7 @@ const submit = async (formEl: FormInstance) => {
}
try {
loading.value = true;
await UpdateAppInstallParams(submitModel.value);
await updateAppInstallParams(submitModel.value);
loading.value = false;
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
handleClose();
@ -276,7 +276,7 @@ const submit = async (formEl: FormInstance) => {
const updateAppConfig = async () => {
try {
await UpdateInstallConfig({
await updateInstallConfig({
installID: Number(paramData.value.id),
webUI: appConfigUpdate.value.webUI,
});

View File

@ -32,7 +32,7 @@
</DrawerPro>
</template>
<script lang="ts" setup>
import { GetIgnoredApp, IgnoreUpgrade } from '@/api/modules/app';
import { getIgnoredApp, ignoreUpgrade } from '@/api/modules/app';
import { ref } from 'vue';
import { MsgSuccess } from '@/utils/message';
import i18n from '@/lang';
@ -54,14 +54,14 @@ const acceptParams = () => {
const getApps = async () => {
try {
const res = await GetIgnoredApp();
const res = await getIgnoredApp();
apps.value = res.data;
} catch (error) {}
};
const cancelIgnore = async (id: number) => {
loading.value = true;
await IgnoreUpgrade({ detailID: id, operate: 'cancel' })
await ignoreUpgrade({ detailID: id, operate: 'cancel' })
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
})

View File

@ -365,12 +365,12 @@
<script lang="ts" setup>
import {
SearchAppInstalled,
InstalledOp,
SyncInstalledApp,
AppInstalledDeleteCheck,
GetAppTags,
GetAppStoreConfig,
searchAppInstalled,
installedOp,
syncInstalledApp,
appInstalledDeleteCheck,
getAppTags,
getAppStoreConfig,
} from '@/api/modules/app';
import { onMounted, onUnmounted, reactive, ref } from 'vue';
import i18n from '@/lang';
@ -456,7 +456,7 @@ const sync = () => {
.then(async () => {
syncLoading.value = true;
try {
await SyncInstalledApp();
await syncInstalledApp();
MsgSuccess(i18n.global.t('app.syncSuccess'));
search();
} finally {
@ -491,10 +491,10 @@ const getTagValue = (key: string) => {
const search = async () => {
searchReq.page = paginationConfig.currentPage;
searchReq.pageSize = paginationConfig.pageSize;
const res = await SearchAppInstalled(searchReq);
const res = await searchAppInstalled(searchReq);
data.value = res.data.items;
paginationConfig.total = res.data.total;
GetAppTags().then((res) => {
getAppTags().then((res) => {
tags.value = res.data;
});
};
@ -505,7 +505,7 @@ const openOperate = (row: any, op: string) => {
if (op == 'upgrade' || op == 'ignore') {
upgradeRef.value.acceptParams(row.id, row.name, row.dockerCompose, op, row.app);
} else if (op == 'delete') {
AppInstalledDeleteCheck(row.id).then(async (res) => {
appInstalledDeleteCheck(row.id).then(async (res) => {
const items = res.data;
if (res.data && res.data.length > 0) {
checkRef.value.acceptParams({ items: items, key: row.appKey, installID: row.id });
@ -525,7 +525,7 @@ const openIgnore = () => {
const operate = async () => {
open.value = false;
loading.value = true;
await InstalledOp(operateReq)
await installedOp(operateReq)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
searchReq.sync = true;
@ -700,9 +700,9 @@ const toLink = (link: string) => {
window.open(link, '_blank');
};
const getAppstoreConfig = async () => {
const getConfig = async () => {
try {
const res = await GetAppStoreConfig();
const res = await getAppStoreConfig();
if (res.data.defaultDomain != '') {
defaultLink.value = res.data.defaultDomain;
}
@ -710,7 +710,7 @@ const getAppstoreConfig = async () => {
};
onMounted(() => {
getAppstoreConfig();
getConfig();
const path = router.currentRoute.value.path;
if (path == '/apps/upgrade') {
activeName.value = i18n.global.t('app.canUpgrade');

View File

@ -80,7 +80,7 @@
</template>
<script lang="ts" setup>
import { App } from '@/api/interface/app';
import { GetAppUpdateVersions, IgnoreUpgrade, InstalledOp } from '@/api/modules/app';
import { getAppUpdateVersions, ignoreUpgrade, installedOp } from '@/api/modules/app';
import i18n from '@/lang';
import { ElMessageBox, FormInstance } from 'element-plus';
import { reactive, ref, onBeforeUnmount } from 'vue';
@ -174,7 +174,7 @@ const getVersions = async (version: string) => {
req['updateVersion'] = version;
}
try {
const res = await GetAppUpdateVersions(req);
const res = await getAppUpdateVersions(req);
versions.value = res.data || [];
if (res.data != null && res.data.length > 0) {
let item = res.data[0];
@ -202,7 +202,7 @@ const operate = async () => {
}
const taskID = uuidv4();
operateReq.taskID = taskID;
await InstalledOp(operateReq)
await installedOp(operateReq)
.then(() => {
bus.emit('upgrade', true);
handleClose();
@ -212,7 +212,7 @@ const operate = async () => {
loading.value = false;
});
} else {
await IgnoreUpgrade(operateReq)
await ignoreUpgrade(operateReq)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
bus.emit('upgrade', true);

View File

@ -26,7 +26,7 @@ import { reactive, ref } from 'vue';
import i18n from '@/lang';
import { FormInstance } from 'element-plus';
import { Rules } from '@/global/form-rules';
import { UpdateAppStoreConfig } from '@/api/modules/app';
import { updateAppStoreConfig } from '@/api/modules/app';
import { MsgSuccess } from '@/utils/message';
const emit = defineEmits<{ (e: 'close'): void }>();
@ -71,7 +71,7 @@ const submit = async () => {
const req = {
defaultDomain: defaultDomain,
};
await UpdateAppStoreConfig(req);
await updateAppStoreConfig(req);
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
} catch (error) {
} finally {

View File

@ -28,7 +28,7 @@
</el-input>
<span class="input-help">{{ $t('app.defaultWebDomainHepler') }}</span>
</el-form-item>
<CustomSetting v-if="isProductPro && globalStore.isMaster" />
<CustomSetting v-if="globalStore.isMasterProductPro" />
<el-form-item v-if="!globalStore.isMaster && useCustomApp">
<el-text type="warning">{{ $t('app.customAppHelper') }}</el-text>
</el-form-item>
@ -41,7 +41,7 @@
</template>
<script setup lang="ts">
import { GetAppStoreConfig, getCurrentNodeCustomAppConfig } from '@/api/modules/app';
import { getAppStoreConfig, getCurrentNodeCustomAppConfig } from '@/api/modules/app';
import { Rules } from '@/global/form-rules';
import { FormRules } from 'element-plus';
import CustomSetting from '@/xpack/views/appstore/index.vue';
@ -82,7 +82,7 @@ function getUrl(url: string) {
const search = async () => {
loading.value = true;
try {
const res = await GetAppStoreConfig();
const res = await getAppStoreConfig();
if (res.data.defaultDomain != '') {
const url = getUrl(res.data.defaultDomain);
if (url) {
@ -104,7 +104,7 @@ const setDefaultDomain = () => {
};
const getNodeConfig = async () => {
if (globalStore.isMaster) {
if (globalStore.isMasterProductPro) {
return;
}
const res = await getCurrentNodeCustomAppConfig();

View File

@ -535,12 +535,12 @@ import { Cronjob } from '@/api/interface/cronjob';
import { addCronjob, editCronjob, loadNextHandle } from '@/api/modules/cronjob';
import CodemirrorPro from '@/components/codemirror-pro/index.vue';
import { listDbItems } from '@/api/modules/database';
import { GetWebsiteOptions } from '@/api/modules/website';
import { getWebsiteOptions } from '@/api/modules/website';
import { MsgError, MsgSuccess } from '@/utils/message';
import { useRouter } from 'vue-router';
import { listContainer } from '@/api/modules/container';
import { Database } from '@/api/interface/database';
import { ListAppInstalled } from '@/api/modules/app';
import { listAppInstalled } from '@/api/modules/app';
import {
loadDefaultSpec,
loadDefaultSpecCustom,
@ -962,12 +962,12 @@ const loadShellUsers = async () => {
};
const loadAppInstalls = async () => {
const res = await ListAppInstalled();
const res = await listAppInstalled();
appOptions.value = res.data || [];
};
const loadWebsites = async () => {
const res = await GetWebsiteOptions({});
const res = await getWebsiteOptions({});
websiteOptions.value = res.data || [];
};

View File

@ -227,7 +227,7 @@ import i18n from '@/lang';
import { ElMessageBox } from 'element-plus';
import { MsgSuccess } from '@/utils/message';
import { listDbItems } from '@/api/modules/database';
import { ListAppInstalled } from '@/api/modules/app';
import { listAppInstalled } from '@/api/modules/app';
import { shortcuts } from '@/utils/shortcuts';
import TaskLog from '@/components/task-log/log-without-dialog.vue';
@ -272,7 +272,7 @@ const acceptParams = async (params: DialogProps): Promise<void> => {
}
}
if (dialogData.value.rowData.type === 'app') {
const res = await ListAppInstalled();
const res = await listAppInstalled();
let itemApps = res.data || [];
for (const item of itemApps) {
if (item.id == dialogData.value.rowData.appID) {

View File

@ -109,7 +109,7 @@ import i18n from '@/lang';
import { ElForm } from 'element-plus';
import { getDatabase, loadRemoteAccess, updateMysqlAccess, updateMysqlPassword } from '@/api/modules/database';
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
import { GetAppConnInfo } from '@/api/modules/app';
import { getAppConnInfo } from '@/api/modules/app';
import { MsgSuccess } from '@/utils/message';
import { getRandomStr } from '@/utils/util';
import { getSettingInfo } from '@/api/modules/setting';
@ -185,7 +185,7 @@ const loadSystemIP = async () => {
const loadPassword = async () => {
if (form.from === 'local') {
const res = await GetAppConnInfo(form.type, form.database);
const res = await getAppConnInfo(form.type, form.database);
form.status = res.data.status;
form.password = res.data.password || '';
form.port = res.data.port || 3306;

View File

@ -286,7 +286,7 @@ import {
import i18n from '@/lang';
import { Database } from '@/api/interface/database';
import { App } from '@/api/interface/app';
import { GetAppPort } from '@/api/modules/app';
import { getAppPort } from '@/api/modules/app';
import router from '@/routers';
import { MsgSuccess } from '@/utils/message';
import { GlobalStore } from '@/store';
@ -473,12 +473,12 @@ const getAppDetail = () => {
};
const loadPhpMyAdminPort = async () => {
const res = await GetAppPort('phpmyadmin', '');
const res = await getAppPort('phpmyadmin', '');
phpadminPort.value = res.data;
};
const loadAdminerPort = async () => {
const res = await GetAppPort('adminer', '');
const res = await getAppPort('adminer', '');
adminerPort.value = res.data;
};

View File

@ -123,7 +123,7 @@ import SlowLog from '@/views/database/mysql/setting/slow-log/index.vue';
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
import { onMounted, reactive, ref } from 'vue';
import { loadDBFile, loadDBBaseInfo, loadMysqlVariables, updateDBFile } from '@/api/modules/database';
import { ChangePort, CheckAppInstalled, GetAppDefaultConfig } from '@/api/modules/app';
import { changePort, checkAppInstalled, getAppDefaultConfig } from '@/api/modules/app';
import { Rules } from '@/global/form-rules';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
@ -203,7 +203,7 @@ const onSubmitChangePort = async () => {
port: baseInfo.port,
};
loading.value = true;
await ChangePort(params)
await changePort(params)
.then(() => {
loading.value = false;
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
@ -236,7 +236,7 @@ function callback(error: any) {
const getDefaultConfig = async () => {
loading.value = true;
await GetAppDefaultConfig(props.type, props.database)
await getAppDefaultConfig(props.type, props.database)
.then((res) => {
mysqlConf.value = res.data;
useOld.value = true;
@ -332,7 +332,7 @@ const goUpgrade = () => {
};
const onLoadInfo = async () => {
await CheckAppInstalled(props.type, props.database).then((res) => {
await checkAppInstalled(props.type, props.database).then((res) => {
mysqlName.value = res.data.name;
mysqlStatus.value = res.data.status;
mysqlVersion.value = res.data.version;

View File

@ -111,7 +111,7 @@ import i18n from '@/lang';
import { ElForm } from 'element-plus';
import { getDatabase, updatePostgresqlPassword } from '@/api/modules/database';
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
import { GetAppConnInfo } from '@/api/modules/app';
import { getAppConnInfo } from '@/api/modules/app';
import { MsgSuccess } from '@/utils/message';
import { getRandomStr } from '@/utils/util';
import { getSettingInfo } from '@/api/modules/setting';
@ -185,7 +185,7 @@ const loadSystemIP = async () => {
const loadPassword = async () => {
if (form.from === 'local') {
const res = await GetAppConnInfo(form.type, form.database);
const res = await getAppConnInfo(form.type, form.database);
form.status = res.data.status;
form.username = res.data.username || '';
form.password = res.data.password || '';

View File

@ -253,7 +253,7 @@ import {
import i18n from '@/lang';
import { Database } from '@/api/interface/database';
import { App } from '@/api/interface/app';
import { GetAppPort } from '@/api/modules/app';
import { getAppPort } from '@/api/modules/app';
import router from '@/routers';
import { MsgSuccess } from '@/utils/message';
import { GlobalStore } from '@/store';
@ -437,7 +437,7 @@ const getAppDetail = () => {
};
const loadPGAdminPort = async () => {
const res = await GetAppPort('pgadmin4', '');
const res = await getAppPort('pgadmin4', '');
pgadminPort.value = res.data;
};

View File

@ -74,7 +74,7 @@ import ContainerLog from '@/components/container-log/index.vue';
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
import { onMounted, reactive, ref } from 'vue';
import { loadDBFile, loadDBBaseInfo, updateDBFile } from '@/api/modules/database';
import { ChangePort, CheckAppInstalled } from '@/api/modules/app';
import { changePort, checkAppInstalled } from '@/api/modules/app';
import { Rules } from '@/global/form-rules';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
@ -122,7 +122,7 @@ const onSubmitChangePort = async () => {
port: baseInfo.port,
};
loading.value = true;
await ChangePort(params)
await changePort(params)
.then(() => {
loading.value = false;
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
@ -211,7 +211,7 @@ const goUpgrade = () => {
};
const onLoadInfo = async () => {
await CheckAppInstalled(props.type, props.database).then((res) => {
await checkAppInstalled(props.type, props.database).then((res) => {
postgresqlName.value = res.data.name;
postgresqlStatus.value = res.data.status;
postgresqlVersion.value = res.data.version;

View File

@ -100,7 +100,7 @@ import i18n from '@/lang';
import { ElForm } from 'element-plus';
import { changeRedisPassword, getDatabase } from '@/api/modules/database';
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
import { GetAppConnInfo } from '@/api/modules/app';
import { getAppConnInfo } from '@/api/modules/app';
import { MsgSuccess } from '@/utils/message';
import { getRandomStr } from '@/utils/util';
import { getSettingInfo } from '@/api/modules/setting';
@ -164,7 +164,7 @@ const random = async () => {
const loadPassword = async () => {
if (form.from === 'local') {
const res = await GetAppConnInfo('redis', form.database);
const res = await getAppConnInfo('redis', form.database);
form.status = res.data.status;
form.password = res.data.password || '';
form.port = res.data.port || 3306;

View File

@ -144,7 +144,7 @@ import Terminal from '@/components/terminal/index.vue';
import AppStatus from '@/components/app-status/index.vue';
import QuickCmd from '@/views/database/redis/command/index.vue';
import { nextTick, onBeforeUnmount, onMounted, ref } from 'vue';
import { CheckAppInstalled } from '@/api/modules/app';
import { checkAppInstalled } from '@/api/modules/app';
import router from '@/routers';
import { GlobalStore } from '@/store';
import { listDatabases, checkRedisCli, installRedisCli } from '@/api/modules/database';
@ -312,7 +312,7 @@ const initTerminal = async () => {
isRefresh.value = !isRefresh.value;
return;
}
await CheckAppInstalled('redis', currentDBName.value)
await checkAppInstalled('redis', currentDBName.value)
.then((res) => {
redisIsExist.value = res.data.isExist;
redisStatus.value = res.data.status;

View File

@ -122,7 +122,7 @@ import Persistence from '@/views/database/redis/setting/persistence/index.vue';
import { loadDBFile, loadRedisConf, updateRedisConf, updateDBFile } from '@/api/modules/database';
import i18n from '@/lang';
import { checkNumberRange, Rules } from '@/global/form-rules';
import { ChangePort, GetAppDefaultConfig } from '@/api/modules/app';
import { changePort, getAppDefaultConfig } from '@/api/modules/app';
import { MsgSuccess } from '@/utils/message';
const loading = ref(false);
@ -226,7 +226,7 @@ const onChangePort = async (formEl: FormInstance | undefined) => {
port: form.port,
};
loading.value = true;
await ChangePort(params)
await changePort(params)
.then(() => {
loading.value = false;
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
@ -270,7 +270,7 @@ const submitForm = async () => {
const getDefaultConfig = async () => {
loading.value = true;
await GetAppDefaultConfig('redis', '')
await getAppDefaultConfig('redis', '')
.then((res) => {
redisConf.value = res.data;
useOld.value = true;

View File

@ -180,7 +180,7 @@
</template>
<script lang="ts" setup>
import { GetAppStoreConfig, InstalledOp } from '@/api/modules/app';
import { getAppStoreConfig, installedOp } from '@/api/modules/app';
import { changeLauncherStatus, loadAppLauncher, loadAppLauncherOption } from '@/api/modules/dashboard';
import i18n from '@/lang';
import { GlobalStore } from '@/store';
@ -206,7 +206,7 @@ const defaultLink = ref('');
const acceptParams = (): void => {
search();
loadOption();
getAppStoreConfig();
getConfig();
};
const goInstall = (key: string, type: string) => {
@ -257,9 +257,9 @@ const toLink = (link: string) => {
window.open(link, '_blank');
};
const getAppStoreConfig = async () => {
const getConfig = async () => {
try {
const res = await GetAppStoreConfig();
const res = await getAppStoreConfig();
if (res.data.defaultDomain != '') {
defaultLink.value = res.data.defaultDomain;
}
@ -282,7 +282,7 @@ const onOperate = async (operation: string, row: any) => {
operate: operation,
detailId: row.detailId,
};
await InstalledOp(params)
await installedOp(params)
.then(() => {
loading.value = false;
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));

View File

@ -26,7 +26,7 @@
<script setup lang="ts">
import { reactive, ref } from 'vue';
import { File } from '@/api/interface/file';
import { BatchChangeRole } from '@/api/modules/files';
import { batchChangeRole } from '@/api/modules/files';
import i18n from '@/lang';
import FileRole from '@/components/file-role/index.vue';
import { MsgSuccess } from '@/utils/message';
@ -87,7 +87,7 @@ const submit = async () => {
}
loading.value = true;
BatchChangeRole(addForm)
batchChangeRole(addForm)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
handleClose();

View File

@ -16,7 +16,7 @@
<script setup lang="ts">
import { ref } from 'vue';
import { File } from '@/api/interface/file';
import { ChangeFileMode } from '@/api/modules/files';
import { changeFileMode } from '@/api/modules/files';
import i18n from '@/lang';
import FileRole from '@/components/file-role/index.vue';
import { MsgSuccess } from '@/utils/message';
@ -50,7 +50,7 @@ const getMode = (val: number) => {
const submit = async () => {
loading.value = true;
ChangeFileMode(form.value)
changeFileMode(form.value)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
handleClose();

View File

@ -29,7 +29,7 @@
</template>
<script lang="ts" setup>
import { ChangeOwner } from '@/api/modules/files';
import { changeOwner } from '@/api/modules/files';
import { Rules } from '@/global/form-rules';
import { FormInstance, FormRules } from 'element-plus';
import { reactive, ref } from 'vue';
@ -78,7 +78,7 @@ const submit = async (formEl: FormInstance | undefined) => {
return;
}
loading.value = true;
ChangeOwner(addForm)
changeOwner(addForm)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
handleClose();

View File

@ -152,7 +152,7 @@
</template>
<script lang="ts" setup>
import { GetFileContent, GetFilesTree, SaveFileContent } from '@/api/modules/files';
import { getFileContent, getFilesTree, saveFileContent } from '@/api/modules/files';
import i18n from '@/lang';
import { MsgError, MsgInfo, MsgSuccess } from '@/utils/message';
import * as monaco from 'monaco-editor';
@ -456,7 +456,7 @@ const quickSave = () => {
const saveContent = () => {
if (isEdit.value) {
loading.value = true;
SaveFileContent(form.value)
saveFileContent(form.value)
.then(() => {
loading.value = false;
isEdit.value = false;
@ -561,7 +561,7 @@ const getContent = (path: string, extension: string) => {
});
}
GetFileContent(codeReq)
getFileContent(codeReq)
.then((res) => {
form.value.content = res.data.content;
oldFileContent.value = res.data.content;
@ -612,7 +612,7 @@ const search = async (path: string) => {
req.sortBy = 'name';
req.sortOrder = 'ascending';
}
return await GetFilesTree(req);
return await getFilesTree(req);
};
const getUpData = async () => {

View File

@ -48,7 +48,7 @@ import { File } from '@/api/interface/file';
import { FormInstance, FormRules } from 'element-plus';
import { Rules } from '@/global/form-rules';
import { CompressExtension, CompressType } from '@/enums/files';
import { CompressFile } from '@/api/modules/files';
import { compressFile } from '@/api/modules/files';
import FileList from '@/components/file-list/index.vue';
import { MsgSuccess } from '@/utils/message';
@ -101,7 +101,7 @@ const submit = async (formEl: FormInstance | undefined) => {
Object.assign(addItem, form.value);
addItem['name'] = form.value.name + extension.value;
loading.value = true;
CompressFile(addItem as File.FileCompress)
compressFile(addItem as File.FileCompress)
.then(() => {
MsgSuccess(i18n.global.t('file.compressSuccess'));
handleClose();

View File

@ -46,7 +46,7 @@
import { ref, reactive, computed } from 'vue';
import { File } from '@/api/interface/file';
import { FormInstance, FormRules } from 'element-plus';
import { CreateFile } from '@/api/modules/files';
import { createFile } from '@/api/modules/files';
import i18n from '@/lang';
import FileRole from '@/components/file-role/index.vue';
import { Rules } from '@/global/form-rules';
@ -117,7 +117,7 @@ const submit = async (formEl: FormInstance | undefined) => {
addItem['mode'] = undefined;
}
addItem['name'] = addForm.name.trim();
CreateFile(addItem as File.FileCreate)
createFile(addItem as File.FileCreate)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
handleClose();

View File

@ -37,7 +37,7 @@ import { reactive, ref } from 'vue';
import { File } from '@/api/interface/file';
import { FormInstance, FormRules } from 'element-plus';
import { Rules } from '@/global/form-rules';
import { DeCompressFile } from '@/api/modules/files';
import { deCompressFile } from '@/api/modules/files';
import { Mimetypes } from '@/global/mimetype';
import FileList from '@/components/file-list/index.vue';
import { MsgSuccess } from '@/utils/message';
@ -89,7 +89,7 @@ const submit = async (formEl: FormInstance | undefined) => {
return;
}
loading.value = true;
DeCompressFile(form.value)
deCompressFile(form.value)
.then(() => {
MsgSuccess(i18n.global.t('file.deCompressSuccess'));
handleClose();

View File

@ -58,7 +58,7 @@ import i18n from '@/lang';
import { ref } from 'vue';
import { File } from '@/api/interface/file';
import { getIcon } from '@/utils/util';
import { DeleteFile, GetRecycleStatus } from '@/api/modules/files';
import { deleteFile, getRecycleStatus } from '@/api/modules/files';
import { MsgSuccess, MsgWarning } from '@/utils/message';
import { loadBaseDir } from '@/api/modules/setting';
@ -78,7 +78,7 @@ const acceptParams = (props: File.File[]) => {
const getStatus = async () => {
try {
const res = await GetRecycleStatus();
const res = await getRecycleStatus();
recycleStatus.value = res.data;
if (recycleStatus.value === 'disable') {
forceDelete.value = true;
@ -100,7 +100,7 @@ const onConfirm = async () => {
return;
}
}
pros.push(DeleteFile({ path: s['path'], isDir: s['isDir'], forceDelete: forceDelete.value }));
pros.push(deleteFile({ path: s['path'], isDir: s['isDir'], forceDelete: forceDelete.value }));
}
loading.value = true;
Promise.all(pros)

View File

@ -42,7 +42,7 @@
</template>
<script lang="ts" setup>
import { ComputeDirSize, GetFileContent } from '@/api/modules/files';
import { computeDirSize, getFileContent } from '@/api/modules/files';
import { computeSize } from '@/utils/util';
import { ref } from 'vue';
import { dateFormatSimple } from '@/utils/util';
@ -64,7 +64,7 @@ const handleClose = () => {
const acceptParams = async (params: InfoProps): Promise<void> => {
props.value = params;
GetFileContent({ path: params.path, expand: false, page: 1, pageSize: 1, isDetail: true }).then((res) => {
getFileContent({ path: params.path, expand: false, page: 1, pageSize: 1, isDetail: true }).then((res) => {
data.value = res.data;
open.value = true;
});
@ -75,7 +75,7 @@ const getDirSize = async (row: any) => {
path: row.path,
};
loading.value = true;
await ComputeDirSize(req)
await computeDirSize(req)
.then(async (res) => {
data.value.dirSize = res.data.size;
})

View File

@ -25,7 +25,7 @@
import { FormInstance, FormRules } from 'element-plus';
import { CompressExtension, CompressType } from '@/enums/files';
import { computed, reactive, ref } from 'vue';
import { DownloadFile } from '@/api/modules/files';
import { downloadFile } from '@/api/modules/files';
import { File } from '@/api/interface/file';
import { Rules } from '@/global/form-rules';
@ -74,7 +74,7 @@ const submit = async (formEl: FormInstance | undefined) => {
Object.assign(addItem, addForm.value);
addItem['name'] = addForm.value.name + extension.value;
loading.value = true;
DownloadFile(addItem as File.FileDownload)
downloadFile(addItem as File.FileDownload)
.then((res) => {
const downloadUrl = window.URL.createObjectURL(new Blob([res]));
const a = document.createElement('a');

View File

@ -10,7 +10,7 @@
</template>
<script setup lang="ts">
import { SearchFavorite, RemoveFavorite } from '@/api/modules/files';
import { searchFavorite, removeFavorite } from '@/api/modules/files';
import i18n from '@/lang';
import { reactive, ref } from 'vue';
@ -41,7 +41,7 @@ const search = async () => {
try {
req.page = paginationConfig.currentPage;
req.pageSize = paginationConfig.pageSize;
const res = await SearchFavorite(req);
const res = await searchFavorite(req);
data.value = res.data.items;
paginationConfig.total = res.data.total;
open.value = true;
@ -54,7 +54,7 @@ const singleDel = async (id: number) => {
cancelButtonText: i18n.global.t('commons.button.cancel'),
}).then(async () => {
try {
await RemoveFavorite(id);
await removeFavorite(id);
search();
} catch (error) {}
});

View File

@ -3,16 +3,16 @@
<div class="flex items-center">
<div class="flex-shrink-0 flex items-center mr-4">
<el-tooltip :content="$t('file.back')" placement="top">
<el-button :icon="Back" @click="back" circle />
<el-button icon="Back" @click="back" circle />
</el-tooltip>
<el-tooltip :content="$t('file.right')" placement="top">
<el-button :icon="Right" @click="right" circle />
<el-button icon="Right" @click="right" circle />
</el-tooltip>
<el-tooltip :content="$t('file.top')" placement="top">
<el-button :icon="Top" @click="top" circle :disabled="paths.length == 0" />
<el-button icon="Top" @click="top" circle :disabled="paths.length == 0" />
</el-tooltip>
<el-tooltip :content="$t('file.refresh')" placement="top">
<el-button :icon="Refresh" circle @click="search" />
<el-button icon="Refresh" circle @click="search" />
</el-tooltip>
</div>
<div
@ -107,9 +107,7 @@
<el-button plain @click="openPaste">{{ $t('file.paste') }}({{ fileMove.count }})</el-button>
</el-tooltip>
<el-tooltip class="box-item" effect="dark" :content="$t('file.cancel')" placement="bottom">
<el-button plain class="close" @click="closeMove">
<el-icon class="close-icon"><Close /></el-icon>
</el-button>
<el-button plain class="close" icon="Close" @click="closeMove"></el-button>
</el-tooltip>
</el-button-group>
</template>
@ -205,15 +203,15 @@
link
type="warning"
size="large"
:icon="StarFilled"
@click="removeFavorite(row.favoriteID)"
icon="StarFilled"
@click="remove(row.favoriteID)"
></el-button>
<div v-else>
<el-button
v-if="hoveredRowIndex === $index"
link
:icon="Star"
@click="addFavorite(row)"
icon="Star"
@click="addToFavorite(row)"
></el-button>
</div>
</div>
@ -304,15 +302,14 @@
<script setup lang="ts">
import { nextTick, onMounted, reactive, ref, computed } from '@vue/runtime-core';
import {
GetFilesList,
GetFileContent,
ComputeDirSize,
AddFavorite,
RemoveFavorite,
SearchFavorite,
getFilesList,
getFileContent,
computeDirSize,
addFavorite,
removeFavorite,
searchFavorite,
} from '@/api/modules/files';
import { computeSize, copyText, dateFormat, getFileType, getIcon, getRandomStr, downloadFile } from '@/utils/util';
import { StarFilled, Star, Top, Right, Close } from '@element-plus/icons-vue';
import { File } from '@/api/interface/file';
import { Mimetypes, Languages } from '@/global/mimetype';
import { useRouter } from 'vue-router';
@ -434,7 +431,7 @@ const search = async () => {
req.page = paginationConfig.currentPage;
req.pageSize = paginationConfig.pageSize;
await GetFilesList(req)
await getFilesList(req)
.then((res) => {
handleSearchResult(res);
})
@ -447,7 +444,7 @@ const search = async () => {
const searchFile = async () => {
loading.value = true;
try {
return await GetFilesList(req);
return await getFilesList(req);
} finally {
loading.value = false;
}
@ -615,7 +612,7 @@ const getDirSize = async (row: any, index: number) => {
path: row.path,
};
btnLoading.value = index;
await ComputeDirSize(req)
await computeDirSize(req)
.then(async (res) => {
let newData = [...data.value];
newData[index].dirSize = res.data.size;
@ -711,7 +708,7 @@ const openCodeEditor = (path: string, extension: string) => {
});
}
GetFileContent(codeReq)
getFileContent(codeReq)
.then((res) => {
fileEdit.content = res.data.content;
fileEdit.path = res.data.path;
@ -828,20 +825,20 @@ const hideFavorite = () => {
hoveredRowIndex.value = -1;
};
const addFavorite = async (row: File.File) => {
const addToFavorite = async (row: File.File) => {
try {
await AddFavorite(row.path);
await addFavorite(row.path);
search();
} catch (error) {}
};
const removeFavorite = async (id: number) => {
const remove = async (id: number) => {
ElMessageBox.confirm(i18n.global.t('file.removeFavorite'), i18n.global.t('commons.msg.remove'), {
confirmButtonText: i18n.global.t('commons.button.confirm'),
cancelButtonText: i18n.global.t('commons.button.cancel'),
}).then(async () => {
try {
await RemoveFavorite(id);
await removeFavorite(id);
search();
} catch (error) {}
});
@ -849,7 +846,7 @@ const removeFavorite = async (id: number) => {
const getFavoriates = async () => {
try {
const res = await SearchFavorite(req);
const res = await searchFavorite(req);
favorites.value = res.data.items;
} catch (error) {}
};

View File

@ -35,7 +35,7 @@
</template>
<script lang="ts" setup>
import { CheckFile, MoveFile } from '@/api/modules/files';
import { checkFile, moveFile } from '@/api/modules/files';
import { Rules } from '@/global/form-rules';
import i18n from '@/lang';
import { FormInstance, FormRules } from 'element-plus';
@ -102,7 +102,7 @@ const changeType = () => {
};
const mvFile = () => {
MoveFile(addForm)
moveFile(addForm)
.then(() => {
if (type.value === 'cut') {
MsgSuccess(i18n.global.t('file.moveSuccess'));
@ -136,7 +136,7 @@ const acceptParams = async (props: MoveProps) => {
type.value = props.type;
if (props.name && props.name != '') {
oldName.value = props.name;
const res = await CheckFile(props.path + '/' + props.name);
const res = await checkFile(props.path + '/' + props.name);
if (res.data) {
changeName.value = true;
addForm.cover = false;

View File

@ -14,7 +14,7 @@
</template>
<script lang="ts" setup>
import { FileKeys } from '@/api/modules/files';
import { fileKeys } from '@/api/modules/files';
import { computeSize } from '@/utils/util';
import { onBeforeUnmount, ref, toRefs } from 'vue';
import MsgInfo from '@/components/msg-info/index.vue';
@ -69,7 +69,7 @@ const initProcess = () => {
const getKeys = () => {
keys.value = [];
res.value = [];
FileKeys().then((res) => {
fileKeys().then((res) => {
if (res.data.keys.length > 0) {
keys.value = res.data.keys;
initProcess();

View File

@ -30,7 +30,7 @@ import i18n from '@/lang';
import { ref } from 'vue';
import { File } from '@/api/interface/file';
import { getIcon } from '@/utils/util';
import { DeleteFile } from '@/api/modules/files';
import { deleteFile } from '@/api/modules/files';
import { MsgSuccess } from '@/utils/message';
const open = ref(false);
@ -48,7 +48,7 @@ const acceptParams = (props: File.RecycleBin[]) => {
const onConfirm = () => {
const pros = [];
for (const s of files.value) {
pros.push(DeleteFile({ path: s.from + '/' + s.rName, isDir: s.isDir, forceDelete: true }));
pros.push(deleteFile({ path: s.from + '/' + s.rName, isDir: s.isDir, forceDelete: true }));
}
loading.value = true;
Promise.all(pros)

View File

@ -59,7 +59,7 @@
</template>
<script lang="ts" setup>
import { GetRecycleStatus, clearRecycle, getRecycleList, reduceFile } from '@/api/modules/files';
import { getRecycleStatus, clearRecycle, getRecycleList, reduceFile } from '@/api/modules/files';
import { reactive, ref } from 'vue';
import { dateFormat, computeSize } from '@/utils/util';
import i18n from '@/lang';
@ -106,7 +106,7 @@ const acceptParams = () => {
const getStatus = async () => {
try {
const res = await GetRecycleStatus();
const res = await getRecycleStatus();
status.value = res.data;
} catch (error) {}
};

View File

@ -25,7 +25,7 @@
</template>
<script lang="ts" setup>
import { RenameRile } from '@/api/modules/files';
import { renameRile } from '@/api/modules/files';
import { Rules } from '@/global/form-rules';
import { FormInstance, FormRules } from 'element-plus';
import { reactive, ref } from 'vue';
@ -76,7 +76,7 @@ const submit = async (formEl: FormInstance | undefined) => {
addItem['oldName'] = getPath(addForm.path, oldName.value);
addItem['newName'] = getPath(addForm.path, addForm.newName);
loading.value = true;
RenameRile(addItem as File.FileRename)
renameRile(addItem as File.FileRename)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
handleClose();

View File

@ -96,7 +96,7 @@
<script setup lang="ts">
import { nextTick, reactive, ref } from 'vue';
import { UploadFile, UploadFiles, UploadInstance, UploadProps, UploadRawFile } from 'element-plus';
import { ChunkUploadFileData, UploadFileData } from '@/api/modules/files';
import { chunkUploadFileData, uploadFileData } from '@/api/modules/files';
import i18n from '@/lang';
import { MsgError, MsgSuccess, MsgWarning } from '@/utils/message';
import { Close, Document, UploadFilled } from '@element-plus/icons-vue';
@ -280,7 +280,7 @@ const submit = async () => {
}
formData.append('overwrite', 'True');
uploadPercent.value = 0;
await UploadFileData(formData, {
await uploadFileData(formData, {
onUploadProgress: (progressEvent) => {
const progress = Math.round((progressEvent.loaded / progressEvent.total) * 100);
uploadPercent.value = progress;
@ -310,7 +310,7 @@ const submit = async () => {
formData.append('chunkCount', chunkCount.toString());
try {
await ChunkUploadFileData(formData, {
await chunkUploadFileData(formData, {
onUploadProgress: (progressEvent) => {
const progress = Math.round(
((uploadedChunkCount + progressEvent.loaded / progressEvent.total) * 100) / chunkCount,

View File

@ -38,7 +38,7 @@
</template>
<script lang="ts" setup>
import { WgetFile } from '@/api/modules/files';
import { wgetFile } from '@/api/modules/files';
import { Rules } from '@/global/form-rules';
import i18n from '@/lang';
import { FormInstance, FormRules } from 'element-plus';
@ -89,7 +89,7 @@ const submit = async (formEl: FormInstance | undefined) => {
return;
}
loading.value = true;
WgetFile(addForm)
wgetFile(addForm)
.then(() => {
MsgSuccess(i18n.global.t('file.downloadStart'));
submitData.value = true;

View File

@ -112,7 +112,7 @@ import FireRouter from '@/views/host/process/index.vue';
import { ref, onMounted, onUnmounted, nextTick, reactive } from 'vue';
import ProcessDetail from './detail/index.vue';
import i18n from '@/lang';
import { StopProcess } from '@/api/modules/process';
import { stopProcess } from '@/api/modules/process';
interface SortStatus {
prop: '';
@ -143,7 +143,7 @@ const buttons = [
{
label: i18n.global.t('process.stopProcess'),
click: function (row: any) {
stopProcess(row);
stop(row);
},
},
];
@ -262,7 +262,7 @@ const search = () => {
}
};
const stopProcess = async (row: any) => {
const stop = async (row: any) => {
opRef.value.acceptParams({
title: i18n.global.t('process.stopProcess'),
names: [row.name],
@ -270,7 +270,7 @@ const stopProcess = async (row: any) => {
i18n.global.t('menu.process'),
i18n.global.t('process.stopProcess'),
]),
api: StopProcess,
api: stopProcess,
params: { PID: row.PID },
successMsg: i18n.global.t('commons.msg.operationSuccess'),
});

View File

@ -27,7 +27,7 @@
import FireRouter from '@/views/host/ssh/index.vue';
import { ref, onMounted, onUnmounted, reactive } from 'vue';
import i18n from '@/lang';
import { StopProcess } from '@/api/modules/process';
import { stopProcess } from '@/api/modules/process';
import { MsgError, MsgSuccess } from '@/utils/message';
const sshSearch = reactive({
@ -39,7 +39,7 @@ const buttons = [
{
label: i18n.global.t('ssh.disconnect'),
click: function (row: any) {
stopProcess(row.PID);
stop(row.PID);
},
},
];
@ -97,7 +97,7 @@ const search = () => {
}
};
const stopProcess = async (PID: number) => {
const stop = async (PID: number) => {
ElMessageBox.confirm(i18n.global.t('ssh.stopSSHWarn'), i18n.global.t('ssh.disconnect'), {
confirmButtonText: i18n.global.t('commons.button.confirm'),
cancelButtonText: i18n.global.t('commons.button.cancel'),
@ -105,7 +105,7 @@ const stopProcess = async (PID: number) => {
})
.then(async () => {
try {
await StopProcess({ PID: PID });
await stopProcess({ PID: PID });
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
} catch (error) {
MsgError(error);

View File

@ -58,7 +58,7 @@
</div>
</template>
<script setup lang="ts">
import { ListWebsites, OpWebsiteLog } from '@/api/modules/website';
import { listWebsites, opWebsiteLog } from '@/api/modules/website';
import { reactive } from 'vue';
import { onMounted } from 'vue';
import { ref, nextTick } from 'vue';
@ -89,7 +89,7 @@ const searchLog = () => {
const getWebsites = async () => {
loading.value = true;
await ListWebsites()
await listWebsites()
.then((res) => {
websites.value = res.data || [];
if (websites.value.length > 0) {
@ -130,12 +130,6 @@ const changeTail = () => {
logRef.value.changeTail(true);
};
// const onCloseLog = async () => {
// tailLog.value = false;
// clearInterval(Number(timer));
// timer = null;
// };
const onSubmitClean = async () => {
const req = {
id: logConfig.id,
@ -143,7 +137,7 @@ const onSubmitClean = async () => {
logType: logConfig.name,
};
loading.value = true;
OpWebsiteLog(req)
opWebsiteLog(req)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
searchLog();

View File

@ -116,7 +116,7 @@
<script lang="ts" setup>
import { Website } from '@/api/interface/website';
import { dateFormatSimple, getProvider } from '@/utils/util';
import { ListSSL } from '@/api/modules/website';
import { listSSL } from '@/api/modules/website';
import { reactive, ref } from 'vue';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
@ -172,7 +172,7 @@ const acceptParams = async (params: DialogProps): Promise<void> => {
if (params.sslInfo?.sslID) {
form.sslID = params.sslInfo.sslID;
const ssls = await ListSSL({});
const ssls = await listSSL({});
sslList.value = ssls.data || [];
changeSSl(params.sslInfo?.sslID);
} else {
@ -183,7 +183,7 @@ const acceptParams = async (params: DialogProps): Promise<void> => {
const emit = defineEmits<{ (e: 'search'): void }>();
const loadSSLs = async () => {
const res = await ListSSL({});
const res = await listSSL({});
sslList.value = res.data || [];
};

View File

@ -115,7 +115,7 @@ import type { ElForm } from 'element-plus';
import { Rules } from '@/global/form-rules';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
import { GetGroupList } from '@/api/modules/group';
import { getGroupList } from '@/api/modules/group';
const loading = ref();
const data = ref();
@ -160,7 +160,7 @@ let commandInfo = reactive<Command.CommandOperate>({
const cmdVisible = ref<boolean>(false);
const loadGroups = async () => {
const res = await GetGroupList('command');
const res = await getGroupList('command');
groupList.value = res.data;
for (const group of groupList.value) {
if (group.isDefault) {

View File

@ -32,7 +32,7 @@ import { ref, reactive } from 'vue';
import type { ElForm } from 'element-plus';
import { Rules } from '@/global/form-rules';
import { editHostGroup } from '@/api/modules/terminal';
import { GetGroupList } from '@/api/modules/group';
import { getGroupList } from '@/api/modules/group';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
@ -66,7 +66,7 @@ const rules = reactive({
});
const loadGroups = async (groupName: string) => {
const res = await GetGroupList('host');
const res = await getGroupList('host');
groupList.value = res.data;
for (const group of groupList.value) {
if (group.name === groupName) {

View File

@ -62,7 +62,7 @@ import GroupDialog from '@/components/group/index.vue';
import GroupChangeDialog from '@/components/group/change.vue';
import OperateDialog from '@/views/terminal/host/operate/index.vue';
import { deleteHost, editHostGroup, searchHosts } from '@/api/modules/terminal';
import { GetGroupList } from '@/api/modules/group';
import { getGroupList } from '@/api/modules/group';
import { reactive, ref } from 'vue';
import i18n from '@/lang';
import { Host } from '@/api/interface/host';
@ -138,7 +138,7 @@ const onBatchDelete = async (row: Host.Host | null) => {
};
const loadGroups = async () => {
const res = await GetGroupList('host');
const res = await getGroupList('host');
groupList.value = res.data;
};

View File

@ -86,7 +86,7 @@ import { ref, reactive } from 'vue';
import type { ElForm } from 'element-plus';
import { Rules } from '@/global/form-rules';
import { addHost, editHost, testByInfo } from '@/api/modules/terminal';
import { GetGroupList } from '@/api/modules/group';
import { getGroupList } from '@/api/modules/group';
import i18n from '@/lang';
import { MsgError, MsgSuccess } from '@/utils/message';
@ -134,7 +134,7 @@ function checkName(rule: any, value: any, callback: any) {
}
const loadGroups = async () => {
const res = await GetGroupList('host');
const res = await getGroupList('host');
groupList.value = res.data;
if (dialogData.value.title === 'create') {
for (const item of groupList.value) {

View File

@ -80,7 +80,7 @@ import { addHost, testByInfo } from '@/api/modules/terminal';
import i18n from '@/lang';
import { reactive, ref } from 'vue';
import { MsgError, MsgSuccess } from '@/utils/message';
import { GetGroupList } from '@/api/modules/group';
import { getGroupList } from '@/api/modules/group';
const dialogVisible = ref();
const isOK = ref(false);
@ -176,7 +176,7 @@ const submitAddHost = (formEl: FormInstance | undefined, ops: string) => {
};
const loadGroups = async () => {
const res = await GetGroupList('host');
const res = await getGroupList('host');
groupList.value = res.data;
for (const item of groupList.value) {
if (item.isDefault) {

View File

@ -21,7 +21,7 @@
<script lang="ts" setup>
import { HostTool } from '@/api/interface/host-tool';
import { GetSupervisorStatus, InitSupervisor } from '@/api/modules/host-tool';
import { getSupervisorStatus, initSupervisor } from '@/api/modules/host-tool';
import { Rules } from '@/global/form-rules';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
@ -47,7 +47,7 @@ const data = ref({
const getStatus = async () => {
try {
loading.value = true;
const res = await GetSupervisorStatus();
const res = await getSupervisorStatus();
data.value = res.data.config as HostTool.Supersivor;
} catch (error) {}
loading.value = false;
@ -60,7 +60,7 @@ const submit = async (formEl: FormInstance | undefined) => {
return;
}
loading.value = true;
InitSupervisor({
initSupervisor({
type: 'supervisord',
configPath: data.value.configPath,
serviceName: data.value.serviceName,

View File

@ -5,14 +5,14 @@
</template>
<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import { GetSupervisorLog } from '@/api/modules/host-tool';
import { getSupervisorLog } from '@/api/modules/host-tool';
import LogPro from '@/components/log-pro/index.vue';
let content = ref('');
let loading = ref(false);
const getConfig = async () => {
const res = await GetSupervisorLog();
const res = await getSupervisorLog();
content.value = res.data;
};

View File

@ -12,7 +12,7 @@
import { onMounted, ref } from 'vue';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
import { OperateSupervisorConfig } from '@/api/modules/host-tool';
import { operateSupervisorConfig } from '@/api/modules/host-tool';
let data = ref();
let content = ref('');
@ -20,7 +20,7 @@ let loading = ref(false);
const submit = () => {
loading.value = true;
OperateSupervisorConfig({ type: 'supervisord', operate: 'set', content: content.value })
operateSupervisorConfig({ type: 'supervisord', operate: 'set', content: content.value })
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
getConfig();
@ -31,7 +31,7 @@ const submit = () => {
};
const getConfig = async () => {
const res = await OperateSupervisorConfig({ type: 'supervisord', operate: 'get' });
const res = await operateSupervisorConfig({ type: 'supervisord', operate: 'get' });
data.value = res.data;
content.value = data.value.content;
};

View File

@ -43,7 +43,7 @@
</template>
<script lang="ts" setup>
import { CreateSupervisorProcess } from '@/api/modules/host-tool';
import { createSupervisorProcess } from '@/api/modules/host-tool';
import { Rules, checkNumberRange } from '@/global/form-rules';
import FileList from '@/components/file-list/index.vue';
import i18n from '@/lang';
@ -114,7 +114,7 @@ const submit = async (formEl: FormInstance | undefined) => {
}
loading.value = true;
process.value.numprocs = String(process.value.numprocsNum);
CreateSupervisorProcess(process.value)
createSupervisorProcess(process.value)
.then(() => {
open.value = false;
em('close', open);

View File

@ -32,7 +32,7 @@
</template>
<script lang="ts" setup>
import { onUnmounted, reactive, ref, watch } from 'vue';
import { OperateSupervisorProcessFile } from '@/api/modules/host-tool';
import { operateSupervisorProcessFile } from '@/api/modules/host-tool';
import i18n from '@/lang';
import { TabsPaneContext } from 'element-plus';
import { MsgSuccess } from '@/utils/message';
@ -54,13 +54,9 @@ let timer: NodeJS.Timer | null = null;
const em = defineEmits(['search']);
watch(open, (val) => {
if (screenfull.isEnabled && !val && !mobile.value) screenfull.exit();
});
const getContent = () => {
loading.value = true;
OperateSupervisorProcessFile(req)
operateSupervisorProcessFile(req)
.then((res) => {
content.value = res.data;
})
@ -97,7 +93,7 @@ const submit = () => {
content: content.value,
};
loading.value = true;
OperateSupervisorProcessFile(updateReq)
operateSupervisorProcessFile(updateReq)
.then(() => {
em('search');
open.value = false;
@ -124,7 +120,7 @@ const cleanLog = async () => {
title: i18n.global.t('commons.msg.clean'),
names: [req.name],
msg: i18n.global.t('commons.msg.operatorHelper', [log, i18n.global.t('commons.msg.clean')]),
api: OperateSupervisorProcessFile,
api: operateSupervisorProcessFile,
params: { name: req.name, operate: 'clear', file: req.file },
});
};

View File

@ -145,7 +145,7 @@ import ConfigSuperVisor from './config/index.vue';
import { computed, onMounted } from 'vue';
import Create from './create/index.vue';
import File from './file/index.vue';
import { GetSupervisorProcess, OperateSupervisorProcess } from '@/api/modules/host-tool';
import { getSupervisorProcess, operateSupervisorProcess } from '@/api/modules/host-tool';
import { GlobalStore } from '@/store';
import i18n from '@/lang';
import { HostTool } from '@/api/interface/host-tool';
@ -212,7 +212,7 @@ const search = async () => {
let needLoadStatus = false;
dataLoading.value = true;
try {
const res = await GetSupervisorProcess();
const res = await getSupervisorProcess();
data.value = res.data;
for (const process of data.value) {
if (process.status && process.status.length > 0) {
@ -234,7 +234,7 @@ const search = async () => {
const loadStatus = async () => {
let needLoadStatus = false;
try {
const res = await GetSupervisorProcess();
const res = await getSupervisorProcess();
const stats = res.data || [];
for (const process of data.value) {
for (const item of stats) {
@ -285,7 +285,7 @@ const operate = async (operation: string, name: string) => {
)
.then(() => {
loading.value = true;
OperateSupervisorProcess({ operate: operation, name: name })
operateSupervisorProcess({ operate: operation, name: name })
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
search();

View File

@ -63,7 +63,7 @@
</div>
</template>
<script lang="ts" setup>
import { GetSupervisorStatus, OperateSupervisor } from '@/api/modules/host-tool';
import { getSupervisorStatus, operateSupervisor } from '@/api/modules/host-tool';
import { onMounted, reactive, ref } from 'vue';
import Status from '@/components/status/index.vue';
import { ElMessageBox } from 'element-plus';
@ -118,7 +118,7 @@ const onOperate = async (operation: string) => {
)
.then(() => {
em('update:loading', true);
OperateSupervisor(operation)
operateSupervisor(operation)
.then(() => {
em('update:maskShow', true);
getStatus();
@ -138,7 +138,7 @@ const getStatus = async () => {
try {
loading.value = true;
em('update:loading', true);
const res = await GetSupervisorStatus();
const res = await getSupervisorStatus();
if (res.data.config) {
data.value = res.data.config as HostTool.Supersivor;
}

View File

@ -38,7 +38,7 @@
</template>
<script lang="ts" setup>
import { InitSupervisor } from '@/api/modules/host-tool';
import { initSupervisor } from '@/api/modules/host-tool';
import { Rules } from '@/global/form-rules';
import i18n from '@/lang';
import { FormInstance } from 'element-plus';
@ -90,7 +90,7 @@ const submit = async (formEl: FormInstance | undefined) => {
return;
}
loading.value = true;
InitSupervisor({
initSupervisor({
type: 'supervisord',
configPath: initModel.value.primaryConfig,
serviceName: initModel.value.serviceName,

View File

@ -32,7 +32,7 @@
<script setup lang="ts">
import { App } from '@/api/interface/app';
import { GetApp, GetAppDetail, SearchApp } from '@/api/modules/app';
import { getAppByKey, getAppDetail, searchApp } from '@/api/modules/app';
import { useVModel } from '@vueuse/core';
import { defineProps } from 'vue';
@ -72,14 +72,14 @@ const changeApp = (appID: number) => {
const changeVersion = async () => {
try {
const res = await GetAppDetail(runtime.value.appID, runtime.value.version, 'runtime');
const res = await getAppDetail(runtime.value.appID, runtime.value.version, 'runtime');
runtime.value.appDetailID = res.data.id;
} catch (error) {}
};
const getApp = async (appkey: string, mode: string) => {
try {
const res = await GetApp(appkey);
const res = await getAppByKey(appkey);
appVersions.value = res.data.versions || [];
if (res.data.versions.length > 0) {
if (mode === 'create') {
@ -90,9 +90,9 @@ const getApp = async (appkey: string, mode: string) => {
} catch (error) {}
};
const searchApp = async (appID: number) => {
const searchAppList = async (appID: number) => {
try {
const res = await SearchApp(appReq);
const res = await searchApp(appReq);
apps.value = res.data.items || [];
if (res.data && res.data.items && res.data.items.length > 0) {
if (appID == null) {
@ -111,9 +111,9 @@ const searchApp = async (appID: number) => {
onMounted(() => {
if (props.mode === 'create') {
searchApp(null);
searchAppList(null);
} else {
searchApp(runtime.value.appID);
searchAppList(runtime.value.appID);
}
});
</script>

View File

@ -181,7 +181,7 @@
<script lang="ts" setup>
import { App } from '@/api/interface/app';
import { Runtime } from '@/api/interface/runtime';
import { GetApp, GetAppDetail, SearchApp } from '@/api/modules/app';
import { getAppByKey, getAppDetail, searchApp } from '@/api/modules/app';
import { CreateRuntime, GetRuntime, ListPHPExtensions, UpdateRuntime } from '@/api/modules/runtime';
import { Rules } from '@/global/form-rules';
import i18n from '@/lang';
@ -308,12 +308,12 @@ const changeResource = (resource: string) => {
runtime.image = '';
} else {
runtime.version = '';
searchApp(null);
searchAppList(null);
}
};
const searchApp = (appId: number) => {
SearchApp(appReq).then((res) => {
const searchAppList = (appId: number) => {
searchApp(appReq).then((res) => {
apps.value = res.data.items || [];
if (res.data && res.data.items && res.data.items.length > 0) {
if (appId == null) {
@ -349,7 +349,7 @@ const changeVersion = () => {
loading.value = true;
initParam.value = false;
extensions.value = undefined;
GetAppDetail(runtime.appID, runtime.version, 'runtime')
getAppDetail(runtime.appID, runtime.version, 'runtime')
.then((res) => {
runtime.appDetailID = res.data.id;
runtime.image = res.data.image + ':' + runtime.version;
@ -371,7 +371,7 @@ const changeVersion = () => {
};
const getApp = (appkey: string, mode: string) => {
GetApp(appkey).then((res) => {
getAppByKey(appkey).then((res) => {
appVersions.value = res.data.versions || [];
if (res.data.versions.length > 0) {
runtime.version = res.data.versions[0];
@ -470,9 +470,9 @@ const acceptParams = async (props: OperateRrops) => {
initParam.value = false;
if (props.mode === 'create') {
Object.assign(runtime, initData(props.type));
searchApp(null);
searchAppList(null);
} else {
searchApp(props.appID);
searchAppList(props.appID);
getRuntime(props.id);
}
extensions.value = '';
@ -480,6 +480,16 @@ const acceptParams = async (props: OperateRrops) => {
listPHPExtensions();
};
watch(
() => runtime.name,
(newVal) => {
if (newVal && mode.value == 'create') {
runtime.params['CONTAINER_NAME'] = newVal;
}
},
{ deep: true },
);
defineExpose({
acceptParams,
});

View File

@ -43,7 +43,7 @@
</template>
<script lang="ts" setup>
import { CreateSupervisorProcess } from '@/api/modules/runtime';
import { createSupervisorProcess } from '@/api/modules/runtime';
import { Rules, checkNumberRange } from '@/global/form-rules';
import FileList from '@/components/file-list/index.vue';
import i18n from '@/lang';
@ -115,7 +115,7 @@ const submit = async (formEl: FormInstance | undefined) => {
}
loading.value = true;
process.value.numprocs = String(process.value.numprocsNum);
CreateSupervisorProcess(process.value)
createSupervisorProcess(process.value)
.then(() => {
open.value = false;
em('close', open);

View File

@ -32,7 +32,7 @@
</template>
<script lang="ts" setup>
import { onUnmounted, reactive, ref } from 'vue';
import { OperateSupervisorProcessFile } from '@/api/modules/runtime';
import { operateSupervisorProcessFile } from '@/api/modules/runtime';
import i18n from '@/lang';
import { TabsPaneContext } from 'element-plus';
import { MsgSuccess } from '@/utils/message';
@ -55,7 +55,7 @@ const em = defineEmits(['search']);
const getContent = () => {
loading.value = true;
OperateSupervisorProcessFile(req)
operateSupervisorProcessFile(req)
.then((res) => {
content.value = res.data;
})
@ -93,7 +93,7 @@ const submit = () => {
id: req.id,
};
loading.value = true;
OperateSupervisorProcessFile(updateReq)
operateSupervisorProcessFile(updateReq)
.then(() => {
em('search');
open.value = false;
@ -121,7 +121,7 @@ const cleanLog = async () => {
title: i18n.global.t('commons.msg.clean'),
names: [req.name],
msg: i18n.global.t('commons.msg.operatorHelper', [log, i18n.global.t('commons.msg.clean')]),
api: OperateSupervisorProcessFile,
api: operateSupervisorProcessFile,
params: { name: req.name, operate: 'clear', file: req.file },
});
};

View File

@ -123,7 +123,7 @@ import { ref } from '@vue/runtime-core';
import { computed } from 'vue';
import Create from './create/index.vue';
import File from './file/index.vue';
import { GetSupervisorProcess, OperateSupervisorProcess } from '@/api/modules/runtime';
import { GetSupervisorProcess, operateSupervisorProcess } from '@/api/modules/runtime';
import { GlobalStore } from '@/store';
import i18n from '@/lang';
import { HostTool } from '@/api/interface/host-tool';
@ -229,7 +229,7 @@ const operate = async (operation: string, name: string) => {
)
.then(() => {
loading.value = true;
OperateSupervisorProcess({ operate: operation, name: name, id: runtimeID.value })
operateSupervisorProcess({ operate: operation, name: name, id: runtimeID.value })
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
search();

View File

@ -65,7 +65,7 @@
import { FormInstance } from 'element-plus';
import { ref } from 'vue';
import { Rules } from '@/global/form-rules';
import { CreateAcmeAccount } from '@/api/modules/website';
import { createAcmeAccount } from '@/api/modules/website';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
import { AcmeAccountTypes, KeyTypes } from '@/global/mimetype';
@ -115,7 +115,7 @@ const submit = async (formEl: FormInstance | undefined) => {
}
loading.value = true;
CreateAcmeAccount(account.value)
createAcmeAccount(account.value)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
handleClose();

View File

@ -42,7 +42,7 @@
<script lang="ts" setup>
import { Website } from '@/api/interface/website';
import { DeleteAcmeAccount, SearchAcmeAccount } from '@/api/modules/website';
import { deleteAcmeAccount, searchAcmeAccount } from '@/api/modules/website';
import i18n from '@/lang';
import { reactive, ref } from 'vue';
import Create from './create/index.vue';
@ -79,7 +79,7 @@ const search = async () => {
page: paginationConfig.currentPage,
pageSize: paginationConfig.pageSize,
};
await SearchAcmeAccount(req).then((res) => {
await searchAcmeAccount(req).then((res) => {
data.value = res.data.items;
paginationConfig.total = res.data.total;
});
@ -101,7 +101,7 @@ const deleteAccount = async (row: any) => {
i18n.global.t('website.acmeAccountManage'),
i18n.global.t('commons.button.delete'),
]),
api: DeleteAcmeAccount,
api: deleteAcmeAccount,
params: { id: row.id },
});
};

View File

@ -37,7 +37,7 @@
<script lang="ts" setup>
import { Website } from '@/api/interface/website';
import { GetDnsResolve, ObtainSSL } from '@/api/modules/website';
import { getDnsResolve, obtainSSL } from '@/api/modules/website';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
import { ref } from 'vue';
@ -60,10 +60,10 @@ const acceptParams = async (props: RenewProps) => {
open.value = true;
dnsResolve.value = [];
sslID.value = props.ssl.id;
getDnsResolve(props.ssl);
getDnsResolveRes(props.ssl);
};
const getDnsResolve = async (row: Website.SSL) => {
const getDnsResolveRes = async (row: Website.SSL) => {
loading.value = true;
let domains = [row.primaryDomain];
@ -72,7 +72,7 @@ const getDnsResolve = async (row: Website.SSL) => {
domains = domains.concat(otherDomains);
}
try {
const res = await GetDnsResolve({ acmeAccountId: row.acmeAccountId, domains: domains });
const res = await getDnsResolve({ acmeAccountId: row.acmeAccountId, domains: domains });
if (res.data) {
dnsResolve.value = res.data;
}
@ -82,7 +82,7 @@ const getDnsResolve = async (row: Website.SSL) => {
};
const submit = () => {
ObtainSSL({ ID: sslID.value })
obtainSSL({ ID: sslID.value })
.then(() => {
MsgSuccess(i18n.global.t('ssl.applyStart'));
handleClose();

View File

@ -53,7 +53,7 @@ import { ref } from 'vue';
import { FormInstance } from 'element-plus';
import { Rules } from '@/global/form-rules';
import { KeyTypes } from '@/global/mimetype';
import { CreateCA } from '@/api/modules/website';
import { createCA } from '@/api/modules/website';
import { MsgSuccess } from '@/utils/message';
import i18n from '@/lang';
@ -106,7 +106,7 @@ const submit = async (formEl: FormInstance | undefined) => {
}
loading.value = true;
CreateCA(ca.value)
createCA(ca.value)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
handleClose();

View File

@ -49,7 +49,7 @@
</DrawerPro>
</template>
<script lang="ts" setup>
import { GetCA } from '@/api/modules/website';
import { getCA } from '@/api/modules/website';
import { ref } from 'vue';
const open = ref(false);
@ -71,7 +71,7 @@ const acceptParams = (caID: number) => {
};
const get = async () => {
const res = await GetCA(id.value);
const res = await getCA(id.value);
ca.value = res.data;
};

View File

@ -35,7 +35,7 @@
<script lang="ts" setup>
import { Website } from '@/api/interface/website';
import { DeleteCA, SearchCAs, DownloadCAFile } from '@/api/modules/website';
import { deleteCA, searchCAs, downloadCAFile } from '@/api/modules/website';
import i18n from '@/lang';
import { reactive, ref } from 'vue';
import Create from './create/index.vue';
@ -80,7 +80,7 @@ const buttons = [
{
label: i18n.global.t('commons.button.delete'),
click: function (row: Website.CA) {
deleteCA(row);
deleteca(row);
},
},
];
@ -99,7 +99,7 @@ const search = async () => {
page: paginationConfig.currentPage,
pageSize: paginationConfig.pageSize,
};
await SearchCAs(req).then((res) => {
await searchCAs(req).then((res) => {
data.value = res.data.items;
paginationConfig.total = res.data.total;
});
@ -114,7 +114,7 @@ const handleClose = () => {
open.value = false;
};
const deleteCA = async (row: any) => {
const deleteca = async (row: any) => {
opRef.value.acceptParams({
title: i18n.global.t('commons.button.delete'),
names: [row.name],
@ -122,14 +122,14 @@ const deleteCA = async (row: any) => {
i18n.global.t('website.ca'),
i18n.global.t('commons.button.delete'),
]),
api: DeleteCA,
api: deleteCA,
params: { id: row.id },
});
};
const onDownload = (row: Website.CA) => {
loading.value = true;
DownloadCAFile({ id: row.id })
downloadCAFile({ id: row.id })
.then((res) => {
const downloadUrl = window.URL.createObjectURL(new Blob([res]));
const a = document.createElement('a');

View File

@ -74,7 +74,7 @@
</template>
<script lang="ts" setup>
import { ObtainSSLByCA } from '@/api/modules/website';
import { obtainSSLByCA } from '@/api/modules/website';
import { Rules, checkNumberRange } from '@/global/form-rules';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
@ -138,7 +138,7 @@ const submit = async (formEl: FormInstance | undefined) => {
}
loading.value = true;
ObtainSSLByCA(obtain.value)
obtainSSLByCA(obtain.value)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
handleClose();

View File

@ -151,7 +151,7 @@
<script lang="ts" setup>
import { Website } from '@/api/interface/website';
import { CreateSSL, ListWebsites, SearchAcmeAccount, SearchDnsAccount, UpdateSSL } from '@/api/modules/website';
import { createSSL, listWebsites, searchAcmeAccount, searchDnsAccount, updateSSL } from '@/api/modules/website';
import { Rules } from '@/global/form-rules';
import i18n from '@/lang';
import { FormInstance } from 'element-plus';
@ -265,7 +265,7 @@ const acceptParams = (op: string, websiteSSL: Website.SSLDTO) => {
ssl.value.websiteId = Number(id.value);
getAcmeAccounts();
getDnsAccounts();
listwebsites();
getwebsites();
open.value = true;
};
@ -274,7 +274,7 @@ const getPath = (dir: string) => {
};
const getAcmeAccounts = async () => {
const res = await SearchAcmeAccount(acmeReq);
const res = await searchAcmeAccount(acmeReq);
acmeAccounts.value = res.data.items || [];
if (acmeAccounts.value.length > 0 && ssl.value.acmeAccountId == undefined) {
ssl.value.acmeAccountId = res.data.items[0].id;
@ -282,7 +282,7 @@ const getAcmeAccounts = async () => {
};
const getDnsAccounts = async () => {
const res = await SearchDnsAccount(dnsReq);
const res = await searchDnsAccount(dnsReq);
dnsAccounts.value = res.data.items || [];
if (dnsAccounts.value.length > 0 && ssl.value.dnsAccountId == undefined) {
ssl.value.dnsAccountId = res.data.items[0].id;
@ -293,8 +293,8 @@ const changeProvider = () => {
dnsResolve.value = [];
};
const listwebsites = async () => {
const res = await ListWebsites();
const getwebsites = async () => {
const res = await listWebsites();
websites.value = res.data;
};
@ -323,7 +323,7 @@ const submit = async (formEl: FormInstance | undefined) => {
}
loading.value = true;
if (operate.value == 'create') {
CreateSSL(ssl.value)
createSSL(ssl.value)
.then((res: any) => {
if (ssl.value.provider != 'dnsManual') {
em('submit', res.data.id);
@ -355,7 +355,7 @@ const submit = async (formEl: FormInstance | undefined) => {
execShell: ssl.value.execShell,
shell: ssl.value.shell,
};
UpdateSSL(sslUpdate)
updateSSL(sslUpdate)
.then(() => {
handleClose();
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));

View File

@ -67,7 +67,7 @@
</DrawerPro>
</template>
<script lang="ts" setup>
import { GetSSL } from '@/api/modules/website';
import { getSSL } from '@/api/modules/website';
import { ref } from 'vue';
import { dateFormatSimple, getProvider, getDNSName } from '@/utils/util';
@ -90,7 +90,7 @@ const acceptParams = (sslId: number) => {
};
const get = async () => {
const res = await GetSSL(id.value);
const res = await getSSL(id.value);
ssl.value = res.data;
};

View File

@ -107,7 +107,7 @@
</template>
<script lang="ts" setup>
import { CreateDnsAccount, UpdateDnsAccount } from '@/api/modules/website';
import { createDnsAccount, updateDnsAccount } from '@/api/modules/website';
import { Rules } from '@/global/form-rules';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
@ -181,7 +181,7 @@ const submit = async (formEl: FormInstance | undefined) => {
loading.value = true;
if (accountData.value.mode === 'edit') {
UpdateDnsAccount(account.value)
updateDnsAccount(account.value)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
handleClose();
@ -190,7 +190,7 @@ const submit = async (formEl: FormInstance | undefined) => {
loading.value = false;
});
} else {
CreateDnsAccount(account.value)
createDnsAccount(account.value)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
handleClose();

View File

@ -35,7 +35,7 @@
<script lang="ts" setup>
import Create from './create/index.vue';
import { Website } from '@/api/interface/website';
import { DeleteDnsAccount, SearchDnsAccount } from '@/api/modules/website';
import { deleteDnsAccount, searchDnsAccount } from '@/api/modules/website';
import { onMounted, reactive, ref } from 'vue';
import i18n from '@/lang';
import { getDNSName } from '@/utils/util';
@ -80,7 +80,7 @@ const search = () => {
page: paginationConfig.currentPage,
pageSize: paginationConfig.pageSize,
};
SearchDnsAccount(req).then((res) => {
searchDnsAccount(req).then((res) => {
data.value = res.data.items;
paginationConfig.total = res.data.total;
});
@ -102,7 +102,7 @@ const deleteAccount = async (row: any) => {
i18n.global.t('website.dnsAccountManage'),
i18n.global.t('commons.button.delete'),
]),
api: DeleteDnsAccount,
api: deleteDnsAccount,
params: { id: row.id },
});
};

View File

@ -18,7 +18,7 @@
<el-button type="primary" plain @click="openDnsAccount()">
{{ $t('website.dnsAccountManage') }}
</el-button>
<el-button plain @click="deleteSSL(null)" :disabled="selects.length === 0">
<el-button plain @click="deletessl(null)" :disabled="selects.length === 0">
{{ $t('commons.button.delete') }}
</el-button>
</template>
@ -157,7 +157,7 @@
<script lang="ts" setup>
import { onMounted, reactive, ref, computed } from 'vue';
import { DeleteSSL, DownloadFile, SearchSSL, UpdateSSL } from '@/api/modules/website';
import { deleteSSL, downloadFile, searchSSL, updateSSL } from '@/api/modules/website';
import DnsAccount from './dns-account/index.vue';
import AcmeAccount from './acme-account/index.vue';
import CA from './ca/index.vue';
@ -255,14 +255,14 @@ const buttons = [
{
label: i18n.global.t('commons.button.delete'),
click: function (row: Website.SSLDTO) {
deleteSSL(row);
deletessl(row);
},
},
];
const onDownload = (ssl: Website.SSLDTO) => {
loading.value = true;
DownloadFile({ id: ssl.id })
downloadFile({ id: ssl.id })
.then((res) => {
const downloadUrl = window.URL.createObjectURL(new Blob([res]));
const a = document.createElement('a');
@ -287,7 +287,7 @@ const search = () => {
pageSize: paginationConfig.pageSize,
};
loading.value = true;
SearchSSL(req)
searchSSL(req)
.then((res) => {
data.value = res.data.items || [];
paginationConfig.total = res.data.total;
@ -304,7 +304,7 @@ const updateDesc = (row: Website.SSLDTO, bulr: Function) => {
const updateConfig = (row: Website.SSLDTO) => {
loading.value = true;
UpdateSSL(row)
updateSSL(row)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
})
@ -347,7 +347,7 @@ const applySSL = (row: Website.SSLDTO) => {
obtainRef.value.acceptParams({ ssl: row });
};
const deleteSSL = async (row: any) => {
const deletessl = async (row: any) => {
let names = [];
let params = {};
if (row == null) {
@ -365,7 +365,7 @@ const deleteSSL = async (row: any) => {
i18n.global.t('website.ssl'),
i18n.global.t('commons.button.delete'),
]),
api: DeleteSSL,
api: deleteSSL,
params: params,
});
search();

View File

@ -28,7 +28,7 @@
<script lang="ts" setup>
import { Website } from '@/api/interface/website';
import { ObtainSSL, RenewSSLByCA } from '@/api/modules/website';
import { obtainSSL, renewSSLByCA } from '@/api/modules/website';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
import { ref } from 'vue';
@ -55,9 +55,9 @@ const submit = async () => {
loading.value = true;
try {
if (ssl.value.provider == 'selfSigned') {
await RenewSSLByCA({ SSLID: ssl.value.id });
await renewSSLByCA({ SSLID: ssl.value.id });
} else {
await ObtainSSL({ ID: ssl.value.id });
await obtainSSL({ ID: ssl.value.id });
}
handleClose();
MsgSuccess(i18n.global.t('ssl.applyStart'));

View File

@ -47,7 +47,7 @@
</template>
<script lang="ts" setup>
import { UploadSSL } from '@/api/modules/website';
import { uploadSSL } from '@/api/modules/website';
import { Rules } from '@/global/form-rules';
import i18n from '@/lang';
import { FormInstance } from 'element-plus';
@ -112,7 +112,7 @@ const submit = async (formEl: FormInstance | undefined) => {
return;
}
loading.value = true;
UploadSSL(ssl.value)
uploadSSL(ssl.value)
.then(() => {
handleClose();
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));

View File

@ -61,7 +61,7 @@
</template>
<script setup lang="ts">
import { GetAntiLeech, ListDomains, UpdateAntiLeech } from '@/api/modules/website';
import { getAntiLeech, listDomains, updateAntiLeech } from '@/api/modules/website';
import { Rules, checkNumberRange } from '@/global/form-rules';
import { FormInstance } from 'element-plus';
import { computed, onMounted, reactive } from 'vue';
@ -108,7 +108,7 @@ const rules = ref({
const changeEnable = (enable: boolean) => {
if (enable) {
ListDomains(id.value)
listDomains(id.value)
.then((res) => {
const domains = res.data || [];
let serverNameStr = '';
@ -141,7 +141,7 @@ const changeEnable = (enable: boolean) => {
const search = async () => {
loading.value = true;
const res = await GetAntiLeech({ websiteID: id.value });
const res = await getAntiLeech({ websiteID: id.value });
loading.value = false;
if (!res.data.enable) {
return;
@ -187,7 +187,7 @@ const update = async (enable: boolean) => {
form.enable = enable;
loading.value = true;
form.websiteID = id.value;
await UpdateAntiLeech(form)
await updateAntiLeech(form)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
search();

View File

@ -44,7 +44,7 @@
</template>
<script lang="ts" setup>
import { OperateAuthConfig, OperatePathAuthConfig } from '@/api/modules/website';
import { operateAuthConfig, operatePathAuthConfig } from '@/api/modules/website';
import { Rules } from '@/global/form-rules';
import i18n from '@/lang';
import { FormInstance } from 'element-plus';
@ -99,7 +99,7 @@ const submit = async (formEl: FormInstance | undefined) => {
loading.value = true;
try {
if (authBasic.value.scope == 'root') {
await OperateAuthConfig(authBasic.value);
await operateAuthConfig(authBasic.value);
} else {
const req = {
websiteID: authBasic.value.websiteID,
@ -110,7 +110,7 @@ const submit = async (formEl: FormInstance | undefined) => {
operate: authBasic.value.operate,
remark: authBasic.value.remark,
};
await OperatePathAuthConfig(req);
await operatePathAuthConfig(req);
}
if (authBasic.value.operate == 'create') {
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));

Some files were not shown because too many files have changed in this diff Show More