Change to show last heartbeat

This commit is contained in:
Bas Wieringa 2024-04-12 15:32:50 +02:00
parent f381d64fce
commit fb50d5f77c
7 changed files with 27 additions and 27 deletions

View file

@ -1,16 +0,0 @@
exports.up = function (knex) {
// Add new column status_page.hide_uptime_percentage
return knex.schema
.alterTable("status_page", function (table) {
table.boolean("hide_uptime_percentage").notNullable().defaultTo(false);
});
};
exports.down = function (knex) {
// Drop column status_page.hide_uptime_percentage
return knex.schema
.alterTable("status_page", function (table) {
table.dropColumn("hide_uptime_percentage");
});
};

View file

@ -0,0 +1,16 @@
exports.up = function (knex) {
// Add new column status_page.show_last_heartbeat
return knex.schema
.alterTable("status_page", function (table) {
table.boolean("show_last_heartbeat").notNullable().defaultTo(false);
});
};
exports.down = function (knex) {
// Drop column status_page.show_last_heartbeat
return knex.schema
.alterTable("status_page", function (table) {
table.dropColumn("show_last_heartbeat");
});
};

View file

@ -246,7 +246,7 @@ class StatusPage extends BeanModel {
showPoweredBy: !!this.show_powered_by,
googleAnalyticsId: this.google_analytics_tag_id,
showCertificateExpiry: !!this.show_certificate_expiry,
hideUptimePercentage: !!this.hide_uptime_percentage
showLastHeartbeat: !!this.show_last_heartbeat
};
}
@ -269,7 +269,7 @@ class StatusPage extends BeanModel {
showPoweredBy: !!this.show_powered_by,
googleAnalyticsId: this.google_analytics_tag_id,
showCertificateExpiry: !!this.show_certificate_expiry,
hideUptimePercentage: !!this.hide_uptime_percentage
showLastHeartbeat: !!this.show_last_heartbeat
};
}

View file

@ -163,7 +163,7 @@ module.exports.statusPageSocketHandler = (socket) => {
statusPage.footer_text = config.footerText;
statusPage.custom_css = config.customCSS;
statusPage.show_powered_by = config.showPoweredBy;
statusPage.hide_uptime_percentage = config.hideUptimePercentage;
statusPage.show_last_heartbeat = config.showLastHeartbeat;
statusPage.show_certificate_expiry = config.showCertificateExpiry;
statusPage.modified_date = R.isoDateTime();
statusPage.google_analytics_tag_id = config.googleAnalyticsId;

View file

@ -38,7 +38,7 @@
<font-awesome-icon v-if="editMode" icon="arrows-alt-v" class="action drag me-3" />
<font-awesome-icon v-if="editMode" icon="times" class="action remove me-3" @click="removeMonitor(group.index, monitor.index)" />
<Status v-if="hideUptimePercentage" :status="statusOfLastHeartbeat(monitor.element.id)" />
<Status v-if="showLastHeartbeat" :status="statusOfLastHeartbeat(monitor.element.id)" />
<Uptime v-else :monitor="monitor.element" type="24" :pill="true" />
<a
v-if="showLink(monitor)"
@ -116,8 +116,8 @@ export default {
showCertificateExpiry: {
type: Boolean,
},
/** Should uptime be hidden? */
hideUptimePercentage: {
/** Should only the last heartbeat be shown? */
showLastHeartbeat: {
type: Boolean,
},
},

View file

@ -853,7 +853,7 @@
"nostrRecipients": "Recipients Public Keys (npub)",
"nostrRecipientsHelp": "npub format, one per line",
"showCertificateExpiry": "Show Certificate Expiry",
"hideUptimePercentage": "Hide Uptime Percentage",
"showLastHeartbeat": "Show Last Heartbeat Only",
"noOrBadCertificate": "No/Bad Certificate",
"gamedigGuessPort": "Gamedig: Guess Port",
"gamedigGuessPortDescription": "The port used by Valve Server Query Protocol may be different from the client port. Try this if the monitor cannot connect to your server.",

View file

@ -60,10 +60,10 @@
<label class="form-check-label" for="show-certificate-expiry">{{ $t("showCertificateExpiry") }}</label>
</div>
<!-- Hide uptime percentage -->
<!-- Show last heartbeat -->
<div class="my-3 form-check form-switch">
<input id="hide-uptime-percentage" v-model="config.hideUptimePercentage" class="form-check-input" type="checkbox">
<label class="form-check-label" for="hide-uptime-percentage">{{ $t("hideUptimePercentage") }}</label>
<input id="show-last-heartbeat" v-model="config.showLastHeartbeat" class="form-check-input" type="checkbox">
<label class="form-check-label" for="show-last-heartbeat">{{ $t("showLastHeartbeat") }}</label>
</div>
<div v-if="false" class="my-3">
@ -325,7 +325,7 @@
👀 {{ $t("statusPageNothing") }}
</div>
<PublicGroupList :edit-mode="enableEditMode" :show-tags="config.showTags" :show-certificate-expiry="config.showCertificateExpiry" :hide-uptime-percentage="config.hideUptimePercentage" />
<PublicGroupList :edit-mode="enableEditMode" :show-tags="config.showTags" :show-certificate-expiry="config.showCertificateExpiry" :show-last-heartbeat="config.showLastHeartbeat" />
</div>
<footer class="mt-5 mb-4">