Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:

env:
BUN_VERSION: "1.4.0"
BUN_VERSION: "1.4.1"

jobs:
verify:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
contents: write

env:
BUN_VERSION: "1.4.0"
BUN_VERSION: "1.4.1"

jobs:
build:
Expand Down
6 changes: 3 additions & 3 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "https://github.com/Igloczek/uptime-maku.git"
},
"engines": {
"bun": ">= 1.4.0"
"bun": ">= 1.4.1"
},
"scripts": {
"dev": "bun run --parallel dev:frontend dev:server",
Expand Down Expand Up @@ -96,7 +96,7 @@
"@testcontainers/postgresql": "^11.12.0",
"@testcontainers/rabbitmq": "^10.28.0",
"@types/bootstrap": "~5.1.13",
"@types/bun": "^1.3.14",
"@types/bun": "^1.4.0",
"@types/node": "^20.19.33",
"@types/web-push": "^3.6.4",
"@vitejs/plugin-vue": "~5.0.5",
Expand Down
12 changes: 5 additions & 7 deletions scripts/build/generate-kuma-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from "node:fs";
import path from "node:path";
import { Database as BunDatabase } from "bun:sqlite";
import { applySqlFile } from "@/db/schema/sql-utils";
import { SCHEMA_VERSION_KEY } from "@/server/db-migrations";
import { LATEST_SCHEMA_VERSION, SCHEMA_VERSION_KEY } from "@/server/db-migrations";

const projectRoot = path.resolve(import.meta.dirname, "../..");
const schemaPath = path.join(projectRoot, "src/db/schema/current.sql");
Expand All @@ -23,17 +23,15 @@ function main() {

const result = db
.query('INSERT INTO setting ("key", value) VALUES (?, ?)')
.run(SCHEMA_VERSION_KEY, "1");
.run(SCHEMA_VERSION_KEY, String(LATEST_SCHEMA_VERSION));

if (!result || Number(result.changes) !== 1) {
throw new Error(`Failed to seed ${SCHEMA_VERSION_KEY} into generated out/kuma.db`);
}

const seeded = db
.query('SELECT value FROM setting WHERE "key" = ?')
.get(SCHEMA_VERSION_KEY)?.value;
if (seeded !== "1") {
throw new Error(`Expected ${SCHEMA_VERSION_KEY}=1 after generation, got ${seeded}`);
const seeded = db.query('SELECT value FROM setting WHERE "key" = ?').get(SCHEMA_VERSION_KEY)?.value;
if (seeded !== String(LATEST_SCHEMA_VERSION)) {
throw new Error(`Expected ${SCHEMA_VERSION_KEY}=${LATEST_SCHEMA_VERSION} after generation, got ${seeded}`);
}
} finally {
db.close();
Expand Down
22 changes: 22 additions & 0 deletions src/components/NotificationDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,26 @@
</template>
</Suspense>

<div class="mb-3 mt-4">
<label for="notification-resend-interval" class="form-label">
{{ $t("Resend notification while down") }}
<span v-if="notification.resendInterval > 0">
({{ $t("resendEveryXMinutes", [notification.resendInterval]) }})
</span>
<span v-else>({{ $t("resendDisabled") }})</span>
</label>
<input
id="notification-resend-interval"
v-model="notification.resendInterval"
type="number"
class="form-control"
required
min="0"
step="1"
/>
<div class="form-text">{{ $t("resendIntervalDescription") }}</div>
</div>

<div class="mb-3 mt-4">
<hr class="dropdown-divider mb-4" />

Expand Down Expand Up @@ -214,6 +234,7 @@ export default {
for (let n of this.appStore.notificationList) {
if (n.id === notificationID) {
this.notification = JSON.parse(n.config);
this.notification.resendInterval ??= 0;

// applyExisting is one time only, but it got saved to database previously. Workaround fix, set it to false here to deal with the problem.
this.notification.applyExisting = false;
Expand All @@ -227,6 +248,7 @@ export default {
name: "",
type: "telegram",
isDefault: false,
resendInterval: 0,
};
}

Expand Down
16 changes: 0 additions & 16 deletions src/components/edit-monitor/EditMonitorHeartbeatSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,6 @@
{{ $t("pingGlobalTimeoutDescription") }}
</div>
</div>
<div class="my-3">
<label for="resend-interval" class="form-label">
{{ $t("Resend Notification if Down X times consecutively") }}
<span v-if="monitor.resendInterval > 0">({{ $t("resendEveryXTimes", [monitor.resendInterval]) }})</span>
<span v-else>({{ $t("resendDisabled") }})</span>
</label>
<input
id="resend-interval"
v-model="monitor.resendInterval"
type="number"
class="form-control"
required
min="0"
step="1"
/>
</div>
</template>

<script>
Expand Down
52 changes: 24 additions & 28 deletions src/components/edit-monitor/EditMonitorNotifications.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
<template>
<h2 class="mb-2">{{ $t("Notifications") }}</h2>
<p v-if="$root.notificationList.length === 0">
{{ $t("Not available, please setup.") }}
</p>
<div
v-for="notification in $root.notificationList"
:key="notification.id"
class="form-check form-switch my-3"
>
<input
:id="'notification' + notification.id"
v-model="monitor.notificationIDList[notification.id]"
class="form-check-input"
type="checkbox"
/>
<label class="form-check-label" :for="'notification' + notification.id">
{{ notification.name }}
<a href="#" @click.prevent="$emit('edit-notification', notification.id)">
{{ $t("Edit") }}
</a>
</label>
<span v-if="notification.isDefault == true" class="badge bg-primary ms-2">
{{ $t("Default") }}
</span>
</div>
<button class="btn btn-primary me-2" type="button" @click="$emit('setup-notification')">
{{ $t("Setup Notification") }}
</button>
<h2 class="mb-2">{{ $t("Notifications") }}</h2>
<p v-if="$root.notificationList.length === 0">
{{ $t("Not available, please setup.") }}
</p>
<div v-for="notification in $root.notificationList" :key="notification.id" class="form-check form-switch my-3">
<input
:id="'notification' + notification.id"
v-model="monitor.notificationIDList[notification.id]"
class="form-check-input"
type="checkbox"
/>
<label class="form-check-label" :for="'notification' + notification.id">
{{ notification.name }}
<a href="#" @click.prevent="$emit('edit-notification', notification.id)">
{{ $t("Edit") }}
</a>
</label>
<span v-if="notification.isDefault == true" class="badge bg-primary ms-2">
{{ $t("Default") }}
</span>
</div>
<button class="btn btn-primary me-2" type="button" @click="$emit('setup-notification')">
{{ $t("Setup Notification") }}
</button>
</template>

<script>
Expand Down
5 changes: 2 additions & 3 deletions src/db/schema/column-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { expectedTableColumns } from "@/db/schema/expected-schema";

const monitorColumnTypes = {
accepted_statuscodes_json: 'TEXT NOT NULL DEFAULT \'["200-299"]\'',
accepted_statuscodes_json: "TEXT NOT NULL DEFAULT '[\"200-299\"]'",
auth_domain: "TEXT",
auth_method: "TEXT",
auth_workstation: "TEXT",
Expand Down Expand Up @@ -79,7 +79,6 @@ const monitorColumnTypes = {
radius_secret: "TEXT",
radius_username: "TEXT",
remote_browser: "INTEGER",
resend_interval: "INTEGER NOT NULL DEFAULT 0",
response_max_length: "INTEGER NOT NULL DEFAULT 1024",
retry_interval: "INTEGER NOT NULL DEFAULT 0",
retry_only_on_status_code_failure: "BOOLEAN NOT NULL DEFAULT 0",
Expand Down Expand Up @@ -238,4 +237,4 @@ export function filterStoreRow(table, row) {
filtered[key] = value;
}
return filtered;
}
}
Loading
Loading