optimize & bump version
This commit is contained in:
@@ -12,54 +12,52 @@
|
||||
'require view';
|
||||
|
||||
return view.extend({
|
||||
load: function() {
|
||||
return fs.exec('/sbin/ip', ['-s', '-j', 'ad']).then(function(res) {
|
||||
if (res.code !== 0 || !res.stdout || res.stdout.trim() === '') {
|
||||
ui.addNotification(null, E('p', {}, _('Unable to get interface info: %s.').format(res.message)));
|
||||
return [];
|
||||
}
|
||||
async load() {
|
||||
const res = await fs.exec('/sbin/ip', ['-s', '-j', 'ad']);
|
||||
if (res.code !== 0 || !res.stdout || res.stdout.trim() === '') {
|
||||
ui.addNotification(null, E('p', {}, _('Unable to get interface info: %s.').format(res.message)));
|
||||
return [];
|
||||
}
|
||||
|
||||
try {
|
||||
const interfaces = JSON.parse(res.stdout);
|
||||
const tailscaleInterfaces = interfaces.filter(iface => iface.ifname.match(/tailscale[0-9]+/));
|
||||
try {
|
||||
const interfaces = JSON.parse(res.stdout);
|
||||
const tailscaleInterfaces = interfaces.filter(iface => iface.ifname.match(/tailscale[0-9]+/));
|
||||
|
||||
return tailscaleInterfaces.map(iface => {
|
||||
const parsedInfo = {
|
||||
name: iface.ifname
|
||||
};
|
||||
return tailscaleInterfaces.map(iface => {
|
||||
const parsedInfo = {
|
||||
name: iface.ifname
|
||||
};
|
||||
|
||||
const addr_info = iface.addr_info || [];
|
||||
addr_info.forEach(addr => {
|
||||
if (addr.family === 'inet') {
|
||||
parsedInfo.ipv4 = addr.local;
|
||||
} else if (addr.family === 'inet6') {
|
||||
parsedInfo.ipv6 = addr.local;
|
||||
}
|
||||
});
|
||||
|
||||
parsedInfo.mtu = iface.mtu;
|
||||
parsedInfo.rxBytes = '%1024mB'.format(iface.stats64.rx.bytes);
|
||||
parsedInfo.txBytes = '%1024mB'.format(iface.stats64.tx.bytes);
|
||||
|
||||
return parsedInfo;
|
||||
const addr_info = iface.addr_info || [];
|
||||
addr_info.forEach(addr => {
|
||||
if (addr.family === 'inet') {
|
||||
parsedInfo.ipv4 = addr.local;
|
||||
} else if (addr.family === 'inet6') {
|
||||
parsedInfo.ipv6 = addr.local;
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
ui.addNotification(null, E('p', {}, _('Error parsing interface info: %s.').format(e.message)));
|
||||
return [];
|
||||
}
|
||||
|
||||
parsedInfo.mtu = iface.mtu;
|
||||
parsedInfo.rxBytes = '%1024mB'.format(iface.stats64.rx.bytes);
|
||||
parsedInfo.txBytes = '%1024mB'.format(iface.stats64.tx.bytes);
|
||||
|
||||
return parsedInfo;
|
||||
});
|
||||
} catch (e) {
|
||||
ui.addNotification(null, E('p', {}, _('Error parsing interface info: %s.').format(e.message)));
|
||||
return [];
|
||||
}
|
||||
},
|
||||
|
||||
pollData(container) {
|
||||
poll.add(async () => {
|
||||
const data = await this.load();
|
||||
dom.content(container, this.renderContent(data));
|
||||
});
|
||||
},
|
||||
|
||||
pollData: function (container) {
|
||||
poll.add(L.bind(function () {
|
||||
return this.load().then(L.bind(function (data) {
|
||||
dom.content(container, this.renderContent(data));
|
||||
}, this));
|
||||
}, this));
|
||||
},
|
||||
|
||||
renderContent: function (data) {
|
||||
if (!Array.isArray(data)) {
|
||||
renderContent(data) {
|
||||
if (!Array.isArray(data) || data.length === 0) {
|
||||
return E('div', {}, _('No interface online.'));
|
||||
}
|
||||
const rows = [
|
||||
@@ -97,7 +95,7 @@ return view.extend({
|
||||
return E('table', { 'class': 'table' }, rows);
|
||||
},
|
||||
|
||||
render: function(data) {
|
||||
render(data) {
|
||||
const content = E([], [
|
||||
E('h2', { class: 'content' }, _('Tailscale')),
|
||||
E('div', { class: 'cbi-map-descr' }, _('Tailscale is a cross-platform and easy to use virtual LAN.')),
|
||||
|
||||
@@ -5,67 +5,66 @@
|
||||
'require view';
|
||||
|
||||
return view.extend({
|
||||
retrieveLog: async function() {
|
||||
return Promise.all([
|
||||
async retrieveLog() {
|
||||
const stat = await Promise.all([
|
||||
L.resolveDefault(fs.stat('/sbin/logread'), null),
|
||||
L.resolveDefault(fs.stat('/usr/sbin/logread'), null)
|
||||
]).then(function(stat) {
|
||||
var logger = stat[0] ? stat[0].path : stat[1] ? stat[1].path : null;
|
||||
]);
|
||||
const logger = stat[0] ? stat[0].path : stat[1] ? stat[1].path : null;
|
||||
|
||||
return fs.exec_direct(logger, [ '-e', 'tailscale' ]).then(logdata => {
|
||||
var statusMappings = {
|
||||
'daemon.err': { status: 'StdErr', startIndex: 9 },
|
||||
'daemon.notice': { status: 'Info', startIndex: 10 }
|
||||
};
|
||||
const loglines = logdata.trim().split(/\n/).map(function(log) {
|
||||
var logParts = log.split(' ').filter(Boolean);
|
||||
if (logParts.length >= 6) {
|
||||
var formattedTime = logParts[1] + ' ' + logParts[2] + ' - ' + logParts[3];
|
||||
var status = logParts[5];
|
||||
var mapping = statusMappings[status] || { status: status, startIndex: 9 };
|
||||
status = mapping.status;
|
||||
var startIndex = mapping.startIndex;
|
||||
var message = logParts.slice(startIndex).join(' ');
|
||||
return formattedTime + ' [ ' + status + ' ] - ' + message;
|
||||
} else {
|
||||
return 'Log is empty.';
|
||||
}
|
||||
}).filter(Boolean);
|
||||
return { value: loglines.join('\n'), rows: loglines.length + 1 };
|
||||
}).catch(function(err) {
|
||||
ui.addNotification(null, E('p', {}, _('Unable to load log data: ' + err.message)));
|
||||
return '';
|
||||
});
|
||||
});
|
||||
const logdata = await fs.exec_direct(logger, ['-e', 'tailscale']);
|
||||
const statusMappings = {
|
||||
'daemon.err': { status: 'StdErr', startIndex: 9 },
|
||||
'daemon.notice': { status: 'Info', startIndex: 10 }
|
||||
};
|
||||
const loglines = logdata.trim().split(/\n/).map(function(log) {
|
||||
const logParts = log.split(' ').filter(Boolean);
|
||||
if (logParts.length >= 6) {
|
||||
const formattedTime = `${logParts[1]} ${logParts[2]} - ${logParts[3]}`;
|
||||
const status = logParts[5];
|
||||
const mapping = statusMappings[status] || { status: status, startIndex: 9 };
|
||||
const newStatus = mapping.status;
|
||||
const startIndex = mapping.startIndex;
|
||||
const message = logParts.slice(startIndex).join(' ');
|
||||
return `${formattedTime} [ ${newStatus} ] - ${message}`;
|
||||
} else {
|
||||
return 'Log is empty.';
|
||||
}
|
||||
}).filter(Boolean);
|
||||
return { value: loglines.join('\n'), rows: loglines.length + 1 };
|
||||
},
|
||||
|
||||
pollLog: async function() {
|
||||
async pollLog() {
|
||||
const element = document.getElementById('syslog');
|
||||
if (element) {
|
||||
const log = await this.retrieveLog();
|
||||
element.value = log.value;
|
||||
element.rows = log.rows;
|
||||
try {
|
||||
const log = await this.retrieveLog();
|
||||
element.value = log.value;
|
||||
element.rows = log.rows;
|
||||
} catch (err) {
|
||||
ui.addNotification(null, E('p', {}, _('Unable to load log data: ' + err.message)));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
load: async function() {
|
||||
load() {
|
||||
poll.add(this.pollLog.bind(this));
|
||||
return await this.retrieveLog();
|
||||
return this.retrieveLog();
|
||||
},
|
||||
|
||||
render: function(loglines) {
|
||||
var scrollDownButton = E('button', {
|
||||
'id': 'scrollDownButton',
|
||||
'class': 'cbi-button cbi-button-neutral'
|
||||
render(loglines) {
|
||||
const scrollDownButton = E('button', {
|
||||
id: 'scrollDownButton',
|
||||
class: 'cbi-button cbi-button-neutral'
|
||||
}, _('Scroll to tail', 'scroll to bottom (the tail) of the log file')
|
||||
);
|
||||
scrollDownButton.addEventListener('click', function() {
|
||||
scrollUpButton.scrollIntoView();
|
||||
});
|
||||
|
||||
var scrollUpButton = E('button', {
|
||||
'id' : 'scrollUpButton',
|
||||
'class': 'cbi-button cbi-button-neutral'
|
||||
const scrollUpButton = E('button', {
|
||||
id : 'scrollUpButton',
|
||||
class: 'cbi-button cbi-button-neutral'
|
||||
}, _('Scroll to head', 'scroll to top (the head) of the log file')
|
||||
);
|
||||
scrollUpButton.addEventListener('click', function() {
|
||||
@@ -73,16 +72,16 @@ return view.extend({
|
||||
});
|
||||
|
||||
return E([], [
|
||||
E('div', { 'id': 'content_syslog' }, [
|
||||
E('div', {'style': 'padding-bottom: 20px'}, [scrollDownButton]),
|
||||
E('div', { id: 'content_syslog' }, [
|
||||
E('div', { style: 'padding-bottom: 20px' }, [scrollDownButton]),
|
||||
E('textarea', {
|
||||
'id': 'syslog',
|
||||
'style': 'font-size:12px',
|
||||
'readonly': 'readonly',
|
||||
'wrap': 'off',
|
||||
'rows': loglines.rows,
|
||||
id: 'syslog',
|
||||
style: 'font-size:12px',
|
||||
readonly: 'readonly',
|
||||
wrap: 'off',
|
||||
rows: loglines.rows,
|
||||
}, [ loglines.value ]),
|
||||
E('div', {'style': 'padding-bottom: 20px'}, [scrollUpButton])
|
||||
E('div', { style: 'padding-bottom: 20px' }, [scrollUpButton])
|
||||
])
|
||||
]);
|
||||
},
|
||||
|
||||
@@ -12,33 +12,32 @@
|
||||
'require uci';
|
||||
'require view';
|
||||
|
||||
var callServiceList = rpc.declare({
|
||||
const callServiceList = rpc.declare({
|
||||
object: 'service',
|
||||
method: 'list',
|
||||
params: ['name'],
|
||||
expect: { '': {} }
|
||||
});
|
||||
|
||||
function getInterfaceSubnets(interfaces = ['lan', 'wan']) {
|
||||
return network.getNetworks().then(networks => {
|
||||
return [...new Set(
|
||||
networks
|
||||
.filter(ifc => interfaces.includes(ifc.getName()))
|
||||
.flatMap(ifc => ifc.getIPAddrs())
|
||||
.filter(addr => addr.includes('/'))
|
||||
.map(addr => {
|
||||
const [ip, cidr] = addr.split('/');
|
||||
const ipParts = ip.split('.').map(Number);
|
||||
const mask = ~((1 << (32 - parseInt(cidr))) - 1);
|
||||
const subnetParts = ipParts.map((part, i) => (part & (mask >> (24 - i * 8))) & 255);
|
||||
return `${subnetParts.join('.')}/${cidr}`;
|
||||
})
|
||||
)];
|
||||
});
|
||||
async function getInterfaceSubnets(interfaces = ['lan', 'wan']) {
|
||||
const networks = await network.getNetworks();
|
||||
return [...new Set(
|
||||
networks
|
||||
.filter(ifc => interfaces.includes(ifc.getName()))
|
||||
.flatMap(ifc => ifc.getIPAddrs())
|
||||
.filter(addr => addr.includes('/'))
|
||||
.map(addr => {
|
||||
const [ip, cidr] = addr.split('/');
|
||||
const ipParts = ip.split('.').map(Number);
|
||||
const mask = ~((1 << (32 - parseInt(cidr))) - 1);
|
||||
const subnetParts = ipParts.map((part, i) => (part & (mask >> (24 - i * 8))) & 255);
|
||||
return `${subnetParts.join('.')}/${cidr}`;
|
||||
})
|
||||
)];
|
||||
}
|
||||
|
||||
function getStatus() {
|
||||
var status = {
|
||||
async function getStatus() {
|
||||
const status = {
|
||||
isRunning: false,
|
||||
backendState: undefined,
|
||||
authURL: undefined,
|
||||
@@ -46,32 +45,32 @@ function getStatus() {
|
||||
onlineExitNodes: [],
|
||||
subnetRoutes: []
|
||||
};
|
||||
return Promise.resolve(callServiceList('tailscale')).then(res => {
|
||||
try {
|
||||
status.isRunning = res['tailscale']['instances']['instance1']['running'];
|
||||
} catch (e) {
|
||||
return status;
|
||||
}
|
||||
return fs.exec("/usr/sbin/tailscale", ["status", "--json"]).then(res => {
|
||||
const tailscaleStatus = JSON.parse(res.stdout.replace(/("\w+"):\s*(\d+)/g, '$1:"$2"'));
|
||||
if (!tailscaleStatus.AuthURL && tailscaleStatus.BackendState === "NeedsLogin") {
|
||||
fs.exec("/usr/sbin/tailscale", ["login"]);
|
||||
}
|
||||
status.backendState = tailscaleStatus.BackendState;
|
||||
status.authURL = tailscaleStatus.AuthURL;
|
||||
status.displayName = (status.backendState === "Running") ? tailscaleStatus.User[tailscaleStatus.Self.UserID].DisplayName : undefined;
|
||||
status.onlineExitNodes = Object.values(tailscaleStatus.Peer)
|
||||
.flatMap(peer => (peer.ExitNodeOption && peer.Online) ? [peer.HostName] : []);
|
||||
status.subnetRoutes = Object.values(tailscaleStatus.Peer)
|
||||
.flatMap(peer => peer.PrimaryRoutes || []);
|
||||
return status;
|
||||
});
|
||||
}).catch(() => status);
|
||||
const res = await callServiceList('tailscale');
|
||||
try {
|
||||
status.isRunning = res['tailscale']['instances']['instance1']['running'];
|
||||
} catch (e) {
|
||||
return status;
|
||||
}
|
||||
const tailscaleRes = await fs.exec("/usr/sbin/tailscale", ["status", "--json"]);
|
||||
const tailscaleStatus = JSON.parse(tailscaleRes.stdout.replace(/("\w+"):\s*(\d+)/g, '$1:"$2"'));
|
||||
if (!tailscaleStatus.AuthURL && tailscaleStatus.BackendState === "NeedsLogin") {
|
||||
fs.exec("/usr/sbin/tailscale", ["login"]);
|
||||
}
|
||||
status.backendState = tailscaleStatus.BackendState;
|
||||
status.authURL = tailscaleStatus.AuthURL;
|
||||
status.displayName = (status.backendState === "Running") ? tailscaleStatus.User[tailscaleStatus.Self.UserID].DisplayName : undefined;
|
||||
if (tailscaleStatus.Peer) {
|
||||
status.onlineExitNodes = Object.values(tailscaleStatus.Peer)
|
||||
.flatMap(peer => (peer.ExitNodeOption && peer.Online) ? [peer.HostName] : []);
|
||||
status.subnetRoutes = Object.values(tailscaleStatus.Peer)
|
||||
.flatMap(peer => peer.PrimaryRoutes || []);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
function renderStatus(isRunning) {
|
||||
var spanTemp = '<em><span style="color:%s"><strong>%s %s</strong></span></em>';
|
||||
var renderHTML;
|
||||
const spanTemp = '<em><span style="color:%s"><strong>%s %s</strong></span></em>';
|
||||
let renderHTML;
|
||||
if (isRunning) {
|
||||
renderHTML = String.format(spanTemp, 'green', _('Tailscale'), _('RUNNING'));
|
||||
} else {
|
||||
@@ -82,11 +81,11 @@ function renderStatus(isRunning) {
|
||||
}
|
||||
|
||||
function renderLogin(loginStatus, authURL, displayName) {
|
||||
var spanTemp = '<span style="color:%s">%s</span>';
|
||||
var renderHTML;
|
||||
if (loginStatus == "NeedsLogin") {
|
||||
const spanTemp = '<span style="color:%s">%s</span>';
|
||||
let renderHTML;
|
||||
if (loginStatus === "NeedsLogin") {
|
||||
renderHTML = String.format('<a href="%s" target="_blank">%s</a>', authURL, _('Need to log in'));
|
||||
} else if (loginStatus == "Running") {
|
||||
} else if (loginStatus === "Running") {
|
||||
renderHTML = String.format('<a href="%s" target="_blank">%s</a>', 'https://login.tailscale.com/admin/machines', displayName);
|
||||
renderHTML += String.format('<br><a style="color:green" id="logout_button">%s</a>', _('Log out and Unbind'));
|
||||
} else {
|
||||
@@ -97,7 +96,7 @@ function renderLogin(loginStatus, authURL, displayName) {
|
||||
}
|
||||
|
||||
return view.extend({
|
||||
load: function() {
|
||||
load() {
|
||||
return Promise.all([
|
||||
uci.load('tailscale'),
|
||||
getStatus(),
|
||||
@@ -105,33 +104,32 @@ return view.extend({
|
||||
]);
|
||||
},
|
||||
|
||||
render: function(data) {
|
||||
var m, s, o;
|
||||
var statusData = data[1];
|
||||
var interfaceSubnets = data[2];
|
||||
var onlineExitNodes = statusData.onlineExitNodes;
|
||||
var subnetRoutes = statusData.subnetRoutes;
|
||||
render(data) {
|
||||
let m, s, o;
|
||||
const statusData = data[1];
|
||||
const interfaceSubnets = data[2];
|
||||
const onlineExitNodes = statusData.onlineExitNodes;
|
||||
const subnetRoutes = statusData.subnetRoutes;
|
||||
|
||||
m = new form.Map('tailscale', _('Tailscale'), _('Tailscale is a cross-platform and easy to use virtual LAN.'));
|
||||
|
||||
s = m.section(form.TypedSection);
|
||||
s.anonymous = true;
|
||||
s.render = function () {
|
||||
poll.add(function() {
|
||||
return Promise.resolve(getStatus()).then(function(res) {
|
||||
var service_view = document.getElementById("service_status");
|
||||
var login_view = document.getElementById("login_status_div");
|
||||
service_view.innerHTML = renderStatus(res.isRunning);
|
||||
login_view.innerHTML = renderLogin(res.backendState, res.authURL, res.displayName);
|
||||
var logoutButton = document.getElementById('logout_button');
|
||||
if (logoutButton) {
|
||||
logoutButton.onclick = function() {
|
||||
if (confirm(_('Are you sure you want to log out and unbind the current device?'))) {
|
||||
fs.exec("/usr/sbin/tailscale", ["logout"]);
|
||||
}
|
||||
poll.add(async function() {
|
||||
const res = await getStatus();
|
||||
const service_view = document.getElementById("service_status");
|
||||
const login_view = document.getElementById("login_status_div");
|
||||
service_view.innerHTML = renderStatus(res.isRunning);
|
||||
login_view.innerHTML = renderLogin(res.backendState, res.authURL, res.displayName);
|
||||
const logoutButton = document.getElementById('logout_button');
|
||||
if (logoutButton) {
|
||||
logoutButton.onclick = function() {
|
||||
if (confirm(_('Are you sure you want to log out and unbind the current device?'))) {
|
||||
fs.exec("/usr/sbin/tailscale", ["logout"]);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return E('div', { class: 'cbi-section', id: 'status_bar' }, [
|
||||
@@ -177,7 +175,7 @@ return view.extend({
|
||||
|
||||
s.tab('advance', _('Advanced Settings'));
|
||||
|
||||
o = s.taboption('advance', form.Flag, 'acceptRoutes', _('Accept Routes'), _('Accept subnet routes that other nodes advertise.'));
|
||||
o = s.taboption('advance', form.Flag, 'accept_routes', _('Accept Routes'), _('Accept subnet routes that other nodes advertise.'));
|
||||
o.default = o.disabled;
|
||||
o.rmempty = false;
|
||||
|
||||
@@ -185,15 +183,15 @@ return view.extend({
|
||||
o.default = '';
|
||||
o.rmempty = true;
|
||||
|
||||
o = s.taboption('advance', form.Flag, 'acceptDNS', _('Accept DNS'), _('Accept DNS configuration from the Tailscale admin console.'));
|
||||
o = s.taboption('advance', form.Flag, 'accept_dns', _('Accept DNS'), _('Accept DNS configuration from the Tailscale admin console.'));
|
||||
o.default = o.enabled;
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.taboption('advance', form.Flag, 'advertiseExitNode', _('Exit Node'), _('Offer to be an exit node for outbound internet traffic from the Tailscale network.'));
|
||||
o = s.taboption('advance', form.Flag, 'advertise_exit_node', _('Exit Node'), _('Offer to be an exit node for outbound internet traffic from the Tailscale network.'));
|
||||
o.default = o.disabled;
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.taboption('advance', form.ListValue, 'exitNode', _('Online Exit Nodes'), _('Select an online machine name to use as an exit node.'));
|
||||
o = s.taboption('advance', form.ListValue, 'exit_node', _('Online Exit Nodes'), _('Select an online machine name to use as an exit node.'));
|
||||
if (onlineExitNodes.length > 0) {
|
||||
o.optional = true;
|
||||
onlineExitNodes.forEach(function(node) {
|
||||
@@ -204,10 +202,10 @@ return view.extend({
|
||||
o.readonly = true;
|
||||
}
|
||||
o.default = '';
|
||||
o.depends('advertiseExitNode', '0');
|
||||
o.depends('advertise_exit_node', '0');
|
||||
o.rmempty = true;
|
||||
|
||||
o = s.taboption('advance', form.DynamicList, 'advertiseRoutes', _('Expose Subnets'), _('Expose physical network routes into Tailscale, e.g. <code>10.0.0.0/24</code>.'));
|
||||
o = s.taboption('advance', form.DynamicList, 'advertise_routes', _('Expose Subnets'), _('Expose physical network routes into Tailscale, e.g. <code>10.0.0.0/24</code>.'));
|
||||
if (interfaceSubnets.length > 0) {
|
||||
interfaceSubnets.forEach(function(subnet) {
|
||||
o.value(subnet, subnet);
|
||||
@@ -216,12 +214,12 @@ return view.extend({
|
||||
o.default = '';
|
||||
o.rmempty = true;
|
||||
|
||||
o = s.taboption('advance', form.Flag, 's2s', _('Site To Site'), _('Use site-to-site layer 3 networking to connect subnets on the Tailscale network.'));
|
||||
o = s.taboption('advance', form.Flag, 'disable_snat_subnet_routes', _('Site To Site'), _('Use site-to-site layer 3 networking to connect subnets on the Tailscale network.'));
|
||||
o.default = o.disabled;
|
||||
o.depends('acceptRoutes', '1');
|
||||
o.depends('accept_routes', '1');
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.taboption('advance', form.DynamicList, 'subnetRoutes', _('Subnet Routes'), _('Select subnet routes advertised by other nodes in Tailscale network.'));
|
||||
o = s.taboption('advance', form.DynamicList, 'subnet_routes', _('Subnet Routes'), _('Select subnet routes advertised by other nodes in Tailscale network.'));
|
||||
if (subnetRoutes.length > 0) {
|
||||
subnetRoutes.forEach(function(route) {
|
||||
o.value(route, route);
|
||||
@@ -231,20 +229,25 @@ return view.extend({
|
||||
o.readonly = true;
|
||||
}
|
||||
o.default = '';
|
||||
o.depends('s2s', '1');
|
||||
o.depends('disable_snat_subnet_routes', '1');
|
||||
o.rmempty = true;
|
||||
|
||||
o = s.taboption('advance', form.MultiValue, 'access', _('Access Control'));
|
||||
o.value('tsfwlan', _('Tailscale access LAN'));
|
||||
o.value('tsfwwan', _('Tailscale access WAN'));
|
||||
o.value('lanfwts', _('LAN access Tailscale'));
|
||||
o.value('wanfwts', _('WAN access Tailscale'));
|
||||
o.default = "tsfwlan tsfwwan lanfwts";
|
||||
o.value('ts_ac_lan', _('Tailscale access LAN'));
|
||||
o.value('ts_ac_wan', _('Tailscale access WAN'));
|
||||
o.value('lan_ac_ts', _('LAN access Tailscale'));
|
||||
o.value('wan_ac_ts', _('WAN access Tailscale'));
|
||||
o.default = "ts_ac_lan ts_ac_wan lan_ac_ts";
|
||||
o.rmempty = true;
|
||||
|
||||
s.tab('extra', _('Extra Settings'));
|
||||
|
||||
o = s.taboption('extra', form.DynamicList, 'flags', _('Additional Flags'), String.format(_('List of extra flags. Format: --flags=value, e.g. <code>--exit-node=10.0.0.1</code>. <br> %s for enabling settings upon the initiation of Tailscale.'), '<a href="https://tailscale.com/kb/1241/tailscale-up" target="_blank">' + _('Available flags') + '</a>'));
|
||||
o = s.taboption('extra', form.DynamicList, 'flags', _('Additional Flags'),
|
||||
String.format(
|
||||
_('List of extra flags. Format: --flags=value, e.g. <code>--exit-node=10.0.0.1</code>. <br> %s for enabling settings upon the initiation of Tailscale.'),
|
||||
'<a href="https://tailscale.com/kb/1241/tailscale-up" target="_blank">' + _('Available flags') + '</a>'
|
||||
)
|
||||
);
|
||||
o.default = '';
|
||||
o.rmempty = true;
|
||||
|
||||
@@ -252,7 +255,7 @@ return view.extend({
|
||||
s.title = _('Custom Server Settings');
|
||||
s.description = String.format(_('Use %s to deploy a private server.'), '<a href="https://github.com/juanfont/headscale" target="_blank">headscale</a>');
|
||||
|
||||
o = s.option(form.Value, 'loginServer', _('Server Address'));
|
||||
o = s.option(form.Value, 'login_server', _('Server Address'));
|
||||
o.default = '';
|
||||
o.rmempty = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user