mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-19 20:06:07 +08:00
fix: Resolve the issue of ignoring MySQL failures (#9734)
Refs https://github.com/1Panel-dev/1Panel/issues/9718
This commit is contained in:
parent
0316cb0662
commit
951ab2502e
5 changed files with 25 additions and 28 deletions
|
@ -6,5 +6,5 @@ type AppIgnoreUpgradeDTO struct {
|
||||||
AppDetailID uint `json:"appDetailID"`
|
AppDetailID uint `json:"appDetailID"`
|
||||||
Scope string `json:"scope"`
|
Scope string `json:"scope"`
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
Icon string `json:"icon"`
|
Name string `json:"name"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ func (a AppIgnoreUpgradeService) List() ([]response.AppIgnoreUpgradeDTO, error)
|
||||||
_ = appIgnoreUpgradeRepo.Delete(repo.WithByID(ignore.ID))
|
_ = appIgnoreUpgradeRepo.Delete(repo.WithByID(ignore.ID))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
dto.Icon = app.Icon
|
dto.Name = app.Name
|
||||||
if ignore.Scope == "version" {
|
if ignore.Scope == "version" {
|
||||||
appDetail, err := appDetailRepo.GetFirst(repo.WithByID(ignore.AppDetailID))
|
appDetail, err := appDetailRepo.GetFirst(repo.WithByID(ignore.AppDetailID))
|
||||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
|
|
@ -1764,6 +1764,10 @@ func ignoreUpdate(installed model.AppInstall) bool {
|
||||||
if installed.App.Type == "php" || installed.Status == constant.StatusInstalling {
|
if installed.App.Type == "php" || installed.Status == constant.StatusInstalling {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
ignores, _ := appIgnoreUpgradeRepo.List(appDetailRepo.WithAppId(installed.AppId), appIgnoreUpgradeRepo.WithScope("all"))
|
||||||
|
if len(ignores) > 0 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
if installed.App.Key == constant.AppMysql {
|
if installed.App.Key == constant.AppMysql {
|
||||||
majorVersion := getMajorVersion(installed.Version)
|
majorVersion := getMajorVersion(installed.Version)
|
||||||
appDetails, _ := appDetailRepo.GetBy(appDetailRepo.WithAppId(installed.App.ID))
|
appDetails, _ := appDetailRepo.GetBy(appDetailRepo.WithAppId(installed.App.ID))
|
||||||
|
@ -1774,8 +1778,7 @@ func ignoreUpdate(installed model.AppInstall) bool {
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
ignores, _ := appIgnoreUpgradeRepo.List(appDetailRepo.WithAppId(installed.AppId), appIgnoreUpgradeRepo.WithScope("all"))
|
return false
|
||||||
return len(ignores) > 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func RequestDownloadCallBack(downloadCallBackUrl string) {
|
func RequestDownloadCallBack(downloadCallBackUrl string) {
|
||||||
|
|
|
@ -282,7 +282,7 @@ export namespace App {
|
||||||
name: string;
|
name: string;
|
||||||
detailID: number;
|
detailID: number;
|
||||||
version: string;
|
version: string;
|
||||||
icon: string;
|
scope: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AppUpdateVersionReq {
|
export interface AppUpdateVersionReq {
|
||||||
|
|
|
@ -1,29 +1,22 @@
|
||||||
<template>
|
<template>
|
||||||
<DrawerPro v-model="open" :header="$t('app.ignoreList')" @close="handleClose" size="small">
|
<DrawerPro v-model="open" :header="$t('app.ignoreList')" @close="handleClose" size="small">
|
||||||
<template #content>
|
<template #content>
|
||||||
<el-row :gutter="5">
|
<el-table :data="apps">
|
||||||
<el-col v-for="(app, index) in apps" :key="index">
|
<el-table-column prop="name" :label="$t('app.app')" />
|
||||||
<el-card class="app-margin">
|
<el-table-column prop="scope" :label="$t('license.trialInfo')">
|
||||||
<el-row :gutter="20">
|
<template #default="{ row }">
|
||||||
<el-col :span="6">
|
<el-tag v-if="row.version != ''">{{ row.version }}</el-tag>
|
||||||
<el-avatar shape="square" :size="60" :src="'data:image/png;base64,' + app.icon" />
|
<el-tag v-else>{{ $t('commons.table.all') + $t('app.version') }}</el-tag>
|
||||||
</el-col>
|
</template>
|
||||||
<el-col :span="12">
|
</el-table-column>
|
||||||
<span>{{ app.name }}</span>
|
<el-table-column prop="scope" :label="$t('commons.table.operate')">
|
||||||
<div>
|
<template #default="{ row }">
|
||||||
<el-tag v-if="app.version != ''">{{ app.version }}</el-tag>
|
<el-button type="primary" link @click="cancelIgnore(row.ID)">
|
||||||
<el-tag v-else>{{ $t('commons.table.all') + $t('app.version') }}</el-tag>
|
{{ $t('app.cancelIgnore') }}
|
||||||
</div>
|
</el-button>
|
||||||
</el-col>
|
</template>
|
||||||
<el-col :span="6">
|
</el-table-column>
|
||||||
<el-button type="primary" link @click="cancelIgnore(app.ID)">
|
</el-table>
|
||||||
{{ $t('app.cancelIgnore') }}
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
|
@ -58,6 +51,7 @@ const getApps = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getIgnoredApp();
|
const res = await getIgnoredApp();
|
||||||
apps.value = res.data;
|
apps.value = res.data;
|
||||||
|
console.log(apps.value);
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue