{% init item = xutils.Storage(name="", url="", message="", id="") %}
<div class="card">
    <form action="/system/crontab/save" method="POST">
    <input class="hide" name="id" value="{{item.id}}">

    <table class="no-border" style="margin: 0 auto; width: 100%;">
        <tr>
            <td>标题</td>
            <td><input type="text" name="name" value="{{item.name}}" class="col-md-12"></td>
        </tr>
        <tr>
            <td>触发链接</td>
            <td>
                <select name="url" value="{{item.url}}">
                {% for script_name in links %}
                    <option value="{{script_name}}">{{script_name}}</option>
                {% end %}
                </select>
            </td>
        </tr>
        <tr>
            <td>周</td>
            <td>
                <select name="tm_wday" value="{{item.tm_wday}}">
                    {% for wday in sorted(xutils.wday_map) %}
                    <option value="{{wday}}">{{xutils.wday_map[wday]}}</option>
                    {% end %}
                </select>
            </td>
        </tr>
        <tr>
            <td>时间</td>
            <td>
                小时:<select name="tm_hour" value="{{item.tm_hour}}">
                    <option value="*">每小时</option>
                    {% for hour in range(24) %}
                    <option value="{{hour}}">{{hour}}</option>
                    {% end %}
                </select>
                分钟:<select name="tm_min" value="{{item.tm_min}}">
                    <option value="*">每分钟</option>
                    <option value="mod5">每5分钟</option>
                    {% for tm_min in range(0, 60, 5) %}
                    <option value="{{tm_min}}">{{tm_min}}</option>
                    {% end %}
                </select>
            </td>
        </tr>

        <tr>
            <td>信息</td>
            <td><textarea name="message" class="col-md-12">{{item.message}}</textarea></td>
        </tr>
        <tr>
            <td></td>
            <td>
                <input type="submit" value="确认">&nbsp;
                <input type="button" class="btn-danger x-dialog-cancel" value="取消">
            </td>
        </tr>

    </table>
    </form>
</div>

