mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-04-22 20:45:26 +08:00
[API节点]支持HTTP API
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>节点名称</th>
|
||||
<th>访问地址</th>
|
||||
<th>GRPC访问地址</th>
|
||||
<th>HTTP访问地址</th>
|
||||
<th class="width6 center">版本号</th>
|
||||
<th class="width5 center">CPU</th>
|
||||
<th class="width5 center">内存</th>
|
||||
@@ -22,9 +23,16 @@
|
||||
<td>{{node.name}}</td>
|
||||
<td>
|
||||
<div v-if="node.accessAddrs != null && node.accessAddrs.length > 0">
|
||||
<span class="ui label tiny basic" v-for="addr in node.accessAddrs">{{addr}}</span>
|
||||
<span class="ui label tiny basic" v-for="addr in node.accessAddrs" style="margin-bottom: 0.5em">{{addr}}</span>
|
||||
</div>
|
||||
<div v-else class="disabled">-</div>
|
||||
</td>
|
||||
<td>
|
||||
<div v-if="node.restAccessAddrs != null && node.restAccessAddrs.length > 0">
|
||||
<span class="ui label tiny basic" v-for="addr in node.restAccessAddrs" style="margin-bottom: 0.5em">{{addr}}</span>
|
||||
</div>
|
||||
<div v-else class="disabled">-</div>
|
||||
</td>
|
||||
<td class="center">
|
||||
<span v-if="node.status.buildVersion.length > 0">v{{node.status.buildVersion}}</span>
|
||||
<span v-else class="disabled">-</span>
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>进程监听端口 *</td>
|
||||
<td>GRPC监听端口 *</td>
|
||||
<td>
|
||||
<network-addresses-box :v-name="'listensJSON'" :v-server-type="'httpWeb'" @change="changeListens"></network-addresses-box>
|
||||
<p class="comment">API节点进程监听的网络端口。</p>
|
||||
<p class="comment">通过GRPC访问API节点进程监听的网络端口。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="hasHTTPS">
|
||||
@@ -23,17 +23,30 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>外部访问地址 *</td>
|
||||
<td>GRPC 外部访问地址 *</td>
|
||||
<td>
|
||||
<api-node-addresses-box :v-name="'accessAddrsJSON'"></api-node-addresses-box>
|
||||
<p class="comment">边缘节点和管理平台等外部节点访问API节点的网络地址。</p>
|
||||
<p class="comment">边缘节点和管理平台等外部节点访问API节点的网络地址,需要保证其他节点能够通过此地址访问到API节点服务。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td :class="{'color-border': restIsOn}">是否开启HTTP API端口</td>
|
||||
<td>
|
||||
<checkbox name="restIsOn" v-model="restIsOn">是否启用HTTP API</checkbox>
|
||||
<p class="comment">启用后用户可以通过HTTP API调用服务接口。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="restIsOn">
|
||||
<td class="color-border">HTTP API监听端口</td>
|
||||
<td>
|
||||
<network-addresses-box :v-name="'restListensJSON'" :v-server-type="'httpWeb'" @change="changeRestListens"></network-addresses-box>
|
||||
<p class="comment">HTTP API节点进程监听的网络端口。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>描述</td>
|
||||
<td>
|
||||
|
||||
@@ -1,8 +1,27 @@
|
||||
Tea.context(function () {
|
||||
this.hasHTTPS = false
|
||||
this.grpcAddrs = []
|
||||
this.restAddrs = []
|
||||
|
||||
this.changeListens = function (addrs) {
|
||||
this.hasHTTPS = addrs.$any(function (k, v) {
|
||||
this.grpcAddrs = addrs
|
||||
|
||||
this.hasHTTPS = this.grpcAddrs.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
})
|
||||
}) || (this.restIsOn && this.restAddrs.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
}))
|
||||
}
|
||||
|
||||
this.changeRestListens = function (addrs) {
|
||||
this.restAddrs = addrs
|
||||
|
||||
this.hasHTTPS = this.grpcAddrs.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
}) || (this.node.restIsOn && this.restAddrs.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
}))
|
||||
}
|
||||
|
||||
this.restIsOn = false
|
||||
})
|
||||
@@ -15,7 +15,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>进程监听端口</td>
|
||||
<td>GRPC监听端口</td>
|
||||
<td>
|
||||
<network-addresses-view :v-addresses="node.listens"></network-addresses-view>
|
||||
<p class="comment">API节点进程监听的网络端口。</p>
|
||||
@@ -28,12 +28,19 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>外部访问地址</td>
|
||||
<td>GRPC外部访问地址</td>
|
||||
<td>
|
||||
<network-addresses-view :v-addresses="node.accessAddrs"></network-addresses-view>
|
||||
<p class="comment">外部访问API节点的网络地址。</p>
|
||||
<p class="comment">通过GRPC访问API节点的网络地址。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="node.restIsOn">
|
||||
<td>HTTP外部访问地址</td>
|
||||
<td>
|
||||
<network-addresses-view :v-addresses="node.restAccessAddrs"></network-addresses-view>
|
||||
<p class="comment">通过HTTP访问API节点的网络地址。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>描述</td>
|
||||
<td>
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>进程监听端口 *</td>
|
||||
<td>GRPC监听端口 *</td>
|
||||
<td>
|
||||
<network-addresses-box :v-name="'listensJSON'" :v-server-type="'httpWeb'" :v-addresses="node.listens" @change="changeListens"></network-addresses-box>
|
||||
<p class="comment">API节点进程监听的网络端口。</p>
|
||||
<p class="comment">通过GRPC访问API节点进程监听的网络端口。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="hasHTTPS">
|
||||
@@ -26,17 +26,30 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>外部访问地址 *</td>
|
||||
<td>GRPC访问地址 *</td>
|
||||
<td>
|
||||
<api-node-addresses-box :v-name="'accessAddrsJSON'" :v-addrs="node.accessAddrs"></api-node-addresses-box>
|
||||
<p class="comment">边缘节点和管理平台等外部节点访问API节点的网络地址。</p>
|
||||
<p class="comment">边缘节点和管理平台等外部节点访问API节点的网络地址,需要保证其他节点能够通过此地址访问到API节点服务。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td :class="{'color-border': node.restIsOn}">是否开启HTTP API端口</td>
|
||||
<td>
|
||||
<checkbox name="restIsOn" v-model="node.restIsOn">是否启用HTTP API</checkbox>
|
||||
<p class="comment">启用后用户可以通过HTTP API调用服务接口。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="node.restIsOn">
|
||||
<td class="color-border">HTTP API监听端口</td>
|
||||
<td>
|
||||
<network-addresses-box :v-name="'restListensJSON'" :v-server-type="'httpWeb'" @change="changeRestListens" :v-addresses="node.restListens"></network-addresses-box>
|
||||
<p class="comment">HTTP API节点进程监听的网络端口。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>描述</td>
|
||||
<td>
|
||||
|
||||
@@ -3,10 +3,29 @@ Tea.context(function () {
|
||||
|
||||
this.hasHTTPS = this.node.listens.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
})
|
||||
}) || (this.node.restIsOn && this.node.restListens.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
}))
|
||||
this.grpcAddrs = []
|
||||
this.restAddrs = []
|
||||
|
||||
this.changeListens = function (addrs) {
|
||||
this.hasHTTPS = addrs.$any(function (k, v) {
|
||||
this.grpcAddrs = addrs
|
||||
|
||||
this.hasHTTPS = this.grpcAddrs.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
})
|
||||
}) || (this.node.restIsOn && this.restAddrs.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
}))
|
||||
}
|
||||
|
||||
this.changeRestListens = function (addrs) {
|
||||
this.restAddrs = addrs
|
||||
|
||||
this.hasHTTPS = this.grpcAddrs.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
}) || (this.node.restIsOn && this.restAddrs.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
}))
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user