refactor: 安装页合并 MySQL/Redis 为「数据库」卡片,地址提示改为动态展示后台/客户端地址
This commit is contained in:
@@ -192,7 +192,9 @@
|
||||
"base": "Base",
|
||||
"appName": "Platform Name",
|
||||
"baseUrl": "Public URL",
|
||||
"baseUrlHint": "All three apps share this URL: admin at /admin, client at /trace, API at /api. Reverse-proxy the domain and HTTPS to the service port (default 3000, decided by how the service is launched — not set here).",
|
||||
"urlAdmin": "Admin",
|
||||
"urlClient": "Client",
|
||||
"dbCard": "Database",
|
||||
"host": "Host",
|
||||
"port": "Port",
|
||||
"database": "Database",
|
||||
|
||||
@@ -192,7 +192,9 @@
|
||||
"base": "基础",
|
||||
"appName": "平台名称",
|
||||
"baseUrl": "对外访问地址",
|
||||
"baseUrlHint": "三端共用此地址:后台 /admin、客户端 /trace、接口 /api。域名与 HTTPS 由 Nginx/宝塔/1Panel 反代到服务端口(默认 3000,由启动方式决定,此处无需填写)。",
|
||||
"urlAdmin": "后台",
|
||||
"urlClient": "客户端",
|
||||
"dbCard": "数据库",
|
||||
"host": "主机",
|
||||
"port": "端口",
|
||||
"database": "数据库",
|
||||
|
||||
@@ -33,7 +33,10 @@
|
||||
<h2>{{ tt('base') }}</h2>
|
||||
<label><span>{{ tt('appName') }}<i class="req">*</i></span><n-input v-model:value="form.appName" /></label>
|
||||
<label><span>{{ tt('baseUrl') }}<i class="req">*</i></span><n-input v-model:value="form.baseUrl" placeholder="https://example.com" /></label>
|
||||
<p class="hint">{{ tt('baseUrlHint') }}</p>
|
||||
<div class="urls">
|
||||
<div><span>{{ tt('urlAdmin') }}</span>{{ baseTrim }}/admin</div>
|
||||
<div><span>{{ tt('urlClient') }}</span>{{ baseTrim }}/trace</div>
|
||||
</div>
|
||||
|
||||
<div class="sub">{{ tt('admin') }}</div>
|
||||
<label><span>{{ tt('adminAccount') }}<i class="req">*</i></span><n-input v-model:value="form.admin.username" /></label>
|
||||
@@ -42,8 +45,10 @@
|
||||
</section>
|
||||
|
||||
<section class="box">
|
||||
<div class="box-head">
|
||||
<h2>MySQL</h2>
|
||||
<h2>{{ tt('dbCard') }}</h2>
|
||||
|
||||
<div class="sub-row">
|
||||
<div class="sub">MySQL</div>
|
||||
<n-button size="tiny" :loading="testingMysql" @click="testMysql">{{ tt('testConnection') }}</n-button>
|
||||
</div>
|
||||
<label><span>{{ tt('host') }}<i class="req">*</i></span><n-input v-model:value="form.mysql.host" /></label>
|
||||
@@ -52,11 +57,9 @@
|
||||
<label><span>{{ tt('username') }}<i class="req">*</i></span><n-input v-model:value="form.mysql.username" /></label>
|
||||
<label><span>{{ tt('password') }}</span><n-input v-model:value="form.mysql.password" type="password" show-password-on="click" /></label>
|
||||
<p v-if="mysqlTest" class="test-result" :class="mysqlTest.ok ? 'ok' : 'fail'">{{ mysqlTest.msg }}</p>
|
||||
</section>
|
||||
|
||||
<section class="box">
|
||||
<div class="box-head">
|
||||
<h2>Redis</h2>
|
||||
<div class="sub-row">
|
||||
<div class="sub">Redis</div>
|
||||
<n-button size="tiny" :loading="testingRedis" @click="testRedis">{{ tt('testConnection') }}</n-button>
|
||||
</div>
|
||||
<label><span>{{ tt('host') }}<i class="req">*</i></span><n-input v-model:value="form.redis.host" /></label>
|
||||
@@ -132,6 +135,8 @@ const driverOptions = computed(() => [
|
||||
{ label: 'OSS / S3', value: 'oss' },
|
||||
]);
|
||||
|
||||
const baseTrim = computed(() => (form.baseUrl || '').replace(/\/+$/, ''));
|
||||
|
||||
const form = reactive<InstallForm>({
|
||||
appName: tt('defaultAppName'),
|
||||
baseUrl: location.origin,
|
||||
@@ -347,6 +352,27 @@ async function submit(): Promise<void> {
|
||||
font-weight: 600;
|
||||
color: var(--n-text-color-2, #526070);
|
||||
}
|
||||
.sub-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin: 14px 0 10px;
|
||||
}
|
||||
.sub-row .sub {
|
||||
margin: 0;
|
||||
}
|
||||
.urls {
|
||||
margin: 6px 0 2px;
|
||||
font-size: 12px;
|
||||
line-height: 1.7;
|
||||
color: var(--n-text-color-3, #6a7687);
|
||||
word-break: break-all;
|
||||
}
|
||||
.urls span {
|
||||
display: inline-block;
|
||||
min-width: 52px;
|
||||
color: var(--n-text-color-2, #526070);
|
||||
}
|
||||
.box label {
|
||||
display: grid;
|
||||
grid-template-columns: 132px 1fr;
|
||||
|
||||
Reference in New Issue
Block a user