Compare commits
No commits in common. "1deb80c7762318260ece19e98564e3725275fc27" and "17e555e7fcd4de7e8742b739243dd7727fad59cd" have entirely different histories.
1deb80c776
...
17e555e7fc
2
main.go
2
main.go
@ -29,7 +29,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
const VERSION = "v37"
|
const VERSION = "v36"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
logger *slog.Logger
|
logger *slog.Logger
|
||||||
|
@ -13,24 +13,17 @@
|
|||||||
.widgets .datapoints {
|
.widgets .datapoints {
|
||||||
font: "Roboto Mono", monospace;
|
font: "Roboto Mono", monospace;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(4, min-content);
|
grid-template-columns: min-content min-content 1fr;
|
||||||
gap: 6px 8px;
|
gap: 6px 8px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.widgets .datapoints div {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.widgets .datapoints .invalid {
|
.widgets .datapoints .invalid {
|
||||||
color: #c83737;
|
color: #c83737;
|
||||||
}
|
}
|
||||||
.widgets .datapoints .delete img {
|
.widgets .datapoints .delete img {
|
||||||
height: 16px;
|
height: 16px;
|
||||||
}
|
}
|
||||||
.widgets .datapoints .values img {
|
|
||||||
height: 16px;
|
|
||||||
width: 16px;
|
|
||||||
}
|
|
||||||
.widgets .action {
|
.widgets .action {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: min-content min-content 1fr;
|
grid-template-columns: min-content min-content 1fr;
|
||||||
|
@ -13,24 +13,17 @@
|
|||||||
.widgets .datapoints {
|
.widgets .datapoints {
|
||||||
font: "Roboto Mono", monospace;
|
font: "Roboto Mono", monospace;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(4, min-content);
|
grid-template-columns: min-content min-content 1fr;
|
||||||
gap: 6px 8px;
|
gap: 6px 8px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.widgets .datapoints div {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.widgets .datapoints .invalid {
|
.widgets .datapoints .invalid {
|
||||||
color: #c83737;
|
color: #c83737;
|
||||||
}
|
}
|
||||||
.widgets .datapoints .delete img {
|
.widgets .datapoints .delete img {
|
||||||
height: 16px;
|
height: 16px;
|
||||||
}
|
}
|
||||||
.widgets .datapoints .values img {
|
|
||||||
height: 16px;
|
|
||||||
width: 16px;
|
|
||||||
}
|
|
||||||
.widgets .action {
|
.widgets .action {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: min-content min-content 1fr;
|
grid-template-columns: min-content min-content 1fr;
|
||||||
|
@ -19,10 +19,9 @@ export class UI {
|
|||||||
let html = Object.keys(this.trigger.datapoints).sort().map(dpName => {
|
let html = Object.keys(this.trigger.datapoints).sort().map(dpName => {
|
||||||
const dp = this.trigger.datapoints[dpName]
|
const dp = this.trigger.datapoints[dpName]
|
||||||
return `
|
return `
|
||||||
|
<div class="datapoint delete"><a href="#" onclick="_ui.deleteDatapoint('${dp.Name}')"><img src="/images/${this.version}/${this.theme}/delete.svg"></a></div>
|
||||||
<div class="datapoint name ${dp.Found ? 'valid' : 'invalid'}"><b>${dp.Name}</b></div>
|
<div class="datapoint name ${dp.Found ? 'valid' : 'invalid'}"><b>${dp.Name}</b></div>
|
||||||
<div class="datapoint value">${dp.Found ? dp.LastDatapointValue.TemplateValue : ''}</div>
|
<div class="datapoint value">${dp.Found ? dp.LastDatapointValue.TemplateValue : ''}</div>
|
||||||
<div class="daatpoint values"><a href="/datapoint/values/${dp.ID}"><img src="/images/${this.version}/${this.theme}/values.svg"></a></div>
|
|
||||||
<div class="datapoint delete"><a href="#" onclick="_ui.deleteDatapoint('${dp.Name}')"><img src="/images/${this.version}/${this.theme}/delete.svg"></a></div>
|
|
||||||
`
|
`
|
||||||
}).join('')
|
}).join('')
|
||||||
datapoints.innerHTML += html
|
datapoints.innerHTML += html
|
||||||
@ -85,7 +84,7 @@ export class UI {
|
|||||||
})
|
})
|
||||||
}//}}}
|
}//}}}
|
||||||
deleteDatapoint(name) {//{{{
|
deleteDatapoint(name) {//{{{
|
||||||
if (!confirm(`Remove datapoint ${name} from this trigger?`)) {
|
if (!confirm(`Delete ${name}?`)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,15 +19,11 @@
|
|||||||
.datapoints {
|
.datapoints {
|
||||||
font: "Roboto Mono", monospace;
|
font: "Roboto Mono", monospace;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(4, min-content);
|
grid-template-columns: min-content min-content 1fr;
|
||||||
gap: 6px 8px;
|
gap: 6px 8px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
div {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.invalid {
|
.invalid {
|
||||||
color: #c83737;
|
color: #c83737;
|
||||||
}
|
}
|
||||||
@ -35,11 +31,6 @@
|
|||||||
.delete img {
|
.delete img {
|
||||||
height: 16px;
|
height: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.values img {
|
|
||||||
height: 16px;
|
|
||||||
width: 16px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.action {
|
.action {
|
||||||
|
Loading…
Reference in New Issue
Block a user