1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 22:18:07 +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"` AccessLogPath string `json:"accessLogPath"`
SitePath string `json:"sitePath"` SitePath string `json:"sitePath"`
AppName string `json:"appName"` AppName string `json:"appName"`
RuntimeName string `json:"runtimeName"`
} }
type WebsitePreInstallCheck struct { type WebsitePreInstallCheck struct {

View File

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

View File

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

View File

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