feat: mysql 和 redis 增加连接信息提示 (#687)

pull/688/head
zhengkunwang223 2023-04-18 15:30:57 +08:00 committed by GitHub
parent 24b9f8f705
commit cb151dc985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 67 additions and 8 deletions

View File

@ -59,6 +59,7 @@ type AppInstalledDTO struct {
type DatabaseConn struct {
Password string `json:"password"`
ServiceName string `json:"serviceName"`
Port int64 `json:"port"`
}
type AppService struct {

View File

@ -141,6 +141,7 @@ func (a *AppInstallService) LoadConnInfo(key string) (response.DatabaseConn, err
}
data.Password = app.Password
data.ServiceName = app.ServiceName
data.Port = app.Port
return data, nil
}

View File

@ -130,6 +130,7 @@ export namespace App {
export interface DatabaseConnInfo {
password: string;
serviceName: string;
port: number;
}
export interface AppInstallResource {
type: string;

View File

@ -422,6 +422,12 @@ const message = {
rdbHelper2: 'The data',
rdbHelper3: 'Meeting either condition triggers RDB persistence',
rdbInfo: 'Ensure that the value in the rule list ranges from 1 to 100000',
containerConn: 'Container connection address',
containerConnHelper: 'PHP runtime environment/container-installed applications use this connection address',
remoteConn: 'External connection address',
remoteConnHelper2: 'Use this address for non-container or external connections',
localIP: 'Local IP',
},
container: {
createContainer: 'Create container',
@ -1174,6 +1180,8 @@ const message = {
runDir: 'Run Directory',
runDirHelper:
'Some programs need to specify a secondary directory as the running directory, such as ThinkPHP5, Laravel',
runUserHelper:
'For websites deployed through the PHP runtime environment, all files, folder owners, and user groups under the index and subdirectories need to be set to 1000, command: chown -R 1000:1000 index',
},
php: {
short_open_tag: 'Short tag support',

View File

@ -431,6 +431,12 @@ const message = {
rdbHelper2: '',
rdbHelper3: 'RDB',
rdbInfo: ' 1-100000 ',
containerConn: '',
containerConnHelper: 'PHP /使',
remoteConn: '',
remoteConnHelper2: '使',
localIP: ' IP',
},
container: {
createContainer: '',
@ -1165,6 +1171,8 @@ const message = {
rewriteHelper: '访default',
runDir: '',
runDirHelper: 'ThinkPHP5Laravel',
runUserHelper:
' PHP index 1000chown -R 1000:1000 index',
},
php: {
short_open_tag: '',

View File

@ -9,7 +9,7 @@
<el-form-item :label="$t('database.rootPassword')" :rules="Rules.requiredInput" prop="password">
<el-input type="password" show-password clearable v-model="form.password">
<template #append>
<el-button @click="copy" icon="DocumentCopy"></el-button>
<el-button @click="copy(form.password)" icon="DocumentCopy"></el-button>
<el-button style="margin-left: 1px" @click="random" icon="RefreshRight"></el-button>
</template>
</el-input>
@ -18,6 +18,19 @@
<el-tag>{{ form.serviceName }}</el-tag>
<span class="input-help">{{ $t('database.serviceNameHelper') }}</span>
</el-form-item>
<el-form-item :label="$t('database.containerConn')">
<el-tag>
{{ form.serviceName + ':3306' }}
</el-tag>
<el-button @click="copy(form.serviceName + ':3306')" icon="DocumentCopy" link></el-button>
<span class="input-help">
{{ $t('database.containerConnHelper') }}
</span>
</el-form-item>
<el-form-item :label="$t('database.remoteConn')">
<el-tag>{{ $t('database.localIP') + ':' + form.port }}</el-tag>
<span class="input-help">{{ $t('database.remoteConnHelper2') }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
@ -56,6 +69,7 @@ const dialogVisiable = ref(false);
const form = ref<App.DatabaseConnInfo>({
password: '',
serviceName: '',
port: 0,
});
const confirmDialogRef = ref();
@ -73,9 +87,9 @@ const random = async () => {
form.value.password = getRandomStr(16);
};
const copy = async () => {
const copy = async (value: string) => {
let input = document.createElement('input');
input.value = form.value.password;
input.value = value;
document.body.appendChild(input);
input.select();
document.execCommand('Copy');

View File

@ -9,7 +9,7 @@
<el-form-item :label="$t('database.requirepass')" :rules="Rules.requiredInput" prop="password">
<el-input type="password" show-password clearable v-model="form.password">
<template #append>
<el-button @click="copy" icon="DocumentCopy"></el-button>
<el-button @click="copy(form.password)" icon="DocumentCopy"></el-button>
<el-button style="margin-left: 1px" @click="random" icon="RefreshRight"></el-button>
</template>
</el-input>
@ -18,6 +18,19 @@
<el-tag>{{ form.serviceName }}</el-tag>
<span class="input-help">{{ $t('database.serviceNameHelper') }}</span>
</el-form-item>
<el-form-item :label="$t('database.containerConn')">
<el-tag>
{{ form.serviceName + ':6379' }}
</el-tag>
<el-button @click="copy(form.serviceName + ':6379')" icon="DocumentCopy" link></el-button>
<span class="input-help">
{{ $t('database.containerConnHelper') }}
</span>
</el-form-item>
<el-form-item :label="$t('database.remoteConn')">
<el-tag>{{ $t('database.localIP') + ':' + form.port }}</el-tag>
<span class="input-help">{{ $t('database.remoteConnHelper2') }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
@ -56,6 +69,7 @@ const dialogVisiable = ref(false);
const form = ref<App.DatabaseConnInfo>({
password: '',
serviceName: '',
port: 0,
});
const confirmDialogRef = ref();
@ -78,9 +92,9 @@ const random = async () => {
form.value.password = getRandomStr(16);
};
const copy = async () => {
const copy = async (value: string) => {
let input = document.createElement('input');
input.value = form.value.password;
input.value = value;
document.body.appendChild(input);
input.select();
document.execCommand('Copy');

View File

@ -13,7 +13,12 @@
</el-descriptions-item>
</el-descriptions>
<br />
<el-alert :closable="false">
<template #default>
<span class="warnHelper">{{ $t('website.runUserHelper') }}</span>
</template>
</el-alert>
<br />
<el-descriptions :title="$t('website.folderTitle')" :column="1" border>
<el-descriptions-item label="waf">{{ $t('website.wafFolder') }}</el-descriptions-item>
<el-descriptions-item label="ssl">{{ $t('website.sslFolder') }}</el-descriptions-item>
@ -42,7 +47,7 @@
<el-form-item>
<el-alert :closable="false">
<template #default>
<span style="white-space: pre-line">{{ $t('website.runDirHelper') }}</span>
<span class="warnHelper">{{ $t('website.runDirHelper') }}</span>
</template>
</el-alert>
</el-form-item>
@ -152,3 +157,10 @@ onMounted(() => {
search();
});
</script>
<style scoped>
.warnHelper {
white-space: pre-line;
display: block;
}
</style>