feat: 修改应用端口,同时修改网站配置

This commit is contained in:
zhengkunwang223 2023-03-08 23:58:42 +08:00 committed by ssongliu
parent 3bd20e5b28
commit bb104bb734
12 changed files with 16 additions and 5 deletions

View File

@ -157,6 +157,7 @@ func handleAppRecover(install *model.AppInstall, recoverFile string, isRollback
}
defer func() {
if !isOk {
global.LOG.Info("recover failed, start to rollback now")
if err := handleAppRecover(install, rollbackFile, true); err != nil {
global.LOG.Errorf("rollback app %s from %s failed, err: %v", install.Name, rollbackFile, err)
return

View File

@ -142,6 +142,7 @@ func handleMysqlRecover(mysqlInfo *repo.RootInfo, recoverDir, dbName, fileName s
}
defer func() {
if !isOk {
global.LOG.Info("recover failed, start to rollback now")
if err := handleMysqlRecover(mysqlInfo, path.Dir(rollbackFile), dbName, path.Base(rollbackFile), true); err != nil {
global.LOG.Errorf("rollback mysql db %s from %s failed, err: %v", dbName, rollbackFile, err)
return

View File

@ -123,6 +123,7 @@ func handleRedisRecover(redisInfo *repo.RootInfo, recoverFile string, isRollback
}
defer func() {
if !isOk {
global.LOG.Info("recover failed, start to rollback now")
if err := handleRedisRecover(redisInfo, rollbackFile, true); err != nil {
global.LOG.Errorf("rollback redis from %s failed, err: %v", rollbackFile, err)
return

View File

@ -106,6 +106,7 @@ func handleWebsiteRecover(website *model.Website, recoverFile string, isRollback
return fmt.Errorf("backup website %s for rollback before recover failed, err: %v", website.Alias, err)
}
defer func() {
global.LOG.Info("recover failed, start to rollback now")
if !isOk {
if err := handleWebsiteRecover(website, rollbackFile, true); err != nil {
global.LOG.Errorf("rollback website %s from %s failed, err: %v", website.Alias, rollbackFile, err)

View File

@ -161,7 +161,7 @@ func (u *MysqlService) Delete(ctx context.Context, req dto.MysqlDBDelete) error
return err
}
if err := excuteSql(app.ContainerName, app.Password, fmt.Sprintf("drop user if exists '%s'@'%s'", db.Name, db.Permission)); err != nil && !req.ForceDelete {
if err := excuteSql(app.ContainerName, app.Password, fmt.Sprintf("drop user if exists '%s'@'%s'", db.Username, db.Permission)); err != nil && !req.ForceDelete {
return err
}
if err := excuteSql(app.ContainerName, app.Password, fmt.Sprintf("drop database if exists `%s`", db.Name)); err != nil && !req.ForceDelete {

View File

@ -856,6 +856,7 @@ func (u *SnapshotService) handleTar(sourceDir, targetDir, name, exclusionRules s
global.LOG.Debug(ss)
stdout, err := cmd.Exec(ss)
if err != nil {
global.LOG.Errorf("do handle tar failed, stdout: %s, err: %v", stdout, err)
return errors.New(stdout)
}
return nil
@ -869,6 +870,7 @@ func (u *SnapshotService) handleUnTar(sourceDir, targetDir string) error {
}
stdout, err := cmd.Exec(fmt.Sprintf("tar zxf %s -C %s .", sourceDir, targetDir))
if err != nil {
global.LOG.Errorf("do handle untar failed, stdout: %s, err: %v", stdout, err)
return errors.New(string(stdout))
}
return nil

View File

@ -21,7 +21,7 @@
<div v-else class="el-upload__tip">
<span class="input-help">{{ $t('website.supportUpType') }}</span>
<span class="input-help">
{{ $t('website.zipFormat') }}
{{ $t('website.zipFormat', [type + '.json']) }}
</span>
</div>
</template>

View File

@ -932,8 +932,7 @@ export default {
static: 'Static',
deployment: 'Deployment',
supportUpType: 'Only .tar.gz files within 50 MB are supported',
zipFormat:
'.tar.gz compressed package structure: test.tar.gz compressed package must contain website.json file',
zipFormat: '.tar.gz compressed package structure: test.tar.gz compressed package must contain {0} file',
proxy: 'Reverse Proxy',
alias: 'Path Name',
remark: 'Remark',

View File

@ -943,7 +943,7 @@ export default {
static: '静态网站',
deployment: '一键部署',
supportUpType: '仅支持 50M 以内 .tar.gz 文件',
zipFormat: '.tar.gz 压缩包结构test.tar.gz 压缩包内必需包含 website.json 文件',
zipFormat: '.tar.gz 压缩包结构test.tar.gz 压缩包内必需包含 {0} 文件',
proxy: '反向代理',
alias: '代号',
remark: '备注',

View File

@ -390,6 +390,10 @@ function hasScript() {
}
const onSubmit = async (formEl: FormInstance | undefined) => {
dialogData.value.rowData.week = Number(dialogData.value.rowData.week);
dialogData.value.rowData.day = Number(dialogData.value.rowData.day);
dialogData.value.rowData.hour = Number(dialogData.value.rowData.hour);
dialogData.value.rowData.minute = Number(dialogData.value.rowData.minute);
if (!formEl) return;
formEl.validate(async (valid) => {
if (!valid) return;

View File

@ -157,6 +157,7 @@ const submitAddHost = (formEl: FormInstance | undefined, ops: string) => {
let isLocal = hostInfo.addr === '127.0.0.1';
emit('on-conn-terminal', title, res.data.id, isLocal);
emit('load-host-tree');
break;
}
});
};

View File

@ -228,6 +228,7 @@ const onSave = async (formEl: FormInstance | undefined, key: string, val: any) =
search();
return;
}
break;
case 'PanelName':
globalStore.setThemeConfig({ ...themeConfig.value, panelName: val });
document.title = val;