]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Cleanup cluster and audit log
authorSebastian Krah <skrah@suse.com>
Tue, 29 Jan 2019 13:38:31 +0000 (14:38 +0100)
committerSebastian Krah <skrah@suse.com>
Tue, 29 Jan 2019 14:49:53 +0000 (15:49 +0100)
Applies the following changes:
- Makes the timestamp bold and not the message
- Colors the priority according to its level
- Indents the message correct if it's longer than one line
- Displays a message when the log is empty

Fixes: https://tracker.ceph.com/issues/37916
Signed-off-by: Sebastian Krah <skrah@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.scss
src/pybind/mgr/dashboard/frontend/src/locale/messages.xlf

index e3ed20b5807f8061be6fe014e0b3e5dc22d5edf6..d14dbf0be6bec35f23197fef2eb343f178fa39d6 100644 (file)
@@ -1,34 +1,34 @@
-<div *ngIf="contentData"> 
+<div *ngIf="contentData">
 <tabset>
   <tab i18n-heading
        heading="Cluster Logs">
   <div class="well">
-  <div *ngIf="contentData.clog">
-  <p *ngFor="let line of contentData.clog">
-    {{ line.stamp }}&nbsp;{{ line.priority }}&nbsp;
-    <span [ngStyle]="line">
-    {{ line.message }}
-    <br>
-    </span>
-    </p>
-  </div>
+    <div *ngIf="contentData.clog">
+      <p *ngFor="let line of contentData.clog">
+        <span class="timestamp">{{ line.stamp }}</span>
+        <span class="priority {{ line.priority | logPriority }}">{{ line.priority }}</span>
+        <span class="message">{{ line.message }}</span>
+      </p>
+    </div>
+    <div *ngIf="contentData.clog.length === 0">
+      <p i18n>No entries found</p>
+    </div>
   </div>
   </tab>
 
   <tab i18n-heading
        heading="Audit Logs">
   <div class="well">
-  <div *ngIf="contentData.audit_log">
-    <p *ngFor="let line of contentData.audit_log">
-    {{ line.stamp }}&nbsp;{{ line.priority }}&nbsp;
-    <span [ngStyle]="line">
-    <span style="font-weight: bold;">
-    {{ line.message }}
-    </span>
-    <br>
-    </span>
-    </p>
-  </div>
+    <div *ngIf="contentData.audit_log">
+      <p *ngFor="let line of contentData.audit_log">
+        <span class="timestamp">{{ line.stamp }}</span>
+        <span class="priority {{ line.priority | logPriority }}">{{ line.priority }}</span>
+        <span class="message">{{ line.message }}</span>
+      </p>
+    </div>
+    <div *ngIf="contentData.audit_log.length === 0">
+      <p i18n>No entries found</p>
+    </div>
   </div>
   </tab>
 </tabset>
index 9d435e65d405fa68f79f094f4eaa9425e6370bb5..b084aada8ccc13a2f0e3e9676b2e4bb023d732b3 100644 (file)
@@ -1,4 +1,41 @@
+@import '../../../../defaults';
+
 p {
   font-family: monospace;
   color: black;
 }
+
+.well {
+  div p {
+    display: flex;
+
+    &:last-child {
+      margin-bottom: 0;
+    }
+  }
+
+  .timestamp {
+    font-weight: bold;
+    flex-shrink: 0;
+  }
+
+  .priority {
+    margin-left: 0.5rem;
+  }
+
+  .message {
+    margin-left: 1rem;
+  }
+
+  .err {
+    color: $color-pink;
+  }
+
+  .warn {
+    color: $color-bright-yellow;
+  }
+
+  .info {
+    color: $color-brand-teal;
+  }
+}
index d7a8c9179d4975d1014a9af71b1da5b6fe4306a9..76711612b5d67623aadcacb4964174b6fdd77343 100644 (file)
           <context context-type="sourcefile">app/ceph/cluster/hosts/hosts.component.html</context>
           <context context-type="linenumber">3</context>
         </context-group>
+      </trans-unit><trans-unit id="e6d57f36aa2bad303c8a8ee944b9bd7fae3c8c26" datatype="html">
+        <source>No entries found</source>
+        <context-group purpose="location">
+          <context context-type="sourcefile">app/ceph/cluster/logs/logs.component.html</context>
+          <context context-type="linenumber">14</context>
+        </context-group>
+        <context-group purpose="location">
+          <context context-type="sourcefile">app/ceph/cluster/logs/logs.component.html</context>
+          <context context-type="linenumber">30</context>
+        </context-group>
       </trans-unit><trans-unit id="d556ab48a65722b400e497f61737f553ee0f89e2" datatype="html">
         <source>Cluster Logs</source>
         <context-group purpose="location">
         <source>Audit Logs</source>
         <context-group purpose="location">
           <context context-type="sourcefile">app/ceph/cluster/logs/logs.component.html</context>
-          <context context-type="linenumber">19</context>
+          <context context-type="linenumber">20</context>
         </context-group>
       </trans-unit><trans-unit id="81b97b8ea996ad1e4f9fca8415021850214884b1" datatype="html">
         <source>Status</source>