add last boot up time for windows (#5478)

* add last boot up time for windows Signed-off-by: si458 <simonsmith5521@gmail.com> * fixed lastbootuptime parsing Signed-off-by: si458 <simonsmith5521@gmail.com> --------- Signed-off-by: si458 <simonsmith5521@gmail.com>

Simon Smith committed Oct 28, 2023 at 19:27 UTC 6c15bcbe050e85edd1d638910bcc903ec46b9405
1 file changed +12
views/default.handlebars
+12
@@ -11565,6 +11565,18 @@
11565 else if (m.OSArchitecture.startsWith('64')) { x += addDetailItem("Architecture", "64-bit", s); }
11566 else { x += addDetailItem("Architecture", EscapeHtml(m.OSArchitecture), s); }
11567 }
11568 + if(m.LastBootUpTime){
11569 + var thedate = {
11570 + year: parseInt(m.LastBootUpTime.substring(0, 4)),
11571 + month: parseInt(m.LastBootUpTime.substring(4, 6)) - 1, // Months are 0-based in JavaScript (0 - January, 11 - December)
11572 + day: parseInt(m.LastBootUpTime.substring(6, 8)),
11573 + hours: parseInt(m.LastBootUpTime.substring(8, 10)),
11574 + minutes: parseInt(m.LastBootUpTime.substring(10, 12)),
11575 + seconds: parseInt(m.LastBootUpTime.substring(12, 14)),
11576 + };
11577 + const date = printDateTime(new Date(thedate.year, thedate.month, thedate.day, thedate.hours, thedate.minutes, thedate.seconds));
11578 + x += addDetailItem("Last Boot Up Time", date);
11579 + }
11580 }
11581 if (x != '') { sections.push({ name: "Operating System", html: x, img: 'software64.png'}); }
11582 }