mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-10 17:13:30 +08:00
fix: 获取镜像导入相应结果
This commit is contained in:
parent
23bb379afe
commit
4992281e36
6 changed files with 20 additions and 9 deletions
|
@ -1,7 +1,6 @@
|
|||
package dto
|
||||
|
||||
type DaemonJsonUpdateByFile struct {
|
||||
Path string `json:"path" validate:"required"`
|
||||
File string `json:"file"`
|
||||
}
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ func (u *DockerService) UpdateConf(req dto.DaemonJsonConf) error {
|
|||
}
|
||||
|
||||
func (u *DockerService) UpdateConfByFile(req dto.DaemonJsonUpdateByFile) error {
|
||||
file, err := os.OpenFile(req.Path, os.O_WRONLY|os.O_TRUNC, 0640)
|
||||
file, err := os.OpenFile(constant.DaemonJsonPath, os.O_WRONLY|os.O_TRUNC, 0640)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -5,8 +5,10 @@ import (
|
|||
"context"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
|
@ -249,9 +251,17 @@ func (u *ImageService) ImageLoad(req dto.ImageLoad) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := client.ImageLoad(context.TODO(), file, true); err != nil {
|
||||
res, err := client.ImageLoad(context.TODO(), file, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
content, err := ioutil.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if strings.Contains(string(content), "Error") {
|
||||
return errors.New(string(content))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<div style="float: left">
|
||||
<el-input type="number" v-model.number="variables.long_query_time" />
|
||||
</div>
|
||||
<el-button style="float: left; margin-left: 10px" @click="openSlowLogs" type="primary">
|
||||
<el-button style="float: left; margin-left: 10px" @click="openSlowLogs">
|
||||
{{ $t('commons.button.save') }}
|
||||
</el-button>
|
||||
<div style="float: left; margin-left: 20px">
|
||||
|
@ -152,6 +152,9 @@ const onSave = async () => {
|
|||
.then(() => {
|
||||
emit('loading', false);
|
||||
isOnEdit.value = false;
|
||||
if (variables.slow_query_log !== 'ON') {
|
||||
detailShow.value = false;
|
||||
}
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
|
@ -139,7 +139,7 @@ import Status from '@/views/database/redis/setting/status/index.vue';
|
|||
import Persistence from '@/views/database/redis/setting/persistence/index.vue';
|
||||
import { loadRedisConf, updateRedisConf, updateRedisConfByFile } from '@/api/modules/database';
|
||||
import i18n from '@/lang';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { checkNumberRange, Rules } from '@/global/form-rules';
|
||||
import { ChangePort, GetAppDefaultConfig } from '@/api/modules/app';
|
||||
import { loadBaseDir } from '@/api/modules/setting';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
@ -162,9 +162,9 @@ const form = reactive({
|
|||
});
|
||||
const rules = reactive({
|
||||
port: [Rules.port],
|
||||
timeout: [Rules.number],
|
||||
maxclients: [Rules.number],
|
||||
maxmemory: [Rules.number],
|
||||
timeout: [Rules.number, checkNumberRange(0, 9999999)],
|
||||
maxclients: [Rules.number, checkNumberRange(1, 999999)],
|
||||
maxmemory: [Rules.number, checkNumberRange(0, 999999)],
|
||||
});
|
||||
|
||||
const activeName = ref('conf');
|
||||
|
|
|
@ -294,7 +294,6 @@ const onSave = async (formEl: FormInstance | undefined, type: string) => {
|
|||
};
|
||||
|
||||
const loadform = async () => {
|
||||
console.log('adqwdqw');
|
||||
form.saves = [];
|
||||
const res = await redisPersistenceConf();
|
||||
form.appendonly = res.data?.appendonly;
|
||||
|
|
Loading…
Reference in a new issue