<!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/repoauth}">
        <div class="layui-form-item">
            <label class="layui-form-label required">仓库类型</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="type" th:value="${repoAuth.type}" readonly>
            </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" th:value="${repoAuth.name}" readonly>
            </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="authType" th:value="${repoAuth.authType}" readonly>
            </div>
        </div>
        <div th:if="${repoAuth.getAuthType()} == 'http'">
            <div class="layui-form-item">
                <label class="layui-form-label required">用户名</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="username" placeholder="请输入用户名" required>
                </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="password" placeholder="请输入密码" required>
                </div>
            </div>
        </div>
        <div class="layui-form-item" th:if="${repoAuth.getAuthType()} == 'ssh'">
            <label class="layui-form-label required">RSA 私钥</label>
            <div class="layui-input-inline">
                <textarea class="layui-textarea" name="rsaPrikey" placeholder="请输入 RSA 私钥"></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>
</body>
</html>