mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-15 18:07:05 +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"`
|
||||
Scope string `json:"scope"`
|
||||
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))
|
||||
continue
|
||||
}
|
||||
dto.Icon = app.Icon
|
||||
dto.Name = app.Name
|
||||
if ignore.Scope == "version" {
|
||||
appDetail, err := appDetailRepo.GetFirst(repo.WithByID(ignore.AppDetailID))
|
||||
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 {
|
||||
return true
|
||||
}
|
||||
ignores, _ := appIgnoreUpgradeRepo.List(appDetailRepo.WithAppId(installed.AppId), appIgnoreUpgradeRepo.WithScope("all"))
|
||||
if len(ignores) > 0 {
|
||||
return true
|
||||
}
|
||||
if installed.App.Key == constant.AppMysql {
|
||||
majorVersion := getMajorVersion(installed.Version)
|
||||
appDetails, _ := appDetailRepo.GetBy(appDetailRepo.WithAppId(installed.App.ID))
|
||||
|
@ -1774,8 +1778,7 @@ func ignoreUpdate(installed model.AppInstall) bool {
|
|||
}
|
||||
return true
|
||||
}
|
||||
ignores, _ := appIgnoreUpgradeRepo.List(appDetailRepo.WithAppId(installed.AppId), appIgnoreUpgradeRepo.WithScope("all"))
|
||||
return len(ignores) > 0
|
||||
return false
|
||||
}
|
||||
|
||||
func RequestDownloadCallBack(downloadCallBackUrl string) {
|
||||
|
|
|
@ -282,7 +282,7 @@ export namespace App {
|
|||
name: string;
|
||||
detailID: number;
|
||||
version: string;
|
||||
icon: string;
|
||||
scope: string;
|
||||
}
|
||||
|
||||
export interface AppUpdateVersionReq {
|
||||
|
|
|
@ -1,29 +1,22 @@
|
|||
<template>
|
||||
<DrawerPro v-model="open" :header="$t('app.ignoreList')" @close="handleClose" size="small">
|
||||
<template #content>
|
||||
<el-row :gutter="5">
|
||||
<el-col v-for="(app, index) in apps" :key="index">
|
||||
<el-card class="app-margin">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-avatar shape="square" :size="60" :src="'data:image/png;base64,' + app.icon" />
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<span>{{ app.name }}</span>
|
||||
<div>
|
||||
<el-tag v-if="app.version != ''">{{ app.version }}</el-tag>
|
||||
<el-tag v-else>{{ $t('commons.table.all') + $t('app.version') }}</el-tag>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" link @click="cancelIgnore(app.ID)">
|
||||
{{ $t('app.cancelIgnore') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="apps">
|
||||
<el-table-column prop="name" :label="$t('app.app')" />
|
||||
<el-table-column prop="scope" :label="$t('license.trialInfo')">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.version != ''">{{ row.version }}</el-tag>
|
||||
<el-tag v-else>{{ $t('commons.table.all') + $t('app.version') }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="scope" :label="$t('commons.table.operate')">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="cancelIgnore(row.ID)">
|
||||
{{ $t('app.cancelIgnore') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
|
@ -58,6 +51,7 @@ const getApps = async () => {
|
|||
try {
|
||||
const res = await getIgnoredApp();
|
||||
apps.value = res.data;
|
||||
console.log(apps.value);
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue