gitpush
This commit is contained in:
parent
4d70e783bd
commit
ff2732d846
26
public/js/home.js
Normal file
26
public/js/home.js
Normal file
@ -0,0 +1,26 @@
|
||||
const now = new Date()
|
||||
const tomorrow = now.getDay() + 1
|
||||
if (tomorrow >= 1 && tomorrow <= 5){
|
||||
document.querySelectorAll(`th:nth-child(${tomorrow + 1})`).forEach(cell => {
|
||||
cell.style.fontWeight = 900
|
||||
cell.classList.add('table-active')
|
||||
})
|
||||
document.querySelectorAll(`tr td:nth-child(${tomorrow + 1})`).forEach(cell => {
|
||||
cell.style.fontWeight = 900
|
||||
cell.classList.add('table-warning')
|
||||
})
|
||||
}
|
||||
|
||||
filesize.partial({base: 2, standard: "jedec"})
|
||||
const zhao = io('ws://zhao', { path: '/status/socket.io', })
|
||||
zhao.on('status', (status) => {
|
||||
zhao_temp.innerText = status.cpu.temperature.toFixed(2)
|
||||
zhao_cpu.innerText = status.cpu.load.toFixed(2)
|
||||
zhao_mem.innerText = filesize(status.memory.available)
|
||||
})
|
||||
const pi = io('ws://pi', { path: '/status/socket.io', })
|
||||
pi.on('status', (status) => {
|
||||
pi_temp.innerText = status.cpu.temperature.toFixed(2)
|
||||
pi_cpu.innerText = status.cpu.load.toFixed(2)
|
||||
pi_mem.innerText = filesize(status.memory.available)
|
||||
})
|
@ -123,18 +123,6 @@ block main
|
||||
td 英语
|
||||
td 劳动
|
||||
td 音乐
|
||||
script.
|
||||
const now = new Date()
|
||||
const tomorrow = now.getDay() + 1
|
||||
if (tomorrow >= 1 && tomorrow <= 5)
|
||||
document.querySelectorAll(`th:nth-child(${tomorrow + 1})`).forEach(cell => {
|
||||
cell.style.fontWeight = 900
|
||||
cell.classList.add('table-active')
|
||||
})
|
||||
document.querySelectorAll(`tr td:nth-child(${tomorrow + 1})`).forEach(cell => {
|
||||
cell.style.fontWeight = 900
|
||||
cell.classList.add('table-warning')
|
||||
})
|
||||
|
||||
.container
|
||||
.row.row-cols-md-2.gy-3
|
||||
@ -178,19 +166,6 @@ block main
|
||||
p.card-text
|
||||
| 内存剩余:
|
||||
code#pi_mem
|
||||
script(src="/socket.io/socket.io.min.js")
|
||||
script(src="/js/filesize.min.js")
|
||||
script.
|
||||
filesize.partial({base: 2, standard: "jedec"})
|
||||
const zhao = io('ws://zhao', { path: '/status/socket.io', })
|
||||
zhao.on('status', (status) => {
|
||||
zhao_temp.innerText = status.cpu.temperature.toFixed(2)
|
||||
zhao_cpu.innerText = status.cpu.load.toFixed(2)
|
||||
zhao_mem.innerText = filesize(status.memory.available)
|
||||
})
|
||||
const pi = io('ws://pi', { path: '/status/socket.io', })
|
||||
pi.on('status', (status) => {
|
||||
pi_temp.innerText = status.cpu.temperature.toFixed(2)
|
||||
pi_cpu.innerText = status.cpu.load.toFixed(2)
|
||||
pi_mem.innerText = filesize(status.memory.available)
|
||||
})
|
||||
script(src="/socket.io/socket.io.min.js", defer)
|
||||
script(src="/js/filesize.min.js", defer)
|
||||
script(src="/js/home.js", defer)
|
||||
|
Loading…
Reference in New Issue
Block a user