Ver código fonte

update DockerRegistryPageController

reghao 6 meses atrás
pai
commit
bf44d19426

+ 2 - 20
mgr/src/main/java/cn/reghao/devops/mgr/build/controller/DockerRegistryPageController.java

@@ -5,7 +5,7 @@ import cn.reghao.devops.mgr.build.db.repository.DockerRegistryRepository;
 import cn.reghao.devops.mgr.build.model.po.DockerRegistry;
 import cn.reghao.devops.mgr.build.service.DockerRegistryService;
 import cn.reghao.devops.mgr.util.PageSort;
-import cn.reghao.jutil.jdk.result.WebResult;
+import cn.reghao.jutil.web.WebResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.data.domain.Page;
@@ -53,25 +53,7 @@ public class DockerRegistryPageController {
         return "/devops/build/docker/add";
     }
 
-    @ApiOperation(value = "DockerRegistry 编辑页面", notes = "N")
-    @PreAuthorize("hasRole('ROLE_ADMIN')")
-    @GetMapping("/registry/edit/{id}")
-    public String editRepoAuthPage(@PathVariable("id") DockerRegistry dockerRegistry, Model model) {
-        dockerRegistry.setNull();
-        model.addAttribute("dockerRegistry", dockerRegistry);
-        return "/devops/build/docker/edit";
-    }
-
-    @ApiOperation(value = "DockerRegistry 详情页面", notes = "N")
-    @PreAuthorize("hasRole('ROLE_ADMIN')")
-    @GetMapping("/registry/detail/{id}")
-    public String repoAuthDetailPage(@PathVariable("id") DockerRegistry dockerRegistry, Model model) {
-        dockerRegistry.setPassword("******");
-        model.addAttribute("dockerRegistry", dockerRegistry);
-        return "/devops/build/docker/detail";
-    }
-
-    @ApiOperation(value = "添加/修改 DockerRegistry 配置", notes = "N")
+    @ApiOperation(value = "添加 DockerRegistry 配置", notes = "N")
     @PreAuthorize("hasRole('ROLE_ADMIN')")
     @PostMapping(value = "/registry", produces = MediaType.APPLICATION_JSON_VALUE)
     @ResponseBody

+ 0 - 27
mgr/src/main/resources/templates/devops/build/docker/detail.html

@@ -1,27 +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>
-                <span>
-                    <th>RegistryUrl</th>
-                    <td th:text="${dockerRegistry.registryUrl}"></td>
-                </span>
-            </tr>
-            <tr>
-                <span>
-                    <th>用户名</th>
-                    <td th:text="${dockerRegistry.username}"></td>
-                    <th>密码</th>
-                    <td th:text="${dockerRegistry.password}"></td>
-                </span>
-            </tr>
-            </tbody>
-        </table>
-    </div>
-<script th:replace="/common/template :: script"></script>
-</body>
-</html>

+ 0 - 39
mgr/src/main/resources/templates/devops/build/docker/edit.html

@@ -1,39 +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/registry}">
-        <div class="layui-form-item">
-            <label class="layui-form-label required">RegistryUrl</label>
-            <div class="layui-input-inline">
-                <input class="layui-input" type="text" name="registryUrl" th:value="${dockerRegistry.registryUrl}" readonly>
-            </div>
-        </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" 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" required>
-                </div>
-            </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/docker/index.html

@@ -24,17 +24,17 @@
                 <thead>
                 <tr>
                     <th class="sortable" data-field="type">Registry Url</th>
+                    <th class="sortable" data-field="username">帐号</th>
+                    <th class="sortable" data-field="password">密码</th>
                     <th>操作</th>
                 </tr>
                 </thead>
                 <tbody>
                 <tr th:each="item:${list}">
                     <td th:text="${item.registryUrl}">仓库类型</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/registry/detail/'+${item.id}}"
-                           data-size="640,480" href="#">详细</a>
-                        <a class="open-popup" data-title="修改用户名/密码" th:attr="data-url=@{'/build/registry/edit/'+${item.id}}"
-                           data-size="640,480" href="#">编辑</a>
                         <a class="ajax-delete" th:attr="data-msg='确定要删除 '+ ${item.registryUrl} + '?'"
                            th:href="@{'/build/registry/' + ${item.id}}">删除</a>
                     </td>