@@ -178,6 +183,21 @@ interface DialogProps {
const changeTab = (val: string) => {
activeName.value = val;
+ switch (val) {
+ case 'conf':
+ loadConfFile();
+ break;
+ case 'persistence':
+ persistenceRef.value!.acceptParams({ status: redisStatus.value });
+ break;
+ case 'tuning':
+ case 'port':
+ loadform();
+ break;
+ case 'status':
+ statusRef.value!.acceptParams({ status: redisStatus.value });
+ break;
+ }
};
const changeLoading = (status: boolean) => {
@@ -189,11 +209,6 @@ const acceptParams = (prop: DialogProps): void => {
redisName.value = prop.redisName;
settingShow.value = true;
loadConfFile();
- if (redisStatus.value === 'Running') {
- statusRef.value!.acceptParams({ status: prop.status });
- persistenceRef.value!.acceptParams({ status: prop.status });
- loadform();
- }
};
const portRef = ref();
@@ -220,7 +235,6 @@ function callback(error: any) {
}
}
const onChangePort = async (formEl: FormInstance | undefined) => {
- console.log('asdqwdwqd');
if (!formEl) return;
const result = await formEl.validateField('port', callback);
if (!result) {
@@ -260,7 +274,7 @@ const submtiForm = async () => {
let param = {
timeout: form.timeout + '',
maxclients: form.maxclients + '',
- maxmemory: form.maxmemory + '',
+ maxmemory: form.maxmemory + 'mb',
};
loading.value = true;
await updateRedisConf(param)
@@ -311,7 +325,7 @@ const loadform = async () => {
form.name = res.data?.name;
form.timeout = Number(res.data?.timeout);
form.maxclients = Number(res.data?.maxclients);
- form.maxmemory = Number(res.data?.maxmemory);
+ form.maxmemory = Number(res.data?.maxmemory.replaceAll('mb', '')) / 1048576;
form.port = Number(res.data?.port);
};
diff --git a/frontend/src/views/database/redis/setting/persistence/index.vue b/frontend/src/views/database/redis/setting/persistence/index.vue
index 14082cfab..60c67f57e 100644
--- a/frontend/src/views/database/redis/setting/persistence/index.vue
+++ b/frontend/src/views/database/redis/setting/persistence/index.vue
@@ -48,13 +48,13 @@
|
-
+ |
{{ $t('database.rdbHelper1') }}
|
|
-
+ |
{{ $t('database.rdbHelper2') }}
|
@@ -89,7 +89,11 @@
- {{ $t('setting.' + row.source) }}
+
+
+ {{ $t('setting.' + row.source) }}
+
+
@@ -270,7 +274,7 @@ const onSave = async (formEl: FormInstance | undefined, type: string) => {
}
let itemSaves = [] as Array;
for (const item of form.saves) {
- if (item.count === 0 || item.second === 0) {
+ if (item.count < 0 || item.count > 100000 || item.second < 0 || item.second > 100000) {
MsgInfo(i18n.global.t('database.rdbInfo'));
return;
}
@@ -290,6 +294,7 @@ 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;
|