<!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/app/config/build/packer}">
        <input type="hidden" name="machineId" th:value="${machineId}"/>
        <input type="hidden" name="machineIpv4" th:value="${machineIpv4}"/>
        <input type="hidden" name="id" th:value="${packer?.id}"/>
        <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}" th:selected="${packer?.type == item.key}">[[${item.value}]]</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item" th:if="${packer} == null">
            <label class="layui-form-label required">打包名字</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="name" placeholder="请输入打包名字" required th:value="${packer?.name}">
            </div>
        </div>
        <div class="layui-form-item" th:if="${packer} != null">
            <label class="layui-form-label required">打包名字</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="name" readonly="true" required th:value="${packer?.name}">
            </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="targetPath" placeholder="请输入存放位置" required th:value="${packer?.targetPath}">
            </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">
</script>
</body>
</html>