2020-09-18 22:01:07 +00:00
'use strict' ;
'require view' ;
'require poll' ;
'require fs' ;
'require ui' ;
'require uci' ;
'require form' ;
'require tools.widgets as widgets' ;
/ *
button handling
* /
2021-08-11 16:28:07 +00:00
function handleAction ( ev ) {
var ifaceValue ;
2020-09-18 22:01:07 +00:00
if ( ev === 'restart' ) {
2021-08-11 16:28:07 +00:00
ifaceValue = String ( uci . get ( 'travelmate' , 'global' , 'trm_iface' ) || 'trm_wwan' ) ;
2021-08-21 20:04:50 +00:00
return fs . exec ( '/etc/init.d/travelmate' , [ 'stop' ] )
. then ( fs . exec ( '/sbin/ifup' , [ ifaceValue ] ) )
. then ( fs . exec ( '/etc/init.d/travelmate' , [ 'start' ] ) )
2020-09-18 22:01:07 +00:00
}
if ( ev === 'setup' ) {
2021-08-11 16:28:07 +00:00
ifaceValue = String ( uci . get ( 'travelmate' , 'global' , 'trm_iface' ) || '' ) ;
2020-09-18 22:01:07 +00:00
L . ui . showModal ( _ ( 'Interface Wizard' ) , [
E ( 'p' , _ ( 'To use Travelmate, you have to set up an uplink interface once. This wizard creates an IPv4- and an IPv6 alias network interface with all required network- and firewall settings.' ) ) ,
E ( 'div' , { 'class' : 'left' , 'style' : 'display:flex; flex-direction:column' } , [
E ( 'label' , { 'class' : 'cbi-input-text' , 'style' : 'padding-top:.5em' } , [
2021-08-11 16:28:07 +00:00
E ( 'input' , { 'class' : 'cbi-input-text' , 'id' : 'iface' , 'placeholder' : 'trm_wwan' , 'value' : ifaceValue , 'maxlength' : '15' , 'spellcheck' : 'false' } ) ,
'\xa0\xa0\xa0' ,
_ ( 'The uplink interface name' )
2020-09-18 22:01:07 +00:00
] ) ,
E ( 'label' , { 'class' : 'cbi-input-text' , 'style' : 'padding-top:.5em' } , [
2021-08-11 16:28:07 +00:00
E ( 'input' , { 'class' : 'cbi-input-text' , 'id' : 'zone' , 'placeholder' : 'wan' , 'maxlength' : '15' , 'spellcheck' : 'false' } ) ,
'\xa0\xa0\xa0' ,
_ ( 'The firewall zone name' )
2020-09-18 22:01:07 +00:00
] ) ,
E ( 'label' , { 'class' : 'cbi-input-text' , 'style' : 'padding-top:.5em' } , [
2021-08-11 16:28:07 +00:00
E ( 'input' , { 'class' : 'cbi-input-text' , 'id' : 'metric' , 'placeholder' : '100' , 'maxlength' : '3' , 'spellcheck' : 'false' } ) ,
'\xa0\xa0\xa0' ,
_ ( 'The interface metric' )
2020-09-18 22:01:07 +00:00
] )
] ) ,
E ( 'div' , { 'class' : 'right' } , [
E ( 'button' , {
'class' : 'btn' ,
'click' : L . hideModal
} , _ ( 'Dismiss' ) ) ,
' ' ,
E ( 'button' , {
'class' : 'cbi-button cbi-button-positive important' ,
2021-08-11 16:28:07 +00:00
'click' : ui . createHandlerFn ( this , function ( ev ) {
2020-09-18 22:01:07 +00:00
var iface = document . getElementById ( 'iface' ) . value || 'trm_wwan' ,
2021-08-11 16:28:07 +00:00
zone = document . getElementById ( 'zone' ) . value || 'wan' ,
metric = document . getElementById ( 'metric' ) . value || '100' ;
L . resolveDefault ( fs . exec ( '/etc/init.d/travelmate' , [ 'setup' , iface , zone , metric ] ) )
. then ( function ( res ) {
if ( res ) {
ui . addNotification ( null , E ( 'p' , res . trim ( ) + '.' ) , 'error' ) ;
} else {
ui . addNotification ( null , E ( 'p' , _ ( 'The uplink interface has been updated.' ) ) , 'info' ) ;
}
} ) ;
2020-09-18 22:01:07 +00:00
L . hideModal ( ) ;
} )
} , _ ( 'Save' ) )
] )
] ) ;
return document . getElementById ( 'iface' ) . focus ( ) ;
}
if ( ev === 'qrcode' ) {
return Promise . all ( [
uci . load ( 'wireless' )
2021-08-11 16:28:07 +00:00
] ) . then ( function ( ) {
2020-09-18 22:01:07 +00:00
var w _sid , w _device , w _ssid , w _enc , w _key , w _hidden , result ,
2021-08-11 16:28:07 +00:00
w _sections = uci . sections ( 'wireless' , 'wifi-iface' ) ,
optionsAP = [ E ( 'option' , { value : '' } , [ _ ( '-- AP Selection --' ) ] ) ] ;
2020-09-18 22:01:07 +00:00
for ( var i = 0 ; i < w _sections . length ; i ++ ) {
if ( w _sections [ i ] . mode === 'ap' && w _sections [ i ] . disabled !== '1' ) {
2021-08-11 16:28:07 +00:00
w _sid = i ;
2020-09-18 22:01:07 +00:00
w _device = w _sections [ i ] . device ;
2021-08-11 16:28:07 +00:00
w _ssid = w _sections [ i ] . ssid ;
2020-09-18 22:01:07 +00:00
optionsAP . push ( E ( 'option' , { value : w _sid } , w _device + ', ' + w _ssid ) ) ;
}
}
var selectAP = E ( 'select' , {
id : 'selectID' ,
class : 'cbi-input-select' ,
2021-08-11 16:28:07 +00:00
change : function ( ev ) {
2020-09-18 22:01:07 +00:00
result = document . getElementById ( 'qrcode' ) ;
if ( document . getElementById ( "selectID" ) . value ) {
2021-08-11 16:28:07 +00:00
w _sid = document . getElementById ( "selectID" ) . value ;
w _ssid = w _sections [ w _sid ] . ssid ;
w _enc = w _sections [ w _sid ] . encryption ;
w _key = w _sections [ w _sid ] . key ;
2020-09-18 22:01:07 +00:00
w _hidden = ( w _sections [ w _sid ] . hidden == 1 ? 'true' : 'false' ) ;
if ( w _enc . startsWith ( 'psk' ) ) {
w _enc = 'WPA' ;
}
else if ( w _enc === 'none' ) {
w _enc = 'nopass' ;
w _key = 'nokey' ;
}
2021-08-11 16:28:07 +00:00
L . resolveDefault ( fs . exec _direct ( '/usr/bin/qrencode' , [ '--inline' , '--8bit' , '--type=SVG' , '--output=-' , 'WIFI:S:' + w _ssid + ';T:' + w _enc + ';P:' + w _key + ';H:' + w _hidden + ';' ] ) , null ) . then ( function ( res ) {
2020-09-18 22:01:07 +00:00
if ( res ) {
result . innerHTML = res . trim ( ) ;
}
else {
2021-08-11 16:28:07 +00:00
result . textContent = _ ( 'The QR-Code could not be generated!' ) ;
2020-09-18 22:01:07 +00:00
}
} ) ;
}
else {
2021-08-11 16:28:07 +00:00
result . textContent = '' ;
2020-09-18 22:01:07 +00:00
}
}
} , optionsAP ) ;
L . ui . showModal ( _ ( 'QR-Code Overview' ) , [
E ( 'p' , _ ( 'Render the QR-Code of the selected Access Point to comfortably transfer the WLAN credentials to your mobile devices.' ) ) ,
E ( 'div' , { 'class' : 'left' , 'style' : 'display:flex; flex-direction:column' } , [
E ( 'label' , { 'class' : 'cbi-input-select' , 'style' : 'padding-top:.5em' } , [
selectAP ,
] )
] ) ,
'\xa0' ,
E ( 'div' , {
'id' : 'qrcode'
} ) ,
E ( 'div' , { 'class' : 'right' } , [
E ( 'button' , {
'class' : 'btn' ,
'click' : L . hideModal
} , _ ( 'Dismiss' ) )
] )
] ) ;
} ) ;
}
}
return view . extend ( {
2021-08-11 16:28:07 +00:00
load : function ( ) {
2020-09-18 22:01:07 +00:00
return Promise . all ( [
uci . load ( 'travelmate' )
] ) ;
} ,
2021-08-11 16:28:07 +00:00
render : function ( result ) {
2020-09-18 22:01:07 +00:00
var m , s , o ;
2021-05-01 09:02:26 +00:00
m = new form . Map ( 'travelmate' , 'Travelmate' , _ ( ' Configuration of the travelmate package to enable travel router functionality . \
2020-09-18 22:01:07 +00:00
For further information < a href = "https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md" target = "_blank" rel = "noreferrer noopener" > check the online documentation < /a>. <br / > \
< em > Please note : < / e m > O n f i r s t s t a r t p l e a s e c a l l t h e \ ' I n t e r f a c e W i z a r d \ ' o n c e , t o m a k e t h e n e c e s s a r y n e t w o r k - a n d f i r e w a l l s e t t i n g s . ' ) ) ;
/ *
poll runtime information
* /
2021-08-11 16:28:07 +00:00
pollData : poll . add ( function ( ) {
return L . resolveDefault ( fs . stat ( '/tmp/trm_runtime.json' ) , null ) . then ( function ( res ) {
2020-09-18 22:01:07 +00:00
var status = document . getElementById ( 'status' ) ;
2021-08-21 20:04:50 +00:00
if ( res && res . size > 0 ) {
2021-08-11 16:28:07 +00:00
L . resolveDefault ( fs . read _direct ( '/tmp/trm_runtime.json' ) , null ) . then ( function ( res ) {
2020-09-18 22:01:07 +00:00
if ( res ) {
var info = JSON . parse ( res ) ;
if ( status && info ) {
status . textContent = ( info . data . travelmate _status || '-' ) + ' / ' + ( info . data . travelmate _version || '-' ) ;
if ( info . data . travelmate _status . startsWith ( 'running' ) ) {
if ( ! status . classList . contains ( "spinning" ) ) {
status . classList . add ( "spinning" ) ;
}
} else {
if ( status . classList . contains ( "spinning" ) ) {
status . classList . remove ( "spinning" ) ;
}
}
} else if ( status ) {
status . textContent = '-' ;
if ( status . classList . contains ( "spinning" ) ) {
status . classList . remove ( "spinning" ) ;
}
}
var station _id = document . getElementById ( 'station_id' ) ;
if ( station _id && info ) {
station _id . textContent = info . data . station _id || '-' ;
}
var station _mac = document . getElementById ( 'station_mac' ) ;
if ( station _mac && info ) {
station _mac . textContent = info . data . station _mac || '-' ;
}
2022-08-20 16:56:02 +00:00
var station _interfaces = document . getElementById ( 'station_interfaces' ) ;
if ( station _interfaces && info ) {
station _interfaces . textContent = info . data . station _interfaces || '-' ;
2020-09-18 22:01:07 +00:00
}
var wpa _flags = document . getElementById ( 'wpa_flags' ) ;
if ( wpa _flags && info ) {
wpa _flags . textContent = info . data . wpa _flags || '-' ;
}
var run _flags = document . getElementById ( 'run_flags' ) ;
if ( run _flags && info ) {
run _flags . textContent = info . data . run _flags || '-' ;
}
var ext _hooks = document . getElementById ( 'ext_hooks' ) ;
if ( ext _hooks && info ) {
ext _hooks . textContent = info . data . ext _hooks || '-' ;
}
var run = document . getElementById ( 'run' ) ;
if ( run && info ) {
run . textContent = info . data . last _run || '-' ;
}
}
} ) ;
2021-08-21 20:04:50 +00:00
} else if ( status ) {
status . textContent = '-' ;
if ( status . classList . contains ( "spinning" ) ) {
status . classList . remove ( "spinning" ) ;
}
2020-09-18 22:01:07 +00:00
}
} ) ;
} , 1 ) ;
/ *
runtime information and buttons
* /
s = m . section ( form . NamedSection , 'global' ) ;
2021-08-11 16:28:07 +00:00
s . render = L . bind ( function ( view , section _id ) {
2020-09-18 22:01:07 +00:00
return E ( 'div' , { 'class' : 'cbi-section' } , [
2021-08-11 16:28:07 +00:00
E ( 'h3' , _ ( 'Information' ) ) ,
E ( 'div' , { 'class' : 'cbi-value' } , [
E ( 'label' , { 'class' : 'cbi-value-title' , 'style' : 'padding-top:0rem' } , _ ( 'Status / Version' ) ) ,
E ( 'div' , { 'class' : 'cbi-value-field spinning' , 'id' : 'status' , 'style' : 'color:#37c' } , '\xa0' )
] ) ,
E ( 'div' , { 'class' : 'cbi-value' } , [
E ( 'label' , { 'class' : 'cbi-value-title' , 'style' : 'padding-top:0rem' } , _ ( 'Station ID' ) ) ,
E ( 'div' , { 'class' : 'cbi-value-field' , 'id' : 'station_id' , 'style' : 'color:#37c' } , '-' )
] ) ,
E ( 'div' , { 'class' : 'cbi-value' } , [
E ( 'label' , { 'class' : 'cbi-value-title' , 'style' : 'padding-top:0rem' } , _ ( 'Station MAC' ) ) ,
E ( 'div' , { 'class' : 'cbi-value-field' , 'id' : 'station_mac' , 'style' : 'color:#37c' } , '-' )
] ) ,
E ( 'div' , { 'class' : 'cbi-value' } , [
2022-08-20 16:56:02 +00:00
E ( 'label' , { 'class' : 'cbi-value-title' , 'style' : 'padding-top:0rem' } , _ ( 'Station Interfaces' ) ) ,
E ( 'div' , { 'class' : 'cbi-value-field' , 'id' : 'station_interfaces' , 'style' : 'color:#37c' } , '-' )
2021-08-11 16:28:07 +00:00
] ) ,
E ( 'div' , { 'class' : 'cbi-value' } , [
E ( 'label' , { 'class' : 'cbi-value-title' , 'style' : 'padding-top:0rem' } , _ ( 'WPA Flags' ) ) ,
E ( 'div' , { 'class' : 'cbi-value-field' , 'id' : 'wpa_flags' , 'style' : 'color:#37c' } , '-' )
] ) ,
E ( 'div' , { 'class' : 'cbi-value' } , [
E ( 'label' , { 'class' : 'cbi-value-title' , 'style' : 'padding-top:0rem' } , _ ( 'Run Flags' ) ) ,
E ( 'div' , { 'class' : 'cbi-value-field' , 'id' : 'run_flags' , 'style' : 'color:#37c' } , '-' )
] ) ,
E ( 'div' , { 'class' : 'cbi-value' } , [
E ( 'label' , { 'class' : 'cbi-value-title' , 'style' : 'padding-top:0rem' } , _ ( 'Ext. Hooks' ) ) ,
E ( 'div' , { 'class' : 'cbi-value-field' , 'id' : 'ext_hooks' , 'style' : 'color:#37c' } , '-' )
] ) ,
E ( 'div' , { 'class' : 'cbi-value' } , [
E ( 'label' , { 'class' : 'cbi-value-title' , 'style' : 'padding-top:0rem' } , _ ( 'Last Run' ) ) ,
E ( 'div' , { 'class' : 'cbi-value-field' , 'id' : 'run' , 'style' : 'color:#37c' } , '-' )
] ) ,
2020-09-18 22:01:07 +00:00
E ( 'div' , { class : 'right' } , [
E ( 'button' , {
'class' : 'cbi-button cbi-button-apply' ,
'id' : 'btn_suspend' ,
2021-08-11 16:28:07 +00:00
'click' : ui . createHandlerFn ( this , function ( ) {
L . resolveDefault ( fs . stat ( '/usr/bin/qrencode' ) , null ) . then ( function ( res ) {
2020-09-18 22:01:07 +00:00
if ( res ) {
return handleAction ( 'qrcode' ) ;
}
return ui . addNotification ( null , E ( 'p' , _ ( 'Please install the separate \'qrencode\' package.' ) ) , 'info' ) ;
} )
} )
2021-08-11 16:28:07 +00:00
} , [ _ ( 'AP QR-Codes...' ) ] ) ,
'\xa0' ,
E ( 'button' , {
'class' : 'cbi-button cbi-button-negative' ,
'click' : ui . createHandlerFn ( this , function ( ) {
return handleAction ( 'restart' ) ;
} )
} , [ _ ( 'Restart Interface' ) ] ) ,
2020-09-18 22:01:07 +00:00
'\xa0' ,
E ( 'button' , {
2021-08-11 16:28:07 +00:00
'class' : 'cbi-button cbi-button-negative' ,
'click' : ui . createHandlerFn ( this , function ( ) {
2020-09-18 22:01:07 +00:00
return handleAction ( 'setup' ) ;
} )
2021-08-11 16:28:07 +00:00
} , [ _ ( 'Interface Wizard...' ) ] )
2020-09-18 22:01:07 +00:00
] )
] ) ;
} , o , this ) ;
this . pollData ;
/ *
tabbed config section
* /
s = m . section ( form . NamedSection , 'global' , 'travelmate' , _ ( 'Settings' ) ) ;
s . addremove = false ;
2021-08-11 16:28:07 +00:00
s . tab ( 'general' , _ ( 'General Settings' ) ) ;
2020-09-18 22:01:07 +00:00
s . tab ( 'additional' , _ ( 'Additional Settings' ) ) ;
s . tab ( 'adv_email' , _ ( 'E-Mail Settings' ) , _ ( 'Please note: E-Mail notifications require the separate setup of the <em>mstmp</em> package.<br /><p> </p>' ) ) ;
/ *
general settings tab
* /
o = s . taboption ( 'general' , form . Flag , 'trm_enabled' , _ ( 'Enabled' ) , _ ( 'Enable the travelmate service.' ) ) ;
o . rmempty = false ;
o = s . taboption ( 'general' , form . Flag , 'trm_debug' , _ ( 'Verbose Debug Logging' ) , _ ( 'Enable verbose debug logging in case of any processing errors.' ) ) ;
o . rmempty = false ;
2021-08-11 16:28:07 +00:00
o = s . taboption ( 'general' , form . Value , 'trm_radio' , _ ( 'Radio Selection' ) , _ ( 'Restrict travelmate to a single radio or change the overall scanning order.' ) ) ;
o . value ( 'radio0' , _ ( 'use the first radio only (radio0)' ) ) ;
o . value ( 'radio1' , _ ( 'use the second radio only (radio1)' ) ) ;
o . value ( 'radio0 radio1' , _ ( 'use both radios, normal sort order (radio0 radio1)' ) ) ;
o . value ( 'radio1 radio0' , _ ( 'use both radios, reverse sort order (radio1 radio0)' ) ) ;
2020-09-18 22:01:07 +00:00
o . rmempty = true ;
o = s . taboption ( 'general' , form . Flag , 'trm_captive' , _ ( 'Captive Portal Detection' ) , _ ( 'Check the internet availability, handle captive portal redirections and keep the uplink connection \'alive\'.' ) ) ;
o . default = 1 ;
o . rmempty = false ;
2022-08-20 16:56:02 +00:00
o = s . taboption ( 'general' , form . Flag , 'trm_vpn' , _ ( 'VPN processing' ) , _ ( 'VPN connections will be managed by travelmate.' ) ) ;
o . default = 1 ;
o . rmempty = false ;
o = s . taboption ( 'general' , widgets . NetworkSelect , 'trm_vpnifacelist' , _ ( 'Limit VPN processing' ) , _ ( 'Limit VPN processing to certain interfaces.' ) ) ;
o . depends ( 'trm_vpn' , '1' ) ;
o . unspecified = true ;
o . multiple = true ;
o . nocreate = true ;
o . rmempty = true ;
2020-09-18 22:01:07 +00:00
o = s . taboption ( 'general' , form . Flag , 'trm_netcheck' , _ ( 'Net Error Check' ) , _ ( 'Treat missing internet availability as an error.' ) ) ;
o . depends ( 'trm_captive' , '1' ) ;
o . default = 0 ;
o . rmempty = false ;
o = s . taboption ( 'general' , form . Flag , 'trm_proactive' , _ ( 'ProActive Uplink Switch' ) , _ ( 'Proactively scan and switch to a higher prioritized uplink, despite of an already existing connection.' ) ) ;
o . default = 1 ;
o . rmempty = false ;
2021-08-11 16:28:07 +00:00
o = s . taboption ( 'general' , form . Flag , 'trm_randomize' , _ ( 'Randomize MAC Addresses' ) , _ ( 'Generate a random unicast MAC address for each uplink connection.' ) ) ;
2020-09-18 22:01:07 +00:00
o . default = 0 ;
o . rmempty = false ;
2021-08-11 16:28:07 +00:00
o = s . taboption ( 'general' , form . Flag , 'trm_autoadd' , _ ( 'AutoAdd Open Uplinks' ) , _ ( 'Automatically add open uplinks like hotel captive portals to your wireless config.' ) ) ;
2020-09-18 22:01:07 +00:00
o . default = 0 ;
o . rmempty = false ;
2021-08-11 16:28:07 +00:00
o = s . taboption ( 'general' , form . Value , 'trm_maxautoadd' , _ ( 'Limit AutoAdd' ) , _ ( 'Limit the maximum number of automatically added open uplinks. To disable this limitation set it to \'0\'.' ) ) ;
o . depends ( 'trm_autoadd' , '1' ) ;
o . placeholder = '5' ;
o . datatype = 'range(0,30)' ;
o . rmempty = true ;
2020-09-18 22:01:07 +00:00
/ *
additional settings tab
* /
o = s . taboption ( 'additional' , form . Value , 'trm_triggerdelay' , _ ( 'Trigger Delay' ) , _ ( 'Additional trigger delay in seconds before travelmate processing begins.' ) ) ;
o . placeholder = '2' ;
o . datatype = 'range(1,60)' ;
o . rmempty = true ;
o = s . taboption ( 'additional' , form . Value , 'trm_maxretry' , _ ( 'Connection Limit' ) , _ ( 'Retry limit to connect to an uplink.' ) ) ;
o . placeholder = '3' ;
o . datatype = 'range(1,10)' ;
o . rmempty = true ;
o = s . taboption ( 'additional' , form . Value , 'trm_minquality' , _ ( 'Signal Quality Threshold' ) , _ ( 'Minimum signal quality threshold as percent for conditional uplink (dis-) connections.' ) ) ;
o . placeholder = '35' ;
o . datatype = 'range(20,80)' ;
o . rmempty = true ;
o = s . taboption ( 'additional' , form . Value , 'trm_maxwait' , _ ( 'Interface Timeout' ) , _ ( 'How long should travelmate wait for a successful wlan uplink connection.' ) ) ;
o . placeholder = '30' ;
o . datatype = 'range(20,40)' ;
o . rmempty = true ;
o = s . taboption ( 'additional' , form . Value , 'trm_timeout' , _ ( 'Overall Timeout' ) , _ ( 'Overall retry timeout in seconds.' ) ) ;
o . placeholder = '60' ;
o . datatype = 'range(30,300)' ;
o . rmempty = true ;
2021-08-15 12:59:54 +00:00
o = s . taboption ( 'additional' , form . Value , 'trm_maxscan' , _ ( 'Scan Limit' ) , _ ( 'Limit the nearby scan results to process only the strongest uplinks.' ) ) ;
o . placeholder = '10' ;
o . datatype = 'range(1,30)' ;
2020-09-18 22:01:07 +00:00
o . rmempty = true ;
o = s . taboption ( 'additional' , form . ListValue , 'trm_captiveurl' , _ ( 'Captive Portal URL' ) , _ ( 'The selected URL will be used for connectivity- and captive portal checks.' ) ) ;
2021-08-11 16:28:07 +00:00
o . value ( 'http://detectportal.firefox.com' , 'Firefox (default)' ) ;
2020-09-18 22:01:07 +00:00
o . value ( 'http://connectivity-check.ubuntu.com' , 'Ubuntu' ) ;
2021-08-11 16:28:07 +00:00
o . value ( 'http://captive.apple.com' , 'Apple' ) ;
2020-09-18 22:01:07 +00:00
o . value ( 'http://connectivitycheck.android.com/generate_204' , 'Google' ) ;
o . value ( 'http://www.msftncsi.com/ncsi.txt' , 'Microsoft' ) ;
o . optional = true ;
o . rmempty = true ;
o = s . taboption ( 'additional' , form . ListValue , 'trm_useragent' , _ ( 'User Agent' ) , _ ( 'The selected user agent will be used for connectivity- and captive portal checks.' ) ) ;
2021-08-11 16:28:07 +00:00
o . value ( 'Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0' , 'Firefox (default)' ) ;
o . value ( 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36' , 'Chromium' ) ;
o . value ( 'Mozilla/5.0 (Macintosh; Intel Mac OS X 11_5_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15' , 'Safari' ) ;
o . value ( 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 Edg/92.0.902.55' , 'Edge' ) ;
o . value ( 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 OPR/77.0.4054.277' , 'Opera' ) ;
2020-09-18 22:01:07 +00:00
o . optional = true ;
o . rmempty = true ;
o = s . taboption ( 'additional' , form . ListValue , 'trm_nice' , _ ( 'Service Priority' ) , _ ( 'The selected priority will be used for travelmate processes.' ) ) ;
o . value ( '-20' , 'Highest Priority' ) ;
o . value ( '-10' , 'High Priority' ) ;
o . value ( '0' , 'Normal Priority (default)' ) ;
o . value ( '10' , 'Less Priority' ) ;
o . value ( '19' , 'Least Priority' ) ;
o . optional = true ;
o . rmempty = true ;
/ *
advanced email settings tab
* /
o = s . taboption ( 'adv_email' , form . Flag , 'trm_mail' , _ ( 'E-Mail Hook' ) , _ ( 'Sends notification E-Mails after every succesful uplink connect.' ) ) ;
o . rmempty = false ;
o = s . taboption ( 'adv_email' , form . Value , 'trm_mailreceiver' , _ ( 'E-Mail Receiver Address' ) , _ ( 'Receiver address for travelmate notification E-Mails.' ) ) ;
o . depends ( 'trm_mail' , '1' ) ;
o . placeholder = 'name@example.com' ;
o . rmempty = true ;
o = s . taboption ( 'adv_email' , form . Value , 'trm_mailsender' , _ ( 'E-Mail Sender Address' ) , _ ( 'Sender address for travelmate notification E-Mails.' ) ) ;
o . depends ( { 'trm_mailreceiver' : '@' , '!contains' : true } ) ;
o . placeholder = 'no-reply@travelmate' ;
o . rmempty = true ;
o = s . taboption ( 'adv_email' , form . Value , 'trm_mailtopic' , _ ( 'E-Mail Topic' ) , _ ( 'Topic for travelmate notification E-Mails.' ) ) ;
o . depends ( { 'trm_mailreceiver' : '@' , '!contains' : true } ) ;
o . placeholder = 'travelmate connection to \'<station>\'' ;
o . rmempty = true ;
o = s . taboption ( 'adv_email' , form . Value , 'trm_mailprofile' , _ ( 'E-Mail Profile' ) , _ ( 'Profile used by \'msmtp\' for travelmate notification E-Mails.' ) ) ;
o . depends ( { 'trm_mailreceiver' : '@' , '!contains' : true } ) ;
o . placeholder = 'trm_notify' ;
o . rmempty = true ;
return m . render ( ) ;
} ,
handleReset : null
} ) ;