1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 14:08:06 +08:00

fix: 解决删除网站锁库的问题 (#608)

This commit is contained in:
zhengkunwang223 2023-04-13 11:00:33 +08:00 committed by GitHub
parent b646c5385d
commit 6115ffe0fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 13 deletions

View File

@ -346,16 +346,6 @@ func (w WebsiteService) DeleteWebsite(req request.WebsiteDelete) error {
return err return err
} }
tx, ctx := helper.GetTxAndContext()
defer tx.Rollback()
_ = backupRepo.DeleteRecord(ctx, commonRepo.WithByType("website"), commonRepo.WithByName(website.Alias))
if err := websiteRepo.DeleteBy(ctx, commonRepo.WithByID(req.ID)); err != nil {
return err
}
if err := websiteDomainRepo.DeleteBy(ctx, websiteDomainRepo.WithWebsiteId(req.ID)); err != nil {
return err
}
if checkIsLinkApp(website) && req.DeleteApp { if checkIsLinkApp(website) && req.DeleteApp {
appInstall, err := appInstallRepo.GetFirst(commonRepo.WithByID(website.AppInstallID)) appInstall, err := appInstallRepo.GetFirst(commonRepo.WithByID(website.AppInstallID))
if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
@ -367,6 +357,16 @@ func (w WebsiteService) DeleteWebsite(req request.WebsiteDelete) error {
} }
} }
} }
tx, ctx := helper.GetTxAndContext()
defer tx.Rollback()
_ = backupRepo.DeleteRecord(ctx, commonRepo.WithByType("website"), commonRepo.WithByName(website.Alias))
if err := websiteRepo.DeleteBy(ctx, commonRepo.WithByID(req.ID)); err != nil {
return err
}
if err := websiteDomainRepo.DeleteBy(ctx, websiteDomainRepo.WithWebsiteId(req.ID)); err != nil {
return err
}
tx.Commit() tx.Commit()
if req.DeleteBackup { if req.DeleteBackup {

View File

@ -1157,7 +1157,7 @@ const message = {
deleteRuntimeHelper: deleteRuntimeHelper:
'The Runtime application needs to be deleted together with the website, please handle it with caution', 'The Runtime application needs to be deleted together with the website, please handle it with caution',
proxyType: 'Listening Network Type', proxyType: 'Listening Network Type',
unix: 'Uinx Network', unix: 'Unix Network',
tcp: 'TCP/IP Network', tcp: 'TCP/IP Network',
phpFPM: 'FPM Config', phpFPM: 'FPM Config',
phpConfig: 'PHP Config', phpConfig: 'PHP Config',

View File

@ -1152,7 +1152,7 @@ const message = {
runtime: '运行环境', runtime: '运行环境',
deleteRuntimeHelper: '运行环境应用需要跟网站一并删除请谨慎处理', deleteRuntimeHelper: '运行环境应用需要跟网站一并删除请谨慎处理',
proxyType: '监听网络类型', proxyType: '监听网络类型',
unix: 'Uinx 网络', unix: 'Unix 网络',
tcp: 'TCP/IP 网络', tcp: 'TCP/IP 网络',
phpFPM: 'FPM 配置文件', phpFPM: 'FPM 配置文件',
phpConfig: 'PHP 配置文件', phpConfig: 'PHP 配置文件',

View File

@ -394,7 +394,7 @@ const changeRuntime = (runID: number) => {
runtimes.value.forEach((item) => { runtimes.value.forEach((item) => {
if (item.id === runID) { if (item.id === runID) {
runtimeResource.value = item.resource; runtimeResource.value = item.resource;
if (item.type === 'appstore') { if (item.resource === 'appstore') {
getAppDetailByID(item.appDetailId); getAppDetailByID(item.appDetailId);
} }
} }