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

feat: 网站 OpenResty 增加重载功能 (#3182)

This commit is contained in:
zhengkunwang 2023-12-05 14:30:10 +08:00 committed by GitHub
parent 14142be38f
commit 58b6a2de32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 3 deletions

View File

@ -262,6 +262,8 @@ func (a *AppInstallService) Operate(req request.AppInstalledOperate) error {
return syncByID(install.ID)
case constant.Upgrade:
return upgradeInstall(install.ID, req.DetailId, req.Backup)
case constant.Reload:
return opNginx(install.ContainerName, constant.NginxReload)
default:
return errors.New("operate not support")
}

View File

@ -36,16 +36,14 @@ const (
type AppOperate string
var (
Up AppOperate = "up"
Down AppOperate = "down"
Start AppOperate = "start"
Stop AppOperate = "stop"
Restart AppOperate = "restart"
Delete AppOperate = "delete"
Sync AppOperate = "sync"
Backup AppOperate = "backup"
Restore AppOperate = "restore"
Update AppOperate = "update"
Rebuild AppOperate = "rebuild"
Upgrade AppOperate = "upgrade"
Reload AppOperate = "reload"
)

View File

@ -30,6 +30,16 @@
{{ $t('app.restart') }}
</el-button>
<el-divider direction="vertical" />
<el-button
type="primary"
link
v-if="data.app === 'OpenResty'"
@click="onOperate('reload')"
:disabled="data.status !== 'Running'"
>
{{ $t('app.reload') }}
</el-button>
<el-divider v-if="data.app === 'OpenResty'" direction="vertical" />
<el-button
type="primary"
@click="setting"

View File

@ -1525,6 +1525,7 @@ const message = {
hostModeHelper:
'The current application network mode is host mode. If you need to open the port, please open it manually on the firewall page.',
showLocal: 'Show Local Application',
reload: 'Reload',
},
website: {
website: 'Website',

View File

@ -1425,6 +1425,7 @@ const message = {
syncAllAppHelper: '即將同步所有應用是否繼續 ',
hostModeHelper: '目前應用網路模式為 host 模式如需放開端口請在防火牆頁面手動放開',
showLocal: '顯示本機應用程式',
reload: '重載',
},
website: {
website: '網站',

View File

@ -1425,6 +1425,7 @@ const message = {
syncAllAppHelper: '即将同步所有应用是否继续',
hostModeHelper: '当前应用网络模式为 host 模式如需放开端口请在防火墙页面手动放开',
showLocal: '显示本地应用',
reload: '重载',
},
website: {
website: '网站',