From 583a8607f15e26fff0972b1e048565b36ca5b89a Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 8 Mar 2010 19:07:13 +0000 Subject: [PATCH] luci-0.9: merge r5764 --- .../luci-initmgr/luasrc/controller/init.lua | 4 +- .../luasrc/model/cbi/init/init.lua | 46 +++++++++++++++---- po/ca/initmgr.po | 12 +++++ po/de/initmgr.po | 16 ++++++- po/el/initmgr.po | 20 ++++++-- po/en/initmgr.po | 16 ++++++- po/es/initmgr.po | 20 ++++++-- po/fr/initmgr.po | 12 +++++ po/it/initmgr.po | 12 +++++ po/ja/initmgr.po | 12 +++++ po/pt/initmgr.po | 16 ++++++- po/pt_BR/initmgr.po | 16 ++++++- po/ru/initmgr.po | 12 +++++ 13 files changed, 186 insertions(+), 28 deletions(-) diff --git a/applications/luci-initmgr/luasrc/controller/init.lua b/applications/luci-initmgr/luasrc/controller/init.lua index c7ef43f83..19771fb32 100644 --- a/applications/luci-initmgr/luasrc/controller/init.lua +++ b/applications/luci-initmgr/luasrc/controller/init.lua @@ -23,7 +23,7 @@ function index() luci.i18n.loadc("initmgr") entry( - {"admin", "system", "init"}, form("init/init"), - luci.i18n.translate("initmgr", "Init Scripts") + {"admin", "services", "init"}, form("init/init"), + luci.i18n.translate("initmgr", "Init Scripts"), 0 ).i18n = "initmgr" end diff --git a/applications/luci-initmgr/luasrc/model/cbi/init/init.lua b/applications/luci-initmgr/luasrc/model/cbi/init/init.lua index 5d915a890..c3cbc4663 100644 --- a/applications/luci-initmgr/luasrc/model/cbi/init/init.lua +++ b/applications/luci-initmgr/luasrc/model/cbi/init/init.lua @@ -32,28 +32,54 @@ end m = SimpleForm("initmgr", translate("initmgr"), translate("initmgr_desc")) m.reset = false +m.submit = false + s = m:section(Table, inits) i = s:option(DummyValue, "index", translate("initmgr_index")) n = s:option(DummyValue, "name", translate("initmgr_name")) -e = s:option(Flag, "enabled", translate("initmgr_enabled")) -e.rmempty = false -e.cfgvalue = function(self, section) - return inits[section].enabled and "1" or "0" +e = s:option(Button, "endisable", translate("initmgr_enabled")) + +e.render = function(self, section, scope) + if inits[section].enabled then + self.title = translate("initmgr_enable", "Enabled") + self.inputstyle = "save" + else + self.title = translate("initmgr_disable", "Disabled") + self.inputstyle = "reset" + end + + Button.render(self, section, scope) end -e.write = function(self, section, value) - if value == "1" and not inits[section].enabled then - inits[section].enabled = true - return luci.sys.init.enable(inits[section].name) - elseif value == "0" and inits[section].enabled then +e.write = function(self, section) + if inits[section].enabled then inits[section].enabled = false return luci.sys.init.disable(inits[section].name) + else + inits[section].enabled = true + return luci.sys.init.enable(inits[section].name) end - return true end + +start = s:option(Button, "start", translate("initmgr_start", "Start")) +start.inputstyle = "apply" +start.write = function(self, section) + luci.sys.call("/etc/init.d/%s %s" %{ inits[section].name, self.option }) +end + +restart = s:option(Button, "restart", translate("initmgr_restart", "Restart")) +restart.inputstyle = "reload" +restart.write = start.write + +stop = s:option(Button, "stop", translate("initmgr_stop", "Stop")) +stop.inputstyle = "remove" +stop.write = start.write + + return m + diff --git a/po/ca/initmgr.po b/po/ca/initmgr.po index 63b66dfa1..ed9b39c43 100644 --- a/po/ca/initmgr.po +++ b/po/ca/initmgr.po @@ -41,3 +41,15 @@ msgstr "Script d'inici" #: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5 msgid "initmgr_enabled" msgstr "Activa/Desactiva" + +#. Start +msgid "initmgr_start" +msgstr "" + +#. Stop +msgid "initmgr_stop" +msgstr "" + +#. Reload +msgid "initmgr_reload" +msgstr "" diff --git a/po/de/initmgr.po b/po/de/initmgr.po index dea77145d..2793d9fc2 100644 --- a/po/de/initmgr.po +++ b/po/de/initmgr.po @@ -22,8 +22,8 @@ msgstr "Startscripte" msgid "initmgr_desc" msgstr "" "Hier können installierte Startscripte aktiviert oder deaktiviert werden. " -"Änderungen werden erst mit einem Geräteneustart angewendet.
Warnung: Wenn essentialle Startscripte wie "network" " +"Änderungen werden erst mit einem Geräteneustart angewendet.
Warnung: Wenn essentialle Startscripte wie "network" " "deaktiviert werden könnte das Gerät unerreichbar werden!" #. Start priority @@ -40,3 +40,15 @@ msgstr "Startscript" #: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5 msgid "initmgr_enabled" msgstr "Aktivieren/Deaktivieren" + +#. Start +msgid "initmgr_start" +msgstr "" + +#. Stop +msgid "initmgr_stop" +msgstr "" + +#. Reload +msgid "initmgr_reload" +msgstr "" diff --git a/po/el/initmgr.po b/po/el/initmgr.po index cdb2f0285..6d5eb8d05 100644 --- a/po/el/initmgr.po +++ b/po/el/initmgr.po @@ -22,10 +22,10 @@ msgstr "Σενάρια Εκκίνησης" msgid "initmgr_desc" msgstr "" "Μπορείτε να ενεργοποιήσετε ή να απενεργοποιήσετε σενάρια εκκίνησης εδώ. Οι " -"αλλαγές θα εφαρμοστούν αφού επανεκκινήσετε τη συσκευή.
Προειδοποίηση: Αν απενεργοποιήσετε απαραίτητα σενάρια εκκίνησης " -"όπως το "network", η συσκευή σας μπορεί να γίνει " -"μη-προσβάσιμη!" +"αλλαγές θα εφαρμοστούν αφού επανεκκινήσετε τη συσκευή.
Προειδοποίηση: Αν απενεργοποιήσετε απαραίτητα σενάρια εκκίνησης " +"όπως το "network", η συσκευή σας μπορεί να γίνει μη-προσβάσιμη!" #. Start priority #: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:3 @@ -41,3 +41,15 @@ msgstr "Σενάριο εκκίνησης" #: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5 msgid "initmgr_enabled" msgstr "Ενεργοποίηση/Απενεργοποίηση" + +#. Start +msgid "initmgr_start" +msgstr "" + +#. Stop +msgid "initmgr_stop" +msgstr "" + +#. Reload +msgid "initmgr_reload" +msgstr "" diff --git a/po/en/initmgr.po b/po/en/initmgr.po index 3183647ca..8fdf6d17d 100644 --- a/po/en/initmgr.po +++ b/po/en/initmgr.po @@ -23,8 +23,8 @@ msgid "initmgr_desc" msgstr "" "You can enable or disable installed init scripts here. Changes will applied " "after a device reboot.
Warning: If you disable essential init " -"scripts like "network", your device might become " -"inaccesable!" +"scripts like "network", your device might become inaccesable!" #. Start priority #: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:3 @@ -40,3 +40,15 @@ msgstr "Initscript" #: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5 msgid "initmgr_enabled" msgstr "Enable/Disable" + +#. Start +msgid "initmgr_start" +msgstr "" + +#. Stop +msgid "initmgr_stop" +msgstr "" + +#. Reload +msgid "initmgr_reload" +msgstr "" diff --git a/po/es/initmgr.po b/po/es/initmgr.po index 37244b48a..f38f7a2e9 100644 --- a/po/es/initmgr.po +++ b/po/es/initmgr.po @@ -21,10 +21,10 @@ msgstr "Scripts de inicio" msgid "initmgr_desc" msgstr "" "Puede activar o desactivar los scripts de inicio (init scripts) desde aquí. " -"Los cambios serána plicados luego de que reinicie el equipo.
ADVERTENCIA: Si desactiva scripts de inicio esenciales como " -""network", su equipo puede no iniciar o volverne " -"inaccesible!." +"Los cambios serána plicados luego de que reinicie el equipo.
ADVERTENCIA: Si desactiva scripts de inicio esenciales como &" +"quot;network", su equipo puede no iniciar o volverne inaccesible!." #. Start priority #: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:3 @@ -40,3 +40,15 @@ msgstr "Nombre del script de inicio" #: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5 msgid "initmgr_enabled" msgstr "Activar/Desactivar" + +#. Start +msgid "initmgr_start" +msgstr "" + +#. Stop +msgid "initmgr_stop" +msgstr "" + +#. Reload +msgid "initmgr_reload" +msgstr "" diff --git a/po/fr/initmgr.po b/po/fr/initmgr.po index d8d3711cd..1443680b3 100644 --- a/po/fr/initmgr.po +++ b/po/fr/initmgr.po @@ -36,3 +36,15 @@ msgstr "" #: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5 msgid "initmgr_enabled" msgstr "" + +#. Start +msgid "initmgr_start" +msgstr "" + +#. Stop +msgid "initmgr_stop" +msgstr "" + +#. Reload +msgid "initmgr_reload" +msgstr "" diff --git a/po/it/initmgr.po b/po/it/initmgr.po index d8d3711cd..1443680b3 100644 --- a/po/it/initmgr.po +++ b/po/it/initmgr.po @@ -36,3 +36,15 @@ msgstr "" #: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5 msgid "initmgr_enabled" msgstr "" + +#. Start +msgid "initmgr_start" +msgstr "" + +#. Stop +msgid "initmgr_stop" +msgstr "" + +#. Reload +msgid "initmgr_reload" +msgstr "" diff --git a/po/ja/initmgr.po b/po/ja/initmgr.po index d8d3711cd..1443680b3 100644 --- a/po/ja/initmgr.po +++ b/po/ja/initmgr.po @@ -36,3 +36,15 @@ msgstr "" #: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5 msgid "initmgr_enabled" msgstr "" + +#. Start +msgid "initmgr_start" +msgstr "" + +#. Stop +msgid "initmgr_stop" +msgstr "" + +#. Reload +msgid "initmgr_reload" +msgstr "" diff --git a/po/pt/initmgr.po b/po/pt/initmgr.po index 56fc6b9de..5e60af02f 100644 --- a/po/pt/initmgr.po +++ b/po/pt/initmgr.po @@ -22,8 +22,8 @@ msgstr "Scripts de Inicialização" msgid "initmgr_desc" msgstr "" "Você pode ativar ou desativar os scripts de inicialização instalados aqui. " -"As mudanças serão aplicadas após a reinicialização do equipamento.
Aviso: Se você desativar algum script de inicialização essencial " +"As mudanças serão aplicadas após a reinicialização do equipamento.
Aviso: Se você desativar algum script de inicialização essencial " "como por exemplo "rede/network", o dispositivo poderá tornar-se " "inacessível!" @@ -41,3 +41,15 @@ msgstr "Script de inicialização" #: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5 msgid "initmgr_enabled" msgstr "Ativar/Desativar" + +#. Start +msgid "initmgr_start" +msgstr "" + +#. Stop +msgid "initmgr_stop" +msgstr "" + +#. Reload +msgid "initmgr_reload" +msgstr "" diff --git a/po/pt_BR/initmgr.po b/po/pt_BR/initmgr.po index a2d557fb6..2d841404a 100644 --- a/po/pt_BR/initmgr.po +++ b/po/pt_BR/initmgr.po @@ -22,8 +22,8 @@ msgstr "Scripts de Inicialização" msgid "initmgr_desc" msgstr "" "Você pode ativar ou desativar os scripts de inicialização instalados aqui. " -"As mudanças serão aplicadas após a reinicialização do equipamento.
Aviso: Se você desativar algum script de inicialização essencial " +"As mudanças serão aplicadas após a reinicialização do equipamento.
Aviso: Se você desativar algum script de inicialização essencial " "como por exemplo "rede/network", o dispositivo poderá tornar-se " "inacessível!" @@ -41,3 +41,15 @@ msgstr "Script de inicialização" #: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5 msgid "initmgr_enabled" msgstr "Ativar/Desativar" + +#. Start +msgid "initmgr_start" +msgstr "" + +#. Stop +msgid "initmgr_stop" +msgstr "" + +#. Reload +msgid "initmgr_reload" +msgstr "" diff --git a/po/ru/initmgr.po b/po/ru/initmgr.po index d8d3711cd..1443680b3 100644 --- a/po/ru/initmgr.po +++ b/po/ru/initmgr.po @@ -36,3 +36,15 @@ msgstr "" #: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5 msgid "initmgr_enabled" msgstr "" + +#. Start +msgid "initmgr_start" +msgstr "" + +#. Stop +msgid "initmgr_stop" +msgstr "" + +#. Reload +msgid "initmgr_reload" +msgstr "" -- 2.25.1