aboutsummaryrefslogtreecommitdiff
path: root/_www/block.d/index.html
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-06-10 20:08:03 +0700
committerShulhan <ms@kilabit.info>2022-06-12 13:02:16 +0700
commitd84e92947fa9d935c374430567b6a3d88a371b5e (patch)
treef33214e40562f09c3c914e6c9beebc42d18cb52c /_www/block.d/index.html
parentb4e49485f815db682def487191c129f8904d85eb (diff)
downloadrescached-d84e92947fa9d935c374430567b6a3d88a371b5e.tar.xz
_www/block.d: fix the variable names on hosts block.d
In the commit 0b92dbb8463d, we changes the field HostsBlocks in Environment to HostBlockd, but we forgot to changes the code in the web. This changes fix this issue.
Diffstat (limited to '_www/block.d/index.html')
-rw-r--r--_www/block.d/index.html24
1 files changed, 12 insertions, 12 deletions
diff --git a/_www/block.d/index.html b/_www/block.d/index.html
index 6c32032..27059c3 100644
--- a/_www/block.d/index.html
+++ b/_www/block.d/index.html
@@ -79,7 +79,7 @@
<span class="info"> Name </span>
</div>
</div>
- <div id="HostsBlocks" class="block_source"></div>
+ <div id="HostBlockd" class="block_source"></div>
<div>
<button onclick="blockdUpdate()">Save</button>
@@ -103,11 +103,11 @@
}
let env = res.data
- renderHostsBlocks(env.HostsBlocks)
+ renderHostBlockd(env.HostBlockd)
}
function onCheckHostblock(key, val) {
- resc.env.HostsBlocks[key].IsEnabled = val
+ resc.env.HostBlockd[key].IsEnabled = val
}
async function blockdFetch(name) {
@@ -117,34 +117,34 @@
return
}
- resc.env.HostsBlocks[name] = res.data
+ resc.env.HostBlockd[name] = res.data
notifInfo("The hosts blocks has been updated.")
- renderHostsBlocks(resc.env.HostsBlocks)
+ renderHostBlockd(resc.env.HostBlockd)
}
async function blockdUpdate() {
- const res = await resc.BlockdUpdate(resc.env.HostsBlocks)
+ const res = await resc.BlockdUpdate(resc.env.HostBlockd)
if (res.code != 200) {
notifError("blockdUpdate: ", res.message)
return
}
- renderHostsBlocks(res.data)
+ renderHostBlockd(res.data)
notifInfo("The hosts blocks has been updated.")
}
- function renderHostsBlocks(hostsBlocks) {
- let parent = document.getElementById("HostsBlocks")
+ function renderHostBlockd(hostsBlockd) {
+ let parent = document.getElementById("HostBlockd")
parent.innerHTML = ""
- for (var k in hostsBlocks) {
- if (!hostsBlocks.hasOwnProperty(k)) {
+ for (var k in hostsBlockd) {
+ if (!hostsBlockd.hasOwnProperty(k)) {
continue;
}
- let hostsBlock = hostsBlocks[k]
+ let hostsBlock = hostsBlockd[k]
let item = document.createElement("div")
item.classList.add("item")
item.innerHTML = `