tazpanel view styles/default/header.html @ rev 621

hardware.cgi: show boot flag (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Dec 19 20:36:00 2017 +0100 (2017-12-19)
parents a15373a181ff
children
line source
1 # Header of TazPanel html page
3 rootclass='user'; [ $(id -u) -eq 0 ] && rootclass='root'
4 TEXTDOMAIN_original="${TEXTDOMAIN:-tazpanel}"
5 export TEXTDOMAIN='tazpanel'
7 extra_menu() {
8 local x
9 case "$1" in
10 */*) filter="s/data-icon=\\\"[^\\\"]*\\\"/data-icon=\\\"\\\"/" ;;
11 *) filter='' ;;
12 esac
13 for x in menu.d/$1/*; do
14 [ -f $x ] && sh $x menu $x | sed "$filter"
15 [ -d $x ] || continue
16 icon="$(sed '/data-icon/!d;s/.*data-icon="\([^"]*\).*/\1/;q' $x/*)"
17 echo -e "<li><a data-icon=\"${icon:-@add@}\">$(_ "$(basename $x)")</a>\n<menu>"
18 extra_menu ${x#menu.d/}
19 echo -e "</menu>\n</li>"
20 done
21 }
23 cat <<EOT
24 <!DOCTYPE html>
25 <html lang="${LANG%%_*}">
26 <head>
27 <title>TazPanel</title>
28 <link rel="shortcut icon" href="/styles/$STYLE/favicon.ico"/>
29 <meta name="viewport" content="width=device-width,initial-scale=1"/>
30 $(printf '\t<link rel="stylesheet" type="text/css" href="/%s"/>\n' $(cd /var/www/tazpanel; ls styles/$STYLE/*.css* | sed 's|.gz||'))
31 $(printf '\t<script type="text/javascript" src="/%s"></script>\n' $(cd /var/www/tazpanel; ls lib/*.js* | sed 's|.gz||'))
32 </head>
33 <body class="$rootclass">
34 <script type="text/javascript">setColorTheme(); setBaseFont();</script>
35 <div id="confirmBreak" style="display:none">$(_ 'Confirm break')</div>
37 <header>
38 <h1 data-icon="tazpanel">@@TITLE@@ </h1>
39 <div>@@SUBTITLE@@</div>
40 </header>
42 <nav id="toolbar">
43 <menu type="toolbar" id="toolbarMenu">
44 <li tabindex="1">
45 <span>$(_ 'Panel')</span>
46 <menu>
47 <li><a data-icon="@info@" href="index.cgi">$(_ 'Summary')</a></li>
48 <li><a data-icon="@proc@" href="index.cgi?top">$(_ 'Processes')</a></li>
49 <li><a data-icon="@terminal@" href="index.cgi?cmd=help">$(_ 'Terminal')</a></li>
50 <li><a data-icon="@report@" href="index.cgi?report" data-root>$(_ 'Create Report')</a></li>
51 $(extra_menu panel)
52 </menu>
53 </li>
54 <li tabindex="2">
55 <span>$(_ 'Network')</span>
56 <menu>
57 <li><a data-icon="@info@" href="network.cgi">$(_ 'Summary')</a></li>
58 <li><a data-icon="@conf@" href="index.cgi?file=/etc/network.conf&amp;action=edit">$(_ 'Config file')</a></li>
59 <li><a data-icon="@eth@" href="network.cgi?eth">$(_ 'Ethernet')</a></li>
60 <li><a data-icon="@wifi@" href="network.cgi?wifi">$(_ 'Wireless')</a></li>
61 $(extra_menu network)
62 </menu>
63 </li>
64 <li tabindex="3">
65 <span>$(_ 'Boot')</span>
66 <menu>
67 <li><a data-icon="@info@" href="boot.cgi">$(_ 'Summary')</a></li>
68 EOT
70 [ -w /boot/grub/menu.lst ] && cat <<EOT
71 <li><a data-icon="@grub@" href="boot.cgi?grub">$(_ 'Boot loader')</a></li>
72 EOT
74 cat <<EOT
75 <li><a data-icon="@logs@" href="boot.cgi?log">$(_ 'Boot logs')</a>
76 <menu>
77 <li><a data-icon="" href="boot.cgi?log=kernel">$(_ 'Kernel messages')</a></li>
78 <li><a data-icon="" href="boot.cgi?log=boot">$(_ 'Boot scripts')</a></li>
79 <li><a data-icon="" href="boot.cgi?log=xlog">$(_ 'X server')</a></li>
80 <li><a data-icon="" href="boot.cgi?log=slim">$(_ 'X session')</a></li>
81 </menu>
82 </li>
83 <li><a data-icon="@logs@" href="boot.cgi?syslog">$(_ 'System logs')</a>
84 <li><a data-icon="@daemons@" href="boot.cgi?daemons" data-root>$(_ 'Manage daemons')</a></li>
85 $([ -x /usr/bin/taziso ] &&
86 echo "<li><a data-icon=\"@cd@\" href=\"boot.cgi?iso\" data-root>$(_ 'ISO mine')</a>")
87 $(extra_menu boot)
88 </menu>
89 </li>
90 <li tabindex="4">
91 <span>$(_ 'Hardware')</span>
92 <menu>
93 <li><a data-icon="@info@" href="hardware.cgi">$(_ 'Summary')</a></li>
94 <li><a data-icon="@modules@" href="hardware.cgi?modules">$(_ 'Kernel modules')</a></li>
95 <li><a data-icon="@detect@" href="hardware.cgi?detect" data-root>$(_ 'Detect PCI/USB')</a></li>
96 <li><a data-icon="@hdd@" href="hardware.cgi#disk">$(_ 'Disks')</a></li>
97 $(extra_menu hardware)
98 </menu>
99 </li>
100 <li tabindex="5">
101 <span>$(_ 'Settings')</span>
102 <menu>
103 <li><a data-icon="@info@" href="settings.cgi" data-root>$(_ 'Summary')</a></li>
104 <li><a data-icon="@user@" href="settings.cgi?users" data-root>$(_ 'Users')</a></li>
105 <li><a data-icon="@group@" href="settings.cgi?groups" data-root>$(_ 'Groups')</a></li>
106 <li><a data-icon="@settings@" href="settings.cgi?tweaks">$(_ 'Tweaks')</a></li>
107 $(extra_menu settings)
108 </menu>
109 </li>
110 EOT
112 cat <<EOT
113 $(for i in menu.d/* ; do [ -f $i ] && sh $i menu $i ; done)
114 </menu>
115 <span id="icons">
116 EOT
118 username="${REMOTE_USER:-root}"
119 case "$username" in
120 root) icon='data-img="@slitaz@"'; warn=''
121 toggle_url="http://$HTTP_HOST/";;
122 *) icon='data-img="@user@"'; warn="$(_ 'Some features are disabled.')"$'\n'
123 toggle_url="http://$RANDOM:*@$HTTP_HOST/user/";;
124 esac
126 cat <<EOT
127 <a $icon title="$(_ 'You are logged in to the TazPanel as user %s.' $username)
128 $warn$(_ 'Click to re-login.')" href="$toggle_url$(basename $REQUEST_URI)"></a>
129 <a data-img="@help@" href="help.cgi"></a>
130 </span>
131 </nav>
133 <div id="noMenu"></div>
134 <script type="text/javascript">addMenuHandlers();</script>
136 <footer>
137 <span id="defaultStatus">
138 $(gettext 'Copyright') &copy; $(date +%Y)
139 <a href="http://www.slitaz.org/" target="_blank" rel="noopener">SliTaz GNU/Linux</a>
140 - <a href="index.cgi?file=/usr/share/licenses/bsd.txt">$(gettext 'BSD License')</a>
141 </span>
142 <span id="statusBar"></span>
143 <span id="ajaxStatus"></span>
144 </footer>
146 <!-- Page content -->
147 <div id="content">
148 EOT
149 export TEXTDOMAIN="$TEXTDOMAIN_original"