wok view turbine/stuff/res/template/scheme @ rev 24060
Up brotli (1.0.9), tinyssh (20210601), udftools (2.3)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Jun 10 07:14:38 2021 +0000 (2021-06-10) |
parents | |
children |
line source
1 # Turbine Scheme File.
2 # Please use HTML5 only.
3 # Javascript and CSS are available.
4 # ----------------------------------------------------------------------------
5 # Provided By The SliTaz Development Team.
6 # Copyright (C) 2017 The SliTaz Association.
7 #
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 # ----------------------------------------------------------------------------
22 # @@ Library and functions by SliTaz OS.
23 . /usr/lib/slitaz/httphelper.sh
24 . /etc/slitaz/slitaz.conf
25 . /lib/libtaz.sh
27 # @@ The output header with the meta-info.
28 appMETAINFO(){
29 cat <<OUTPUT
30 <!DOCTYPE html>
31 <html>
32 <head>
33 <meta charset="$APP_ENCODING"/>
34 <title>$APP_TITLE - $APP_DESC</title>
36 <style type="text/css">
37 <!--
38 $(cat $APP_DESIGN)
39 -->
40 </style>
42 <script type="text/javascript">
43 $(cat $APP_SCRIPT)
44 </script>
46 </head>
47 <body>
48 <div id="panel">
50 <p title="$USER" id="user-id" data-icon=" ">$USER</p>
52 <header class="textup">
53 <h1><img src="?img=lg" alt="" />$APP_TITLE</h1>
54 <h3>$(_ "$APP_DESC")</h3>
55 </header>
57 OUTPUT
58 }
60 appSTATUS(){
61 cat <<OUTPUT
63 <section id="pc">
64 <h1>
65 $(awk -F: '/model name/ {print $2;exit}' /proc/cpuinfo) <br>
66 <small class="date">$(date)</small>
67 </h1>
68 </section>
70 <div id="display">
72 <aside class="panel">
73 <span class="info textup"><small>Active</small></span><br>
74 <h2 class="rs">$(awk -F"[: ]+" '/Active/ {print $2;exit}' /proc/meminfo)</h2>
75 </aside>
76 <aside class="panel">
77 <span class="info textup"><small>Mem Total</small></span><br>
78 <h2 class="rs">$(awk -F"[: ]+" '/MemTotal/ {print $2;exit}' /proc/meminfo)</h2>
79 </aside>
80 <aside class="panel">
81 <span class="info textup"><small>Inactive</small></span><br>
82 <h2 class="rs">$(awk -F"[: ]+" '/Inactive/ {print $2;exit}' /proc/meminfo)</h2>
83 </aside>
84 <br /> <!-- @@ breakpoint -->
86 <aside class="panel" data="left">
87 <section>
88 <table>
89 <tr>
90 <td>Buffers</td>
91 <td class="rs tr">$(awk -F"[: ]+" '/Buffers/ {print $2;exit}' /proc/meminfo)</td>
92 </tr>
93 <tr>
94 <td>Cached</td>
95 <td class="rs tr">$(awk -F"[: ]+" '/Cached/ {print $2;exit}' /proc/meminfo)</td>
96 </tr>
97 <tr>
98 <td>Mapped</td>
99 <td class="rs tr">$(awk -F"[: ]+" '/Mapped/ {print $2;exit}' /proc/meminfo)</td>
100 </tr>
101 <tr>
102 <td>Slab</td>
103 <td class="rs tr">$(awk -F"[: ]+" '/Slab/ {print $2;exit}' /proc/meminfo)</td>
104 </tr>
105 </table>
106 </section>
107 </aside>
109 <aside class="panel" data="center">
110 <section>
111 <aside class="l">
112 <p><small>Free<br><span style="color:lightgreen">$(free | grep Mem | awk '{print ($4/$2)*100.0}')</span></small></p>
113 </aside>
114 <aside class="r">
115 <p><small>Used<br><span style="color:orange">$(free | grep Mem | awk '{print ($3/$2)*100.0}')</span></small></p>
116 </aside>
117 <br /><hr />
118 <form method="POST" action="freeup.cgi">
119 <button type="submit">$(_ 'FREE UP!')</button>
120 </form>
121 </section>
122 </aside>
124 <aside class="panel" data="right">
125 <section>
126 <table>
127 <tr>
128 <td>HighTotal</td>
129 <td class="rs tr">$(awk -F"[: ]+" '/HighTotal/ {print $2;exit}' /proc/meminfo)</td>
130 </tr>
131 <tr>
132 <td>HighFree</td>
133 <td class="rs tr">$(awk -F"[: ]+" '/HighFree/ {print $2;exit}' /proc/meminfo)</td>
134 </tr>
135 <tr>
136 <td>LowTotal</td>
137 <td class="rs tr">$(awk -F"[: ]+" '/LowTotal/ {print $2;exit}' /proc/meminfo)</td>
138 </tr>
139 <tr>
140 <td>LowFree</td>
141 <td class="rs tr">$(awk -F"[: ]+" '/LowFree/ {print $2;exit}' /proc/meminfo)</td>
142 </tr>
143 </table>
144 </section>
145 </aside>
146 <br /> <!-- @@ breakpoint -->
148 OUTPUT
149 }
151 # @@ The action and animation
152 appFREEUP(){
153 cat <<OUTPUT
155 <div class="anibox">
156 <img class="ani spin" src="?img=ani2" alt="">
157 <img class="gear" src="?img=ani3" alt="">
158 <img class="fix spin" src="?img=turbine" alt=""/>
159 </div><!-- // anibox -->
161 <!--
162 <section>
163 <div class="linescan"></div>
164 </section>
165 -->
167 OUTPUT
168 }
170 # @@ The footer with additional information.
171 appFOOTER(){
172 cat <<OUTPUT
174 </div> <!-- # display -->
176 <footer class="textup">
177 <h4>$APP_NAME $APP_VERSION - $APP_LICENSE</h4><hr>
178 <h5>SliTaz GNU/Linux $SLITAZ_RELEASE ~ Kernel $(uname -r) ~ Machine $(uname -m)<br>
179 Provided by The SliTaz DevTeam - Copyright (C) 2017 The SliTaz Association
180 </h5>
181 </footer>
183 </div>
184 </body>
185 </html>
186 OUTPUT
187 }
189 textRELOAD(){
190 cat <<OUTPUT
191 <p title="Reload" id="reload"><a href="?"></a></p>
192 OUTPUT
193 }
195 appCLOSE(){
196 cat <<OUTPUT
198 <form id="close" method="POST" action="quit">
199 <button type="submit" title="$(_ 'Exit')">X</button>
200 </form>
202 OUTPUT
203 }
205 appRETURN(){
206 cat <<OUTPUT
207 <html><head>
208 <meta http-equiv="refresh" content="1;url=status.cgi" />
209 </head></html>
210 OUTPUT
211 }