2020-10-26 21:14:26 +08:00
|
|
|
|
{$layout}
|
|
|
|
|
|
{$template "/clusters/cluster/menu"}
|
|
|
|
|
|
{$template "/left_menu"}
|
2021-08-14 18:06:24 +08:00
|
|
|
|
{$template "/code_editor"}
|
2020-10-26 21:14:26 +08:00
|
|
|
|
|
|
|
|
|
|
<div class="right-box">
|
2021-08-14 18:06:24 +08:00
|
|
|
|
<div class="ui steps small fluid">
|
|
|
|
|
|
<div class="ui step" :class="{active: step == 'info'}">
|
|
|
|
|
|
<div class="content">1. 填写节点信息</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="ui step" :class="{active: step == 'install'}">
|
|
|
|
|
|
<div class="content">2. 安装节点</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="ui step" :class="{active: step == 'finish'}">
|
|
|
|
|
|
<div class="content">3. 完成</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 填写信息 -->
|
|
|
|
|
|
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success" v-show="step == 'info'">
|
2020-10-26 21:14:26 +08:00
|
|
|
|
<input type="hidden" name="clusterId" :value="clusterId"/>
|
|
|
|
|
|
<table class="ui table definition selectable">
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td class="title">节点名称 *</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<input type="text" name="name" maxlength="50" ref="focus"/>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
2020-12-23 19:44:10 +08:00
|
|
|
|
<td>IP地址 *</td>
|
2020-10-26 21:14:26 +08:00
|
|
|
|
<td>
|
|
|
|
|
|
<node-ip-addresses-box></node-ip-addresses-box>
|
2020-11-15 21:17:52 +08:00
|
|
|
|
<p class="comment">用于访问节点和域名解析等。</p>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr v-if="dnsRoutes.length > 0">
|
|
|
|
|
|
<td>DNS线路</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<input type="hidden" name="dnsDomainId" :value="dnsDomainId"/>
|
2020-11-16 13:03:45 +08:00
|
|
|
|
<dns-route-selector :v-all-routes="dnsRoutes"></dns-route-selector>
|
2021-01-31 16:03:52 +08:00
|
|
|
|
<p class="comment">当前节点对应的DNS线路,可用线路是根据集群设置的域名获取的,注意DNS服务商可能对这些线路有其他限制。</p>
|
2020-10-26 21:14:26 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2020-12-10 16:11:41 +08:00
|
|
|
|
<tr>
|
|
|
|
|
|
<td>所属区域</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<node-region-selector></node-region-selector>
|
2020-12-23 19:44:10 +08:00
|
|
|
|
<p class="comment">设置区域后才能根据区域进行流量统计和计费。</p>
|
2020-12-10 16:11:41 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2020-10-28 20:00:27 +08:00
|
|
|
|
<tr>
|
|
|
|
|
|
<td>所属分组</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<node-group-selector :v-cluster-id="clusterId"></node-group-selector>
|
2020-12-23 19:44:10 +08:00
|
|
|
|
<p class="comment">仅用来筛选服务。</p>
|
2020-10-28 20:00:27 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2020-10-26 21:14:26 +08:00
|
|
|
|
<tr>
|
2020-11-15 21:17:52 +08:00
|
|
|
|
<td colspan="2">
|
|
|
|
|
|
<more-options-indicator></more-options-indicator>
|
|
|
|
|
|
</td>
|
2020-10-26 21:14:26 +08:00
|
|
|
|
</tr>
|
|
|
|
|
|
<tbody v-show="moreOptionsVisible">
|
2020-11-15 21:17:52 +08:00
|
|
|
|
<tr>
|
|
|
|
|
|
<td>SSH主机地址</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<input type="text" name="sshHost" maxlength="64"/>
|
2021-08-14 18:06:24 +08:00
|
|
|
|
<p class="comment">比如192.168.1.100,用于远程安装节点应用程序。</p>
|
2020-11-15 21:17:52 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td>SSH主机端口</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<input type="text" name="sshPort" maxlength="5"/>
|
|
|
|
|
|
<p class="comment">常见的比如22。</p>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td>SSH登录认证</td>
|
|
|
|
|
|
<td>
|
2021-08-14 21:33:48 +08:00
|
|
|
|
<grant-selector :v-node-cluster-id="clusterId"></grant-selector>
|
2020-11-15 21:17:52 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2020-10-26 21:14:26 +08:00
|
|
|
|
</tbody>
|
|
|
|
|
|
</table>
|
2021-08-14 18:06:24 +08:00
|
|
|
|
<submit-btn>下一步</submit-btn>
|
2020-10-26 21:14:26 +08:00
|
|
|
|
</form>
|
2021-08-14 18:06:24 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 安装节点 -->
|
|
|
|
|
|
<div v-if="step == 'install'">
|
|
|
|
|
|
<div class="ui tabular menu">
|
|
|
|
|
|
<a href="" class="item" :class="{active: installMethod == 'remote'}" @click.prevent="switchInstallMethod('remote')">远程安装</a>
|
|
|
|
|
|
<a href="" class="item" :class="{active: installMethod == 'manual'}" @click.prevent="switchInstallMethod('manual')">手动安装</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 远程安装 -->
|
|
|
|
|
|
<div v-if="installMethod == 'remote'">
|
|
|
|
|
|
<form class="ui form">
|
|
|
|
|
|
<table class="ui table definition selectable">
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td class="title">SSH主机地址 *</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<input type="text" name="sshHost2" maxlength="64" v-model="sshHost" ref="installSSHHostRef" style="width: 16em" @change="changeSSHHost"/>
|
|
|
|
|
|
<div v-if="node.addresses != null && node.addresses.length > 1" style="margin-top: 1em">
|
|
|
|
|
|
<a href="" class="ui label small basic" v-for="addr in node.addresses" title="点击使用" @click.prevent="selectSSHHost(addr)">{{addr}}</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<p class="comment">比如192.168.1.100,用于远程安装节点应用程序。</p>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td>SSH主机端口 *</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<input type="text" name="sshPort2" maxlength="5" v-model="sshPort" style="width:5em"/>
|
|
|
|
|
|
<p class="comment"><node-login-suggest-ports ref="nodeLoginSuggestPortsRef" @select="selectLoginPort" @auto-select="autoSelectLoginPort"></node-login-suggest-ports></p>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td>SSH登录认证 *</td>
|
|
|
|
|
|
<td>
|
2021-08-14 21:33:48 +08:00
|
|
|
|
<grant-selector :v-grant="node.grant" :v-node-cluster-id="clusterId" @change="changeGrant"></grant-selector>
|
2021-08-14 18:06:24 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div v-if="installStatus != null && (installStatus.isRunning || installStatus.isFinished)"
|
|
|
|
|
|
class="ui segment installing-box">
|
|
|
|
|
|
<div v-if="installStatus.isRunning" class="blue">安装中...</div>
|
|
|
|
|
|
<div v-if="installStatus.isFinished">
|
|
|
|
|
|
<span v-if="installStatus.isOk" class="green">已安装成功</span>
|
|
|
|
|
|
<span v-if="!installStatus.isOk" class="red">安装过程中发生错误:{{installStatus.error}}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<button class="ui primary button" type="button" @click.prevent="install" v-if="!isInstalling">远程安装</button>
|
|
|
|
|
|
<button class="ui button disabled" v-if="isInstalling">正在安装</button>
|
|
|
|
|
|
<a href="" @click.prevent="finish" v-if="!isInstalling" style="margin-left: 1em; float: right">跳过安装</a>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 手动安装 -->
|
|
|
|
|
|
<div v-if="installMethod == 'manual'">
|
2021-08-25 17:16:14 +08:00
|
|
|
|
<div class="row">上传边缘节点程序到服务器并解压,然后在边缘节点安装目录下,复制<code-label>configs/api.template.yaml</code-label>为<code-label>configs/api.yaml</code-label>,然后修改文件里面的内容为以下内容:</div>
|
|
|
|
|
|
<div class="margin"></div>
|
2021-08-14 18:06:24 +08:00
|
|
|
|
<source-code-box id="rpc-code" type="text/yaml">rpc:
|
|
|
|
|
|
endpoints: [ {{apiEndpoints}} ]
|
|
|
|
|
|
nodeId: "{{node.uniqueId}}"
|
|
|
|
|
|
secret: "{{node.secret}}"</source-code-box>
|
2021-08-25 17:16:14 +08:00
|
|
|
|
<div class="margin"></div>
|
2021-08-14 18:06:24 +08:00
|
|
|
|
<div class="row">然后再使用<code-label>bin/edge-node start</code-label>命令启动节点。</div>
|
|
|
|
|
|
<div>
|
2021-08-14 21:33:48 +08:00
|
|
|
|
<div class="ui divider"></div>
|
|
|
|
|
|
<a href="" @click.prevent="finish">安装完成</a>
|
2021-08-14 18:06:24 +08:00
|
|
|
|
<a href="" @click.prevent="finish" style="float: right">跳过安装</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 完成 -->
|
|
|
|
|
|
<div v-show="step == 'finish'">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div style="text-align: center; font-size: 1.4em; margin-top: 2.4em" v-if="isInstalled"><span class="green">"{{node.name}}"节点已被创建并安装成功。</span></div>
|
|
|
|
|
|
<div style="text-align: center; font-size: 1.4em; margin-top: 2.4em" v-if="!isInstalled"><span class="green">"{{node.name}}"节点已创建成功。</span></div>
|
|
|
|
|
|
<div style="text-align: center; margin-top: 3em">
|
|
|
|
|
|
<a :href="'/clusters/cluster/node?nodeId=' + nodeId + '&clusterId=' + clusterId" class="ui button primary" type="button">现在进入节点详情<i class="ui icon long arrow alternate right"></i></a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="text-align: center; margin-top: 1em">
|
|
|
|
|
|
<a href="" @click.prevent="createNext">继续创建下一个节点</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2020-10-26 21:14:26 +08:00
|
|
|
|
</div>
|