Compare commits
2 Commits
17e555e7fc
...
1deb80c776
Author | SHA1 | Date | |
---|---|---|---|
|
1deb80c776 | ||
|
85a6da0b0a |
2
main.go
2
main.go
@ -29,7 +29,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const VERSION = "v36"
|
||||
const VERSION = "v37"
|
||||
|
||||
var (
|
||||
logger *slog.Logger
|
||||
|
@ -13,17 +13,24 @@
|
||||
.widgets .datapoints {
|
||||
font: "Roboto Mono", monospace;
|
||||
display: grid;
|
||||
grid-template-columns: min-content min-content 1fr;
|
||||
grid-template-columns: repeat(4, min-content);
|
||||
gap: 6px 8px;
|
||||
margin-bottom: 8px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.widgets .datapoints div {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.widgets .datapoints .invalid {
|
||||
color: #c83737;
|
||||
}
|
||||
.widgets .datapoints .delete img {
|
||||
height: 16px;
|
||||
}
|
||||
.widgets .datapoints .values img {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
}
|
||||
.widgets .action {
|
||||
display: grid;
|
||||
grid-template-columns: min-content min-content 1fr;
|
||||
|
@ -13,17 +13,24 @@
|
||||
.widgets .datapoints {
|
||||
font: "Roboto Mono", monospace;
|
||||
display: grid;
|
||||
grid-template-columns: min-content min-content 1fr;
|
||||
grid-template-columns: repeat(4, min-content);
|
||||
gap: 6px 8px;
|
||||
margin-bottom: 8px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.widgets .datapoints div {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.widgets .datapoints .invalid {
|
||||
color: #c83737;
|
||||
}
|
||||
.widgets .datapoints .delete img {
|
||||
height: 16px;
|
||||
}
|
||||
.widgets .datapoints .values img {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
}
|
||||
.widgets .action {
|
||||
display: grid;
|
||||
grid-template-columns: min-content min-content 1fr;
|
||||
|
@ -19,9 +19,10 @@ export class UI {
|
||||
let html = Object.keys(this.trigger.datapoints).sort().map(dpName => {
|
||||
const dp = this.trigger.datapoints[dpName]
|
||||
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 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('')
|
||||
datapoints.innerHTML += html
|
||||
@ -84,7 +85,7 @@ export class UI {
|
||||
})
|
||||
}//}}}
|
||||
deleteDatapoint(name) {//{{{
|
||||
if (!confirm(`Delete ${name}?`)) {
|
||||
if (!confirm(`Remove datapoint ${name} from this trigger?`)) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -19,11 +19,15 @@
|
||||
.datapoints {
|
||||
font: "Roboto Mono", monospace;
|
||||
display: grid;
|
||||
grid-template-columns: min-content min-content 1fr;
|
||||
grid-template-columns: repeat(4, min-content);
|
||||
gap: 6px 8px;
|
||||
margin-bottom: 8px;
|
||||
white-space: nowrap;
|
||||
|
||||
div {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.invalid {
|
||||
color: #c83737;
|
||||
}
|
||||
@ -31,6 +35,11 @@
|
||||
.delete img {
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.values img {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.action {
|
||||
|
Loading…
Reference in New Issue
Block a user