Skip to content

Commit

Permalink
Alerts showing different time than time plugin #2214
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolargo committed Nov 11, 2023
1 parent dbbdc34 commit 36ed96b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions glances/outputs/static/js/components/plugin-alert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<div class="table-row" v-for="(alert, alertId) in alerts" :key="alertId">
<div class="table-cell text-left">
{{ formatDate(alert.begin) }}
{{ alert.tz }}
({{ alert.ongoing ? 'ongoing' : alert.duration }}) -
<span v-show="!alert.ongoing"> {{ alert.level }} on </span>
<span :class="alert.level.toLowerCase()">
Expand Down Expand Up @@ -41,10 +42,11 @@ export default {
alerts() {
return (this.stats || []).map((alertalertStats) => {
const alert = {};
var tzoffset = new Date().getTimezoneOffset();
alert.name = alertalertStats[3];
alert.level = alertalertStats[2];
alert.begin = alertalertStats[0] * 1000;
alert.end = alertalertStats[1] * 1000;
alert.begin = alertalertStats[0] * 1000 - tzoffset * 60 * 1000;
alert.end = alertalertStats[1] * 1000 - tzoffset * 60 * 1000;
alert.ongoing = alertalertStats[1] == -1;
alert.min = alertalertStats[6];
alert.mean = alertalertStats[5];
Expand Down
2 changes: 1 addition & 1 deletion glances/outputs/static/public/glances.js

Large diffs are not rendered by default.

0 comments on commit 36ed96b

Please sign in to comment.