Compare commits

...

20 Commits

Author SHA1 Message Date
Mohammad Jibin
0c44249599
Merge be83595a19 into 46d90a6a99 2024-09-29 15:06:26 +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
Frank Elsinga
be83595a19
Merge branch 'master' into feature/time-format 2024-05-20 00:18:21 +02:00
Substancia
15d7f5d348 load once and cache 2023-10-09 15:01:00 +05:30
Substancia
1db6722670 Merge branch 'feature/time-format' of github.com-substancia:Substancia/uptime-kuma into feature/time-format 2023-10-08 13:37:02 +05:30
Mohammad Jibin
556d98754d
Merge branch 'louislam:master' into feature/time-format 2023-10-08 13:36:16 +05:30
Substancia
449f68e20b fix PR tasks 2023-10-08 13:35:32 +05:30
Mohammad Jibin
be31cbe842
Merge branch 'master' into feature/time-format 2023-10-04 01:22:24 +05:30
Substancia
0fbf2f375f fix PR comments 2023-10-03 03:50:04 +05:30
Substancia
5e9d562712 cleanup 2023-10-03 02:40:22 +05:30
Substancia
7a4918d493 move time format change to settings 2023-10-03 02:22:16 +05:30
Mohammad Jibin
06a9e47f62
Merge branch 'louislam:master' into feature/time-format 2023-10-02 23:31:14 +05:30
Substancia
e1d47c56a5 fix lint 2023-10-02 19:34:58 +05:30
Substancia
dbaf84fe39 feat: add support for 12-hour time format 2023-10-02 19:27:49 +05:30
Substancia
e897a96c17 [empty commit] pull request for Substancia 2023-10-02 19:26:47 +05:30
10 changed files with 3203 additions and 2338 deletions

5421
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-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",
"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",
"mark-as-nightly": "node extra/mark-as-nightly.js",
"reset-password": "node extra/reset-password.js",
@ -72,7 +72,7 @@
"start-server-node14-win": "private\\node14\\node.exe server/server.js"
},
"dependencies": {
"@grpc/grpc-js": "~1.7.3",
"@grpc/grpc-js": "~1.8.22",
"@louislam/ping": "~0.4.4-mod.1",
"@louislam/sqlite3": "15.1.6",
"@vvo/tzdb": "^6.125.0",
@ -91,7 +91,7 @@
"dayjs": "~1.11.5",
"dev-null": "^0.1.1",
"dotenv": "~16.0.3",
"express": "~4.19.2",
"express": "~4.21.0",
"express-basic-auth": "~1.2.1",
"express-static-gzip": "~2.1.7",
"feed": "^4.2.2",
@ -138,8 +138,8 @@
"redbean-node": "~0.3.0",
"redis": "~4.5.1",
"semver": "~7.5.4",
"socket.io": "~4.7.5",
"socket.io-client": "~4.7.5",
"socket.io": "~4.8.0",
"socket.io-client": "~4.8.0",
"socks-proxy-agent": "6.1.1",
"tar": "~6.2.1",
"tcp-ping": "~0.1.1",
@ -172,7 +172,7 @@
"cross-env": "~7.0.3",
"delay": "^5.0.0",
"dns2": "~2.0.1",
"dompurify": "~3.0.11",
"dompurify": "~3.1.7",
"eslint": "~8.14.0",
"eslint-plugin-jsdoc": "~46.4.6",
"eslint-plugin-vue": "~8.7.1",

View File

@ -15,6 +15,10 @@ export default {
type: Boolean,
default: false,
},
use12HourTimeFormat: {
type: Boolean,
default: false
},
},
computed: {
@ -22,7 +26,7 @@ export default {
if (this.dateOnly) {
return this.$root.date(this.value);
} else {
return this.$root.datetime(this.value);
return this.$root.datetime(this.value, this.use12HourTimeFormat);
}
},
},

View File

@ -40,6 +40,10 @@ export default {
type: Number,
required: true,
},
use12HourTimeFormat: {
type: Boolean,
default: false
}
},
data() {
return {
@ -64,6 +68,13 @@ export default {
},
computed: {
chartOptions() {
const hourTimeFormat = this.use12HourTimeFormat ? "hh" : "HH";
const minuteTimeFormat = `${hourTimeFormat}:mm${
this.use12HourTimeFormat ? " A" : ""
}`;
const tooltipFormat = `YYYY-MM-DD ${hourTimeFormat}:mm:ss${
this.use12HourTimeFormat ? " A" : ""
}`;
return {
responsive: true,
maintainAspectRatio: false,
@ -101,10 +112,10 @@ export default {
time: {
minUnit: "minute",
round: "second",
tooltipFormat: "YYYY-MM-DD HH:mm:ss",
tooltipFormat,
displayFormats: {
minute: "HH:mm",
hour: "MM-DD HH:mm",
minute: minuteTimeFormat,
hour: `MM-DD ${minuteTimeFormat}`,
}
},
ticks: {

View File

@ -37,6 +37,42 @@
</select>
</div>
<!-- Time Format -->
<div class="mb-4">
<label class="form-label">
{{ $t("Time Format") }}
</label>
<div class="form-check">
<input
id="timeFormatIndex12Hour"
v-model="settings.use12HourTimeFormat"
class="form-check-input"
type="radio"
name="timeFormatIndex"
:value="true"
required
/>
<label class="form-check-label" for="timeFormatIndex12Hour">
{{ $t("12-hour") }}
</label>
</div>
<div class="form-check">
<input
id="timeFormatIndex24Hour"
v-model="settings.use12HourTimeFormat"
class="form-check-input"
type="radio"
name="timeFormatIndex"
:value="false"
required
/>
<label class="form-check-label" for="timeFormatIndex24Hour">
{{ $t("24-hour") }}
</label>
</div>
</div>
<!-- Search Engine -->
<div class="mb-4">
<label class="form-label">
@ -259,6 +295,7 @@ export default {
*/
saveGeneral() {
localStorage.timezone = this.$root.userTimezone;
this.$root.use12HourTimeFormat = this.settings.use12HourTimeFormat;
this.saveSettings();
},
/**

View File

@ -905,6 +905,9 @@
"successEnabled": "Enabled Successfully.",
"tagNotFound": "Tag not found.",
"foundChromiumVersion": "Found Chromium/Chrome. Version: {0}",
"Time Format": "Time Format",
"12-hour": "12 Hour",
"24-hour": "24 Hour",
"Remote Browsers": "Remote Browsers",
"Remote Browser": "Remote Browser",
"Add a Remote Browser": "Add a Remote Browser",

View File

@ -35,10 +35,16 @@ export default {
/**
* Return a given value in the format YYYY-MM-DD HH:mm:ss
* @param {any} value Value to format as date time
* @param {boolean} use12HourTimeFormat Whether to use 12-hour format
* @returns {string} Formatted string
*/
datetime(value) {
return this.datetimeFormat(value, "YYYY-MM-DD HH:mm:ss");
datetime(value, use12HourTimeFormat = false) {
const hourTimeFormat = use12HourTimeFormat ? "hh" : "HH";
const timeFormat =
`YYYY-MM-DD ${hourTimeFormat}:mm:ss${
use12HourTimeFormat ? " A" : ""
}`;
return this.datetimeFormat(value, timeFormat);
},
/**

View File

@ -59,7 +59,7 @@
<tr v-for="(beat, index) in displayedRecords" :key="index" :class="{ 'shadow-box': $root.windowWidth <= 550}">
<td class="name-column"><router-link :to="`/dashboard/${beat.monitorID}`">{{ $root.monitorList[beat.monitorID]?.name }}</router-link></td>
<td><Status :status="beat.status" /></td>
<td :class="{ 'border-0':! beat.msg}"><Datetime :value="beat.time" /></td>
<td :class="{ 'border-0':! beat.msg}"><Datetime :value="beat.time" :use12HourTimeFormat="use12HourTimeFormat" /></td>
<td class="border-0">{{ beat.msg }}</td>
</tr>
@ -113,6 +113,7 @@ export default {
},
importantHeartBeatListLength: 0,
displayedRecords: [],
use12HourTimeFormat: false
};
},
watch: {
@ -127,6 +128,10 @@ export default {
},
},
created() {
this.loadSettings();
},
mounted() {
this.getImportantHeartbeatListLength();
@ -203,6 +208,16 @@ export default {
}
},
/**
* Retrieves important settings values.
* @returns {void}
*/
loadSettings() {
this.$root.getSocket().emit("getSettings", res => {
this.use12HourTimeFormat = res.data.use12HourTimeFormat;
});
}
},
};
</script>

View File

@ -184,7 +184,7 @@
<div v-if="showPingChartBox" class="shadow-box big-padding text-center ping-chart-wrapper">
<div class="row">
<div class="col">
<PingChart :monitor-id="monitor.id" />
<PingChart :monitor-id="monitor.id" :use12HourTimeFormat="use12HourTimeFormat" />
</div>
</div>
</div>
@ -228,7 +228,7 @@
<tbody>
<tr v-for="(beat, index) in displayedRecords" :key="index" style="padding: 10px;">
<td><Status :status="beat.status" /></td>
<td :class="{ 'border-0':! beat.msg}"><Datetime :value="beat.time" /></td>
<td :class="{ 'border-0':! beat.msg}"><Datetime :value="beat.time" :use12HourTimeFormat="use12HourTimeFormat" /></td>
<td class="border-0">{{ beat.msg }}</td>
</tr>
@ -328,6 +328,7 @@ export default {
currentExample: "javascript-fetch",
code: "",
},
use12HourTimeFormat: false,
};
},
computed: {
@ -420,6 +421,10 @@ export default {
},
},
created() {
this.loadSettings();
},
mounted() {
this.getImportantHeartbeatListLength();
@ -656,7 +661,14 @@ export default {
.replace("https://example.com/api/push/key?status=up&msg=OK&ping=", this.pushURL);
this.pushMonitor.code = code;
});
},
loadSettings() {
this.$root.getSocket().emit("getSettings", res => {
this.use12HourTimeFormat = res.data.use12HourTimeFormat || false;
});
}
},
};
</script>

View File

@ -163,6 +163,10 @@ export default {
this.settings.searchEngineIndex = false;
}
if (this.settings.use12HourTimeFormat === undefined) {
this.settings.use12HourTimeFormat = false;
}
if (this.settings.entryPage === undefined) {
this.settings.entryPage = "dashboard";
}