summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-12-14 07:14:18 +0100
committerGitHub <noreply@github.com>2018-12-14 07:14:18 +0100
commitb5fb2a841f476cfc35bde65a52484be38e5ce5c4 (patch)
tree540ad7440510d62d11794cb64e1c9d9c263df88d
parent76f81c262c2db625a3f36743db25c87377bf61b4 (diff)
parent83703aaec0f03d9dc4962bcfa672f86d8a3b0cdc (diff)
Merge pull request #2375 from sotux/master-luci-app-aria2
luci-app-aria2: fix showRPCURL when using https
-rw-r--r--applications/luci-app-aria2/Makefile2
-rw-r--r--applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm11
2 files changed, 8 insertions, 5 deletions
diff --git a/applications/luci-app-aria2/Makefile b/applications/luci-app-aria2/Makefile
index e957c436f..4bac79dee 100644
--- a/applications/luci-app-aria2/Makefile
+++ b/applications/luci-app-aria2/Makefile
@@ -14,7 +14,7 @@ PKG_VERSION:=1.0.1
# Release == build
# increase on changes of translation files
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_LICENSE:=Apache-2.0
PKG_MAINTAINER:=Hsing-Wang Liao <kuoruan@gmail.com>
diff --git a/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm b/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm
index a06d2015f..318182c08 100644
--- a/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm
+++ b/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm
@@ -45,11 +45,14 @@ function showRPCURL() {
var auth_method = document.getElementById("cbid.aria2.main.rpc_auth_method");
var auth_port = document.getElementById("cbid.aria2.main.rpc_listen_port");
var auth_port_value;
+ if (window.location.protocol == "https:") {
+ protocol += "s";
+ }
if (auth_port.value == "") {
- auth_port_value = "6800"
+ auth_port_value = "6800";
} else {
- auth_port_value = auth_port.value
- };
+ auth_port_value = auth_port.value;
+ }
if (auth_method.value == "token") {
var auth_token = document.getElementById("cbid.aria2.main.rpc_secret");
newTextNode.value = protocol + "://token:" + auth_token.value + "@" + document.domain + ":" + auth_port_value + "/jsonrpc";
@@ -68,7 +71,7 @@ function openWebUI(path) {
var pos = curWwwPath.indexOf(pathName);
var localhostPath = curWwwPath.substring(0, pos);
var url = localhostPath + "/" + path;
- window.open(url)
+ window.open(url);
};
//]]>
</script>