mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-17 03:04:46 +08:00
redis 增加详细的远程连接信息,并添加复制按钮 (#2328)
* redis 增加详细的远程连接信息,并添加复制按钮 * 优化数据加载流程,避免出现 systemIP 被覆盖的问题
This commit is contained in:
parent
f06f487e8a
commit
ac98d63fcd
@ -142,6 +142,7 @@ export namespace App {
|
|||||||
password: string;
|
password: string;
|
||||||
privilege: boolean;
|
privilege: boolean;
|
||||||
serviceName: string;
|
serviceName: string;
|
||||||
|
systemIP: string;
|
||||||
port: number;
|
port: number;
|
||||||
}
|
}
|
||||||
export interface AppInstallResource {
|
export interface AppInstallResource {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-drawer v-model="dialogVisiable" :destroy-on-close="true" :close-on-click-modal="false" size="30%">
|
<el-drawer v-model="dialogVisible" :destroy-on-close="true" :close-on-click-modal="false" size="30%">
|
||||||
<template #header>
|
<template #header>
|
||||||
<DrawerHeader :header="$t('database.databaseConnInfo')" :back="handleClose" />
|
<DrawerHeader :header="$t('database.databaseConnInfo')" :back="handleClose" />
|
||||||
</template>
|
</template>
|
||||||
@ -32,7 +32,8 @@
|
|||||||
</span>
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('database.remoteConn')">
|
<el-form-item :label="$t('database.remoteConn')">
|
||||||
<el-tag>{{ $t('database.localIP') + ':' + form.port }}</el-tag>
|
<el-tag>{{ form.systemIP + ':' + form.port }}</el-tag>
|
||||||
|
<el-button @click="onCopy(form.systemIP + ':6379')" icon="DocumentCopy" link></el-button>
|
||||||
<span class="input-help">{{ $t('database.remoteConnHelper2') }}</span>
|
<span class="input-help">{{ $t('database.remoteConnHelper2') }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -43,7 +44,7 @@
|
|||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button :disabled="loading" @click="dialogVisiable = false">
|
<el-button :disabled="loading" @click="dialogVisible = false">
|
||||||
{{ $t('commons.button.cancel') }}
|
{{ $t('commons.button.cancel') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button :disabled="loading" type="primary" @click="onSave(formRef)">
|
<el-button :disabled="loading" type="primary" @click="onSave(formRef)">
|
||||||
@ -67,15 +68,17 @@ import DrawerHeader from '@/components/drawer-header/index.vue';
|
|||||||
import { App } from '@/api/interface/app';
|
import { App } from '@/api/interface/app';
|
||||||
import { getRandomStr } from '@/utils/util';
|
import { getRandomStr } from '@/utils/util';
|
||||||
import useClipboard from 'vue-clipboard3';
|
import useClipboard from 'vue-clipboard3';
|
||||||
|
import { getSettingInfo } from '@/api/modules/setting';
|
||||||
const { toClipboard } = useClipboard();
|
const { toClipboard } = useClipboard();
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|
||||||
const dialogVisiable = ref(false);
|
const dialogVisible = ref(false);
|
||||||
const form = ref<App.DatabaseConnInfo>({
|
const form = ref<App.DatabaseConnInfo>({
|
||||||
privilege: false,
|
privilege: false,
|
||||||
password: '',
|
password: '',
|
||||||
serviceName: '',
|
serviceName: '',
|
||||||
|
systemIP: '',
|
||||||
port: 0,
|
port: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -89,10 +92,10 @@ const formRef = ref<FormInstance>();
|
|||||||
const acceptParams = (): void => {
|
const acceptParams = (): void => {
|
||||||
form.value.password = '';
|
form.value.password = '';
|
||||||
loadPassword();
|
loadPassword();
|
||||||
dialogVisiable.value = true;
|
dialogVisible.value = true;
|
||||||
};
|
};
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
dialogVisiable.value = false;
|
dialogVisible.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const random = async () => {
|
const random = async () => {
|
||||||
@ -110,7 +113,9 @@ const onCopy = async (value: string) => {
|
|||||||
|
|
||||||
const loadPassword = async () => {
|
const loadPassword = async () => {
|
||||||
const res = await GetAppConnInfo('redis', '');
|
const res = await GetAppConnInfo('redis', '');
|
||||||
|
const settingInfoRes = await getSettingInfo();
|
||||||
form.value = res.data;
|
form.value = res.data;
|
||||||
|
form.value.systemIP = settingInfoRes.data.systemIP || i18n.global.t('database.localIP');
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
@ -120,7 +125,7 @@ const onSubmit = async () => {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||||
dialogVisiable.value = false;
|
dialogVisible.value = false;
|
||||||
emit('checkExist');
|
emit('checkExist');
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user