mirror of https://github.com/1Panel-dev/1Panel
feat: 网站列表增加网站目录跳转功能 (#892)
parent
f8ab71953d
commit
7f1f758e60
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue