{$layout "layout_popup"}

<h3>修改节点DNS设置</h3>

<form class="ui form" data-tea-action="$" data-tea-success="success">
	<input type="hidden" name="nodeId" :value="nodeId"/>
	<input type="hidden" name="domainId" :value="domainId"/>
    <input type="hidden" name="ipAddrId" :value="ipAddrId"/>
	<csrf-token></csrf-token>

	<table class="ui table definition selectable">
		<tr v-if="domainName.length > 0">
			<td>主域名</td>
			<td>{{domainName}}
				<p class="comment">由当前节点所属集群设置。</p>
			</td>
		</tr>
		<tr>
			<td class="title">IP地址 *</td>
			<td>
				<input type="text" name="ipAddr" maxlength="64" ref="focus" v-model="ipAddr"/>
				<p class="comment">用于域名解析的节点IP地址。</p>
			</td>
		</tr>
		<tr v-if="domainId > 0">
			<td>线路</td>
			<td>
                <p class="comment" v-if="allRoutes.length == 0">没有可选的线路。<a href="" @click.prevent="syncDomain(domainId)">[获取线路]</a></p>
				<div v-if="allRoutes.length > 0">
					<dns-route-selector :v-all-routes="allRoutes" :v-routes="routes"></dns-route-selector>
					<p class="comment">当前节点IP对应的线路。<a href="" @click.prevent="syncDomain(domainId)">[重新获取线路]</a></p>
				</div>
			</td>
		</tr>
        <tr v-if="domainId == 0">
            <td>线路</td>
            <td><span class="disabled">当前集群没有选择域名。</span></td>
        </tr>
	</table>

	<submit-btn></submit-btn>
</form>