{$layout "layout_popup"}

<h3>修改记录</h3>
<form class="ui form" data-tea-action="$" data-tea-success="success">
    <csrf-token></csrf-token>
    <input type="hidden" name="recordId" :value="record.id"/>
    <table class="ui table definition selectable">
        <tr>
            <td class="title">记录名</td>
            <td>
                <div class="ui input right labeled">
                    <input type="text" name="name" ref="focus" v-model="record.name"/>
                    <span class="ui label">.{{domain.name}}</span>
                </div>
            </td>
        </tr>
        <tr>
            <td>记录类型</td>
            <td>
                <select class="ui dropdown auto-width" name="type" v-model="type" @change="changeType">
                    <option v-for="t in types" :value="t.type">{{t.type}}</option>
                </select>
                <p class="comment">{{typeDescription}}</p>
            </td>
        </tr>
        <tr>
            <td>记录值</td>
            <td>
                <input type="text" name="value" maxlength="512" v-model="record.value"/>
            </td>
        </tr>
        <tr>
            <td>TTL</td>
            <td>
                <select class="ui dropdown auto-width" name="ttl" v-model="record.ttl">
                    <option v-for="v in ttlValues" :value="v.value">{{v.name}}</option>
                </select>
            </td>
        </tr>
        <tr>
            <td>线路</td>
            <td>
                <ns-routes-selector :v-routes="record.routes"></ns-routes-selector>
            </td>
        </tr>
        <tr>
            <td colspan="2"><more-options-indicator></more-options-indicator></td>
        </tr>
        <tbody v-show="moreOptionsVisible">
            <tr>
                <td>备注</td>
                <td>
                    <textarea rows="2" name="description" v-model="record.description"></textarea>
                </td>
            </tr>
            <tr>
                <td>是否启用</td>
                <td>
                    <checkbox name="isOn" v-model="record.isOn"></checkbox>
                </td>
            </tr>
        </tbody>
    </table>
    <submit-btn></submit-btn>
</form>