Jelajahi Sumber

构建部署页面中的构建结果根据返回显示不同的颜色

reghao 4 tahun lalu
induk
melakukan
6e1e86452a
1 mengubah file dengan 11 tambahan dan 2 penghapusan
  1. 11 2
      dmaster/src/main/resources/templates/app/bd/build.html

+ 11 - 2
dmaster/src/main/resources/templates/app/bd/build.html

@@ -64,7 +64,7 @@
                     <td><label class="timo-checkbox"><input type="checkbox" th:value="${item.appId}">
                         <i class="layui-icon layui-icon-ok"></i></label></td>
                     <td>
-                        <a class="open-popup" data-title="应用配置详情" data-size="1200,600" href="#"
+                        <a class="open-popup" data-title="应用配置详情" data-size="1200,500" href="#"
                            th:text="${item.appName}" th:attr="data-url=@{'/app/config/app/detail/'+${item.appId}}"></a>
                     </td>
                     <td th:text="${item.appType}">类型</td>
@@ -73,7 +73,7 @@
                     <td th:text="${item.commitId}">当前构建版本</td>
                     <td th:text="${item.commitTime}">提交时间</td>
                     <td>
-                        <a class="open-popup" data-title="构建结果" data-size="1000,600" href="#"
+                        <a class="open-popup build-result" data-title="构建结果" href="#"
                            th:text="${item.buildResult}" th:attr="data-url=@{'/app/log/build/'+${item.buildLogId} + '/result'}"></a>
                     </td>
                     <td th:text="${item.buildTime}">构建时间</td>
@@ -102,6 +102,15 @@
         url = '?env=' + param
         window.location.href = window.location.pathname + url;
     }
+
+    $(".build-result").each(function () {
+        var text = $(this).text().trim()
+        if (text === '成功') {
+            $(this).css("color", "#009688")
+        } else {
+            $(this).css("color", "#ff4500")
+        }
+    })
 </script>
 </body>
 </html>