feat: Restrict abnormal database selection during application installation (#8059)

This commit is contained in:
zhengkunwang 2025-03-04 15:18:04 +08:00 committed by GitHub
parent f242f71661
commit f71ff7d80c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 132 additions and 97 deletions

View file

@ -141,6 +141,7 @@ type AppService struct {
Value string `json:"value"`
Config interface{} `json:"config"`
From string `json:"from"`
Status string `json:"status"`
}
type AppParam struct {

View file

@ -358,7 +358,7 @@ func LoadContainerName() (string, error) {
if err != nil {
return "", fmt.Errorf("ollama service is not found, err: %v", err)
}
if ollamaBaseInfo.Status != constant.Running {
if ollamaBaseInfo.Status != constant.StatusRunning {
return "", fmt.Errorf("container %s of ollama is not running, please check and retry!", ollamaBaseInfo.ContainerName)
}
return ollamaBaseInfo.ContainerName, nil

View file

@ -373,6 +373,15 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
return
}
}
if hostName, ok := req.Params["PANEL_DB_HOST"]; ok {
database, _ := databaseRepo.Get(repo.WithByName(hostName.(string)))
if database.AppInstallID > 0 {
databaseInstall, _ := appInstallRepo.GetFirst(repo.WithByID(database.AppInstallID))
if databaseInstall.Status != constant.StatusRunning {
return nil, buserr.WithName("ErrAppIsDown", databaseInstall.Name)
}
}
}
if app.Key == "openresty" && app.Resource == "remote" && common.CompareVersion(appDetail.Version, "1.27") {
if dir, ok := req.Params["WEBSITE_DIR"]; ok {
siteDir := dir.(string)
@ -421,7 +430,7 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
AppId: appDetail.AppId,
AppDetailId: appDetail.ID,
Version: appDetail.Version,
Status: constant.Installing,
Status: constant.StatusInstalling,
HttpPort: httpPort,
HttpsPort: httpsPort,
App: app,
@ -536,7 +545,7 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
}
handleAppStatus := func(t *task.Task) {
appInstall.Status = constant.UpErr
appInstall.Status = constant.StatusUpErr
appInstall.Message = installTask.Task.ErrorMsg
_ = appInstallRepo.Save(context.Background(), appInstall)
}
@ -545,7 +554,7 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
go func() {
if taskErr := installTask.Execute(); taskErr != nil {
appInstall.Status = constant.InstallErr
appInstall.Status = constant.StatusInstallErr
appInstall.Message = taskErr.Error()
if strings.Contains(taskErr.Error(), "Timeout") && strings.Contains(taskErr.Error(), "Pulling") {
appInstall.Message = buserr.New("PullImageTimeout").Error() + appInstall.Message
@ -808,7 +817,7 @@ func (a AppService) GetAppUpdate() (*response.AppUpdateRes, error) {
if err != nil {
return nil, err
}
if setting.AppStoreSyncStatus == constant.Syncing {
if setting.AppStoreSyncStatus == constant.StatusSyncing {
res.IsSyncing = true
return res, nil
}
@ -931,7 +940,7 @@ func (a AppService) SyncAppListFromRemote(taskID string) (err error) {
list = updateRes.AppList
}
settingService := NewISettingService()
_ = settingService.Update("AppStoreSyncStatus", constant.Syncing)
_ = settingService.Update("AppStoreSyncStatus", constant.StatusSyncing)
setting, err := settingService.GetSettingInfo()
if err != nil {
@ -1156,7 +1165,7 @@ func (a AppService) SyncAppListFromRemote(taskID string) (err error) {
}
tx.Commit()
_ = settingService.Update("AppStoreSyncStatus", constant.SyncSuccess)
_ = settingService.Update("AppStoreSyncStatus", constant.StatusSyncSuccess)
_ = settingService.Update("AppStoreLastModified", strconv.Itoa(list.LastModified))
t.Log(i18n.GetMsgByKey("AppStoreSyncSuccess"))
return nil
@ -1165,7 +1174,7 @@ func (a AppService) SyncAppListFromRemote(taskID string) (err error) {
go func() {
if err = syncTask.Execute(); err != nil {
_ = NewISettingService().Update("AppStoreLastModified", "0")
_ = NewISettingService().Update("AppStoreSyncStatus", constant.Error)
_ = NewISettingService().Update("AppStoreSyncStatus", constant.StatusError)
}
}()

View file

@ -406,11 +406,11 @@ func (a *AppInstallService) Update(req request.AppInstalledUpdate) error {
_ = fileOp.WriteFile(installed.GetComposePath(), strings.NewReader(backupDockerCompose), constant.DirPerm)
return err
}
installed.Status = constant.Running
installed.Status = constant.StatusRunning
_ = appInstallRepo.Save(context.Background(), &installed)
website, _ := websiteRepo.GetFirst(websiteRepo.WithAppInstallId(installed.ID))
if changePort && website.ID != 0 && website.Status == constant.Running {
if changePort && website.ID != 0 && website.Status == constant.StatusRunning {
go func() {
nginxInstall, err := getNginxFull(&website)
if err != nil {
@ -455,9 +455,9 @@ func (a *AppInstallService) SyncAll(systemInit bool) error {
return err
}
for _, i := range allList {
if i.Status == constant.Installing || i.Status == constant.Upgrading || i.Status == constant.Rebuilding || i.Status == constant.Uninstalling {
if i.Status == constant.StatusInstalling || i.Status == constant.StatusUpgrading || i.Status == constant.StatusRebuilding || i.Status == constant.StatusUninstalling {
if systemInit {
i.Status = constant.Error
i.Status = constant.StatusError
i.Message = "1Panel restart causes the task to terminate"
_ = appInstallRepo.Save(context.Background(), &i)
}
@ -498,8 +498,10 @@ func (a *AppInstallService) GetServices(key string) ([]response.AppService, erro
}
service.Config = paramMap
service.From = constant.AppResourceLocal
service.Status = install.Status
} else {
service.From = constant.AppResourceRemote
service.Status = constant.StatusRunning
}
res = append(res, service)
}
@ -508,7 +510,7 @@ func (a *AppInstallService) GetServices(key string) ([]response.AppService, erro
if err != nil {
return nil, err
}
installs, err := appInstallRepo.ListBy(appInstallRepo.WithAppId(app.ID), appInstallRepo.WithStatus(constant.Running))
installs, err := appInstallRepo.ListBy(appInstallRepo.WithAppId(app.ID), appInstallRepo.WithStatus(constant.StatusRunning))
if err != nil {
return nil, err
}
@ -521,6 +523,7 @@ func (a *AppInstallService) GetServices(key string) ([]response.AppService, erro
Label: install.Name,
Value: install.ServiceName,
Config: paramMap,
Status: install.Status,
})
}
}
@ -774,7 +777,7 @@ func (a *AppInstallService) GetParams(id uint) (*response.AppConfig, error) {
}
func syncAppInstallStatus(appInstall *model.AppInstall, force bool) error {
if appInstall.Status == constant.Installing || appInstall.Status == constant.Rebuilding || appInstall.Status == constant.Upgrading || appInstall.Status == constant.Uninstalling {
if appInstall.Status == constant.StatusInstalling || appInstall.Status == constant.StatusRebuilding || appInstall.Status == constant.StatusUpgrading || appInstall.Status == constant.StatusUninstalling {
return nil
}
cli, err := docker.NewClient()

View file

@ -333,7 +333,7 @@ func deleteAppInstall(deleteReq request.AppInstallDelete) error {
}
uninstall := func(t *task.Task) error {
install.Status = constant.Uninstalling
install.Status = constant.StatusUninstalling
_ = appInstallRepo.Save(context.Background(), &install)
dir, _ := os.Stat(appDir)
if dir != nil {
@ -434,7 +434,7 @@ func deleteAppInstall(deleteReq request.AppInstallDelete) error {
uninstallTask.AddSubTask(task.GetTaskName(install.Name, task.TaskUninstall, task.TaskScopeApp), uninstall, nil)
go func() {
if err := uninstallTask.Execute(); err != nil && !deleteReq.ForceDelete {
install.Status = constant.Error
install.Status = constant.StatusError
_ = appInstallRepo.Save(context.Background(), &install)
}
}()
@ -554,7 +554,7 @@ func upgradeInstall(req request.AppInstallUpgrade) error {
if err != nil {
return err
}
install.Status = constant.Upgrading
install.Status = constant.StatusUpgrading
var (
upErr error
@ -747,7 +747,7 @@ func upgradeInstall(req request.AppInstallUpgrade) error {
return err
}
t.LogSuccess(logStr)
install.Status = constant.Running
install.Status = constant.StatusRunning
return appInstallRepo.Save(context.Background(), &install)
}
@ -769,8 +769,8 @@ func upgradeInstall(req request.AppInstallUpgrade) error {
err = upgradeTask.Execute()
if err != nil {
existInstall, _ := appInstallRepo.GetFirst(repo.WithByID(req.InstallID))
if existInstall.ID > 0 && existInstall.Status != constant.Running {
existInstall.Status = constant.UpgradeErr
if existInstall.ID > 0 && existInstall.Status != constant.StatusRunning {
existInstall.Status = constant.StatusUpgradeErr
existInstall.Message = err.Error()
_ = appInstallRepo.Save(context.Background(), &existInstall)
}
@ -889,7 +889,7 @@ func downloadApp(app model.App, appDetail model.AppDetail, appInstall *model.App
defer func() {
if err != nil {
if appInstall != nil {
appInstall.Status = constant.DownloadErr
appInstall.Status = constant.StatusDownloadErr
appInstall.Message = err.Error()
}
}
@ -1105,18 +1105,18 @@ func upApp(task *task.Task, appInstall *model.AppInstall, pullImages bool) error
if appInstall.Message == "" {
appInstall.Message = err.Error()
}
appInstall.Status = constant.UpErr
appInstall.Status = constant.StatusUpErr
_ = appInstallRepo.Save(context.Background(), appInstall)
return err
} else {
appInstall.Status = constant.Running
appInstall.Status = constant.StatusRunning
_ = appInstallRepo.Save(context.Background(), appInstall)
return nil
}
}
func rebuildApp(appInstall model.AppInstall) error {
appInstall.Status = constant.Rebuilding
appInstall.Status = constant.StatusRebuilding
_ = appInstallRepo.Save(context.Background(), &appInstall)
go func() {
dockerComposePath := appInstall.GetComposePath()
@ -1137,7 +1137,7 @@ func rebuildApp(appInstall model.AppInstall) error {
}
appInstall.ContainerName = strings.Join(containerNames, ",")
appInstall.Status = constant.Running
appInstall.Status = constant.StatusRunning
_ = appInstallRepo.Save(context.Background(), &appInstall)
}()
return nil
@ -1336,24 +1336,24 @@ func handleErr(install model.AppInstall, err error, out string) error {
install.Message = out
reErr = errors.New(out)
}
install.Status = constant.UpErr
install.Status = constant.StatusUpErr
_ = appInstallRepo.Save(context.Background(), &install)
return reErr
}
func doNotNeedSync(installed model.AppInstall) bool {
return installed.Status == constant.Installing || installed.Status == constant.Rebuilding || installed.Status == constant.Upgrading ||
installed.Status == constant.Syncing || installed.Status == constant.Uninstalling || installed.Status == constant.InstallErr
return installed.Status == constant.StatusInstalling || installed.Status == constant.StatusRebuilding || installed.Status == constant.StatusUpgrading ||
installed.Status == constant.StatusSyncing || installed.Status == constant.StatusUninstalling || installed.Status == constant.StatusInstallErr
}
func synAppInstall(containers map[string]types.Container, appInstall *model.AppInstall, force bool) {
oldStatus := appInstall.Status
containerNames := strings.Split(appInstall.ContainerName, ",")
if len(containers) == 0 {
if appInstall.Status == constant.UpErr && !force {
if appInstall.Status == constant.StatusUpErr && !force {
return
}
appInstall.Status = constant.Error
appInstall.Status = constant.StatusError
appInstall.Message = buserr.WithName("ErrContainerNotFound", strings.Join(containerNames, ",")).Error()
_ = appInstallRepo.Save(context.Background(), appInstall)
return
@ -1384,21 +1384,21 @@ func synAppInstall(containers map[string]types.Container, appInstall *model.AppI
}
switch {
case exitedCount == total:
appInstall.Status = constant.Stopped
appInstall.Status = constant.StatusStopped
case runningCount == total:
appInstall.Status = constant.Running
if oldStatus == constant.Running {
appInstall.Status = constant.StatusRunning
if oldStatus == constant.StatusRunning {
return
}
case restartingCount == total:
appInstall.Status = constant.Restating
appInstall.Status = constant.StatusRestarting
case pausedCount == total:
appInstall.Status = constant.Paused
appInstall.Status = constant.StatusPaused
case len(notFoundNames) == total:
if appInstall.Status == constant.UpErr && !force {
if appInstall.Status == constant.StatusUpErr && !force {
return
}
appInstall.Status = constant.Error
appInstall.Status = constant.StatusError
appInstall.Message = buserr.WithName("ErrContainerNotFound", strings.Join(notFoundNames, ",")).Error()
default:
var msg string
@ -1412,7 +1412,7 @@ func synAppInstall(containers map[string]types.Container, appInstall *model.AppI
msg = buserr.New("ErrAppWarn").Error()
}
appInstall.Message = msg
appInstall.Status = constant.UnHealthy
appInstall.Status = constant.StatusUnHealthy
}
_ = appInstallRepo.Save(context.Background(), appInstall)
}
@ -1761,7 +1761,7 @@ func getMajorVersion(version string) string {
}
func ignoreUpdate(installed model.AppInstall) bool {
if installed.App.Type == "php" || installed.Status == constant.Installing {
if installed.App.Type == "php" || installed.Status == constant.StatusInstalling {
return true
}
if installed.App.Key == constant.AppMysql {

View file

@ -224,6 +224,7 @@ func (u *BackupRecordService) LoadRecordSize(req dto.SearchForSize) ([]dto.Recor
default:
_, records, err := backupRepo.PageRecord(
req.Page, req.PageSize,
repo.WithOrderBy("created_at desc"),
repo.WithByName(req.Name),
repo.WithByType(req.Type),
repo.WithByDetailName(req.DetailName),

View file

@ -55,11 +55,11 @@ type logOption struct {
func (u *DockerService) LoadDockerStatus() string {
client, err := docker.NewDockerClient()
if err != nil {
return constant.Stopped
return constant.StatusStopped
}
defer client.Close()
if _, err := client.Ping(context.Background()); err != nil {
return constant.Stopped
return constant.StatusStopped
}
return constant.StatusRunning

View file

@ -303,13 +303,13 @@ func recoverAppData(src string, itemHelper *snapRecoverHelper) error {
var wg sync.WaitGroup
for i := 0; i < len(appInstalls); i++ {
wg.Add(1)
appInstalls[i].Status = constant.Rebuilding
appInstalls[i].Status = constant.StatusRebuilding
_ = appInstallRepo.Save(context.Background(), &appInstalls[i])
go func(app model.AppInstall) {
defer wg.Done()
dockerComposePath := app.GetComposePath()
_, _ = compose.Up(dockerComposePath)
app.Status = constant.Running
app.Status = constant.StatusRunning
_ = appInstallRepo.Save(context.Background(), &app)
}(appInstalls[i])
}

View file

@ -1153,7 +1153,7 @@ func (w WebsiteService) PreInstallCheck(req request.WebsiteInstallCheckReq) ([]r
Version: install.Version,
AppName: install.App.Name,
})
if install.Status != constant.Running {
if install.Status != constant.StatusRunning {
showErr = true
}
}

View file

@ -377,7 +377,7 @@ func (w WebsiteSSLService) ObtainSSL(apply request.WebsiteSSLApply) error {
func handleError(websiteSSL *model.WebsiteSSL, err error) {
if websiteSSL.Status == constant.SSLInit || websiteSSL.Status == constant.SSLError {
websiteSSL.Status = constant.Error
websiteSSL.Status = constant.StatusError
} else {
websiteSSL.Status = constant.SSLApplyError
}

View file

@ -1,23 +1,6 @@
package constant
const (
Running = "Running"
UnHealthy = "UnHealthy"
Error = "Error"
Stopped = "Stopped"
Installing = "Installing"
DownloadErr = "DownloadErr"
Upgrading = "Upgrading"
UpgradeErr = "UpgradeErr"
Rebuilding = "Rebuilding"
Syncing = "Syncing"
SyncSuccess = "SyncSuccess"
Paused = "Paused"
UpErr = "UpErr"
InstallErr = "InstallErr"
Uninstalling = "Uninstalling"
Restating = "Restarting"
ContainerPrefix = "1Panel-"
AppNormal = "Normal"

View file

@ -1,27 +1,39 @@
package constant
const (
StatusRunning = "Running"
StatusCanceled = "Canceled"
StatusDone = "Done"
StatusWaiting = "Waiting"
StatusSuccess = "Success"
StatusFailed = "Failed"
StatusUploading = "Uploading"
StatusEnable = "Enable"
StatusDisable = "Disable"
StatusNone = "None"
StatusDeleted = "Deleted"
StatusExecuting = "Executing"
StatusBuilding = "Building"
StatusReCreating = "Recreating"
StatusStopped = "Stopped"
StatusCreating = "Creating"
StatusStartErr = "StartErr"
StatusNormal = "Normal"
StatusError = "Error"
StatusStarting = "Starting"
StatusRestarting = "ReStarting"
StatusRunning = "Running"
StatusCanceled = "Canceled"
StatusDone = "Done"
StatusWaiting = "Waiting"
StatusSuccess = "Success"
StatusFailed = "Failed"
StatusUploading = "Uploading"
StatusEnable = "Enable"
StatusDisable = "Disable"
StatusNone = "None"
StatusDeleted = "Deleted"
StatusExecuting = "Executing"
StatusBuilding = "Building"
StatusReCreating = "Recreating"
StatusStopped = "Stopped"
StatusCreating = "Creating"
StatusStartErr = "StartErr"
StatusNormal = "Normal"
StatusError = "Error"
StatusStarting = "Starting"
StatusRestarting = "ReStarting"
StatusUnHealthy = "UnHealthy"
StatusInstalling = "Installing"
StatusDownloadErr = "DownloadErr"
StatusUpgrading = "Upgrading"
StatusUpgradeErr = "UpgradeErr"
StatusRebuilding = "Rebuilding"
StatusSyncing = "Syncing"
StatusSyncSuccess = "SyncSuccess"
StatusPaused = "Paused"
StatusUpErr = "UpErr"
StatusInstallErr = "InstallErr"
StatusUninstalling = "Uninstalling"
OrderDesc = "descending"
OrderAsc = "ascending"

View file

@ -82,7 +82,7 @@ CustomAppStoreNotConfig: "Please configure the offline package address in the ap
CustomAppStoreNotFound: "Failed to retrieve app store package, please check if it exists",
CustomAppStoreFileValid: "App store package must be in .tar.gz format"
PullImageTimeout: "Image pull timeout, please check the network and try again"
ErrAppIsDown: "{{ .name }} application status is abnormal, please check"
#file
ErrFileCanNotRead: "File can not read"

View file

@ -74,6 +74,7 @@ PullImageStart: "画像の引っ張りを開始{{.name}}"
PullImageSuccess: "画像が正常に引っ張られました"
UpgradeAppStart: "アプリケーションのアップグレードを起動{{.name}}"
UpgradeAppSuccess: "App {{.Name}}アップグレードされました"
ErrAppIsDown: "{{ .name }} アプリケーションの状態が異常です、確認してください"
#file
ErrFileCanNotRead: "ファイルは読み取れません"

View file

@ -75,6 +75,7 @@ PullImageStart: "이미지 {{ .name }} 가져오기 시작"
PullImageSuccess: "이미지 가져오기 성공"
UpgradeAppStart: "애플리케이션 {{ .name }} 업그레이드 시작"
UpgradeAppSuccess: "앱 {{ .name }} 업그레이드 성공"
ErrAppIsDown: "{{ .name }} 애플리케이션 상태가 비정상입니다. 확인하세요"
# 파일
ErrFileCanNotRead: "파일을 읽을 수 없습니다"

View file

@ -75,6 +75,7 @@ PullImageStart: "Memulakan penarikan imej {{ .name }}"
PullImageSuccess: "Imej berjaya ditarik"
UpgradeAppStart: "Memulakan peningkatan aplikasi {{ .name }}"
UpgradeAppSuccess: "Aplikasi {{ .name }} berjaya dinaik taraf"
ErrAppIsDown: "{{ .name }} status aplikasi tidak normal, sila periksa"
#file
ErrFileCanNotRead: "Fail tidak boleh dibaca"

View file

@ -74,6 +74,7 @@ PullImageStart: "Iniciando o download da imagem {{ .name }}"
PullImageSuccess: "Imagem baixada com sucesso"
UpgradeAppStart: "Iniciando a atualização do aplicativo {{ .name }}"
UpgradeAppSuccess: "Aplicativo {{ .name }} atualizado com sucesso"
ErrAppIsDown: "{{ .name }} status do aplicativo é anormal, por favor, verifique"
#file
ErrFileCanNotRead: "Não foi possível ler o arquivo"

View file

@ -75,6 +75,7 @@ PullImageStart: "Начало загрузки образа {{ .name }}"
PullImageSuccess: "Образ успешно загружен"
UpgradeAppStart: "Начало обновления приложения {{ .name }}"
UpgradeAppSuccess: "Приложение {{ .name }} успешно обновлено"
ErrAppIsDown: "{{ .name }} статус приложения аномальный, пожалуйста, проверьте"
#file
ErrFileCanNotRead: "Файл недоступен для чтения"

View file

@ -87,7 +87,7 @@ CustomAppStoreNotConfig: "請在應用商店設置離線包地址",
CustomAppStoreNotFound: "應用商店包獲取失敗,請檢查是否存在",
CustomAppStoreFileValid: "應用商店包需要 .tar.gz 格式"
PullImageTimeout: "拉取鏡像超時,請嘗試增加鏡像加速或更換其他鏡像加速"
ErrAppIsDown: "{{ .name }} 應用狀態異常,請檢查"
#file
ErrFileCanNotRead: "此文件不支持預覽"

View file

@ -95,6 +95,7 @@ CustomAppStoreNotConfig: "请在应用商店设置离线包地址"
CustomAppStoreNotFound: "应用商店包获取失败,请检查是否存在"
CustomAppStoreFileValid: "应用商店包需要 .tar.gz 格式"
PullImageTimeout: "拉取镜像超时,请尝试增加镜像加速或者更换其他镜像加速"
ErrAppIsDown: "{{ .name }} 应用状态异常,请检查"
#file
ErrFileCanNotRead: "此文件不支持预览"

View file

@ -15,7 +15,7 @@ func Init() {
}
func syncApp() {
_ = service.NewISettingService().Update("AppStoreSyncStatus", constant.SyncSuccess)
_ = service.NewISettingService().Update("AppStoreSyncStatus", constant.StatusSyncSuccess)
if err := service.NewIAppService().SyncAppListFromRemote(""); err != nil {
global.LOG.Errorf("App Store synchronization failed")
return

View file

@ -222,6 +222,7 @@ export namespace App {
value: string;
config?: Object;
from?: string;
status: string;
}
export interface VersionDetail {

View file

@ -16,6 +16,7 @@
<script lang="ts" setup>
import { reactive, ref } from 'vue';
import bus from '@/global/bus';
import LogFile from '@/components/log/file/index.vue';
defineProps({
showClose: {
@ -53,6 +54,8 @@ const openWithTaskID = (id: string, tail: boolean) => {
}
open.value = true;
bus.emit('refreshTask', true);
console.log('11111');
};
const openWithResourceID = (taskType: string, taskOperate: string, resourceID: number) => {

View file

@ -2958,10 +2958,10 @@ const message = {
},
customApp: {
name: '自定义应用仓库',
appStoreType: '应用商店包来源',
appStoreType: '仓库来源',
appStoreUrl: '仓库地址',
local: '机路径',
remote: '远程链接',
local: '',
remote: '远程',
imagePrefix: '镜像前缀',
imagePrefixHelper:
'作用自定义镜像前缀修改 compose 文件中的镜像字段例如当镜像前缀设置为 1panel/custom MaxKB image 字段将变更为 1panel/custom/maxkb:v1.10.0',

View file

@ -271,6 +271,10 @@ html {
width: 200px !important;
}
.p-w-300 {
width: 300px !important;
}
.p-w-100 {
width: 100px !important;
}

View file

@ -79,19 +79,31 @@
v-model="form[p.child.envKey]"
v-if="p.child.type == 'service'"
@change="changeService(form[p.child.envKey], p.services)"
class="p-w-200"
class="p-w-300"
>
<el-option
v-for="service in p.services"
:key="service.label"
:value="service.value"
:label="service.label"
:disabled="service.status != 'Running'"
>
<span>{{ service.label }}</span>
<span class="float-right" v-if="service.from != ''">
<el-tag v-if="service.from === 'local'">{{ $t('commons.table.local') }}</el-tag>
<el-tag v-else type="success">{{ $t('database.remote') }}</el-tag>
</span>
<el-row :gutter="5">
<el-col :span="10">
<span>{{ service.label }}</span>
</el-col>
<el-col :span="8">
<span v-if="service.from != ''">
<el-tag v-if="service.from === 'local'">
{{ $t('commons.table.local') }}
</el-tag>
<el-tag v-else type="success">{{ $t('database.remote') }}</el-tag>
</span>
</el-col>
<el-col :span="6">
<Status :key="service.status" :status="service.status"></Status>
</el-col>
</el-row>
</el-option>
</el-select>
</el-form-item>

View file

@ -28,7 +28,7 @@
</el-input>
<span class="input-help">{{ $t('app.defaultWebDomainHepler') }}</span>
</el-form-item>
<CustomSetting v-if="globalStore.isMasterProductPro" />
<CustomSetting v-if="globalStore.isMaster && globalStore.isProductPro" />
<el-form-item v-if="!globalStore.isMaster && useCustomApp">
<el-text type="warning">{{ $t('app.customAppHelper') }}</el-text>
</el-form-item>

View file

@ -101,7 +101,7 @@ import Delete from '@/views/website/runtime/delete/index.vue';
import i18n from '@/lang';
import RouterMenu from '../index.vue';
import router from '@/routers/router';
import ComposeLogs from '@/components/log/composeindex.vue';
import ComposeLogs from '@/components/log/compose/index.vue';
import { Promotion } from '@element-plus/icons-vue';
import PortJumpDialog from '@/components/port-jump/index.vue';
import AppResources from '@/views/website/runtime/php/check/index.vue';