Update
This commit is contained in:
@@ -58,13 +58,13 @@ function renderStatus(isRunning) {
|
|||||||
function renderLogin(loginStatus, authURL) {
|
function renderLogin(loginStatus, authURL) {
|
||||||
var spanTemp = '<span style="color:%s">%s</span>';
|
var spanTemp = '<span style="color:%s">%s</span>';
|
||||||
var renderHTML;
|
var renderHTML;
|
||||||
if (loginStatus.backendState == undefined) {
|
if (loginStatus == undefined) {
|
||||||
renderHTML = String.format(spanTemp, 'orange', _('NOT RUNNING'));
|
renderHTML = String.format(spanTemp, 'orange', _('NOT RUNNING'));
|
||||||
} else {
|
} else {
|
||||||
if (loginStatus.backendState == "NeedsLogin") {
|
if (loginStatus == "NeedsLogin") {
|
||||||
renderHTML = String.format('<a href="%s" target="_blank">%s</a>', authURL, _('Needs Login'));
|
renderHTML = String.format('<a href="%s" target="_blank">%s</a>', authURL, _('Needs Login'));
|
||||||
} else {
|
} else {
|
||||||
renderHTML = String.format(spanTemp, 'green', _('Logged IN'));
|
renderHTML = String.format(spanTemp, 'green', _('Logged In'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ return view.extend({
|
|||||||
o.renderWidget = function(section_id, option_id) {
|
o.renderWidget = function(section_id, option_id) {
|
||||||
poll.add(function() {
|
poll.add(function() {
|
||||||
return L.resolveDefault(getLoginStatus()).then(function(res) {
|
return L.resolveDefault(getLoginStatus()).then(function(res) {
|
||||||
document.getElementById('login_status_div').innerHTML = renderLogin(res, res.authURL);
|
document.getElementById('login_status_div').innerHTML = renderLogin(res.backendState, res.authURL);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/* SPDX-License-Identifier: GPL-3.0-only
|
/* SPDX-License-Identifier: GPL-3.0-only
|
||||||
*
|
*
|
||||||
|
* Copyright (C) 2022 ImmortalWrt.org
|
||||||
* Copyright (C) 2024 asvow
|
* Copyright (C) 2024 asvow
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
2
root/etc/config/tailscale
Normal file
2
root/etc/config/tailscale
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
config tailscale 'settings'
|
||||||
|
option enabled '0'
|
||||||
@@ -66,7 +66,7 @@ start_instance() {
|
|||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
config_load 'tailscale'
|
config_load 'tailscale'
|
||||||
config_foreach start_instance 'settings'
|
config_foreach start_instance 'tailscale'
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_instance() {
|
stop_instance() {
|
||||||
@@ -80,7 +80,7 @@ stop_instance() {
|
|||||||
|
|
||||||
stop_service() {
|
stop_service() {
|
||||||
config_load 'tailscale'
|
config_load 'tailscale'
|
||||||
config_foreach stop_instance 'settings'
|
config_foreach stop_instance 'tailscale'
|
||||||
}
|
}
|
||||||
|
|
||||||
reload_service() {
|
reload_service() {
|
||||||
|
|||||||
Reference in New Issue
Block a user