<!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/machine/host/sshauth/'+${machineId}}">
        <div class="layui-form-item">
            <label class="layui-form-label required">选择地址</label>
            <div class="layui-input-inline">
                <select name="ipv4">
                    <option th:each="item : ${ipv4List}" th:value="${item.key}" th:selected="${machineIpv4} eq ${item.key}">[[${item.value}]]</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">SSH 端口</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="port" placeholder="请输入 SSH 端口" th:value="${sshAuth?.port}">
            </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="username" placeholder="请输入用户名" required th:value="${sshAuth?.username}">
            </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 th:value="${sshAuth?.password}">
            </div>
        </div>
        <!-- TODO 暂时不使用私钥登录 -->
        <!--<div class="layui-form-item">
            <label class="layui-form-label required">RSA 私钥</label>
            <div class="layui-input-inline">
                <textarea class="layui-textarea" name="rsaPrikey" placeholder="请输入 RSA 私钥" required th:text="${sshAuth?.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>
</body>
</html>