+ <%_ WARNING: An alternative partition might have its own settings and completely different firmware.
+ As your network configuration and WiFi SSID/password on alternative partition might be different,
+ you might have to adjust your computer settings to be able to access your device once it reboots.
+ Please also be aware that alternative partition firmware might not provide an easy way to switch active partition
+ and boot back to the currently active partition.
+ Click "Proceed" below to reboot device to an alternative partition. %>
+
+ <%_ WARNING: Power off might result in a reboot on a device which doesn't support power off.
+ Click "Proceed" below to power off your device. %>
+
%s
"
+ %{ t and " title='" .. t .. "'" or "", s }
+ end
+
+ function rowstyle(i)
+ return "cbi-rowstyle-%i" %{
+ ( i % 2 ) == 0 and 2 or 1
+ }
+ end
+
+ function format_matches(z)
+ local html = { }
+
+ if type(z) ~= "table" then
+ z = { matches = { z } }
+ end
+
+ if z.localprefix then
+ for _, m in ipairs(z.matches) do
+ html[#html+1] =
+ digit_pattern(z.localprefix, "local prefix") .. " " ..
+ digit_pattern(m)
+ end
+ end
+
+ if z.intlmatches and #z.intlmatches > 0 then
+ for _, i in ipairs(z.intlmatches) do
+ for _, m in ipairs(z.matches) do
+ html[#html+1] = "%s %s" %{
+ digit_pattern("(%s)" % i, "intl. prefix"),
+ digit_pattern(m)
+ }
+ end
+ end
+ else
+ for _, m in ipairs(z.matches) do
+ html[#html+1] = digit_pattern(m)
+ end
+ end
+
+ return table.concat(html, "; ")
+ end
+%>
+
+
+
+
+<%+footer%>
diff --git a/applications/luci-app-asterisk/luasrc/view/asterisk/dialzones.htm b/applications/luci-app-asterisk/luasrc/view/asterisk/dialzones.htm
new file mode 100644
index 00000000..ffdbbcf3
--- /dev/null
+++ b/applications/luci-app-asterisk/luasrc/view/asterisk/dialzones.htm
@@ -0,0 +1,165 @@
+<%#
+ Copyright 2008 Steven Barth %s
" % s
+ end
+
+ function rowstyle(i)
+ return "cbi-rowstyle-%i" %{
+ ( i % 2 ) == 0 and 2 or 1
+ }
+ end
+
+ local function find_trunks()
+ local t = { }
+
+ uci:foreach("asterisk", "sip",
+ function(s)
+ if uci:get_bool("asterisk", s['.name'], "provider") then
+ t[#t+1] = {
+ "SIP/%s" % s['.name'],
+ "SIP: %s" % s['.name']
+ }
+ end
+ end)
+
+ uci:foreach("asterisk", "iax",
+ function(s)
+ t[#t+1] = {
+ "IAX/%s" % s['.name'],
+ "IAX: %s" % s.extension or s['.name']
+ }
+ end)
+
+ return t
+ end
+
+%>
+
+
+
+
+<%+footer%>
diff --git a/applications/luci-app-asterisk/po/ca/asterisk.po b/applications/luci-app-asterisk/po/ca/asterisk.po
new file mode 100644
index 00000000..aa534432
--- /dev/null
+++ b/applications/luci-app-asterisk/po/ca/asterisk.po
@@ -0,0 +1,680 @@
+# asterisk.pot
+# generated from ./applications/luci-asterisk/luasrc/i18n/asterisk.en.lua
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-06-10 03:40+0200\n"
+"PO-Revision-Date: 2009-05-31 19:18+0200\n"
+"Last-Translator: Eduard Duran + +
+ + + +<%+footer%> diff --git a/applications/luci-app-attendedsysupgrade/root/etc/uci-defaults/40_luci-attendedsysupgrade b/applications/luci-app-attendedsysupgrade/root/etc/uci-defaults/40_luci-attendedsysupgrade new file mode 100755 index 00000000..1b890c0c --- /dev/null +++ b/applications/luci-app-attendedsysupgrade/root/etc/uci-defaults/40_luci-attendedsysupgrade @@ -0,0 +1,7 @@ +#!/bin/sh + +rm -rf /tmp/luci-indexcache /tmp/luci-modulecache/ +/etc/init.d/uhttpd restart +/etc/init.d/rpcd reload + +return 0 diff --git a/applications/luci-app-attendedsysupgrade/root/usr/share/rpcd/acl.d/attendedsysupgrade.json b/applications/luci-app-attendedsysupgrade/root/usr/share/rpcd/acl.d/attendedsysupgrade.json new file mode 100644 index 00000000..75493192 --- /dev/null +++ b/applications/luci-app-attendedsysupgrade/root/usr/share/rpcd/acl.d/attendedsysupgrade.json @@ -0,0 +1,31 @@ +{ + "attendedsysupgrade": { + "description": "attended sysupgrade via rpcd and luci", + "read": { + "ubus": { + "rpc-sys": [ + "upgrade_start", + "packagelist" + ], + "system": [ + "board", + "info" + ], + "uci": [ + "get", "set", "commit" + ] + }, + "uci": [ + "attendedsysupgrade" + ] + }, + "write": { + "cgi-io": [ + "upload" + ], + "uci": [ + "attendedsysupgrade" + ] + } + } +} diff --git a/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js b/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js new file mode 100644 index 00000000..60f586de --- /dev/null +++ b/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js @@ -0,0 +1,402 @@ +function $(s) { + return document.getElementById(s.substring(1)); +} + +function show(s) { + $(s).style.display = 'block'; +} + +function hide(s) { + $(s).style.display = 'none'; +} + +function set_server() { + hide("#error_box"); + data.url = $("#server").value; + ubus_call("uci", "set", { "config": "attendedsysupgrade", "section": "server", values: { "url": data.url } }) + ubus_call("uci", "commit", { "config": "attendedsysupgrade" }) + var server_button = $("#server") + server_button.type = 'button'; + server_button.className = 'cbi-button cbi-button-edit'; + server_button.parentElement.removeChild($("#button_set")); + server_button.onclick = edit_server; +} + +function edit_server() { + $("#server").type = 'text'; + $("#server").onkeydown = function(event) { + if(event.key === 'Enter') { + set_server(); + return false; + } + } + $("#server").className = ''; + $("#server").onclick = null; + + button_set = document.createElement("input"); + button_set.type = "button"; + button_set.value = "Save"; + button_set.name = "button_set"; + button_set.id = "button_set"; + button_set.className = 'cbi-button cbi-button-edit'; + button_set.style = 'background-image: url("/luci-static/resources/cbi/save.gif");' + button_set.onclick = set_server + $("#server").parentElement.appendChild(button_set); +} + +function edit_packages() { + data.edit_packages = true + hide("#edit_button"); + $("#edit_packages").value = data.packages.join("\n"); + show("#edit_packages"); +} + +// requests to the upgrade server +function server_request(request_dict, path, callback) { + request_dict.distro = data.release.distribution; + request_dict.target = data.release.target.split("\/")[0]; + request_dict.subtarget = data.release.target.split("\/")[1]; + var request = new XMLHttpRequest(); + request.open("POST", data.url + "/" + path, true); + request.setRequestHeader("Content-type", "application/json"); + request.send(JSON.stringify(request_dict)); + request.onerror = function(e) { + error_box("upgrade server down") + show("#server_div"); + } + request.addEventListener('load', function(event) { + callback(request) + }); +} + +// initial setup, get system information +function setup() { + ubus_call("rpc-sys", "packagelist", {}, "packages"); + ubus_call("system", "board", {}, "release"); + ubus_call("system", "board", {}, "board_name"); + ubus_call("system", "board", {}, "model"); + ubus_call("system", "info", {}, "memory"); + uci_get({ "config": "attendedsysupgrade", "section": "server", "option": "url" }) + uci_get({ "config": "attendedsysupgrade", "section": "client", "option": "upgrade_packages" }) + uci_get({ "config": "attendedsysupgrade", "section": "client", "option": "advanced_mode" }) + uci_get({ "config": "attendedsysupgrade", "section": "client", "option": "auto_search" }) + setup_ready(); +} + +function setup_ready() { + // checks if a async ubus calls have finished + if(ubus_counter != ubus_closed) { + setTimeout(setup_ready, 300) + } else { + if(data.auto_search == 1) { + upgrade_check(); + } else { + show("#upgrade_button"); + show("#server_div"); + $("#server").value = data.url; + } + } +} + +function uci_get(option) { + // simple wrapper to get a uci value store in data.