Compare commits

...

18 Commits

Author SHA1 Message Date
broodroosterdev
0d2ba644ae
Merge 2192bfa42b into 46d90a6a99 2024-09-29 15:06:27 +00:00
Louis Lam
46d90a6a99
1.23.14 changes merge to 2.0.0 (#5138) 2024-09-29 23:06:09 +08:00
Louis Lam
3479992302 Resolve conflict of package-lock.json 2024-09-29 22:13:05 +08:00
Louis Lam
030bb1c0b8 Merge branch 'master' into 1.23.14-to-2.0.0
# Conflicts:
#	package-lock.json
2024-09-29 22:12:25 +08:00
Louis Lam
7da401662f Merge branch '1.23.X' into 1.23.14-to-2.0.0
# Conflicts:
#	package-lock.json
#	package.json
2024-09-29 22:05:23 +08:00
Louis Lam
243726b03c Update to 1.23.14 2024-09-29 21:46:19 +08:00
Louis Lam
936665aac3
[1.23.X] Update dependencies (#5132) 2024-09-28 03:43:54 +08:00
broodroosterdev
2192bfa42b
Merge branch 'master' into hide-uptime-percentage 2024-04-12 15:37:32 +02:00
Bas Wieringa
fb50d5f77c Change to show last heartbeat 2024-04-12 15:32:50 +02:00
broodroosterdev
f381d64fce
Use v-else instead of negative v-if
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2024-04-12 15:12:53 +02:00
broodroosterdev
75f2c69ac5
Merge branch 'master' into hide-uptime-percentage 2024-03-21 21:14:37 +01:00
Bas Wieringa
629b15c56e Add required newline to end of migration file 2024-03-15 17:09:53 +01:00
Bas Wieringa
612581a5d5 Refactor migration to new knex migrations 2024-03-15 17:07:57 +01:00
Bas Wieringa
e539e5aa73 Final linting fix 2024-03-15 16:47:49 +01:00
Bas Wieringa
a34ca83844 Remove spaces to fix lint error 2024-03-15 16:43:20 +01:00
Bas Wieringa
488504c3fd Fix input of the statusOfLastHeartbeat function 2024-03-15 16:18:34 +01:00
Bas Wieringa
26e234c132 Remove import that is no longer used 2024-03-15 16:03:32 +01:00
Bas Wieringa
201ac9245b Add toggle to hide the uptime percentage on a statuspage 2024-03-15 15:54:29 +01:00
8 changed files with 3149 additions and 2332 deletions

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");
});
};

5419
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@
"build-docker-nightly-local": "npm run build && docker build -f docker/dockerfile -t louislam/uptime-kuma:nightly2 --target nightly .", "build-docker-nightly-local": "npm run build && docker build -f docker/dockerfile -t louislam/uptime-kuma:nightly2 --target nightly .",
"build-docker-pr-test": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64 -t louislam/uptime-kuma:pr-test2 --target pr-test2 . --push", "build-docker-pr-test": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64 -t louislam/uptime-kuma:pr-test2 --target pr-test2 . --push",
"upload-artifacts": "docker buildx build -f docker/dockerfile --platform linux/amd64 -t louislam/uptime-kuma:upload-artifact --build-arg VERSION --build-arg GITHUB_TOKEN --target upload-artifact . --progress plain", "upload-artifacts": "docker buildx build -f docker/dockerfile --platform linux/amd64 -t louislam/uptime-kuma:upload-artifact --build-arg VERSION --build-arg GITHUB_TOKEN --target upload-artifact . --progress plain",
"setup": "git checkout 1.23.13 && npm ci --production && npm run download-dist", "setup": "git checkout 1.23.14 && npm ci --production && npm run download-dist",
"download-dist": "node extra/download-dist.js", "download-dist": "node extra/download-dist.js",
"mark-as-nightly": "node extra/mark-as-nightly.js", "mark-as-nightly": "node extra/mark-as-nightly.js",
"reset-password": "node extra/reset-password.js", "reset-password": "node extra/reset-password.js",
@ -72,7 +72,7 @@
"start-server-node14-win": "private\\node14\\node.exe server/server.js" "start-server-node14-win": "private\\node14\\node.exe server/server.js"
}, },
"dependencies": { "dependencies": {
"@grpc/grpc-js": "~1.7.3", "@grpc/grpc-js": "~1.8.22",
"@louislam/ping": "~0.4.4-mod.1", "@louislam/ping": "~0.4.4-mod.1",
"@louislam/sqlite3": "15.1.6", "@louislam/sqlite3": "15.1.6",
"@vvo/tzdb": "^6.125.0", "@vvo/tzdb": "^6.125.0",
@ -91,7 +91,7 @@
"dayjs": "~1.11.5", "dayjs": "~1.11.5",
"dev-null": "^0.1.1", "dev-null": "^0.1.1",
"dotenv": "~16.0.3", "dotenv": "~16.0.3",
"express": "~4.19.2", "express": "~4.21.0",
"express-basic-auth": "~1.2.1", "express-basic-auth": "~1.2.1",
"express-static-gzip": "~2.1.7", "express-static-gzip": "~2.1.7",
"feed": "^4.2.2", "feed": "^4.2.2",
@ -138,8 +138,8 @@
"redbean-node": "~0.3.0", "redbean-node": "~0.3.0",
"redis": "~4.5.1", "redis": "~4.5.1",
"semver": "~7.5.4", "semver": "~7.5.4",
"socket.io": "~4.7.5", "socket.io": "~4.8.0",
"socket.io-client": "~4.7.5", "socket.io-client": "~4.8.0",
"socks-proxy-agent": "6.1.1", "socks-proxy-agent": "6.1.1",
"tar": "~6.2.1", "tar": "~6.2.1",
"tcp-ping": "~0.1.1", "tcp-ping": "~0.1.1",
@ -172,7 +172,7 @@
"cross-env": "~7.0.3", "cross-env": "~7.0.3",
"delay": "^5.0.0", "delay": "^5.0.0",
"dns2": "~2.0.1", "dns2": "~2.0.1",
"dompurify": "~3.0.11", "dompurify": "~3.1.7",
"eslint": "~8.14.0", "eslint": "~8.14.0",
"eslint-plugin-jsdoc": "~46.4.6", "eslint-plugin-jsdoc": "~46.4.6",
"eslint-plugin-vue": "~8.7.1", "eslint-plugin-vue": "~8.7.1",

View File

@ -409,6 +409,7 @@ class StatusPage extends BeanModel {
showPoweredBy: !!this.show_powered_by, showPoweredBy: !!this.show_powered_by,
googleAnalyticsId: this.google_analytics_tag_id, googleAnalyticsId: this.google_analytics_tag_id,
showCertificateExpiry: !!this.show_certificate_expiry, showCertificateExpiry: !!this.show_certificate_expiry,
showLastHeartbeat: !!this.show_last_heartbeat
}; };
} }
@ -432,6 +433,7 @@ class StatusPage extends BeanModel {
showPoweredBy: !!this.show_powered_by, showPoweredBy: !!this.show_powered_by,
googleAnalyticsId: this.google_analytics_tag_id, googleAnalyticsId: this.google_analytics_tag_id,
showCertificateExpiry: !!this.show_certificate_expiry, showCertificateExpiry: !!this.show_certificate_expiry,
showLastHeartbeat: !!this.show_last_heartbeat
}; };
} }

View File

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

View File

@ -38,7 +38,8 @@
<font-awesome-icon v-if="editMode" icon="arrows-alt-v" class="action drag me-3" /> <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)" /> <font-awesome-icon v-if="editMode" icon="times" class="action remove me-3" @click="removeMonitor(group.index, monitor.index)" />
<Uptime :monitor="monitor.element" type="24" :pill="true" /> <Status v-if="showLastHeartbeat" :status="statusOfLastHeartbeat(monitor.element.id)" />
<Uptime v-else :monitor="monitor.element" type="24" :pill="true" />
<a <a
v-if="showLink(monitor)" v-if="showLink(monitor)"
:href="monitor.element.url" :href="monitor.element.url"
@ -91,6 +92,7 @@ import Draggable from "vuedraggable";
import HeartbeatBar from "./HeartbeatBar.vue"; import HeartbeatBar from "./HeartbeatBar.vue";
import Uptime from "./Uptime.vue"; import Uptime from "./Uptime.vue";
import Tag from "./Tag.vue"; import Tag from "./Tag.vue";
import Status from "./Status.vue";
export default { export default {
components: { components: {
@ -99,6 +101,7 @@ export default {
HeartbeatBar, HeartbeatBar,
Uptime, Uptime,
Tag, Tag,
Status,
}, },
props: { props: {
/** Are we in edit mode? */ /** Are we in edit mode? */
@ -113,7 +116,11 @@ export default {
/** Should expiry be shown? */ /** Should expiry be shown? */
showCertificateExpiry: { showCertificateExpiry: {
type: Boolean, type: Boolean,
} },
/** Should only the last heartbeat be shown? */
showLastHeartbeat: {
type: Boolean,
},
}, },
data() { data() {
return { return {
@ -182,6 +189,17 @@ export default {
} }
}, },
/**
* Returns the status of the last heartbeat
* @param {number} monitorId Id of the monitor to get status for
* @returns {number} Status of the last heartbeat
*/
statusOfLastHeartbeat(monitorId) {
let heartbeats = this.$root.heartbeatList[monitorId] ?? [];
let lastHeartbeat = heartbeats[heartbeats.length - 1];
return lastHeartbeat?.status;
},
/** /**
* Returns certificate expiry color based on days remaining * Returns certificate expiry color based on days remaining
* @param {object} monitor Monitor to show expiry for * @param {object} monitor Monitor to show expiry for

View File

@ -879,6 +879,7 @@
"nostrRecipients": "Recipients Public Keys (npub)", "nostrRecipients": "Recipients Public Keys (npub)",
"nostrRecipientsHelp": "npub format, one per line", "nostrRecipientsHelp": "npub format, one per line",
"showCertificateExpiry": "Show Certificate Expiry", "showCertificateExpiry": "Show Certificate Expiry",
"showLastHeartbeat": "Show Last Heartbeat Only",
"noOrBadCertificate": "No/Bad Certificate", "noOrBadCertificate": "No/Bad Certificate",
"cacheBusterParam": "Add the {0} parameter", "cacheBusterParam": "Add the {0} parameter",
"cacheBusterParamDescription": "Randomly generated parameter to skip caches.", "cacheBusterParamDescription": "Randomly generated parameter to skip caches.",

View File

@ -68,6 +68,12 @@
<label class="form-check-label" for="show-certificate-expiry">{{ $t("showCertificateExpiry") }}</label> <label class="form-check-label" for="show-certificate-expiry">{{ $t("showCertificateExpiry") }}</label>
</div> </div>
<!-- Show last heartbeat -->
<div class="my-3 form-check form-switch">
<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"> <div v-if="false" class="my-3">
<label for="password" class="form-label">{{ $t("Password") }} <sup>{{ $t("Coming Soon") }}</sup></label> <label for="password" class="form-label">{{ $t("Password") }} <sup>{{ $t("Coming Soon") }}</sup></label>
<input id="password" v-model="config.password" disabled type="password" autocomplete="new-password" class="form-control"> <input id="password" v-model="config.password" disabled type="password" autocomplete="new-password" class="form-control">
@ -328,7 +334,7 @@
👀 {{ $t("statusPageNothing") }} 👀 {{ $t("statusPageNothing") }}
</div> </div>
<PublicGroupList :edit-mode="enableEditMode" :show-tags="config.showTags" :show-certificate-expiry="config.showCertificateExpiry" /> <PublicGroupList :edit-mode="enableEditMode" :show-tags="config.showTags" :show-certificate-expiry="config.showCertificateExpiry" :show-last-heartbeat="config.showLastHeartbeat" />
</div> </div>
<footer class="mt-5 mb-4"> <footer class="mt-5 mb-4">