Skip to content

Commit

Permalink
timeline and gui improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
matjaz99 committed Jul 2, 2023
1 parent 81b2000 commit ae167e1
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 26 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
## 2.4.5-SNAPSHOT

* [CHANGE] Moved all configuration parameters from configuration view to providers
* [FEATURE] Journal Timeline
* [FEATURE] Journal Timeline in instance view
* [ENHANCEMENT] Added link to active alerts directly from providers
* [ENHANCEMENT] Show targets count in targets view
* [ENHANCEMENT] Added POJO support in MongoDB client
* [ENHANCEMENT] Added configuration option for `ALERTMONITOR_MONGODB_CONNECT_TIMEOUT_SEC` and `ALERTMONITOR_MONGODB_READ_TIMEOUT_SEC`
* [ENHANCEMENT] Added `provider` attribute to alerts
* [ENHANCEMENT] Added provider file path to config view

## 2.4.4-SNAPSHOT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public List<DEvent> getJournal() {

List<DEvent> docsResultList = collection.find()
.sort(Sorts.descending("timestamp"))
.limit(1000)
.limit(5000)
.into(new ArrayList<>());

logger.info("MongoDbDataManager: docsResultList size=" + docsResultList.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ public String getRuntimeId() {
return AmProps.RUNTIME_ID;
}

public String getProvidersFilePath() {
return AmProps.ALERTMONITOR_DATAPROVIDERS_CONFIG_FILE;
}




Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public String getUpStatusTooltip() {
.endDate(end)
.editable(true)
.group(e.getAlertname())
.styleClass("sdfg".toLowerCase())
.styleClass(e.getSeverity().toLowerCase())
.build();

model.add(event);
Expand Down
2 changes: 2 additions & 0 deletions src/main/webapp/WEB-INF/taglib/target.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<h:link value="#{target.hostname}" outcome="/targets/instance">
<f:param name="target" value="#{target.id}" />
</h:link>
<h:outputText value="UP" rendered="#{target.up}" style="margin-left: 20px; color: green; font-weight: bold" />
<h:outputText value="DOWN" rendered="#{!target.up}" style="margin-left: 20px; color: red; font-weight: bold" />
</span>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/main/webapp/config/config.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
<f:selectItem itemLabel="TRACE" itemValue="TRACE"/>
</p:selectOneMenu>

<p:outputLabel value="Providers file path: " class="boldtext"/>
<p:outputLabel value="#{uiConfigBean.providersFilePath}" />

<p:outputLabel value="Data retention (days): " class="boldtext">
<i class="pi pi-pencil" style="font-size: 0.5 rem"></i>
</p:outputLabel>
Expand Down
9 changes: 6 additions & 3 deletions src/main/webapp/resources/css/am_styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ body .ui-datatable .ui-datatable-data tr td {
border-radius: 4px;
margin-bottom: 1.1rem;
}
/* override .card style */
.target-true {
/* override .card style in targets. add to <div class="card target-#{target.up}"> */
/*.target-true {
background: #89FF61 !important;
border: 1px solid #2C7B00 !important;
box-shadow: 0 2px 1px -1px rgba(0, 255, 0, 0.2), 0 1px 1px 0 rgba(0, 255, 0, 0.14), 0 1px 3px 0 rgba(0, 255, 0, 0.12) !important;
Expand All @@ -130,4 +130,7 @@ body .ui-datatable .ui-datatable-data tr td {
background: #FF7474 !important;
border: 1px solid #750000 !important;
box-shadow: 0 2px 1px -1px rgba(255, 0, 0, 0.2), 0 1px 1px 0 rgba(255, 0, 0, 0.14), 0 1px 3px 0 rgba(255, 0, 0, 0.12) !important;
}
}*/



34 changes: 14 additions & 20 deletions src/main/webapp/targets/instance.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<h:form>
<p:accordionPanel dynamic="true" cache="true">
<p:tab title="Active alerts">
<p:tab title="Active alerts (#{uiInstanceBean.instanceActiveAlarms.size()})">
<p:dataTable id="tAlertsTable" widgetVar="notifsTable"
value="#{uiInstanceBean.instanceActiveAlarms}" var="a"
rowStyleClass="#{a.severity}"
Expand Down Expand Up @@ -112,27 +112,21 @@

</p:dataTable>
</p:tab>
<p:tab title="Timeline">
<div class="card">
<p:timeline id="timeline" value="#{uiInstanceBean.model}"
editable="false" eventMargin="10" eventMarginAxis="0"
start="#{uiInstanceBean.start}" end="#{uiInstanceBean.end}"
stackEvents="false" widgetVar="timelineWdgt">
<f:facet name="menu">
<p:commandButton type="button" icon="pi pi-chevron-left" styleClass="ml-2" onclick="PF('timelineWdgt').move(-0.3);" />
<p:commandButton type="button" icon="pi pi-chevron-right" styleClass="ml-2" onclick="PF('timelineWdgt').move(0.3);" />
<p:commandButton type="button" icon="pi pi-search-minus" styleClass="ml-2" onclick="PF('timelineWdgt').zoom(-0.5);" />
<p:commandButton type="button" icon="pi pi-search-plus" styleClass="ml-2" onclick="PF('timelineWdgt').zoom(0.5);" />
</f:facet>

<f:facet name="loading">
<h2>Loading timeline...</h2>
</f:facet>
</p:timeline>
</div>
</p:tab>
</p:accordionPanel>

<br/>

<div class="card">
<p:timeline id="timeline" value="#{uiInstanceBean.model}"
editable="false" eventMargin="10" eventMarginAxis="0"
start="#{uiInstanceBean.start}" end="#{uiInstanceBean.end}"
stackEvents="false" widgetVar="timelineWdgt">

<f:facet name="loading">
<h2>Loading timeline...</h2>
</f:facet>
</p:timeline>
</div>

</h:form>

Expand Down
2 changes: 2 additions & 0 deletions src/main/webapp/targets/targets.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<p:ajax listener="#{uiBean.getTargets}" update="targetsForm"/>
</p:toggleSwitch>
<br/>
<p:outputLabel value="Size: #{uiBean.targets.size()}"/>
<br/>
<p:tag id="resultStatus" styleClass="p-mr-2" severity="danger" value="#{uiBean.result}" rendered="#{uiBean.result != null}"></p:tag>

<p:dataView var="target"
Expand Down

0 comments on commit ae167e1

Please sign in to comment.