Browse Source

fix: MySQL 设置页样式统一 (#2335)

pull/2337/head
ssongliu 1 year ago committed by GitHub
parent
commit
072b516d10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      frontend/src/lang/modules/en.ts
  2. 2
      frontend/src/lang/modules/tw.ts
  3. 2
      frontend/src/lang/modules/zh.ts
  4. 94
      frontend/src/views/database/mysql/setting/index.vue
  5. 36
      frontend/src/views/database/redis/password/index.vue

2
frontend/src/lang/modules/en.ts

@ -1544,7 +1544,7 @@ const message = {
writing: 'Number of Responses (Writing)',
waiting: 'resident process (Waiting)',
status: 'Current Status',
nginxConfig: 'OpenResty Settings',
nginxConfig: 'Settings',
configResource: 'Configuration',
saveAndReload: 'Save and Reload',
},

2
frontend/src/lang/modules/tw.ts

@ -1469,7 +1469,7 @@ const message = {
writing: '響應數(Writing)',
waiting: '駐留進程(Waiting)',
status: '當前狀態',
nginxConfig: 'OpenResty 設置',
nginxConfig: '設置',
configResource: '配置修改',
saveAndReload: '保存並重載',
},

2
frontend/src/lang/modules/zh.ts

@ -1469,7 +1469,7 @@ const message = {
writing: '响应数(Writing)',
waiting: '驻留进程(Waiting)',
status: '当前状态',
nginxConfig: 'OpenResty 设置',
nginxConfig: '设置',
configResource: '配置修改',
saveAndReload: '保存并重载',
},

94
frontend/src/views/database/mysql/setting/index.vue

@ -2,58 +2,54 @@
<div v-loading="loading">
<LayoutContent>
<template #title>
<back-button
name="MySQL"
:header="
props.database +
' [' +
(props.type === 'mysql' ? 'MySQL' : 'MariaDB') +
'] - ' +
$t('commons.button.set')
"
/>
<back-button name="MySQL" :header="props.database + ' ' + $t('commons.button.set')">
<template #buttons>
<el-button type="primary" :plain="activeName !== 'conf'" @click="jumpToConf">
{{ $t('database.confChange') }}
</el-button>
<el-button
type="primary"
:disabled="mysqlStatus !== 'Running'"
:plain="activeName !== 'status'"
@click="activeName = 'status'"
>
{{ $t('database.currentStatus') }}
</el-button>
<el-button
type="primary"
:disabled="mysqlStatus !== 'Running'"
:plain="activeName !== 'tuning'"
@click="activeName = 'tuning'"
>
{{ $t('database.performanceTuning') }}
</el-button>
<el-button type="primary" :plain="activeName !== 'port'" @click="activeName = 'port'">
{{ $t('commons.table.port') }}
</el-button>
<el-button
type="primary"
:disabled="mysqlStatus !== 'Running'"
:plain="activeName !== 'log'"
@click="activeName = 'log'"
>
{{ $t('database.log') }}
</el-button>
<el-button
type="primary"
:disabled="mysqlStatus !== 'Running'"
@click="jumpToSlowlog"
:plain="activeName !== 'slowLog'"
>
{{ $t('database.slowLog') }}
</el-button>
</template>
</back-button>
</template>
<template #toolbar>
<el-button type="primary" :plain="activeName !== 'conf'" @click="jumpToConf">
{{ $t('database.confChange') }}
</el-button>
<el-button
type="primary"
:disabled="mysqlStatus !== 'Running'"
:plain="activeName !== 'status'"
@click="activeName = 'status'"
>
{{ $t('database.currentStatus') }}
</el-button>
<el-button
type="primary"
:disabled="mysqlStatus !== 'Running'"
:plain="activeName !== 'tuning'"
@click="activeName = 'tuning'"
>
{{ $t('database.performanceTuning') }}
</el-button>
<el-button type="primary" :plain="activeName !== 'port'" @click="activeName = 'port'">
{{ $t('commons.table.port') }}
</el-button>
<el-button
type="primary"
:disabled="mysqlStatus !== 'Running'"
:plain="activeName !== 'log'"
@click="activeName = 'log'"
>
{{ $t('database.log') }}
</el-button>
<el-button
type="primary"
:disabled="mysqlStatus !== 'Running'"
@click="jumpToSlowlog"
:plain="activeName !== 'slowLog'"
>
{{ $t('database.slowLog') }}
</el-button>
<template #app>
<AppStatus :app-key="props.type" :app-name="props.database" v-model:loading="loading" />
</template>
<template #main>
<div v-if="activeName === 'conf'">
<codemirror

36
frontend/src/views/database/redis/password/index.vue

@ -6,22 +6,6 @@
<el-form @submit.prevent v-loading="loading" ref="formRef" :model="form" label-position="top">
<el-row type="flex" justify="center">
<el-col :span="22">
<el-form-item :label="$t('commons.login.password')" :rules="Rules.paramComplexity" prop="password">
<el-input type="password" show-password clearable v-model="form.password">
<template #append>
<el-button @click="onCopy(form.password)">{{ $t('commons.button.copy') }}</el-button>
<el-divider direction="vertical" />
<el-button style="margin-left: 1px" @click="random">
{{ $t('commons.button.random') }}
</el-button>
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('database.serviceName')" prop="serviceName">
<el-tag>{{ form.serviceName }}</el-tag>
<el-button @click="onCopy(form.serviceName)" icon="DocumentCopy" link></el-button>
<span class="input-help">{{ $t('database.serviceNameHelper') }}</span>
</el-form-item>
<el-form-item :label="$t('database.containerConn')">
<el-tag>
{{ form.serviceName + ':6379' }}
@ -32,10 +16,24 @@
</span>
</el-form-item>
<el-form-item :label="$t('database.remoteConn')">
<el-tag>{{ form.systemIP + ':' + form.port }}</el-tag>
<el-tooltip v-if="loadConnInfo().length > 48" :content="loadConnInfo()" placement="top">
<el-tag>{{ loadConnInfo().substring(0, 48) }}...</el-tag>
</el-tooltip>
<el-tag v-else>{{ loadConnInfo() }}</el-tag>
<el-button @click="onCopy(form.systemIP + ':6379')" icon="DocumentCopy" link></el-button>
<span class="input-help">{{ $t('database.remoteConnHelper2') }}</span>
</el-form-item>
<el-form-item :label="$t('commons.login.password')" :rules="Rules.paramComplexity" prop="password">
<el-input type="password" show-password clearable v-model="form.password">
<template #append>
<el-button @click="onCopy(form.password)">{{ $t('commons.button.copy') }}</el-button>
<el-divider direction="vertical" />
<el-button style="margin-left: 1px" @click="random">
{{ $t('commons.button.random') }}
</el-button>
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
@ -133,6 +131,10 @@ const onSubmit = async () => {
});
};
function loadConnInfo() {
return form.value.systemIP + ':' + form.value.port;
}
const onSave = async (formEl: FormInstance | undefined) => {
if (!formEl) return;
formEl.validate(async (valid) => {

Loading…
Cancel
Save