diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-02-26 12:49:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 12:49:11 +0100 |
commit | 7c6c043df7323b74e96d892568f5defcd8e7fd0f (patch) | |
tree | 903001ce25e1b6b03d447cf1ccd2aa95bfe0f8f3 | |
parent | 507654bcc81871460bf79640788023bf2e05160f (diff) | |
parent | 36e66aeba0e3e1414544d16078d28cb65c2c961c (diff) |
Merge pull request #3686 from etactica/pk-to-js
luci-app-pagekitec: convert pagekite ui to js
4 files changed, 40 insertions, 30 deletions
diff --git a/applications/luci-app-pagekitec/Makefile b/applications/luci-app-pagekitec/Makefile index ea6132342..d87500977 100644 --- a/applications/luci-app-pagekitec/Makefile +++ b/applications/luci-app-pagekitec/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI Support for PageKite -LUCI_DEPENDS:=+luci-compat +pagekitec +LUCI_DEPENDS:=+pagekitec PKG_MAINTAINER:=Karl Palsson <karlp@tweak.net.au> diff --git a/applications/luci-app-pagekitec/htdocs/luci-static/resources/view/pagekitec.js b/applications/luci-app-pagekitec/htdocs/luci-static/resources/view/pagekitec.js new file mode 100644 index 000000000..13161de7a --- /dev/null +++ b/applications/luci-app-pagekitec/htdocs/luci-static/resources/view/pagekitec.js @@ -0,0 +1,37 @@ +'use strict'; +'require form'; + +var desc = _("" + + "<p/>Note: you need a working PageKite account, or at least, your own running front end for this form to work. " + + "Visit <a href='https://pagekite.net/home/'>your account</a> to set up a name for your " + + "router and get a secret key for the connection." + + "<p/><em>Note: this web configurator only supports " + + "some very very basic uses of pagekite.</em>" +); + +return L.view.extend({ + render: function() { + var m, s, o; + + m = new form.Map('pagekitec', _('PageKite'), desc); + + s = m.section(form.TypedSection, 'pagekitec', _("Configuration")); + s.anonymous = true; + + o = s.option(form.Value, "kitename", _("Kite Name")); + o = s.option(form.Value, "kitesecret", _("Kite Secret")); + o.password = true; + + o = s.option(form.Flag, "static", _("Static setup"), + _("Static setup, disable FE failover and DDNS updates, set this if you are running your " + + "own frontend without a pagekite.me account")); + o = s.option(form.Flag, "simple_http", _("Basic HTTP"), _("Enable a tunnel to the local HTTP server (in most cases, this admin interface)")); + o = s.option(form.Flag, "simple_ssh", _("Basic SSH"), _("Enable a tunnel to the local SSH server")); + o = s.option(form.Value, "simple_ws", _("Basic WebSockets"), _("Enable a WebSockets tunnel on a given local port")); + o.placeholder = 8083; + o.datatype = "port"; + o.optional = true; + + return m.render(); + } +}); diff --git a/applications/luci-app-pagekitec/luasrc/model/cbi/pagekitec.lua b/applications/luci-app-pagekitec/luasrc/model/cbi/pagekitec.lua deleted file mode 100644 index 1abd3f79d..000000000 --- a/applications/luci-app-pagekitec/luasrc/model/cbi/pagekitec.lua +++ /dev/null @@ -1,26 +0,0 @@ -m = Map("pagekitec", translate("PageKite"), - translate([[ -<p/>Note: you need a working PageKite account, or at least, your own running front end for this form to work. -Visit <a href="https://pagekite.net/home/">your account</a> to set up a name for your -router and get a secret key for the connection. -<p/><em>Note: this web configurator only supports -some very very basic uses of pagekite.</em> -]])) - -s = m:section(TypedSection, "pagekitec", translate("PageKite")) -s.anonymous = true - -p = s:option(Value, "kitename", translate("Kite Name")) -p = s:option(Value, "kitesecret", translate("Kite Secret")) -p.password = true -p = s:option(Flag, "static", translate("Static Setup"), - translate([[Static setup, disable FE failover and DDNS updates, set this if you are running your - own frontend without a pagekite.me account]])) - -p = s:option(Flag, "simple_http", translate("Basic HTTP"), - translate([[Enable a tunnel to the local HTTP server (in most cases, this admin -site)]])) -p = s:option(Flag, "simple_ssh", translate("Basic SSH"), - translate([[Enable a tunnel to the local SSH server]])) - -return m diff --git a/applications/luci-app-pagekitec/root/usr/share/luci/menu.d/luci-app-pagekitec.json b/applications/luci-app-pagekitec/root/usr/share/luci/menu.d/luci-app-pagekitec.json index 54af904c5..fbbda3a26 100644 --- a/applications/luci-app-pagekitec/root/usr/share/luci/menu.d/luci-app-pagekitec.json +++ b/applications/luci-app-pagekitec/root/usr/share/luci/menu.d/luci-app-pagekitec.json @@ -2,9 +2,8 @@ "admin/services/pagekitec": { "title": "PageKite", "action": { - "type": "cbi", - "path": "pagekitec", - "post": { "cbi.submit": true } + "type": "view", + "path": "pagekitec" } } } |