From cb151dc9855f469b54656ef41e1eeb20c5ba4021 Mon Sep 17 00:00:00 2001
From: zhengkunwang223 <31820853+zhengkunwang223@users.noreply.github.com>
Date: Tue, 18 Apr 2023 15:30:57 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20mysql=20=E5=92=8C=20redis=20=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E8=BF=9E=E6=8E=A5=E4=BF=A1=E6=81=AF=E6=8F=90=E7=A4=BA?=
=?UTF-8?q?=20(#687)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
backend/app/dto/response/app.go | 1 +
backend/app/service/app_install.go | 1 +
frontend/src/api/interface/app.ts | 1 +
frontend/src/lang/modules/en.ts | 8 ++++++++
frontend/src/lang/modules/zh.ts | 8 ++++++++
.../database/mysql/root-password/index.vue | 20 ++++++++++++++++---
.../views/database/redis/password/index.vue | 20 ++++++++++++++++---
.../config/basic/site-folder/index.vue | 16 +++++++++++++--
8 files changed, 67 insertions(+), 8 deletions(-)
diff --git a/backend/app/dto/response/app.go b/backend/app/dto/response/app.go
index 8f8bf9b73..f9ac0b3de 100644
--- a/backend/app/dto/response/app.go
+++ b/backend/app/dto/response/app.go
@@ -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 {
diff --git a/backend/app/service/app_install.go b/backend/app/service/app_install.go
index 5210dec85..95cf4b43d 100644
--- a/backend/app/service/app_install.go
+++ b/backend/app/service/app_install.go
@@ -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
}
diff --git a/frontend/src/api/interface/app.ts b/frontend/src/api/interface/app.ts
index 2e4b4b154..1fb035872 100644
--- a/frontend/src/api/interface/app.ts
+++ b/frontend/src/api/interface/app.ts
@@ -130,6 +130,7 @@ export namespace App {
export interface DatabaseConnInfo {
password: string;
serviceName: string;
+ port: number;
}
export interface AppInstallResource {
type: string;
diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts
index 0dededfb0..aa72d8edc 100644
--- a/frontend/src/lang/modules/en.ts
+++ b/frontend/src/lang/modules/en.ts
@@ -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',
diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts
index 65aa7488a..465ddeac1 100644
--- a/frontend/src/lang/modules/zh.ts
+++ b/frontend/src/lang/modules/zh.ts
@@ -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: '部分程序需要指定二级目录作为运行目录,如ThinkPHP5,Laravel',
+ runUserHelper:
+ '通过 PHP 运行环境部署的网站,需要将 index 和子目录下的所有文件、文件夹所有者和用户组设置为 1000,命令:chown -R 1000:1000 index',
},
php: {
short_open_tag: '短标签支持',
diff --git a/frontend/src/views/database/mysql/root-password/index.vue b/frontend/src/views/database/mysql/root-password/index.vue
index 6d9bd0066..9e7e2947a 100644
--- a/frontend/src/views/database/mysql/root-password/index.vue
+++ b/frontend/src/views/database/mysql/root-password/index.vue
@@ -9,7 +9,7 @@
-
+
@@ -18,6 +18,19 @@
{{ form.serviceName }}
{{ $t('database.serviceNameHelper') }}
+
+
+ {{ form.serviceName + ':3306' }}
+
+
+
+ {{ $t('database.containerConnHelper') }}
+
+
+
+ {{ $t('database.localIP') + ':' + form.port }}
+ {{ $t('database.remoteConnHelper2') }}
+
@@ -56,6 +69,7 @@ const dialogVisiable = ref(false);
const form = ref({
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');
diff --git a/frontend/src/views/database/redis/password/index.vue b/frontend/src/views/database/redis/password/index.vue
index 97322b05a..b995963f6 100644
--- a/frontend/src/views/database/redis/password/index.vue
+++ b/frontend/src/views/database/redis/password/index.vue
@@ -9,7 +9,7 @@
-
+
@@ -18,6 +18,19 @@
{{ form.serviceName }}
{{ $t('database.serviceNameHelper') }}
+
+
+ {{ form.serviceName + ':6379' }}
+
+
+
+ {{ $t('database.containerConnHelper') }}
+
+
+
+ {{ $t('database.localIP') + ':' + form.port }}
+ {{ $t('database.remoteConnHelper2') }}
+
@@ -56,6 +69,7 @@ const dialogVisiable = ref(false);
const form = ref({
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');
diff --git a/frontend/src/views/website/website/config/basic/site-folder/index.vue b/frontend/src/views/website/website/config/basic/site-folder/index.vue
index 3ae3321e5..df7b330bb 100644
--- a/frontend/src/views/website/website/config/basic/site-folder/index.vue
+++ b/frontend/src/views/website/website/config/basic/site-folder/index.vue
@@ -13,7 +13,12 @@
-
+
+
+ {{ $t('website.runUserHelper') }}
+
+
+
{{ $t('website.wafFolder') }}
{{ $t('website.sslFolder') }}
@@ -42,7 +47,7 @@
- {{ $t('website.runDirHelper') }}
+ {{ $t('website.runDirHelper') }}
@@ -152,3 +157,10 @@ onMounted(() => {
search();
});
+
+