Compare commits

...
3 Commits
3 changed files with 14 additions and 5 deletions
+3 -3
View File
@@ -437,7 +437,7 @@ var EncryptHostPassword = &gormigrate.Migration{
ID: "20230703-encrypt-host-password",
Migrate: func(tx *gorm.DB) error {
var hosts []model.Host
if err := tx.Find(&hosts).Error; err != nil {
if err := tx.Where("1 = 1").Find(&hosts).Error; err != nil {
return err
}
@@ -462,7 +462,7 @@ var EncryptHostPassword = &gormigrate.Migration{
if err != nil {
return err
}
if err := tx.Model(&model.Host{}).Update("private_key", key).Error; err != nil {
if err := tx.Model(&model.Host{}).Where("id = ?", host.ID).Update("private_key", key).Error; err != nil {
return err
}
}
@@ -471,7 +471,7 @@ var EncryptHostPassword = &gormigrate.Migration{
if err != nil {
return err
}
if err := tx.Model(&model.Host{}).Update("pass_phrase", pass).Error; err != nil {
if err := tx.Model(&model.Host{}).Where("id = ?", host.ID).Update("pass_phrase", pass).Error; err != nil {
return err
}
}
@@ -224,7 +224,7 @@ const submit = async (formEl: FormInstance | undefined) => {
if (req.memoryLimit < 0) {
req.memoryLimit = 0;
}
if (req.advanced && !req.allowPort) {
if (installData.value.app.key != 'openresty' && req.advanced && !req.allowPort) {
ElMessageBox.confirm(i18n.global.t('app.installWarn'), i18n.global.t('app.checkTitle'), {
confirmButtonText: i18n.global.t('commons.button.confirm'),
cancelButtonText: i18n.global.t('commons.button.cancel'),
@@ -222,7 +222,16 @@ const listSSL = () => {
ListSSL(sslReq).then((res) => {
ssls.value = res.data || [];
if (ssls.value.length > 0) {
form.websiteSSLId = ssls.value[0].id;
let exist = false;
for (const ssl of ssls.value) {
if (ssl.id === form.websiteSSLId) {
exist = true;
break;
}
}
if (!exist) {
form.websiteSSLId = ssls.value[0].id;
}
changeSSl(form.websiteSSLId);
} else {
websiteSSL.value = {};