diff --git a/alist/files/alist.init b/alist/files/alist.init index a1703bb2..157aa479 100755 --- a/alist/files/alist.init +++ b/alist/files/alist.init @@ -188,7 +188,7 @@ start_service() { json_dump > $data_dir/config.json - procd_open_instance + procd_open_instance alist procd_set_param command $PROG procd_append_param command server --data $data_dir procd_set_param stdout 0 @@ -196,7 +196,13 @@ start_service() { procd_set_param respawn procd_set_param limits core="unlimited" procd_set_param limits nofile="200000 200000" - procd_close_instance + procd_close_instance alist +} + +reload_service() { + stop + sleep 3 + start } service_triggers() { diff --git a/luci-app-alist/htdocs/luci-static/resources/view/alist/basic.js b/luci-app-alist/htdocs/luci-static/resources/view/alist/basic.js index 23c2416b..3cdebc7f 100644 --- a/luci-app-alist/htdocs/luci-static/resources/view/alist/basic.js +++ b/luci-app-alist/htdocs/luci-static/resources/view/alist/basic.js @@ -17,18 +17,18 @@ function getServiceStatus() { return L.resolveDefault(callServiceList('alist'), {}).then(function (res) { var isRunning = false; try { - isRunning = res['alist']['instances']['instance1']['running']; + isRunning = res['alist']['instances']['alist']['running']; } catch (e) { } return isRunning; }); } -function renderStatus(isRunning, webport) { +function renderStatus(isRunning, protocol, webport) { var spanTemp = '%s %s'; var renderHTML; if (isRunning) { - var button = String.format('', - _('Open Web Interface'), window.location.hostname, webport); + var button = String.format('', + _('Open Web Interface'), protocol, window.location.hostname, webport); renderHTML = spanTemp.format('green', 'Alist', _('RUNNING')) + button; } else { renderHTML = spanTemp.format('red', 'Alist', _('NOT RUNNING')); @@ -64,6 +64,13 @@ return view.extend({ render: function (data) { var m, s, o; var webport = uci.get(data[0], '@alist[0]', 'port') || '5244'; + var ssl = uci.get(data[0], '@alist[0]', 'ssl') || '0'; + var protocol; + if (ssl === '0') { + protocol = 'http:'; + } else if (ssl === '1') { + protocol = 'https:'; + } m = new form.Map('alist', _('Alist'), _('A file list program that supports multiple storage.') + @@ -79,7 +86,7 @@ return view.extend({ poll.add(function () { return L.resolveDefault(getServiceStatus()).then(function (res) { var view = document.getElementById('service_status'); - view.innerHTML = renderStatus(res, webport); + view.innerHTML = renderStatus(res, protocol, webport); }); }); @@ -108,10 +115,12 @@ return view.extend({ o = s.option(form.Value, 'ssl_cert', _('SSL cert'), _('SSL certificate file path')); + o.rmempty = false; o.depends('ssl', '1'); o = s.option(form.Value, 'ssl_key', _('SSL key'), _('SSL key file path')); + o.rmempty = false; o.depends('ssl', '1'); o = s.option(form.Flag, 'mysql', _('Enable Database')); diff --git a/luci-app-wechatpush/root/usr/share/serverchan/serverchan b/luci-app-wechatpush/root/usr/share/serverchan/serverchan index 157f211e..5a19c62f 100755 --- a/luci-app-wechatpush/root/usr/share/serverchan/serverchan +++ b/luci-app-wechatpush/root/usr/share/serverchan/serverchan @@ -678,9 +678,9 @@ function rand_geturl(){ echo `curl -k -s -w "%{http_code}" -m 5 ${url_str} -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.58" -o /dev/null` } local check=`getcheck` - while [ -z "$check" ] || [[ $check -ne 200 && $check -ne 301 && $check -ne 302 ]]; do + while [ -z "$check" ] || [[ $check -ne 200 && $check -ne 202 && $check -ne 301 && $check -ne 302 ]]; do local check=`getcheck` - if [ ! -z "$check" ] && [[ $check -eq 200 || $check -eq 301 || $check -eq 302 ]]; then + if [ ! -z "$check" ] && [[ $check -eq 200 || $check -eq 202 || $check -eq 301 || $check -eq 302 ]]; then [ ! -z "$network_enable" ] && [ "$network_enable" -eq "404" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【网络状态】网络恢复正常.." >> ${logfile} local network_enable="200" else