mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-26 20:57:13 +02:00
0.7.33
* add alarms overview to WebGui #608 * fix webGui total values #1084
This commit is contained in:
parent
8544e86e0f
commit
9b250c5385
7 changed files with 146 additions and 7 deletions
|
@ -126,6 +126,10 @@ function toIsoDateStr(d) {
|
|||
return new Date(d.getTime() + (d.getTimezoneOffset() * -60000)).toISOString().substring(0, 19).replace('T', ', ');
|
||||
}
|
||||
|
||||
function toIsoTimeStr(d) {
|
||||
return new Date(d.getTime() + (d.getTimezoneOffset() * -60000)).toISOString().substring(11, 19).replace('T', ', ');
|
||||
}
|
||||
|
||||
function setHide(id, hide) {
|
||||
var elm = document.getElementById(id);
|
||||
if(hide) {
|
||||
|
@ -272,3 +276,29 @@ function svg(data=null, w=24, h=24, cl=null, tooltip=null) {
|
|||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
function modal(title, body) {
|
||||
if(null == document.getElementById("modal")) {
|
||||
document.getElementById("wrapper").append(
|
||||
ml("div", {id: "modal-wrapper", class: "modal", onclick: modalClose}),
|
||||
ml("div", {id: "modal", class: "modal"},
|
||||
ml("div", {class: "modal-content"}, [
|
||||
ml("div", {class: "modal-header"}, [
|
||||
ml("h5", {}, title),
|
||||
ml("button", {class: "close", type: "button", onclick: modalClose}, "×")
|
||||
]),
|
||||
ml("div", {class: "modal-body"}, body)
|
||||
]
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function modalClose() {
|
||||
var e = document.getElementById("modal");
|
||||
if(null != e) {
|
||||
e.remove();
|
||||
document.getElementById("modal-wrapper").remove();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue