{$layout}
{$template "menu"}

<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
    <csrf-token></csrf-token>
	<input type="hidden" name="addrId" :value="addr.id"/>
	<table class="ui table definition selectable">
		<tr>
			<td class="title">IP地址 *</td>
			<td>
				<input type="text" name="ip" maxlength="128" ref="focus" v-model="addr.ip"/>
			</td>
		</tr>
		<tr>
			<td>允许公开访问</td>
			<td>
                <checkbox name="canAccess" value="1" v-model="addr.canAccess"></checkbox>
				<p class="comment">是否为可以公开访问的IP，如果选中表示当前IP可以被公开访问，并可被加入到DNS解析记录中。</p>
			</td>
		</tr>
        <tr>
            <td class="title">备注</td>
            <td>
                <input type="text" name="name" maxlength="50" v-model="addr.name"/>
            </td>
        </tr>
        <tr>
            <td>在线状态</td>
            <td>
                <b-select
                    name="isUp"
                    v-model="addr.isUp"
                    auto-width
                    :options="[
                        {label: '在线', value: '1'},
                        {label: '离线', value: '0'},
                    ]"
                ></b-select>

                <!-- <select class="ui dropdown auto-width" name="isUp" v-model="addr.isUp">
                    <option value="1">在线</option>
                    <option value="0">离线</option>
                </select> -->
            </td>
        </tr>
        <tr v-if="teaIsPlus && supportThresholds">
            <td>阈值设置</td>
            <td>
                <node-ip-address-thresholds-box :v-thresholds="addr.thresholds"></node-ip-address-thresholds-box>
            </td>
        </tr>
        <tr>
            <td colspan="2"><more-options-indicator></more-options-indicator></td>
        </tr>
        <tbody v-show="moreOptionsVisible">
            <tr>
                <td>专属集群</td>
                <td>
                    <node-ip-address-clusters-selector :v-clusters="clusters"></node-ip-address-clusters-selector>
                </td>
            </tr>
            <tr>
                <td>启用当前IP</td>
                <td>
                    <checkbox name="isOn" :v-value="1" v-model="addr.isOn"></checkbox>
                    <p class="comment">选中表示当前IP有效。</p>
                </td>
            </tr>
        </tbody>
	</table>
	<submit-btn></submit-btn>
</form>