Pārlūkot izejas kodu

update RepoAuthPageController.java

reghao 6 mēneši atpakaļ
vecāks
revīzija
a9395ba67d

+ 1 - 19
mgr/src/main/java/cn/reghao/devops/mgr/build/controller/RepoAuthPageController.java

@@ -62,15 +62,6 @@ public class RepoAuthPageController {
         return "/devops/build/repoauth/add";
     }
 
-    @ApiOperation(value = "仓库认证编辑页面", notes = "N")
-    @PreAuthorize("hasRole('ROLE_ADMIN')")
-    @GetMapping("/repoauth/edit/{id}")
-    public String editRepoAuthPage(@PathVariable("id") RepoAuthConfig repoAuth, Model model) {
-        repoAuth.setNull();
-        model.addAttribute("repoAuth", repoAuth);
-        return "/devops/build/repoauth/edit";
-    }
-
     private void setRepoAuthModel(Model model) {
         List<KeyValue> repos = new ArrayList<>();
         for (RepoType repoType : RepoType.values()) {
@@ -86,16 +77,7 @@ public class RepoAuthPageController {
         model.addAttribute("auths", auths);
     }
 
-    @ApiOperation(value = "仓库认证详情页面", notes = "N")
-    @PreAuthorize("hasRole('ROLE_ADMIN')")
-    @GetMapping("/repoauth/detail/{id}")
-    public String repoAuthDetailPage(@PathVariable("id") RepoAuthConfig repoAuth, Model model) {
-        repoAuth.setPassword("******");
-        model.addAttribute("repoAuth", repoAuth);
-        return "/devops/build/repoauth/detail";
-    }
-
-    @ApiOperation(value = "添加/修改仓库认证配置", notes = "N")
+    @ApiOperation(value = "添加仓库认证配置", notes = "N")
     @PreAuthorize("hasRole('ROLE_ADMIN')")
     @PostMapping(value = "/repoauth", produces = MediaType.APPLICATION_JSON_VALUE)
     @ResponseBody

+ 0 - 35
mgr/src/main/resources/templates/devops/build/repoauth/detail.html

@@ -1,35 +0,0 @@
-<!DOCTYPE html>
-<html xmlns:th="http://www.thymeleaf.org">
-<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})"></head>
-<body>
-    <div class="timo-detail-page">
-        <table class="layui-table timo-detail-table">
-            <tbody>
-            <tr>
-                <th>仓库类型</th>
-                <td th:text="${repoAuth.type}"></td>
-                <th>认证名字</th>
-                <td th:text="${repoAuth.name}"></td>
-            </tr>
-            <tr>
-                <th>认证方式</th>
-                <td th:text="${repoAuth.authType}"></td>
-                <span th:if="${repoAuth.authType} == 'ssh'">
-                    <th>RSA 私钥</th>
-                    <td>
-                        <textarea class="layui-textarea" readonly="readonly" th:text="${repoAuth.rsaPrikey}"></textarea>
-                    </td>
-                </span>
-                <span th:if="${repoAuth.authType} == 'http'">
-                    <th>用户名</th>
-                    <td th:text="${repoAuth.username}"></td>
-                    <th>密码</th>
-                    <td th:text="${repoAuth.password}"></td>
-                </span>
-            </tr>
-            </tbody>
-        </table>
-    </div>
-<script th:replace="/common/template :: script"></script>
-</body>
-</html>

+ 0 - 57
mgr/src/main/resources/templates/devops/build/repoauth/edit.html

@@ -1,57 +0,0 @@
-<!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="@{/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>

+ 4 - 4
mgr/src/main/resources/templates/devops/build/repoauth/index.html

@@ -26,6 +26,8 @@
                     <th class="sortable" data-field="type">仓库类型</th>
                     <th class="sortable" data-field="name">认证名字</th>
                     <th class="sortable" data-field="authType">认证类型</th>
+                    <th class="sortable" data-field="username">帐号</th>
+                    <th class="sortable" data-field="password">密码</th>
                     <th>操作</th>
                 </tr>
                 </thead>
@@ -34,11 +36,9 @@
                     <td th:text="${item.type}">仓库类型</td>
                     <td th:text="${item.name}">认证名字</td>
                     <td th:text="${item.authType}">认证类型</td>
+                    <td th:text="${item.username}">帐号</td>
+                    <td th:text="${item.password}">密码</td>
                     <td>
-                        <a class="open-popup" data-title="详细" th:attr="data-url=@{'/build/repoauth/detail/'+${item.id}}"
-                           data-size="640,480" href="#">详细</a>
-                        <a class="open-popup" data-title="修改用户名/密码" th:attr="data-url=@{'/build/repoauth/edit/'+${item.id}}"
-                           data-size="640,480" href="#">编辑</a>
                         <a class="ajax-delete" th:attr="data-msg='确定要删除 '+ ${item.name} + '?'"
                            th:href="@{'/build/repoauth/' + ${item.id}}">删除</a>
                     </td>