{$layout "layout_popup"}

<b-settings-header v-if="region.id > 0">修改节点区域</b-settings-header>
<b-settings-header v-if="region == null || region.id == 0">设置节点区域</b-settings-header>
<!-- <h3 v-if="region.id > 0">修改节点区域</h3> -->
<!-- <h3 v-if="region == null || region.id == 0">设置节点区域</h3> -->

<form class="ui form" data-tea-action="$" data-tea-success="success">
    <csrf-token></csrf-token>

    <input type="hidden" name="nodeId" :value="node.id"/>

    <table class="ui table definition selectable">
        <tr>
            <td class="title">节点</td>
            <td>{{node.name}}</td>
        </tr>
        <tr>
            <td>区域 *</td>
            <td>
                <b-select
                    name="regionId"
                    v-model="region.id"
                    auto-width
                    :options="[
                        {label: '[选择区域]', value: '0'},
                        ...regions.map(r => ({
                            label: r.name??'',
                            value: r.id??'',
                        }))
                    ]"
                ></b-select>

                <!-- <select class="ui dropdown auto-width" name="regionId" v-model="region.id">
                    <option value="0">[选择区域]</option>
                    <option v-for="r in regions" :value="r.id">{{r.name}}</option>
                </select> -->
            </td>
        </tr>
    </table>
    <submit-btn></submit-btn>
</form>

