1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 16:29:17 +08:00

feat: 网站列表增加网站目录跳转功能 (#892)

This commit is contained in:
zhengkunwang223 2023-05-06 11:05:33 +07:00 committed by GitHub
parent f8ab71953d
commit 7f1f758e60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -96,6 +96,10 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons
if err != nil {
return 0, nil, err
}
nginxInstall, err := getAppInstallByKey(constant.AppOpenresty)
if err != nil {
return 0, nil, err
}
for _, web := range websites {
var (
appName string
@ -115,10 +119,12 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons
}
runtimeName = runtime.Name
}
sitePath := path.Join(constant.AppInstallDir, constant.AppOpenresty, nginxInstall.Name, "www", "sites", web.Alias)
websiteDTOs = append(websiteDTOs, response.WebsiteDTO{
Website: web,
AppName: appName,
RuntimeName: runtimeName,
SitePath: sitePath,
})
}
return total, websiteDTOs, nil

View File

@ -79,6 +79,15 @@
<span v-if="row.type === 'runtime'">[{{ row.runtimeName }}]</span>
</template>
</el-table-column>
<el-table-column :label="$t('website.sitePath')" prop="sitePath">
<template #default="{ row }">
<el-button type="primary" link @click="toFolder(row.sitePath)">
<el-icon>
<FolderOpened />
</el-icon>
</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('commons.table.status')" prop="status" width="100px">
<template #default="{ row }">
<el-button
@ -404,6 +413,10 @@ const opWebsite = (op: string, id: number) => {
});
};
const toFolder = (folder: string) => {
router.push({ path: '/hosts/files', query: { path: folder } });
};
onMounted(() => {
search();
listGroup();