summaryrefslogtreecommitdiff
path: root/web/kvm/navbar.pug
blob: ac3f0a04ea94a08588a26665cdb277ac28af981c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
mixin navbar_led(id, icon, cls="led-gray")
	img(id=id, class=cls src=`${svg_dir}/${icon}.svg`)

mixin menu_message(icon, short, classes="")
	div(class="text")
		table
			tr
				td(rowspan="2") #[img(class=`sign ${classes}` src=`${svg_dir}/${icon}.svg`)]
				td(style="line-height:1.5") #[b #{short}]
			if block
				tr
					td
						sup(style="line-height:1")
							block

mixin menu_switch_notable_gpio(channel, title, confirm_off="")
	td #{title}:
	td(align="right")
		div(class="switch-box")
			input(disabled type="checkbox" id=`gpio-switch-${channel}` class="gpio-switch"
				data-channel=channel data-confirm-off=confirm_off)
			label(for=`gpio-switch-${channel}`)
				span(class="switch-inner")
				span(class="switch")

mixin menu_switch_notable(id, title, enabled, checked)
	td #{title}:
	td(align="right")
		div(class="switch-box")
			input(checked=checked disabled=!enabled type="checkbox" id=id)
			label(for=id)
				span(class="switch-inner")
				span(class="switch")

mixin menu_switch(id, title, enabled, checked)
	table(class="kv")
		tr
			+menu_switch_notable(id, title, enabled, checked)

ul(id="navbar")
	li(class="left")
		a(id="logo" href="/") ←  
			img(class="svg-gray" src=`${svg_dir}/logo.svg` alt="π-kvm")

	include navbar-health.pug

	include navbar-system.pug
	include navbar-atx.pug
	include navbar-msd.pug
	include navbar-macro.pug
	include navbar-text.pug
	include navbar-shortcuts.pug
	include navbar-gpio.pug