{$layout}
{$template "menu_domain"}

<form class="ui form" data-tea-action="$" data-tea-success="success">
    <csrf-token></csrf-token>
    <input type="hidden" name="domainId" :value="domain.id"/>
    <table class="ui table definition selectable">
        <tr>
            <td>域名 *</td>
            <td>
                {{domain.name}}
            </td>
        </tr>
        <tr>
            <td class="title">所属集群 *</td>
            <td>
                <ns-cluster-selector :v-cluster-id="domain.clusterId"></ns-cluster-selector>
                <p class="comment">需要部署域名服务的集群。</p>
            </td>
        </tr>
        <tr v-show="dnsHosts != null && dnsHosts.length > 0">
            <td>DNS服务器</td>
            <td>
                <span v-for="host in dnsHosts" class="ui basic small label">{{host}}</span>
            </td>
        </tr>
        <tr>
            <td colspan="2"><more-options-indicator></more-options-indicator></td>
        </tr>
        <tbody v-show="moreOptionsVisible">
            <tr>
                <td>所属用户</td>
                <td>
                    <ns-user-selector :v-user-id="domain.userId" @change="changeUserId"></ns-user-selector>
                    <p class="comment">当前域名所属的平台用户。</p>
                </td>
            </tr>
            <tr v-if="hasGroups">
                <td>所属分组</td>
                <td>
                    <ns-domain-group-selector :v-domain-group-id="domain.groupId" ref="groupSelector"></ns-domain-group-selector>
                </td>
            </tr>
            <tr>
                <td>启用</td>
                <td>
                    <checkbox name="isOn" :v-value="1" v-model="domain.isOn"></checkbox>
                </td>
            </tr>
        </tbody>
    </table>
    <submit-btn></submit-btn>
</form>