summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full/luasrc/view
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-10-24 01:10:34 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-10-24 01:10:34 +0000
commit6245ad6a73090ac3668e8f4b9749614592294a08 (patch)
tree8f08e3253f1e8c9b85908a8e94b513bff55b7841 /modules/admin-full/luasrc/view
parenteb6e37ebb7b9d576e9eb9f1a0d140936d11ddf11 (diff)
modules/admin-full: rework system menu area
Diffstat (limited to 'modules/admin-full/luasrc/view')
-rw-r--r--modules/admin-full/luasrc/view/admin_system/applyreboot.htm43
-rw-r--r--modules/admin-full/luasrc/view/admin_system/backupfiles.htm19
-rw-r--r--modules/admin-full/luasrc/view/admin_system/clock_status.htm36
-rw-r--r--modules/admin-full/luasrc/view/admin_system/flashops.htm94
-rw-r--r--modules/admin-full/luasrc/view/admin_system/ipkg.htm7
-rw-r--r--modules/admin-full/luasrc/view/admin_system/packages.htm71
-rw-r--r--modules/admin-full/luasrc/view/admin_system/upgrade.htm133
7 files changed, 281 insertions, 122 deletions
diff --git a/modules/admin-full/luasrc/view/admin_system/applyreboot.htm b/modules/admin-full/luasrc/view/admin_system/applyreboot.htm
index 8ff7118c7e..4f06b287d2 100644
--- a/modules/admin-full/luasrc/view/admin_system/applyreboot.htm
+++ b/modules/admin-full/luasrc/view/admin_system/applyreboot.htm
@@ -12,10 +12,39 @@ You may obtain a copy of the License at
$Id$
-%>
-<%+header%>
-<h2><a id="content" name="content"><%:System%></a></h2>
-<br />
-<p><% if msg then %><%=msg%><% else %><%:Changes applied.%><% end %></p>
-<p><%:Please wait: Device rebooting...%></p>
-<script type="text/javascript">setTimeout("location='<%=controller%>'", 60000)</script>
-<%+footer%> \ No newline at end of file
+
+<html>
+ <head>
+ <title><%=luci.sys.hostname()%> - <% if title then %><%=title%><% else %><%:Rebooting...%><% end %></title>
+ <link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" />
+ <script type="text/javascript" src="<%=resource%>/xhr.js"></script>
+ <script type="text/javascript">//<![CDATA[
+ var interval = window.setInterval(function() {
+ var img = new Image();
+
+ img.onload = function() {
+ window.clearInterval(interval);
+ location.href = 'http://<%=addr or luci.http.getenv("SERVER_NAME")%>/';
+ };
+
+ img.src = 'http://<%=addr or luci.http.getenv("SERVER_NAME")%><%=resource%>/icons/loading.gif?' + Math.random();
+ }, 5000);
+ //]]></script>
+ </head>
+ <body>
+ <div id="maincontainer">
+ <div id="maincontent">
+ <h2><a id="content" name="content"><%:System%> - <% if title then %><%=title%><% else %><%:Rebooting...%><% end %></a></h2>
+ <fieldset class="cbi-section">
+ <p>
+ <% if msg then %><%=msg%><% else %><%:Changes applied.%><% end %>
+ </p>
+ <p>
+ <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" />
+ <%:Waiting for router...%>
+ </p>
+ </fieldset>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/modules/admin-full/luasrc/view/admin_system/backupfiles.htm b/modules/admin-full/luasrc/view/admin_system/backupfiles.htm
new file mode 100644
index 0000000000..38b5f03a14
--- /dev/null
+++ b/modules/admin-full/luasrc/view/admin_system/backupfiles.htm
@@ -0,0 +1,19 @@
+<%#
+LuCI - Lua Configuration Interface
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+-%>
+
+<ul class="cbi-tabmenu">
+ <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/system/flashops")%>"><%:Actions%></a></li>
+ <li class="cbi-tab"><a href="#"><%:Configuration%></a></li>
+</ul>
diff --git a/modules/admin-full/luasrc/view/admin_system/clock_status.htm b/modules/admin-full/luasrc/view/admin_system/clock_status.htm
new file mode 100644
index 0000000000..84e151075f
--- /dev/null
+++ b/modules/admin-full/luasrc/view/admin_system/clock_status.htm
@@ -0,0 +1,36 @@
+<%+cbi/valueheader%>
+
+<script type="text/javascript">//<![CDATA[
+ XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "system", "clock_status")%>', null,
+ function(x, rv)
+ {
+ var s = document.getElementById('<%=self.option%>-clock-status');
+ if (s)
+ {
+ s.innerHTML = rv.timestring || '?';
+ }
+ }
+ );
+
+ function sync_clock(btn)
+ {
+ btn.disabled = true;
+ btn.value = '<%:Synchronizing...%>';
+
+ XHR.get('<%=luci.dispatcher.build_url("admin", "system", "clock_status")%>',
+ { set: Math.floor((new Date()).getTime() / 1000) },
+ function()
+ {
+ btn.disabled = false;
+ btn.value = '<%:Sync with browser%>';
+ }
+ );
+
+ return false;
+ }
+//]]></script>
+
+<span id="<%=self.option%>-clock-status"><em><%:Collecting data...%></em></span>
+<input type="button" class="cbi-button cbi-button-apply" value="<%:Sync with browser%>" onclick="return sync_clock(this)" />
+
+<%+cbi/valuefooter%>
diff --git a/modules/admin-full/luasrc/view/admin_system/flashops.htm b/modules/admin-full/luasrc/view/admin_system/flashops.htm
new file mode 100644
index 0000000000..628ede7728
--- /dev/null
+++ b/modules/admin-full/luasrc/view/admin_system/flashops.htm
@@ -0,0 +1,94 @@
+<%#
+LuCI - Lua Configuration Interface
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+-%>
+
+<%+header%>
+
+<h2><a id="content" name="content"><%:System%> - <%:Flash operations%></a></h2>
+
+<ul class="cbi-tabmenu">
+ <li class="cbi-tab"><a href="#"><%:Actions%></a></li>
+ <li class="cbi-tab-disabled"><a href="<%=REQUEST_URI%>/backupfiles"><%:Configuration%></a></li>
+</ul>
+
+<fieldset class="cbi-section">
+
+ <fieldset class="cbi-section">
+ <legend><%:Backup / Restore%></legend>
+ <form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data">
+ <div class="cbi-section-descr"><%:Click "Generate archive" to download a tar archive of the current configuration files. To reset the firmware to its initial state, click "Perform reset" (only possible with squashfs images).%></div>
+ <div class="cbi-section-node">
+ <div class="cbi-value<% if not reset_avail then %> cbi-value-last<% end %>">
+ <label class="cbi-value-title" for="image"><%:Download backup%>:</label>
+ <div class="cbi-value-field">
+ <input class="cbi-button cbi-button-apply" type="submit" name="backup" value="<%:Generate archive%>" />
+ </div>
+ </div>
+ <% if reset_avail then %>
+ <div class="cbi-value cbi-value-last">
+ <label class="cbi-value-title"><%:Reset to defaults%>:</label>
+ <div class="cbi-value-field">
+ <input onclick="return confirm('<%:Really reset all changes?%>')" class="cbi-button cbi-button-reset" type="submit" name="reset" value="<%:Perform reset%>" />
+ </div>
+ </div>
+ <% end %>
+ </div>
+ <br />
+ <div class="cbi-section-descr"><%:To restore configuration files, you can upload a previously generated backup archive here.%></div>
+ <div class="cbi-section-node">
+ <div class="cbi-value cbi-value-last">
+ <label class="cbi-value-title" for="archive"><%:Restore backup%>:</label>
+ <div class="cbi-value-field">
+ <input type="file" name="archive" id="archive" />
+ <input type="submit" class="cbi-button cbi-input-apply" name="restore" value="<%:Upload archive...%>" />
+ </div>
+ </div>
+ </div>
+ </form>
+ </fieldset>
+
+ <br />
+
+ <fieldset class="cbi-section">
+ <legend><%:Flash new firmware image%></legend>
+ <% if upgrade_avail then %>
+ <form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data">
+ <div class="cbi-section-descr"><%:Upload a sysupgrade-compatible image here to replace the running firmware. Check "Keep settings" to retain the current configuration (requires an OpenWrt compatible firmware image).%></div>
+ <div class="cbi-section-node">
+ <div class="cbi-value">
+ <label class="cbi-value-title" for="keep"><%:Keep settings%>:</label>
+ <div class="cbi-value-field">
+ <input type="checkbox" name="keep" id="keep" checked="checked" />
+ </div>
+ </div>
+ <div class="cbi-value cbi-value-last<% if image_invalid then %> cbi-value-error<% end %>">
+ <label class="cbi-value-title" for="image"><%:Image%>:</label>
+ <div class="cbi-value-field">
+ <input type="file" name="image" id="image" />
+ <input type="submit" class="cbi-button cbi-input-apply" value="<%:Flash image...%>" />
+ </div>
+ </div>
+ </div>
+ <% if image_invalid then %>
+ <div class="cbi-section-error"><%:The uploaded image file does not contain a supported format. Make sure that you choose the generic image format for your platform. %></div>
+ <% end %>
+ </form>
+ <% else %>
+ <div class="cbi-section-descr"><%:Sorry, there is no sysupgrade support present, a new firmware image must be flashed manually. Please refer to the OpenWrt wiki for device specific install instructions.%></div>
+ <% end %>
+ </fieldset>
+
+</fieldset>
+
+<%+footer%>
diff --git a/modules/admin-full/luasrc/view/admin_system/ipkg.htm b/modules/admin-full/luasrc/view/admin_system/ipkg.htm
index c14e4546fc..7f0956cfde 100644
--- a/modules/admin-full/luasrc/view/admin_system/ipkg.htm
+++ b/modules/admin-full/luasrc/view/admin_system/ipkg.htm
@@ -12,7 +12,8 @@ You may obtain a copy of the License at
$Id$
-%>
-<ul>
-<li><strong><%:Package lists%>:</strong> <code>src <em>Name</em> <em>URL</em></code></li>
-<li><strong><%:Installation targets%>:</strong> <code>dest <em>Name</em> <em>Pfad</em></code></li>
+
+<ul class="cbi-tabmenu">
+ <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/system/packages")%>"><%:Actions%></a></li>
+ <li class="cbi-tab"><a href="#"><%:Configuration%></a></li>
</ul>
diff --git a/modules/admin-full/luasrc/view/admin_system/packages.htm b/modules/admin-full/luasrc/view/admin_system/packages.htm
index e78f1c2ca7..aff582e7f9 100644
--- a/modules/admin-full/luasrc/view/admin_system/packages.htm
+++ b/modules/admin-full/luasrc/view/admin_system/packages.htm
@@ -53,13 +53,55 @@ end
<form method="post" action="<%=REQUEST_URI%>">
<div class="cbi-map">
+
+ <ul class="cbi-tabmenu">
+ <li class="cbi-tab"><a href="#"><%:Actions%></a></li>
+ <li class="cbi-tab-disabled"><a href="<%=REQUEST_URI%>/ipkg"><%:Configuration%></a></li>
+ </ul>
+
<fieldset class="cbi-section">
- <ul>
- <li><a href="<%=REQUEST_URI%>/ipkg"><%:Edit package lists and installation targets%></a></li>
- <li><a href="<%=REQUEST_URI%>?update=1"><%:Update package lists%></a></li>
- </ul>
+
+
+ <fieldset class="cbi-section-node">
+ <% if (install and next(install)) or (remove and next(remove)) or update or upgrade then %>
+ <div class="cbi-value">
+ <% if #stdout > 0 then %><pre><%=pcdata(stdout)%></pre><% end %>
+ <% if #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
+ </div>
+ <% end %>
+
+ <% if querypat then %>
+ <div class="cbi-value">
+ <%:Displaying only packages containing%> <strong>"<%=pcdata(query)%>"</strong>
+ <input type="button" onclick="location.href='?display=<%=pcdata(display)%>'" href="#" class="cbi-button cbi-button-reset" style="margin-left:1em" value="<%:Reset%>" />
+ <br style="clear:both" />
+ </div>
+ <% end %>
+
+ <% if no_lists or old_lists then %>
+ <div class="cbi-value">
+ <% if old_lists then %>
+ <%:Package lists are older than 24 hours%>
+ <% else %>
+ <%:No package lists available%>
+ <% end %>
+ <input type="button" onclick="location.href='?update=1'" href="#" class="cbi-button cbi-button-apply" style="margin-left:3em" value="<%:Update lists%>" />
+ </div>
+ <% end %>
+
+ <div class="cbi-value cbi-value-last">
+ <%:Free space%>: <strong><%=(100-used_perc)%>%</strong> (<strong><%=wa.byte_format(free_byte)%></strong>)
+ <div style="margin:3px 0; width:300px; height:10px; border:1px solid #000000; background-color:#80C080">
+ <div style="background-color:#F08080; border-right:1px solid #000000; height:100%; width:<%=used_perc%>%">&#160;</div>
+ </div>
+ </div>
+ </fieldset>
+
<br />
+
<fieldset class="cbi-section-node">
+ <input type="hidden" name="display" value="<%=pcdata(display)%>" />
+
<div class="cbi-value">
<label class="cbi-value-title"><%:Download and install package%>:</label>
<div class="cbi-value-field">
@@ -71,7 +113,6 @@ end
<div class="cbi-value cbi-value-last">
<label class="cbi-value-title"><%:Filter%>:</label>
<div class="cbi-value-field">
- <input type="hidden" name="display" value="<%=pcdata(display)%>" />
<input type="text" name="query" size="20" value="<%=pcdata(query)%>" />
<input type="submit" class="cbi-button cbi-input-find" name="search" value="<%:Find package%>" />
</div>
@@ -81,31 +122,13 @@ end
<br />
<h3><%:Status%></h3>
- <fieldset class="cbi-section">
- <%:Free space%>: <strong><%=(100-used_perc)%>%</strong> (<strong><%=wa.byte_format(free_byte)%></strong>)
- <div style="margin:3px 0; width:300px; height:10px; border:1px solid #000000; background-color:#80C080">
- <div style="background-color:#F08080; border-right:1px solid #000000; height:100%; width:<%=used_perc%>%">&#160;</div>
- </div>
-
- <% if querypat then %>
- <br /><hr /><br />
- <%:Displaying only packages containing%> <strong>"<%=pcdata(query)%>"</strong>
- <input type="button" onclick="location.href='?display=<%=pcdata(display)%>'" href="#" class="cbi-button cbi-button-reset" style="margin-left:3em" value="Reset" />
- <% end %>
- <% if (install and next(install)) or (remove and next(remove)) or update or upgrade then %>
- <br /><hr /><br />
- <% if #stdout > 0 then %><pre><%=pcdata(stdout)%></pre><% end %>
- <% if #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
- <% end %>
- </fieldset>
- <br />
<ul class="cbi-tabmenu">
<li class="cbi-tab<% if display ~= "installed" then %>-disabled<% end %>"><a href="?display=installed&amp;query=<%=pcdata(query)%>"><%:Installed packages%><% if query then %> (<%=pcdata(query)%>)<% end %></a></li>
<li class="cbi-tab<% if display ~= "available" then %>-disabled<% end %>"><a href="?display=available&amp;query=<%=pcdata(query)%>"><%:Available packages%><% if query then %> (<%=pcdata(query)%>)<% end %></a></li>
</ul>
-
+
<% if display ~= "available" then %>
<fieldset class="cbi-section">
<table class="cbi-section-table" style="width:100%">
diff --git a/modules/admin-full/luasrc/view/admin_system/upgrade.htm b/modules/admin-full/luasrc/view/admin_system/upgrade.htm
index 372fa5971d..950eba8e75 100644
--- a/modules/admin-full/luasrc/view/admin_system/upgrade.htm
+++ b/modules/admin-full/luasrc/view/admin_system/upgrade.htm
@@ -15,96 +15,53 @@ $Id$
<%+header%>
-<h2><a id="content" name="content"><%:System%></a></h2>
-<h3><%:Flash Firmware%></h3>
+<h2><a id="content" name="content"><%:System%> - <%:Flash Firmware%> - <%:Verify%></a></h2>
+<p>
+ <%_ The flash image was uploaded.
+ Below is the checksum and file size listed,
+ compare them with the original file to ensure data integrity.<br />
+ Click "Proceed" below to start the flash procedure. %>
-<% if step == 1 then %>
- <% if supported then %>
- <form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data">
- <p>
- <%:Upload an OpenWrt image file to reflash the device.%>
- <% if bad_image then %>
- <br /><br />
- <div class="error"><%:The uploaded image file does not
- contain a supported format. Make sure that you choose the generic
- image format for your platform. %></div>
- <% end %>
- </p>
- <div>
- <%:Firmware image%>:<br />
- <input type="hidden" name="step" value="2" />
- <input type="file" size="30" name="image" />
- <br />
- <br />
- <% if keepavail then -%>
- <input type="checkbox" name="keepcfg" value="1" checked="checked" />
- <span class="bold"><%:Keep configuration files%></span>
- <% end -%>
-
- <br />
- <input class="cbi-button cbi-button-apply" type="submit" value="<%:Upload image%>" />
- </div>
- </form>
- <% else %>
- <div class="error"><%_ Sorry.
- OpenWrt does not support a system upgrade on this platform.<br />
- You need to manually flash your device. %></div>
+ <% if storage > 0 and size > storage then %>
+ <br /><br />
+ <div class="error"><%:It appears that you try to
+ flash an image that does not fit into the flash memory, please verify
+ the image file! %></div>
<% end %>
-<% elseif step == 2 then %>
- <p>
- <%_ The flash image was uploaded.
- Below is the checksum and file size listed,
- compare them with the original file to ensure data integrity.<br />
- Click "Proceed" below to start the flash procedure. %>
- <% if flashsize > 0 and filesize > flashsize then %>
- <br /><br />
- <div class="error"><%:It appears that you try to
- flash an image that does not fit into the flash memory, please verify
- the image file! %></div>
- <% end %>
+</p>
- <br />
- <ul>
- <li><%:Checksum%>: <code><%=checksum%></code></li>
- <li><%:Size%>: <%
- local w = require "luci.tools.webadmin"
- write(w.byte_format(filesize))
-
- if flashsize > 0 then
- write(luci.i18n.translatef(
- " (%s available)",
- w.byte_format(flashsize)
- ))
- end
- %></li>
- <li><% if keepconfig then %>
- <%:Configuration files will be kept.%>
- <% else %>
- <%:Note: Configuration files will be erased.%>
- <% end %></li>
- </ul>
- </p>
- <div class="cbi-page-actions right">
- <form style="display:inline">
- <input type="hidden" name="step" value="3" />
- <input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
- <input class="cbi-button cbi-button-apply" type="submit" value="<%:Proceed%>" />
- </form>
- <form style="display:inline">
- <input type="hidden" name="step" value="1" />
- <input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
- <input class="cbi-button cbi-button-reset" type="submit" value="<%:Cancel%>" />
- </form>
- </div>
-<% elseif step == 3 then %>
- <p><%_ The system is flashing now.<br />
- DO NOT POWER OFF THE DEVICE!<br />
- Wait a few minutes until you try to reconnect.
- It might be necessary to renew the address of your computer to reach the device
- again, depending on your settings. %></p>
-
- <iframe src="<%=REQUEST_URI%>?step=4&#38;keepcfg=<%=keepconfig and "1" or "0"%>" style="border:1px solid black; width:100%; height:150px"></iframe>
-<% end %>
-<%+footer%>
+<fieldset class="cbi-section">
+ <ul>
+ <li><%:Checksum%>: <code><%=checksum%></code></li>
+ <li><%:Size%>: <%
+ local w = require "luci.tools.webadmin"
+ write(w.byte_format(size))
+
+ if storage > 0 then
+ write(luci.i18n.translatef(
+ " (%s available)",
+ w.byte_format(storage)
+ ))
+ end
+ %></li>
+ <li><% if keep then %>
+ <%:Configuration files will be kept.%>
+ <% else %>
+ <%:Note: Configuration files will be erased.%>
+ <% end %></li>
+ </ul>
+</fieldset>
+<div class="cbi-page-actions right">
+ <form style="display:inline" action="<%=REQUEST_URI%>" method="post">
+ <input type="hidden" name="step" value="2" />
+ <input type="hidden" name="keep" value="<%=keep and "1" or ""%>" />
+ <input class="cbi-button cbi-button-apply" type="submit" value="<%:Proceed%>" />
+ </form>
+ <form style="display:inline" action="<%=REQUEST_URI%>" method="post">
+ <input class="cbi-button cbi-button-reset" type="submit" value="<%:Cancel%>" />
+ </form>
+</div>
+
+<%+footer%>