make Prettier
This commit is contained in:
parent
ef34fefc39
commit
880da4d685
|
@ -0,0 +1,18 @@
|
|||
{ "node": true
|
||||
, "browser": true
|
||||
, "jquery": true
|
||||
, "globals": { "angular": true, "Promise": true }
|
||||
|
||||
, "indent": 2
|
||||
, "onevar": true
|
||||
, "laxcomma": true
|
||||
, "laxbreak": true
|
||||
, "curly": true
|
||||
, "nonbsp": true
|
||||
|
||||
, "eqeqeq": true
|
||||
, "immed": true
|
||||
, "undef": true
|
||||
, "unused": true
|
||||
, "latedef": true
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"bracketSpacing": true,
|
||||
"printWidth": 120,
|
||||
"tabWidth": 4,
|
||||
"trailingComma": "none",
|
||||
"useTabs": false
|
||||
}
|
|
@ -4,28 +4,33 @@
|
|||
<title>Websock VPN Instrumentation</title>
|
||||
</head>
|
||||
<body ng-app="vpnAdmin" ng-controller="vpnInstrumentationController">
|
||||
|
||||
<div class="panel panel-default panel-primary">
|
||||
<div class="panel-heading">VPN Instrumentation</div>
|
||||
<div class="panel-body">
|
||||
<div class="panel panel-default panel-info">
|
||||
<div class="panel-heading">Control Plane</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="row"> <!-- Auth -->
|
||||
<div class="row">
|
||||
<!-- Auth -->
|
||||
<div class="col-lg-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button" ng-click="startWebSocket()">Start WebSocket</button>
|
||||
<button class="btn btn-default" type="button" ng-click="startWebSocket()">
|
||||
Start WebSocket
|
||||
</button>
|
||||
</span>
|
||||
<button class="btn btn-default" type="button" ng-class="conn == false && 'btn-danger' || 'btn-success'">
|
||||
<button
|
||||
class="btn btn-default"
|
||||
type="button"
|
||||
ng-class="conn == false && 'btn-danger' || 'btn-success'"
|
||||
>
|
||||
{[{ conn == false && 'False' || 'True' }]}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<br />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
|
@ -33,7 +38,7 @@
|
|||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button">Auth</button>
|
||||
</span>
|
||||
<input type="text" class="form-control" placeholder="Enter auth data here">
|
||||
<input type="text" class="form-control" placeholder="Enter auth data here" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -51,20 +56,34 @@
|
|||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js"></script>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
|
||||
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css"
|
||||
integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
<script
|
||||
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
|
||||
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
console.log("startup");
|
||||
|
||||
var vpnAdmin = angular.module('vpnAdmin',[]);
|
||||
var vpnAdmin = angular.module("vpnAdmin", []);
|
||||
vpnAdmin.config(function ($interpolateProvider) {
|
||||
console.log("vpnTest Config");
|
||||
$interpolateProvider.startSymbol('{[{');
|
||||
$interpolateProvider.endSymbol('}]}');
|
||||
$interpolateProvider.startSymbol("{[{");
|
||||
$interpolateProvider.endSymbol("}]}");
|
||||
});
|
||||
vpnAdmin.controller('vpnInstrumentationController', function ($scope) {
|
||||
vpnAdmin.controller("vpnInstrumentationController", function ($scope) {
|
||||
console.log("vpnInstrumentationController startup");
|
||||
|
||||
$scope.log_elements = [];
|
||||
|
@ -73,9 +92,9 @@ vpnAdmin.controller('vpnInstrumentationController', function ($scope) {
|
|||
|
||||
$scope.webSocketStatus = function () {
|
||||
if ($scope.conn == false) {
|
||||
return ""
|
||||
}
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
$scope.startWebSocket = function () {
|
||||
console.log("Start webSocket {{$}}");
|
||||
|
@ -84,27 +103,22 @@ vpnAdmin.controller('vpnInstrumentationController', function ($scope) {
|
|||
$scope.append_log("Websocket opened");
|
||||
$scope.conn.onclose = function (evt) {
|
||||
$scope.append_log("Connection closed.");
|
||||
}
|
||||
};
|
||||
$scope.conn.onmessage = function (evt) {
|
||||
$scope.append_log(evt.data)
|
||||
}
|
||||
}
|
||||
else {
|
||||
appendLog($("<div><b>Your browser does not support WebSockets.</b></div>"))
|
||||
$scope.append_log(evt.data);
|
||||
};
|
||||
} else {
|
||||
appendLog($("<div><b>Your browser does not support WebSockets.</b></div>"));
|
||||
}
|
||||
};
|
||||
|
||||
$scope.auth_click = function () {
|
||||
$scope.append_log($scope.auth_key)
|
||||
$scope.append_log($scope.auth_key);
|
||||
};
|
||||
|
||||
$scope.append_log = function (txt) {
|
||||
$scope.log_elements.push(txt)
|
||||
$scope.log_elements.push(txt);
|
||||
};
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</html>
|
|
@ -4,28 +4,33 @@
|
|||
<title>Websock VPN Test Client</title>
|
||||
</head>
|
||||
<body ng-app="vpnTest" ng-controller="vpnTestController">
|
||||
|
||||
<div class="panel panel-default panel-primary">
|
||||
<div class="panel-heading">WebSocket Client Test</div>
|
||||
<div class="panel-body">
|
||||
<div class="panel panel-default panel-info">
|
||||
<div class="panel-heading">Control Plane</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="row"> <!-- Auth -->
|
||||
<div class="row">
|
||||
<!-- Auth -->
|
||||
<div class="col-lg-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button" ng-click="startWebSocket()">Start WebSocket</button>
|
||||
<button class="btn btn-default" type="button" ng-click="startWebSocket()">
|
||||
Start WebSocket
|
||||
</button>
|
||||
</span>
|
||||
<button class="btn btn-default" type="button" ng-class="conn == false && 'btn-danger' || 'btn-success'">
|
||||
<button
|
||||
class="btn btn-default"
|
||||
type="button"
|
||||
ng-class="conn == false && 'btn-danger' || 'btn-success'"
|
||||
>
|
||||
{[{ conn == false && 'False' || 'True' }]}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<br />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
|
@ -33,25 +38,30 @@
|
|||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button">Auth</button>
|
||||
</span>
|
||||
<input type="text" class="form-control" placeholder="Enter auth data here">
|
||||
<input type="text" class="form-control" placeholder="Enter auth data here" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<br />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" ng-click="send_click()" type="button">Send</button>
|
||||
<button class="btn btn-default" ng-click="send_click()" type="button">
|
||||
Send
|
||||
</button>
|
||||
</span>
|
||||
<input ng-model="send_data" type="text" class="form-control" placeholder="Enter send data here">
|
||||
<input
|
||||
ng-model="send_data"
|
||||
type="text"
|
||||
class="form-control"
|
||||
placeholder="Enter send data here"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default panel-danger">
|
||||
|
@ -66,32 +76,46 @@
|
|||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js"></script>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
|
||||
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css"
|
||||
integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
<script
|
||||
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
|
||||
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
console.log("startup");
|
||||
|
||||
var vpnTest = angular.module('vpnTest',[]);
|
||||
var vpnTest = angular.module("vpnTest", []);
|
||||
vpnTest.config(function ($interpolateProvider) {
|
||||
console.log("vpnTest Config");
|
||||
$interpolateProvider.startSymbol('{[{');
|
||||
$interpolateProvider.endSymbol('}]}');
|
||||
$interpolateProvider.startSymbol("{[{");
|
||||
$interpolateProvider.endSymbol("}]}");
|
||||
});
|
||||
vpnTest.controller('vpnTestController', function ($scope) {
|
||||
vpnTest.controller("vpnTestController", function ($scope) {
|
||||
console.log("vpnTestController startup");
|
||||
|
||||
$scope.log_elements = [];
|
||||
$scope.auth_key = "";
|
||||
$scope.conn = false;
|
||||
$scope.send_data = ""
|
||||
$scope.send_data = "";
|
||||
|
||||
$scope.webSocketStatus = function () {
|
||||
if ($scope.conn == false) {
|
||||
return ""
|
||||
}
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
$scope.startWebSocket = function () {
|
||||
console.log("Start webSocket {{$}}");
|
||||
|
@ -100,33 +124,28 @@ vpnTest.controller('vpnTestController', function ($scope) {
|
|||
$scope.append_log("Websocket opened");
|
||||
$scope.conn.onclose = function (evt) {
|
||||
$scope.append_log("Connection closed.");
|
||||
}
|
||||
};
|
||||
$scope.conn.onmessage = function (evt) {
|
||||
console.log(evt.data)
|
||||
$scope.append_log(evt.data)
|
||||
}
|
||||
}
|
||||
else {
|
||||
appendLog($("<div><b>Your browser does not support WebSockets.</b></div>"))
|
||||
console.log(evt.data);
|
||||
$scope.append_log(evt.data);
|
||||
};
|
||||
} else {
|
||||
appendLog($("<div><b>Your browser does not support WebSockets.</b></div>"));
|
||||
}
|
||||
};
|
||||
|
||||
$scope.auth_click = function () {
|
||||
$scope.append_log($scope.auth_key)
|
||||
$scope.append_log($scope.auth_key);
|
||||
};
|
||||
|
||||
$scope.send_click = function () {
|
||||
console.log("send_click")
|
||||
$scope.conn.send($scope.send_data)
|
||||
console.log("send_click");
|
||||
$scope.conn.send($scope.send_data);
|
||||
};
|
||||
|
||||
$scope.append_log = function (txt) {
|
||||
$scope.log_elements.push(txt)
|
||||
$scope.log_elements.push(txt);
|
||||
};
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
<!doctype html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta charset="utf-8" />
|
||||
<title>Page Not Found</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<style>
|
||||
|
||||
* {
|
||||
line-height: 1.2;
|
||||
margin: 0;
|
||||
|
@ -38,8 +37,8 @@
|
|||
}
|
||||
|
||||
@media only screen and (max-width: 280px) {
|
||||
|
||||
body, p {
|
||||
body,
|
||||
p {
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
|
@ -47,9 +46,7 @@
|
|||
font-size: 1.5em;
|
||||
margin: 0 0 0.3em;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -95,22 +95,6 @@ textarea {
|
|||
Author's custom styles
|
||||
========================================================================== */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* ==========================================================================
|
||||
Helper classes
|
||||
========================================================================== */
|
||||
|
@ -195,10 +179,7 @@ textarea {
|
|||
/* Style adjustments for viewports that meet the condition */
|
||||
}
|
||||
|
||||
@media print,
|
||||
(-webkit-min-device-pixel-ratio: 1.25),
|
||||
(min-resolution: 1.25dppx),
|
||||
(min-resolution: 120dpi) {
|
||||
@media print, (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 1.25dppx), (min-resolution: 120dpi) {
|
||||
/* Style adjustments for high resolution devices */
|
||||
}
|
||||
|
||||
|
|
|
@ -1,23 +1,26 @@
|
|||
<!doctype html>
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
||||
<title></title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<link rel="apple-touch-icon" href="apple-touch-icon.png">
|
||||
<link rel="apple-touch-icon" href="apple-touch-icon.png" />
|
||||
<!-- Place favicon.ico in the root directory -->
|
||||
|
||||
<link rel="stylesheet" href="css/normalize.css">
|
||||
<link rel="stylesheet" href="css/main.css">
|
||||
<link rel="stylesheet" href="css/normalize.css" />
|
||||
<link rel="stylesheet" href="css/main.css" />
|
||||
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
|
||||
<base href="/">
|
||||
<base href="/" />
|
||||
</head>
|
||||
<body ng-app="rvpnApp">
|
||||
<!--[if lt IE 8]>
|
||||
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
|
||||
<p class="browserupgrade">
|
||||
You are using an <strong>outdated</strong> browser. Please
|
||||
<a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.
|
||||
</p>
|
||||
<![endif]-->
|
||||
|
||||
<!-- Admin GUI Begins Here -->
|
||||
|
@ -38,39 +41,57 @@
|
|||
<li><a href="#">Help</a></li>
|
||||
<li><a href="#">Login</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div ng-view></div>
|
||||
|
||||
|
||||
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
|
||||
<script>window.jQuery || document.write('<script src="admin/js/vendor/jquery-1.12.0.min.js"><\/script>')</script>
|
||||
<script>
|
||||
window.jQuery || document.write('<script src="admin/js/vendor/jquery-1.12.0.min.js"><\/script>');
|
||||
</script>
|
||||
<script src="admin/js/plugins.js"></script>
|
||||
<script src="admin/js/main.js"></script>
|
||||
|
||||
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
|
||||
<script>
|
||||
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
|
||||
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
|
||||
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
|
||||
e.src='https://www.google-analytics.com/analytics.js';
|
||||
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
|
||||
ga('create','UA-XXXXX-X','auto');ga('send','pageview');
|
||||
(function (b, o, i, l, e, r) {
|
||||
b.GoogleAnalyticsObject = l;
|
||||
b[l] ||
|
||||
(b[l] = function () {
|
||||
(b[l].q = b[l].q || []).push(arguments);
|
||||
});
|
||||
b[l].l = +new Date();
|
||||
e = o.createElement(i);
|
||||
r = o.getElementsByTagName(i)[0];
|
||||
e.src = "https://www.google-analytics.com/analytics.js";
|
||||
r.parentNode.insertBefore(e, r);
|
||||
})(window, document, "script", "ga");
|
||||
ga("create", "UA-XXXXX-X", "auto");
|
||||
ga("send", "pageview");
|
||||
</script>
|
||||
</body>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-route.js"></script>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
|
||||
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css"
|
||||
integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
<script
|
||||
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
|
||||
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
<script src="/admin/js/vendor/filter.js"></script>
|
||||
<script src="/admin/js/app.js"></script>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
console.log("app.sh startup")
|
||||
console.log("app.sh startup");
|
||||
|
||||
var app = angular.module("rvpnApp", ["ngRoute", "angular-duration-format"]);
|
||||
|
||||
|
@ -27,93 +27,92 @@ app.config(function($routeProvider, $locationProvider) {
|
|||
$locationProvider.html5Mode(true);
|
||||
});
|
||||
|
||||
app.filter('bytes', function() {
|
||||
app.filter("bytes", function () {
|
||||
return function (bytes, precision) {
|
||||
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
|
||||
if (typeof precision === 'undefined') precision = 1;
|
||||
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
|
||||
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return "-";
|
||||
if (typeof precision === "undefined") precision = 1;
|
||||
var units = ["bytes", "kB", "MB", "GB", "TB", "PB"],
|
||||
number = Math.floor(Math.log(bytes) / Math.log(1024));
|
||||
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
|
||||
}
|
||||
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + " " + units[number];
|
||||
};
|
||||
});
|
||||
|
||||
app.filter('hfcduration', function() {
|
||||
app.filter("hfcduration", function () {
|
||||
return function (duration, precision) {
|
||||
remain = duration
|
||||
duration_day = 24*60*60
|
||||
duration_hour = 60*60
|
||||
duration_minute = 60
|
||||
duration_str = ""
|
||||
remain = duration;
|
||||
duration_day = 24 * 60 * 60;
|
||||
duration_hour = 60 * 60;
|
||||
duration_minute = 60;
|
||||
duration_str = "";
|
||||
|
||||
days = Math.floor(remain / duration_day)
|
||||
days = Math.floor(remain / duration_day);
|
||||
if (days > 0) {
|
||||
remain = remain - (days * duration_day)
|
||||
duration_str = duration_str + days + 'd'
|
||||
remain = remain - days * duration_day;
|
||||
duration_str = duration_str + days + "d";
|
||||
}
|
||||
|
||||
hours = Math.floor(remain / duration_hour)
|
||||
hours = Math.floor(remain / duration_hour);
|
||||
if (hours > 0) {
|
||||
remain = remain - (hours * duration_hour)
|
||||
duration_str = duration_str + hours + 'h'
|
||||
remain = remain - hours * duration_hour;
|
||||
duration_str = duration_str + hours + "h";
|
||||
}
|
||||
|
||||
mins = Math.floor(remain / duration_minute)
|
||||
mins = Math.floor(remain / duration_minute);
|
||||
if (mins > 0) {
|
||||
remain = remain - (mins * duration_minute)
|
||||
duration_str = duration_str + mins + 'm'
|
||||
remain = remain - mins * duration_minute;
|
||||
duration_str = duration_str + mins + "m";
|
||||
}
|
||||
|
||||
secs = Math.floor(remain)
|
||||
duration_str = duration_str + secs + 's'
|
||||
secs = Math.floor(remain);
|
||||
duration_str = duration_str + secs + "s";
|
||||
|
||||
return (duration_str);
|
||||
}
|
||||
return duration_str;
|
||||
};
|
||||
});
|
||||
|
||||
app.controller('statusController', function ($scope, $http) {
|
||||
app.controller("statusController", function ($scope, $http) {
|
||||
console.log("statusController");
|
||||
$scope.status_search = "";
|
||||
|
||||
var api = '/api/org.rootprojects.tunnel/status'
|
||||
var api = "/api/org.rootprojects.tunnel/status";
|
||||
|
||||
$scope.updateView = function () {
|
||||
$http.get(api).then(function (response) {
|
||||
console.log(response);
|
||||
data = response.data;
|
||||
if (data.error == 'ok' ){
|
||||
if (data.error == "ok") {
|
||||
$scope.status = data.result;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$scope.updateView()
|
||||
};
|
||||
|
||||
$scope.updateView();
|
||||
});
|
||||
|
||||
app.controller('serverController', function ($scope, $http) {
|
||||
app.controller("serverController", function ($scope, $http) {
|
||||
$scope.servers = [];
|
||||
$scope.servers_search = "";
|
||||
$scope.servers_trigger_details = [];
|
||||
$scope.filtered
|
||||
$scope.filtered;
|
||||
|
||||
var api = '/api/org.rootprojects.tunnel/servers'
|
||||
var api = "/api/org.rootprojects.tunnel/servers";
|
||||
|
||||
$scope.updateView = function () {
|
||||
$http.get(api).then(function (response) {
|
||||
//console.log(response);
|
||||
data = response.data;
|
||||
if (data.error == 'ok' ){
|
||||
if (data.error == "ok") {
|
||||
$scope.servers = data.result.servers;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.triggerDetail = function (id) {
|
||||
//console.log("triggerDetail ", id, $scope.servers_trigger_details[id])
|
||||
if ($scope.servers_trigger_details[id] == true) {
|
||||
$scope.servers_trigger_details[id] = false;
|
||||
} else {
|
||||
$scope.servers_trigger_details[id] = true
|
||||
$scope.servers_trigger_details[id] = true;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -122,11 +121,9 @@ app.controller('serverController', function ($scope, $http) {
|
|||
if ($scope.servers_trigger_details[id] == true) {
|
||||
return false;
|
||||
} else {
|
||||
return true
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.updateView()
|
||||
|
||||
$scope.updateView();
|
||||
});
|
||||
|
||||
|
|
|
@ -3,10 +3,30 @@
|
|||
var method;
|
||||
var noop = function () {};
|
||||
var methods = [
|
||||
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
|
||||
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
|
||||
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
|
||||
'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
|
||||
"assert",
|
||||
"clear",
|
||||
"count",
|
||||
"debug",
|
||||
"dir",
|
||||
"dirxml",
|
||||
"error",
|
||||
"exception",
|
||||
"group",
|
||||
"groupCollapsed",
|
||||
"groupEnd",
|
||||
"info",
|
||||
"log",
|
||||
"markTimeline",
|
||||
"profile",
|
||||
"profileEnd",
|
||||
"table",
|
||||
"time",
|
||||
"timeEnd",
|
||||
"timeline",
|
||||
"timelineEnd",
|
||||
"timeStamp",
|
||||
"trace",
|
||||
"warn"
|
||||
];
|
||||
var length = methods.length;
|
||||
var console = (window.console = window.console || {});
|
||||
|
@ -19,6 +39,6 @@
|
|||
console[method] = noop;
|
||||
}
|
||||
}
|
||||
}());
|
||||
})();
|
||||
|
||||
// Place any jQuery/helper plugins in here.
|
||||
|
|
|
@ -1,59 +1,67 @@
|
|||
// ### filter.js >>
|
||||
|
||||
angular
|
||||
.module('angular-duration-format.filter', [ ])
|
||||
.filter('duration', function() {
|
||||
angular.module("angular-duration-format.filter", []).filter("duration", function () {
|
||||
var DURATION_FORMATS_SPLIT = /((?:[^ydhms']+)|(?:'(?:[^']|'')*')|(?:y+|d+|h+|m+|s+))(.*)/;
|
||||
var DURATION_FORMATS = {
|
||||
y: { // years
|
||||
y: {
|
||||
// years
|
||||
// "longer" years are not supported
|
||||
value: 365 * 24 * 60 * 60 * 1000,
|
||||
value: 365 * 24 * 60 * 60 * 1000
|
||||
},
|
||||
yy: {
|
||||
value: 'y',
|
||||
pad: 2,
|
||||
value: "y",
|
||||
pad: 2
|
||||
},
|
||||
d: { // days
|
||||
value: 24 * 60 * 60 * 1000,
|
||||
d: {
|
||||
// days
|
||||
value: 24 * 60 * 60 * 1000
|
||||
},
|
||||
dd: {
|
||||
value: 'd',
|
||||
pad: 2,
|
||||
value: "d",
|
||||
pad: 2
|
||||
},
|
||||
h: { // hours
|
||||
value: 60 * 60 * 1000,
|
||||
h: {
|
||||
// hours
|
||||
value: 60 * 60 * 1000
|
||||
},
|
||||
hh: { // padded hours
|
||||
value: 'h',
|
||||
pad: 2,
|
||||
hh: {
|
||||
// padded hours
|
||||
value: "h",
|
||||
pad: 2
|
||||
},
|
||||
m: { // minutes
|
||||
value: 60 * 1000,
|
||||
m: {
|
||||
// minutes
|
||||
value: 60 * 1000
|
||||
},
|
||||
mm: { // padded minutes
|
||||
value: 'm',
|
||||
pad: 2,
|
||||
mm: {
|
||||
// padded minutes
|
||||
value: "m",
|
||||
pad: 2
|
||||
},
|
||||
s: { // seconds
|
||||
value: 1000,
|
||||
s: {
|
||||
// seconds
|
||||
value: 1000
|
||||
},
|
||||
ss: { // padded seconds
|
||||
value: 's',
|
||||
pad: 2,
|
||||
ss: {
|
||||
// padded seconds
|
||||
value: "s",
|
||||
pad: 2
|
||||
},
|
||||
sss: { // milliseconds
|
||||
value: 1,
|
||||
},
|
||||
ssss: { // padded milliseconds
|
||||
value: 'sss',
|
||||
pad: 4,
|
||||
sss: {
|
||||
// milliseconds
|
||||
value: 1
|
||||
},
|
||||
ssss: {
|
||||
// padded milliseconds
|
||||
value: "sss",
|
||||
pad: 4
|
||||
}
|
||||
};
|
||||
|
||||
function _parseFormat(string) {
|
||||
// @inspiration AngularJS date filter
|
||||
var parts = [];
|
||||
var format = string ? string.toString() : '';
|
||||
var format = string ? string.toString() : "";
|
||||
|
||||
while (format) {
|
||||
var match = DURATION_FORMATS_SPLIT.exec(format);
|
||||
|
@ -73,31 +81,46 @@ angular
|
|||
}
|
||||
|
||||
function _formatDuration(timestamp, format) {
|
||||
var text = '';
|
||||
var text = "";
|
||||
var values = {};
|
||||
|
||||
format.filter(function(format) { // filter only value parts of format
|
||||
format
|
||||
.filter(function (format) {
|
||||
// filter only value parts of format
|
||||
return DURATION_FORMATS.hasOwnProperty(format);
|
||||
}).map(function(format) { // get formats with values only
|
||||
})
|
||||
.map(function (format) {
|
||||
// get formats with values only
|
||||
var config = DURATION_FORMATS[format];
|
||||
|
||||
if (config.hasOwnProperty('pad')) {
|
||||
if (config.hasOwnProperty("pad")) {
|
||||
return config.value;
|
||||
} else {
|
||||
return format;
|
||||
}
|
||||
}).filter(function(format, index, arr) { // remove duplicates
|
||||
return (arr.indexOf(format) === index);
|
||||
}).map(function(format) { // get format configurations with values
|
||||
return angular.extend({
|
||||
name: format,
|
||||
}, DURATION_FORMATS[format]);
|
||||
}).sort(function(a, b) { // sort formats descending by value
|
||||
})
|
||||
.filter(function (format, index, arr) {
|
||||
// remove duplicates
|
||||
return arr.indexOf(format) === index;
|
||||
})
|
||||
.map(function (format) {
|
||||
// get format configurations with values
|
||||
return angular.extend(
|
||||
{
|
||||
name: format
|
||||
},
|
||||
DURATION_FORMATS[format]
|
||||
);
|
||||
})
|
||||
.sort(function (a, b) {
|
||||
// sort formats descending by value
|
||||
return b.value - a.value;
|
||||
}).forEach(function(format) { // create values for format parts
|
||||
var value = values[format.name] = Math.floor(timestamp / format.value);
|
||||
})
|
||||
.forEach(function (format) {
|
||||
// create values for format parts
|
||||
var value = (values[format.name] = Math.floor(timestamp / format.value));
|
||||
|
||||
timestamp = timestamp - (value * format.value);
|
||||
timestamp = timestamp - value * format.value;
|
||||
});
|
||||
|
||||
format.forEach(function (part) {
|
||||
|
@ -106,9 +129,11 @@ angular
|
|||
if (format) {
|
||||
var value = values[format.value];
|
||||
|
||||
text += (format.hasOwnProperty('pad') ? _padNumber(value, Math.max(format.pad, value.toString().length)) : values[part]);
|
||||
text += format.hasOwnProperty("pad")
|
||||
? _padNumber(value, Math.max(format.pad, value.toString().length))
|
||||
: values[part];
|
||||
} else {
|
||||
text += part.replace(/(^'|'$)/g, '').replace(/''/g, '\'');
|
||||
text += part.replace(/(^'|'$)/g, "").replace(/''/g, "'");
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -116,14 +141,14 @@ angular
|
|||
}
|
||||
|
||||
function _padNumber(number, len) {
|
||||
return ((new Array(len + 1)).join('0') + number).slice(-len);
|
||||
return (new Array(len + 1).join("0") + number).slice(-len);
|
||||
}
|
||||
|
||||
return function (value, format) {
|
||||
var parsedValue = parseFloat(value, 10);
|
||||
var parsedFormat = _parseFormat(format);
|
||||
|
||||
if (isNaN(parsedValue) || (parsedFormat.length === 0)) {
|
||||
if (isNaN(parsedValue) || parsedFormat.length === 0) {
|
||||
return value;
|
||||
} else {
|
||||
return _formatDuration(parsedValue, parsedFormat);
|
||||
|
@ -131,18 +156,10 @@ angular
|
|||
};
|
||||
});
|
||||
|
||||
|
||||
// ### << filter.js
|
||||
|
||||
|
||||
|
||||
// ### main.js >>
|
||||
|
||||
angular
|
||||
.module('angular-duration-format', [
|
||||
'angular-duration-format.filter',
|
||||
]);
|
||||
|
||||
angular.module("angular-duration-format", ["angular-duration-format.filter"]);
|
||||
|
||||
// ### << main.js
|
||||
|
||||
|
|
|
@ -9,10 +9,15 @@
|
|||
<form class="form-inline pull-right">
|
||||
<div class="form-group">
|
||||
<label for="search">Search:</label>
|
||||
<input type="text" class="form-control" id="search" data-ng-model="servers_search">
|
||||
<input type="text" class="form-control" id="search" data-ng-model="servers_search" />
|
||||
</div>
|
||||
<button type="button" title="Refresh" class="btn btn-default" aria-label="Refresh">
|
||||
<span class="glyphicon glyphicon-refresh" title="Refresh" aria-hidden="false" ng-click="updateView()"></span>
|
||||
<span
|
||||
class="glyphicon glyphicon-refresh"
|
||||
title="Refresh"
|
||||
aria-hidden="false"
|
||||
ng-click="updateView()"
|
||||
></span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -30,8 +35,9 @@
|
|||
<th width="5%">Duration</th>
|
||||
<th width="5%">State</th>
|
||||
<th width="5%">Idle</th>
|
||||
<th width="1%"><center><span class="glyphicon glyphicon-option-vertical" aria-hidden="true"></span></center></th>
|
||||
|
||||
<th width="1%">
|
||||
<center><span class="glyphicon glyphicon-option-vertical" aria-hidden="true"></span></center>
|
||||
</th>
|
||||
|
||||
<tr ng-repeat="s in servers | filter:servers_search | orderBy:'server_id'">
|
||||
<td>{{ s.server_id }}</td>
|
||||
|
@ -68,22 +74,25 @@
|
|||
<td>{{ s.server_state }}</td>
|
||||
<td>{{ s.idle | hfcduration }}</td>
|
||||
<td>
|
||||
<span class="glyphicon glyphicon-zoom-in" title="Detail" aria-hidden="false" ng-click="triggerDetail(s.server_id)"></span>
|
||||
<span
|
||||
class="glyphicon glyphicon-zoom-in"
|
||||
title="Detail"
|
||||
aria-hidden="false"
|
||||
ng-click="triggerDetail(s.server_id)"
|
||||
></span>
|
||||
<div ng-hide="checkDetail(s.server_id)">
|
||||
 
|
||||
<div ng-repeat="d in s.domains | orderBy:'domain_name'">
|
||||
<span class="glyphicon glyphicon-zoom-in" title="Detail" aria-hidden="false" ng-click="triggerDetail(s.server_id+d.domain_name)"></span>
|
||||
<span
|
||||
class="glyphicon glyphicon-zoom-in"
|
||||
title="Detail"
|
||||
aria-hidden="false"
|
||||
ng-click="triggerDetail(s.server_id+d.domain_name)"
|
||||
></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
|
@ -9,10 +9,15 @@
|
|||
<form class="form-inline pull-right">
|
||||
<div class="form-group">
|
||||
<label for="search">Search:</label>
|
||||
<input type="text" class="form-control" id="search" data-ng-model="servers_search">
|
||||
<input type="text" class="form-control" id="search" data-ng-model="servers_search" />
|
||||
</div>
|
||||
<button type="button" title="Refresh" class="btn btn-default" aria-label="Refresh">
|
||||
<span class="glyphicon glyphicon-refresh" title="Refresh" aria-hidden="false" ng-click="updateView()"></span>
|
||||
<span
|
||||
class="glyphicon glyphicon-refresh"
|
||||
title="Refresh"
|
||||
aria-hidden="false"
|
||||
ng-click="updateView()"
|
||||
></span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -38,9 +43,10 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-8">Deadtime: dwell:{{ status.dead_time.dwell}} idle:{{ status.dead_time.idle}} cancel:{{ status.dead_time.cancel_check}}</div>
|
||||
<div class="col-md-8">
|
||||
Deadtime: dwell:{{ status.dead_time.dwell}} idle:{{ status.dead_time.idle}} cancel:{{
|
||||
status.dead_time.cancel_check}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ docker-compose version 1.11.2, build dfed245
|
|||
hcamacho@Hanks-MBP:rvpn-docker $ docker --version
|
||||
Docker version 17.03.0-ce, build 60ccb22
|
||||
```
|
||||
|
||||
- checkout code into gopath
|
||||
|
||||
```bash
|
||||
|
@ -87,6 +88,3 @@ rvpn_1 | INFO: genericlistener: 2017/03/04 18:13:02.270281 connection.go:242: W
|
|||
```
|
||||
|
||||
The line "Connection Registration Accepted indicates a client WSS registered, was authenticated and registered its domains with the RVPN
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue