<!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/compiler}">
        <div class="layui-form-item">
            <label class="layui-form-label required">编译类型<i id="compile_type_tips" class="fa fa-question-circle"></i></label>
            <div class="layui-input-inline">
                <select name="type">
                    <option th:each="item : ${compileTypes}" 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="home_path_tips" class="fa fa-question-circle"></i></label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="homePath" placeholder="请输入编译器主目录">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">编译脚本<i id="compile_script_tips" class="fa fa-question-circle"></i></label>
            <div class="layui-input-inline">
                <textarea class="layui-textarea" name="compileScript" placeholder="请输入编译脚本"></textarea>
            </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 () {
        $("#compile_type_tips").hover(function () {
            var tips = layer.tips('不需要编译器指定 none 类型<br />',
                '#compile_type_tips',{
                tips: [1, '#555555']
            });
            sleep(1000);
            layer.close(tips);
        })

        $("#home_path_tips").hover(function () {
            var tips = layer.tips(
                '采用 maven 编译必须指定 maven 的主目录<br/>' +
                '其他编译类型不需要指定编译器的主目录<br/>', +
                '#home_path_tips',{
                    tips: [1, '#555555']
                });
            sleep(1000);
            layer.close(tips);
        })

        $("#compile_script_tips").hover(function () {
            var tips = layer.tips(
                '编译脚本中的编译器必须指定绝对路径(absolute path)<br/>',
                '#compile_script_tips',{
                    tips: [1, '#555555']
                });
            sleep(1000);
            layer.close(tips);
        })
    })
</script>
</body>
</html>