root 2019-08-21 20:06:42 -07:00
parent 22097287cc
commit 0739e8fc22
13 changed files with 861 additions and 0 deletions

6
debian/readynas/web/Makefile vendored Normal file
View file

@ -0,0 +1,6 @@
all:
mkdir -p build
jsx --target es3 -x jsx . ./build
rm -f ztui.min.js
#minify build/*.js >>ztui.min.js
#rm -rf build

10
debian/readynas/web/README.md vendored Normal file
View file

@ -0,0 +1,10 @@
ZeroTier HTML5 UI
======
This is the new (as of 1.0.3) ZeroTier One UI. It's implemented in HTML5 and React.
If you make changes to the .jsx files, type 'make'. You will need NodeJS, react-tools, and minify installed and available in your path.
For this to work, these files must be installed in the 'ui' subfolder of the ZeroTier home path. For development it's nice to symlink this to the 'ui' folder in your working directory. If the 'ui' subfolder is not present, the UI static files will not be served by the embedded web server.
Packaging for Mac and Windows is accomplished by way of the wrappers in ext/. For Mac this is done with a modified version of MacGap. Windows uses a custom project that embeds a web view.

73
debian/readynas/web/ZeroTierNetwork.jsx vendored Normal file
View file

@ -0,0 +1,73 @@
var ZeroTierNetwork = React.createClass({
getInitialState: function() {
return {};
},
leaveNetwork: function(event) {
Ajax.call({
url: window.ui_addr+'network/'+this.props.nwid+ '?' + window.COOKIE_KEY + '=' + window.COOKIE_VAL + window.CSRF_TOKEN_KEY + '=' + window.CSRF_TOKEN_VAL,
type: 'DELETE',
success: function(data) {
if (this.props.onNetworkDeleted)
this.props.onNetworkDeleted(this.props.nwid);
}.bind(this),
error: function(error) {
}.bind(this)
});
event.preventDefault();
},
render: function() {
return (
<div className="zeroTierNetwork">
<div className="networkInfo">
<span className="networkId">{this.props.nwid}</span>&nbsp;
<span className="networkName">{this.props.name}</span>
</div>
<div className="networkProps">
<div className="row">
<div className="name">Status</div>
<div className="value">{this.props['status']}</div>
</div>
<div className="row">
<div className="name">Type</div>
<div className="value">{this.props['type']}</div>
</div>
<div className="row">
<div className="name">MAC</div>
<div className="value zeroTierAddress">{this.props['mac']}</div>
</div>
<div className="row">
<div className="name">MTU</div>
<div className="value">{this.props['mtu']}</div>
</div>
<div className="row">
<div className="name">Broadcast</div>
<div className="value">{(this.props['broadcastEnabled']) ? 'ENABLED' : 'DISABLED'}</div>
</div>
<div className="row">
<div className="name">Bridging</div>
<div className="value">{(this.props['bridge']) ? 'ACTIVE' : 'DISABLED'}</div>
</div>
<div className="row">
<div className="name">Device</div>
<div className="value">{(this.props['portDeviceName']) ? this.props['portDeviceName'] : '(none)'}</div>
</div>
<div className="row">
<div className="name">Managed&nbsp;IPs</div>
<div className="value ipList">
{
this.props['assignedAddresses'].map(function(ipAssignment) {
return (
<div key={ipAssignment} className="ipAddress">{ipAssignment}</div>
);
})
}
</div>
</div>
</div>
<button type="button" className="leaveNetworkButton" onClick={this.leaveNetwork}>Leave&nbsp;Network</button>
</div>
);
}
});

252
debian/readynas/web/ZeroTierNode.jsx vendored Normal file
View file

@ -0,0 +1,252 @@
var ZeroTierNode = React.createClass({
getInitialState: function() {
// get local address (of NAS) for ZT UI server and auth functions
if(location.protocol == 'https:') {
window.ui_port = 5001
}
else {
window.ui_port = 5000
}
window.auth_addr = location.protocol + "//" + document.location.host + "/"
window.ui_addr = location.protocol + "//" + document.location.hostname + ":" + ui_port + "/"
this.syno_init()
return {
address: '----------',
online: false,
version: '_._._',
_networks: [],
_peers: []
};
},
ago: function(ms) {
if (ms > 0) {
var tmp = Math.round((Date.now() - ms) / 1000);
return ((tmp > 0) ? tmp : 0);
} else return 0;
},
updatePeers: function() {
Ajax.call({
url: window.ui_addr+'peer'
+ '?' + window.COOKIE_KEY + '=' + window.COOKIE_VAL + window.CSRF_TOKEN_KEY + '=' + window.CSRF_TOKEN_VAL,
type: 'GET',
success: function(data) {
if (data) {
var pl = JSON.parse(data);
if (Array.isArray(pl)) {
this.setState({_peers: pl});
}
}
}.bind(this),
error: function() {
}.bind(this)
});
},
updateNetworks: function() {
Ajax.call({
url: window.ui_addr+'network'
+ '?' + window.COOKIE_KEY + '=' + window.COOKIE_VAL + window.CSRF_TOKEN_KEY + '=' + window.CSRF_TOKEN_VAL,
type: 'GET',
success: function(data) {
if (data) {
var nwl = JSON.parse(data);
if (Array.isArray(nwl)) {
this.setState({_networks: nwl});
}
}
}.bind(this),
error: function() {
}.bind(this)
});
},
requestAuth: function() {
this.dispatchRequest('auth', {})
},
requestVersion: function () {
this.dispatchRequest('version', {})
},
dispatchRequest: function(path, parameters) {
Ajax.call({
url: window.ui_addr + path
+ '?' + window.COOKIE_KEY + '=' + window.COOKIE_VAL + window.CSRF_TOKEN_KEY + '=' + window.CSRF_TOKEN_VAL,
type: 'GET',
success: function (response) {
var data = JSON.parse(response.responseText)
alert('data=' + data)
}.bind(this),
error: function (response) {
//alert('request error')
//this.setState('UNAUTH');
}.bind(this),
})
},
getCookieVal : function(offset){
var endstr = document.cookie.indexOf(";", offset);
if(endstr == -1){
endstr = document.cookie.length;
}
return unescape(document.cookie.substring(offset, endstr));
},
getCookie : function(name){
var arg = name + "=",
alen = arg.length,
clen = document.cookie.length,
i = 0,
j = 0;
while(i < clen){
j = i + alen;
if(document.cookie.substring(i, j) == arg){
return this.getCookieVal(j);
}
i = document.cookie.indexOf(" ", i) + 1;
if(i === 0){
break;
}
}
return null;
},
syno_init: function()
{
if (this.CSRF_TOKEN_KEY == 'SynoToken') {
return
}
// Synology DSM require SynoToken (CSRF) and Cookie (USER) to authenticate a user request
window.CSRF_TOKEN_KEY ='SynoToken'
window.CSRF_TOKEN_VAL = null
window.COOKIE_KEY = 'Cookie'
window.COOKIE_VAL ='id='+this.getCookie('id')
Ajax.call({
url: window.auth_addr+'webman/login.cgi',
type: 'GET',
success: function(data) {
this.alertedToFailure = false;
if (data) {
var parsed_data = JSON.parse(data)
window.CSRF_TOKEN_VAL = parsed_data[window.CSRF_TOKEN_KEY]
this.authenticated = true
}
this.requestAuth()
}.bind(this),
error: function(xhr){
//this.setState('UNAUTH');
}.bind(this)
});
},
updateAll: function() {
if(this.authenticated) {
Ajax.call({
url: window.ui_addr+'status' + '?' + window.COOKIE_KEY + '=' + window.COOKIE_VAL + window.CSRF_TOKEN_KEY + '=' + window.CSRF_TOKEN_VAL,
type: 'GET',
success: function(data) {
this.alertedToFailure = false;
if (data) {
var status = JSON.parse(data);
this.setState(status);
document.title = 'ZeroTier One [' + status.address + ']';
}
this.updateNetworks();
this.updatePeers();
}.bind(this),
error: function(xhr){
//this.setState('UNAUTH');
}.bind(this)
});
}
},
joinNetwork: function(event) {
event.preventDefault();
if ((this.networkToJoin)&&(this.networkToJoin.length === 16)) {
Ajax.call({
url: window.ui_addr+'network/'+this.networkToJoin
+ '?' + window.COOKIE_KEY + '=' + window.COOKIE_VAL + window.CSRF_TOKEN_KEY + '=' + window.CSRF_TOKEN_VAL,
type: 'POST',
success: function(data) {
this.networkToJoin = '';
if (this.networkInputElement)
this.networkInputElement.value = '';
this.updateNetworks();
}.bind(this),
error: function() {
}.bind(this)
});
} else {
alert('To join a network, create a network at https://my.zerotier.com and enter its 16-digit network ID here.');
}
},
resetService: function(event) {
event.preventDefault();
Ajax.call({
url: window.ui_addr+'reset'
+ '?' + window.COOKIE_KEY + '=' + window.COOKIE_VAL + window.CSRF_TOKEN_KEY + '=' + window.CSRF_TOKEN_VAL,
type: 'POST',
success: function(data) {
// ...
}.bind(this),
error: function() {
}.bind(this)
});
},
handleNetworkIdEntry: function(event) {
this.networkInputElement = event.target;
var nid = this.networkInputElement.value;
if (nid) {
nid = nid.toLowerCase();
var nnid = '';
for(var i=0;((i<nid.length)&&(i<16));++i) {
if ("0123456789abcdef".indexOf(nid.charAt(i)) >= 0)
nnid += nid.charAt(i);
}
this.networkToJoin = nnid;
this.networkInputElement.value = nnid;
} else {
this.networkToJoin = '';
this.networkInputElement.value = '';
}
},
handleNetworkDelete: function(nwid) {
var networks = [];
for(var i=0;i<this.state._networks.length;++i) {
if (this.state._networks[i].nwid !== nwid)
networks.push(this.state._networks[i]);
}
this.setState({_networks: networks});
},
componentDidMount: function() {
this.updateAll();
this.updateIntervalId = setInterval(this.updateAll,1000);
},
componentWillUnmount: function() {
clearInterval(this.updateIntervalId);
},
render: function() {
return (
<div className="zeroTierNode">
<div className="middle"><div className="middleCell">
<div className="middleScroll">
<div className="networks" key="_networks">
{
this.state._networks.map(function(network) {
network['onNetworkDeleted'] = this.handleNetworkDelete;
return React.createElement('div',{className: 'network',key: network.nwid},React.createElement(ZeroTierNetwork,network));
}.bind(this))
}
</div>
</div>
</div></div>
<div className="bottom">
<div className="left">
<span className="statusLine"><span className="zeroTierAddress">{this.state.address}</span>&nbsp;&nbsp;{this.state.online ? (this.state.tcpFallbackActive ? 'TUNNELED' : 'ONLINE') : 'OFFLINE'}&nbsp;&nbsp;{this.state.version}</span>
</div>
<div className="right">
<form onSubmit={this.joinNetwork}><input type="text" maxlength="16" placeholder="[ Network ID ]" onChange={this.handleNetworkIdEntry} size="16"/>
<button type="button" onClick={this.joinNetwork}>Join</button></form>
</div>
</div>
</div>
);
}
});

10
debian/readynas/web/config vendored Normal file
View file

@ -0,0 +1,10 @@
{
".url": {
"org.example.ZeroTier": {
"type": "legacy",
"title": "ZeroTier",
"icon": "images/icon_{0}.png",
"url": "/webman/3rdparty/zerotier/index.html"
}
}
}

BIN
debian/readynas/web/images/Icon_72.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
debian/readynas/web/images/icon_256.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

28
debian/readynas/web/index.html vendored Normal file
View file

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ZeroTier One</title>
<link rel="stylesheet" href="zerotier.css">
<script src="simpleajax.min.js"></script>
<!-- <script src="https://fb.me/react-0.13.2.js"></script> -->
<script src="react.min.js"></script>
<script src="build/ZeroTierNode.js"></script>
<script src="build/ZeroTierNetwork.js"></script>
</head>
<body><div style="width: 100%; height: 100%;" id="main"></div></body>
<script src="main.js"></script>
<script>
function resizeMiddleScrollClasses() {
var elems = document.getElementsByTagName('*'), i;
for (i in elems) {
if ((' ' + elems[i].className + ' ').indexOf(' middleScroll ') > -1) {
elems[i].style.height = (document.body.clientHeight - (elems[i].parentNode.parentNode.previousElementSibling.clientHeight + elems[i].parentNode.parentNode.nextElementSibling.clientHeight)) + "px";
}
}
}
</script>
</html>

46
debian/readynas/web/main.js vendored Normal file
View file

@ -0,0 +1,46 @@
/*
* ZeroTier One - Network Virtualization Everywhere
* Copyright (C) 2011-2015 ZeroTier, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --
*
* ZeroTier may be used and distributed under the terms of the GPLv3, which
* are available at: http://www.gnu.org/licenses/gpl-3.0.html
*
* If you would like to embed ZeroTier into a commercial application or
* redistribute it in a modified binary form, please contact ZeroTier Networks
* LLC. Start here: http://www.zerotier.com/
*/
function getUrlParameter(parameter)
{
var currLocation = window.location.search;
if (currLocation.indexOf('?') < 0)
return '';
var parArr = currLocation.split("?")[1].split("&");
for(var i = 0; i < parArr.length; i++){
parr = parArr[i].split("=");
if (parr[0] == parameter) {
return decodeURIComponent(parr[1]);
}
}
return '';
}
React.render(
React.createElement(ZeroTierNode, {}),
document.getElementById('main')
);

220
debian/readynas/web/package-lock.json generated vendored Normal file
View file

@ -0,0 +1,220 @@
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"acorn": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.3.0.tgz",
"integrity": "sha512-Yej+zOJ1Dm/IMZzzj78OntP/r3zHEaKcyNoU2lAaxPtrseM6rF0xwqoz5Q5ysAiED9hTjI2hgtvLXitlCN1/Ug=="
},
"amdefine": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
"integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU="
},
"ast-types": {
"version": "0.9.6",
"resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.9.6.tgz",
"integrity": "sha1-ECyenpAF0+fjgpvwxPok7oYu6bk="
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"base62": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/base62/-/base62-0.1.1.tgz",
"integrity": "sha1-e0F0wvlESXU7EcJlHAg9qEGnsIQ="
},
"brace-expansion": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
"requires": {
"balanced-match": "1.0.0",
"concat-map": "0.0.1"
}
},
"commander": {
"version": "2.12.2",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz",
"integrity": "sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA=="
},
"commoner": {
"version": "0.10.8",
"resolved": "https://registry.npmjs.org/commoner/-/commoner-0.10.8.tgz",
"integrity": "sha1-NPw2cs0kOT6LtH5wyqApOBH08sU=",
"requires": {
"commander": "2.12.2",
"detective": "4.7.1",
"glob": "5.0.15",
"graceful-fs": "4.1.11",
"iconv-lite": "0.4.19",
"mkdirp": "0.5.1",
"private": "0.1.8",
"q": "1.5.1",
"recast": "0.11.23"
}
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"defined": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz",
"integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM="
},
"detective": {
"version": "4.7.1",
"resolved": "https://registry.npmjs.org/detective/-/detective-4.7.1.tgz",
"integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==",
"requires": {
"acorn": "5.3.0",
"defined": "1.0.0"
}
},
"esprima": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz",
"integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM="
},
"glob": {
"version": "5.0.15",
"resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
"integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=",
"requires": {
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
}
},
"graceful-fs": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
"integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg="
},
"iconv-lite": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
"integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ=="
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"requires": {
"once": "1.4.0",
"wrappy": "1.0.2"
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"jstransform": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/jstransform/-/jstransform-10.1.0.tgz",
"integrity": "sha1-tMSb9j8WLBCLA0g5moc3xxOwqDo=",
"requires": {
"base62": "0.1.1",
"esprima-fb": "13001.1001.0-dev-harmony-fb",
"source-map": "0.1.31"
},
"dependencies": {
"esprima-fb": {
"version": "13001.1001.0-dev-harmony-fb",
"resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-13001.1001.0-dev-harmony-fb.tgz",
"integrity": "sha1-YzrNtA2b1NuKHB1owGqUKVn60rA="
},
"source-map": {
"version": "0.1.31",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.31.tgz",
"integrity": "sha1-n3BNDWnZ4TioG63267T94z0VHGE=",
"requires": {
"amdefine": "1.0.1"
}
}
}
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"requires": {
"brace-expansion": "1.1.8"
}
},
"minimist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
},
"mkdirp": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"requires": {
"minimist": "0.0.8"
}
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"requires": {
"wrappy": "1.0.2"
}
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"private": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
"integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg=="
},
"q": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
"integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc="
},
"react-tools": {
"version": "0.13.3",
"resolved": "https://registry.npmjs.org/react-tools/-/react-tools-0.13.3.tgz",
"integrity": "sha1-2mrH1Nd3elml6VHPRucv1La0Ciw=",
"requires": {
"commoner": "0.10.8",
"jstransform": "10.1.0"
}
},
"recast": {
"version": "0.11.23",
"resolved": "https://registry.npmjs.org/recast/-/recast-0.11.23.tgz",
"integrity": "sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM=",
"requires": {
"ast-types": "0.9.6",
"esprima": "3.1.3",
"private": "0.1.8",
"source-map": "0.5.7"
}
},
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w="
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
}
}
}

15
debian/readynas/web/react.min.js vendored Normal file

File diff suppressed because one or more lines are too long

2
debian/readynas/web/simpleajax.min.js vendored Normal file
View file

@ -0,0 +1,2 @@
/** SimpleAjax v1.0.1 - MIT license - https://github.com/freelancephp/SimpleAjax */
(function(window){var SimpleAjax=window.SimpleAjax={xhr:null,settings:{url:"",type:"GET",dataType:"text",async:true,cache:true,data:null,contentType:"application/x-www-form-urlencoded",success:null,error:null,complete:null,accepts:{text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"}},call:function(a){var b=this,c=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),d=function(a,b){var c={};for(var d in a)c[d]=typeof b[d]=="undefined"?a[d]:b[d];return c}(this.settings,a),e=function(){if(c.readyState==4){if(c.status>=200&&c.status<300||c.status===304){var a=d.dataType=="xml"?c.responseXML:c.responseText;if(d.dataType=="json")a=b.parseJSON(a);if(b.isFunction(d.success))d.success.call(d,a,c.status,c)}else{if(b.isFunction(d.error))d.error.call(d,c,c.status)}if(b.isFunction(d.complete))d.complete.call(d,c,c.status)}};this.xhr=c;if(!d.cache)d.url+=(d.url.indexOf("?")>-1?"&":"?")+"_nocache="+(new Date).getTime();if(d.data){if(d.type=="GET"){d.url+=(d.url.indexOf("?")>-1?"&":"?")+this.param(d.data);d.data=null}else{d.data=this.param(d.data)}}c.open(d.type,d.url,d.async);c.setRequestHeader("Content-type",d.contentType);if(d.dataType&&d.accepts[d.dataType])c.setRequestHeader("Accept",d.accepts[d.dataType]);if(d.async){c.onreadystatechange=e;c.send(d.data)}else{c.send(d.data);e()}return this},get:function(a,b,c){if(this.isFunction(b)){c=b;b=null}return this.call({url:a,type:"GET",data:b,success:c})},post:function(a,b,c){if(this.isFunction(b)){c=b;b=null}return this.call({url:a,type:"POST",data:b,success:c})},load:function(a,b,c,d){if(typeof a=="string")a=document.getElementById(a);return this.call({url:b,type:c?"POST":"GET",data:c||null,complete:d||null,success:function(b){try{a.innerHTML=b}catch(c){var d=document.createElement("div");d.innerHTML=b;while(a.firstChild)a.removeChild(a.firstChild);for(var e=0,f=d.childNodes.length;e<f;e++)a.appendChild(d.childNodes[e])}}})},param:function(a){var b=[];for(var c in a){b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]))}return b.join("&")},parseJSON:function(data){if(typeof data!=="string"||!data)return null;return eval("("+this.trim(data)+")")},trim:function(a){return a.replace(/^\s+/,"").replace(/\s+$/,"")},isFunction:function(a){return Object.prototype.toString.call(a)==="[object Function]"}};if(!window.Ajax){window.Ajax=SimpleAjax}})(window)

199
debian/readynas/web/zerotier.css vendored Normal file
View file

@ -0,0 +1,199 @@
/* Dark blue-grey: #234447
* Light blue-grey: #91a2a3
* Light yellow: #ffffcc
* Orange: #ffb354 */
html,body {
font-family: "Helvetica Neue","Lucida Sans Unicode",sans-serif;
font-size: 12pt;
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
.zeroTierAddress {
font-family: monospace;
}
.zeroTierNode {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
display: table;
}
.zeroTierNode > .middle {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
display: table-row;
}
.zeroTierNode > .middle > .middleCell {
width: 100%;
height: 100%;
display: table-cell;
border-bottom: 1px solid #cfcfcf;
}
.zeroTierNode > .middle > .middleCell > .middleScroll {
display: block;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
overflow: scroll;
overflow-x: hidden;
overflow-y: scroll;
background: #dddddd;
}
.zeroTierNode > .middle > .middleCell > .middleScroll > .networks {
display: block;
width: 100%;
padding: 0 0 0.25rem 0;
margin: 0;
border: 0;
text-align: left;
border-collapse: collapse;
}
.zeroTierNode > .middle > .middleCell > .middleScroll > .networks > .network {
display: block;
border-top: 0.12rem solid #dddddd;
border-bottom: 0.12rem solid #dddddd;
padding: 0.25rem;
background: #ffffff;
}
.zeroTierNode > .bottom {
font-size: 12pt;
width: 100%;
overflow: hidden;
display: table-row;
color: #000000;
background: #dfdfdf;
}
.zeroTierNode > .bottom > .left {
text-align: left;
white-space: nowrap;
float: left;
padding: 0 0 0 0.5rem;
font-size: 12pt;
height: 100%;
}
.zeroTierNode > .bottom > .left > .statusLine {
font-family: monospace;
white-space: nowrap;
font-size: 11pt;
height: 100%;
}
.zeroTierNode > .bottom > .right {
text-align: right;
height: 100%;
white-space: nowrap;
float: right;
font-size: 12pt;
background: #ffffff;
}
.zeroTierNode > .bottom > .right form {
height: 100%;
}
.zeroTierNode > .bottom > .right input {
font-family: monospace;
font-size: 12pt;
background: #ffffff;
color: #000000;
outline: none;
outline-style: none;
box-shadow: 0;
border: 0;
margin: 0;
padding: 0 0.25rem 0 0.25rem;
display: inline;
height: 100%;
}
.zeroTierNode > .bottom > .right button {
display: inline-block;
font-size: 12pt;
background: #ffb354;
border: 1px solid #ffb354;
color: #000000;
margin: 0;
padding: 0.05rem 0.75rem 0.05rem 0.75rem;
outline: none;
outline-style: none;
height: 100%;
}
.zeroTierNode > .bottom > .right button:hover {
cursor: pointer;
outline: none;
outline-style: none;
border: 1px solid #000000;
}
.zeroTierNetwork {
padding: 0;
margin: 0;
display: inline-block;
text-align: right;
width: 100%;
position: relative;
}
.zeroTierNetwork .networkInfo {
padding: 0 0 0.25rem 0;
text-align: left;
font-size: 12pt;
}
.zeroTierNetwork .networkInfo .networkId {
font-size: 11pt;
font-family: monospace;
color: #000000;
}
.zeroTierNetwork .networkInfo .networkName {
padding: 0 0 0 1rem;
float: right;
font-size: 12pt;
}
.zeroTierNetwork .networkProps {
width: 100%;
display: table;
padding: 0;
margin: 0 auto 0 auto;
border-top: 1px solid #999999;
border-bottom: 1px solid #999999;
}
.zeroTierNetwork .networkProps > .row {
display: table-row;
}
.zeroTierNetwork .networkProps > .row > .name {
display: table-cell;
font-size: 10pt;
padding: 0.1rem 0.5rem 0.1rem 0.5rem;
}
.zeroTierNetwork .networkProps > .row > .value {
font-size: 10pt;
display: table-cell;
padding: 0.1rem 0.5rem 0.1rem 0.5rem;
background: #eeeeee;
}
.zeroTierNetwork .ipList {
}
.zeroTierNetwork .ipAddress {
font-family: monospace;
font-size: 10pt;
}
.zeroTierNetwork .leaveNetworkButton {
padding: 0.25rem 0.5rem 0.25rem 0.5rem;
margin: 0.25rem 0 0 0;
font-size: 9pt;
background: #ffffff;
outline: none;
background: #ffb354;
border: 1px solid #ffb354;
cursor: pointer;
}
.zeroTierNetwork .leaveNetworkButton:hover {
border: 1px solid #000000;
}