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

feat: 网站列表增加运行环境字段 (#562)

This commit is contained in:
zhengkunwang223 2023-04-10 16:24:26 +08:00 committed by GitHub
parent cc51eaef3f
commit 1bba2664b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 9 deletions

View File

@ -10,6 +10,7 @@ type WebsiteDTO struct {
AccessLogPath string `json:"accessLogPath"`
SitePath string `json:"sitePath"`
AppName string `json:"appName"`
RuntimeName string `json:"runtimeName"`
}
type WebsitePreInstallCheck struct {

View File

@ -78,17 +78,28 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons
return 0, nil, err
}
for _, web := range websites {
var appName string
if web.Type == constant.Deployment {
var (
appName string
runtimeName string
)
switch web.Type {
case constant.Deployment:
appInstall, err := appInstallRepo.GetFirst(commonRepo.WithByID(web.AppInstallID))
if err != nil {
return 0, nil, err
}
appName = appInstall.Name
case constant.Runtime:
runtime, err := runtimeRepo.GetFirst(commonRepo.WithByID(web.RuntimeID))
if err != nil {
return 0, nil, err
}
runtimeName = runtime.Name
}
websiteDTOs = append(websiteDTOs, response.WebsiteDTO{
Website: web,
AppName: appName,
Website: web,
AppName: appName,
RuntimeName: runtimeName,
})
}
return total, websiteDTOs, nil

View File

@ -24,6 +24,7 @@ export namespace Website {
accessLogPath: string;
sitePath: string;
appName: string;
runtimeName: string;
}
export interface NewAppInstall {

View File

@ -76,6 +76,7 @@
<template #default="{ row }">
{{ $t('website.' + row.type) }}
<span v-if="row.type === 'deployment'">[{{ row.appName }}]</span>
<span v-if="row.type === 'runtime'">[{{ row.runtimeName }}]</span>
</template>
</el-table-column>
<el-table-column :label="$t('commons.table.status')" prop="status">
@ -203,11 +204,11 @@ const maskShow = ref(true);
const createRef = ref();
const deleteRef = ref();
const groupRef = ref();
let openNginxConfig = ref(false);
let nginxIsExist = ref(false);
let containerName = ref('');
let nginxStatus = ref('');
let installPath = ref('');
const openNginxConfig = ref(false);
const nginxIsExist = ref(false);
const containerName = ref('');
const nginxStatus = ref('');
const installPath = ref('');
const uploadRef = ref();
const dialogBackupRef = ref();
const defaultRef = ref();