diff --git a/backend/app/dto/response/app.go b/backend/app/dto/response/app.go index 2ef7563eb..f169f22d9 100644 --- a/backend/app/dto/response/app.go +++ b/backend/app/dto/response/app.go @@ -29,6 +29,7 @@ type AppInstalledCheck struct { LastBackupAt string `json:"lastBackupAt"` AppInstallID uint `json:"appInstallId"` ContainerName string `json:"containerName"` + InstallPath string `json:"installPath"` } type AppDetailDTO struct { diff --git a/backend/app/service/app_install.go b/backend/app/service/app_install.go index 4d5b8ffb0..7bbfd57fc 100644 --- a/backend/app/service/app_install.go +++ b/backend/app/service/app_install.go @@ -74,6 +74,7 @@ func (a AppInstallService) CheckExist(key string) (*response.AppInstalledCheck, res.Status = appInstall.Status res.AppInstallID = appInstall.ID res.IsExist = true + res.InstallPath = path.Join(constant.AppInstallDir, appInstall.Name) if len(appInstall.Backups) > 0 { res.LastBackupAt = appInstall.Backups[0].CreatedAt.Format("2006-01-02 15:04:05") } diff --git a/frontend/src/api/interface/app.ts b/frontend/src/api/interface/app.ts index 687c40cbc..94ac0f12b 100644 --- a/frontend/src/api/interface/app.ts +++ b/frontend/src/api/interface/app.ts @@ -96,6 +96,7 @@ export namespace App { lastBackupAt: string; appInstallId: number; containerName: string; + installPath: string; } export interface AppInstallResource { diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 19b32f3c5..1eda02563 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -895,6 +895,7 @@ export default { deleteAppHelper: '同时删除关联应用以及应用备份', deleteBackupHelper: '同时删除网站备份', deleteConfirmHelper: '删除操作无法回滚,请输入 "{0}" 删除此网站', + staticPath: '对应主目录:', }, nginx: { serverNamesHashBucketSizeHelper: '服务器名字的hash表大小', diff --git a/frontend/src/views/website/website/create/index.vue b/frontend/src/views/website/website/create/index.vue index f7309b60c..cbb7261cc 100644 --- a/frontend/src/views/website/website/create/index.vue +++ b/frontend/src/views/website/website/create/index.vue @@ -109,6 +109,11 @@ +
+ + {{ $t('website.staticPath') + staticPath + '/' + website.alias }} + +
@@ -190,6 +195,7 @@ let appDetail = ref(); let appParams = ref(); let paramKey = ref(1); let preCheckRef = ref(); +let staticPath = ref(''); const em = defineEmits(['close']); @@ -236,10 +242,12 @@ const getAppDetail = (version: string) => { }); }; -const acceptParams = async () => { +const acceptParams = async (installPath: string) => { if (websiteForm.value) { websiteForm.value.resetFields(); } + console.log(installPath); + staticPath.value = installPath + '/www/sites'; await ListGroups().then((res) => { groups.value = res.data; diff --git a/frontend/src/views/website/website/index.vue b/frontend/src/views/website/website/index.vue index d037566af..a6cf97dbe 100644 --- a/frontend/src/views/website/website/index.vue +++ b/frontend/src/views/website/website/index.vue @@ -106,6 +106,7 @@ let openNginxConfig = ref(false); let nginxIsExist = ref(false); let containerName = ref(''); let nginxStatus = ref(''); +let installPath = ref(''); const paginationConfig = reactive({ currentPage: 1, @@ -178,7 +179,7 @@ const openDelete = (website: Website.Website) => { }; const openCreate = () => { - createRef.value.acceptParams(); + createRef.value.acceptParams(installPath.value); }; const openGroup = () => { @@ -189,6 +190,7 @@ const checkExist = (data: App.CheckInstalled) => { nginxIsExist.value = data.isExist; containerName.value = data.containerName; nginxStatus.value = data.status; + installPath.value = data.installPath; }; onMounted(() => {