[安装]安装时可以选择手工输入API地址

This commit is contained in:
GoEdgeLab
2020-11-24 08:47:35 +08:00
parent e50ddb95f3
commit 688c5742bc
3 changed files with 23 additions and 8 deletions

View File

@@ -8,7 +8,6 @@ var isConfigured bool
// 判断系统是否已经配置过
func IsConfigured() bool {
return false//TODO
if isConfigured {
return true
}

View File

@@ -82,13 +82,20 @@
<tr>
<td>节点主机地址</td>
<td>
<div v-if="serverIPs.length > 0">
<select name="newHost" class="ui dropdown auto-width">
<option v-for="ip in serverIPs" :value="ip">{{ip}}</option>
</select>
</div>
<div v-else="">
<input type="text" name="newHost" value=""/>
<div class="ui fields inline">
<div class="ui field">
<div v-if="serverIPs.length > 0 && !apiHostInput">
<select name="newHost" class="ui dropdown auto-width">
<option v-for="ip in serverIPs" :value="ip">{{ip}}</option>
</select>
</div>
<div v-else="">
<input type="text" name="newHost" value="" ref="newHostRef" placeholder="x.x.x.x"/>
</div>
</div>
<div class="ui field">
<a href="" v-if="!apiHostInput" @click.prevent="inputAPIHost()">[手工输入]</a>
</div>
</div>
<p class="comment">其他节点访问此API节点的主机地址可以是IP或者域名第一次安装时通常是<strong>当前服务器</strong>的IP地址。后期可以修改这个地址。</p>
</td>

View File

@@ -18,6 +18,8 @@ Tea.context(function () {
this.newAPINodePort = "8001"
this.apiRequesting = false
this.apiHostInput = false // 是否手工输入
this.apiSubmit = function () {
this.apiRequesting = true
}
@@ -41,6 +43,13 @@ Tea.context(function () {
this.step = this.STEP_INTRO
}
this.inputAPIHost = function () {
this.apiHostInput = true
this.$delay(function () {
this.$refs.newHostRef.focus()
})
}
// 数据库
this.dbInfo = {}
this.dbRequesting = false