<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})"></head>

<body>
<div class="layui-form timo-compile">
    <form th:action="@{/api/build/packer}">
        <div class="layui-form-item">
            <label class="layui-form-label required">打包类型</label>
            <div class="layui-input-inline">
                <select name="type">
                    <option th:each="item : ${packTypes}" th:value="${item.key}">[[${item.value}]]</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">RegistryUrl</label>
            <div class="layui-input-inline">
                <select name="dockerRegistry">
                    <option th:each="item : ${registryList}" th:value="${item.key}">[[${item.value}]]</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">打包名字</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="name" placeholder="请输入打包名字" required>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">存放位置<i id="target_path_tips" class="fa fa-question-circle"></i></label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="targetPath" placeholder="docker 打包类型必须填写" required>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">bin 目录名<i id="bin_dirname_tips" class="fa fa-question-circle"></i></label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="binDirname" placeholder="zip 打包类型必须填写" required>
            </div>
        </div>
        <div class="layui-form-item timo-finally">
            <button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
            <button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
        </div>
    </form>
</div>

<script th:replace="/common/template :: script"></script>
<script type="text/javascript" th:src="@{/js/plugins/jquery-2.2.4.min.js}"></script>
<script type="text/javascript">
    $(function () {
        $("#target_path_tips").hover(function () {
            var tips = layer.tips(
                'docker 打包类型的存放地址是 docker 仓库地址<br/>' +
                'zip 打包类型不需要填写<br/>', +
                    '#target_path_tips',{
                    tips: [1, '#555555']
                });
            sleep(1000);
            layer.close(tips);
        })

        $("#bin_dirname_tips").hover(function () {
            var tips = layer.tips(
                '构建生成的可执行文件及配置文件, 脚本文件等所在的目录名<br/>' +
                'docker 打包类型不需要填写<br/>' +
                'zip 打包类型必须填写<br/>',
                '#bin_dirname_tips',{
                    tips: [1, '#555555']
                });
            sleep(1000);
            layer.close(tips);
        })
    })
</script>
</body>
</html>