mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-07 13:40:24 +08:00
安装时如果数据库地址填写的是公网IP,则提示会影响系统运行性能
This commit is contained in:
@@ -149,8 +149,9 @@
|
||||
<tr>
|
||||
<td class="title">MySQL主机地址 *</td>
|
||||
<td>
|
||||
<input type="text" name="host" maxlength="100" placeholder="比如 192.168.1.100" style="width:16em" ref="dbHost" v-model="localDB.host"/>
|
||||
<input type="text" name="host" maxlength="100" placeholder="比如 192.168.1.100" style="width:16em" ref="dbHost" v-model="localDB.host" @change="checkDBIP" @input="localDB.isLocal = true"/>
|
||||
<p class="comment" v-if="localDBHost.length > 0 && localDBHost == localDB.host"><span class="blue">已经自动填入从当前服务器发现的MySQL数据库信息。</span></p>
|
||||
<p class="comment" v-if="!localDB.isLocal"><span class="red">当前地址不是局域网IP,可能会严重影响系统运行性能,请优先选择局域网IP。</span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -57,7 +57,7 @@ Tea.context(function () {
|
||||
|
||||
// 数据库
|
||||
this.dbInfo = {}
|
||||
this.localDB = {"host": "", "port": "", "username": "", "port": ""}
|
||||
this.localDB = {"host": "", "port": "", "username": "", "port": "", "isLocal": true}
|
||||
this.localDBHost = ""
|
||||
this.dbRequesting = false
|
||||
|
||||
@@ -65,10 +65,26 @@ Tea.context(function () {
|
||||
this.$post(".detectDB")
|
||||
.success(function (resp) {
|
||||
this.localDB = resp.data.localDB
|
||||
this.localDB["isLocal"] = true
|
||||
this.localDBHost = this.localDB.host
|
||||
})
|
||||
}
|
||||
|
||||
this.checkDBIP = function () {
|
||||
this.localDB["isLocal"] = true
|
||||
if (this.localDB.host.length == 0) {
|
||||
return
|
||||
}
|
||||
this.$post(".checkLocalIP")
|
||||
.params({
|
||||
host: this.localDB.host
|
||||
})
|
||||
.success(function (resp) {
|
||||
this.localDB["isLocal"] = resp.data.isLocal
|
||||
this.$forceUpdate()
|
||||
})
|
||||
}
|
||||
|
||||
this.dbSubmit = function () {
|
||||
this.dbRequesting = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user