<!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/repoauth}">
        <input type="hidden" name="id" th:value="${repoAuth?.id}"/>
        <input type="hidden" name="isDelete" th:value="${repoAuth?.isDelete}"/>
        <div class="layui-form-item">
            <label class="layui-form-label required">仓库类型</label>
            <div class="layui-input-inline">
                <select name="type">
                    <option th:each="item : ${repos}" th:value="${item.key}" th:selected="${repoAuth?.type == item.key}">[[${item.value}]]</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item" th:if="${repoAuth} == 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="${repoAuth?.name}">
            </div>
        </div>
        <div class="layui-form-item" th:if="${repoAuth} != 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="${repoAuth?.name}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">认证类型</label>
            <div class="layui-input-inline">
                <select name="authType">
                    <option th:each="item : ${auths}" th:value="${item.key}" th:selected="${repoAuth?.authType == item.key}">[[${item.value}]]</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">用户名(http)</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="username" placeholder="请输入用户名" required th:value="${repoAuth?.username}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">密码(http)</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="password" placeholder="请输入密码" required th:value="${repoAuth?.password}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">RSA 私钥(ssh)</label>
            <div class="layui-input-inline">
                <textarea class="layui-textarea" name="rsaPrikey" placeholder="请输入 RSA 私钥" required th:text="${repoAuth?.rsaPrikey}"></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">
</script>
</body>
</html>