Переглянути джерело

admin dashboard node status updates

jrivard@gmail.com 6 роки тому
батько
коміт
b750c4677e

+ 8 - 0
server/src/main/java/password/pwm/http/servlet/admin/AppDashboardData.java

@@ -113,6 +113,7 @@ public class AppDashboardData implements Serializable
     private Map<LocalDB.DB, String> localDbSizes;
     private Map<LocalDB.DB, String> localDbSizes;
     private List<NodeData> nodeData;
     private List<NodeData> nodeData;
     private String nodeSummary;
     private String nodeSummary;
+    private DataStorageMethod nodeStorageMethod;
     private int ldapConnectionCount;
     private int ldapConnectionCount;
     private int sessionCount;
     private int sessionCount;
     private int requestsInProgress;
     private int requestsInProgress;
@@ -155,6 +156,13 @@ public class AppDashboardData implements Serializable
         builder.nodeSummary = pwmApplication.getClusterService().isMaster()
         builder.nodeSummary = pwmApplication.getClusterService().isMaster()
                 ? "This node is the current master"
                 ? "This node is the current master"
                 : "This node is not the current master";
                 : "This node is not the current master";
+        {
+            final Collection<DataStorageMethod> dataStorageMethods = pwmApplication.getClusterService().serviceInfo().getUsedStorageMethods();
+            if ( !JavaHelper.isEmpty( dataStorageMethods ) )
+            {
+                builder.nodeStorageMethod = dataStorageMethods.iterator().next();
+            }
+        }
 
 
         builder.ldapConnectionCount( ldapConnectionCount( pwmApplication ) );
         builder.ldapConnectionCount( ldapConnectionCount( pwmApplication ) );
         builder.sessionCount( pwmApplication.getSessionTrackService().sessionCount() );
         builder.sessionCount( pwmApplication.getSessionTrackService().sessionCount() );

+ 9 - 2
webapp/src/main/webapp/WEB-INF/jsp/admin-dashboard.jsp

@@ -401,10 +401,10 @@
                 <% } %>
                 <% } %>
             </div>
             </div>
 
 
-            <% if (!JavaHelper.isEmpty(appDashboardData.getNodeData())) { %>
             <input name="tabs" type="radio" id="tab-7" class="input"/>
             <input name="tabs" type="radio" id="tab-7" class="input"/>
             <label for="tab-7" class="label">Nodes</label>
             <label for="tab-7" class="label">Nodes</label>
             <div id="Status" class="tab-content-pane" title="Nodes">
             <div id="Status" class="tab-content-pane" title="Nodes">
+                <% if (!JavaHelper.isEmpty(appDashboardData.getNodeData())) { %>
                 <div style="max-height: 400px; overflow: auto;">
                 <div style="max-height: 400px; overflow: auto;">
                     <table class="nomargin">
                     <table class="nomargin">
                         <tr>
                         <tr>
@@ -450,9 +450,16 @@
                     <div class="footnote">
                     <div class="footnote">
                         <%=appDashboardData.getNodeSummary()%>
                         <%=appDashboardData.getNodeSummary()%>
                     </div>
                     </div>
+                    <% if ( appDashboardData.getNodeStorageMethod() != null ) { %>
+                    <p><div class="footnote">
+                    Node communication method: <%= appDashboardData.getNodeStorageMethod() %>
+                    </div></p>
+                    <% } %>
                 </div>
                 </div>
+                <% } else { %>
+                <div class="footnote">Node data is not yet available.</div>
+                <% } %>
             </div>
             </div>
-            <% } %>
 
 
             <pwm:if test="<%=PwmIfTest.booleanSetting%>" setting="<%=PwmSetting.PW_EXPY_NOTIFY_ENABLE%>">
             <pwm:if test="<%=PwmIfTest.booleanSetting%>" setting="<%=PwmSetting.PW_EXPY_NOTIFY_ENABLE%>">
             <input name="tabs" type="radio" id="tab-8" class="input"/>
             <input name="tabs" type="radio" id="tab-8" class="input"/>