diff --git a/app/main.js b/app/main.js
new file mode 100644
index 0000000..d6a67a6
--- /dev/null
+++ b/app/main.js
@@ -0,0 +1,58 @@
+var app = angular.module('app', ['ngRoute', 'nvd3']);
+
+app.service('connectionService', [ConnectionService]);
+
+app.config(function ($routeProvider) {
+ $routeProvider.when("/home", {
+ title: "Home"
+ })
+ .when("/:address/info", {
+ title: "Server",
+ templateUrl: "app/server/info.html",
+ nav: true
+ })
+ .when("/:address/console", {
+ title: "Console",
+ templateUrl: "app/console/console.html",
+ nav: true
+ })
+ .when("/:address/chat", {
+ title: "Chat",
+ templateUrl: "app/chat/chat.html",
+ nav: true
+ })
+ .when("/:address/playerlist", {
+ title: "Player List",
+ templateUrl: "app/player/list.html",
+ nav: true
+ })
+ .when("/:address/player/:userid", {
+ title: "Player Info",
+ templateUrl: "app/player/info.html"
+ })
+ .otherwise({
+ redirectTo: '/home'
+ });
+});
+
+app.filter('SecondsToDuration', [secondsToDuration]);
+
+function secondsToDuration() {
+ return function (input) {
+ input = parseInt(input);
+
+ var out = "";
+ var hours = Math.floor(input / 3600);
+ if (input > 3600)
+ out += hours + "h";
+
+ var minutes = Math.floor(input / 60) % 60;
+ if (input > 60)
+ out += minutes + "m";
+
+ var seconds = input % 60;
+ out += seconds + "s";
+
+ return out;
+ }
+}
diff --git a/app/player/info.html b/app/player/info.html
new file mode 100644
index 0000000..d7a935a
--- /dev/null
+++ b/app/player/info.html
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+ Player: {{getUsername()}}
+
+
+
+
+
+
+
+
+
+
+
+ Info
+
+
+
+ This Player is currently not connected to this server!
+
+
+
+
+
+
+
diff --git a/app/player/info.js b/app/player/info.js
new file mode 100644
index 0000000..69b8c4d
--- /dev/null
+++ b/app/player/info.js
@@ -0,0 +1,51 @@
+app.controller('playerInfoController', PlayerInfoController);
+
+function PlayerInfoController($scope, connectionService, $routeParams) {
+ $scope.userid = $routeParams.userid;
+
+ $scope.info = null;
+
+ $scope.refresh = function () {
+ connectionService.getPlayers((players) => {
+
+ for (var i in players) {
+ if (players[i].SteamID === $scope.userid) {
+
+ // set player data
+ $scope.info = players[i];
+
+ // remove xp remnants
+ if ($scope.info['CurrentLevel'] !== undefined)
+ delete $scope.info['CurrentLevel'];
+ if ($scope.info['UnspentXp'] !== undefined)
+ delete $scope.info['UnspentXp'];
+
+ // fix violation level
+ if ($scope.info['VoiationLevel'] !== undefined) {
+ var violationLevel = $scope.info['VoiationLevel'];
+ delete $scope.info['VoiationLevel'];
+ $scope.info['ViolationLevel'] = violationLevel;
+ }
+
+ return;
+ }
+ }
+
+ // player not found
+ // reset data to null
+ $scope.info = null;
+ }, $scope);
+ }
+
+ $scope.getUsername = function () {
+ // try to find players name in info
+ if ($scope.info && $scope.info.DisplayName) {
+ return $scope.info.DisplayName;
+ }
+
+ // otherwise show the id
+ return $scope.userid;
+ }
+
+ connectionService.installService($scope, $scope.refresh)
+}
diff --git a/app/player/list.html b/app/player/list.html
new file mode 100644
index 0000000..4c22442
--- /dev/null
+++ b/app/player/list.html
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+ | Actions |
+
+ Username |
+ Steam ID |
+ Violation Level |
+ Address |
+ Ping |
+ Duration |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+ {{line.DisplayName}}
+ |
+
+
+ {{line.SteamID}}
+ |
+
+
+ {{line.VoiationLevel}}
+ |
+
+
+ {{line.Address}}
+ |
+
+
+ {{line.Ping}}
+ |
+
+
+ {{line.ConnectedSeconds | SecondsToDuration}}
+ |
+
+
+
+
+
+
+
+
+
diff --git a/app/player/list.js b/app/player/list.js
new file mode 100644
index 0000000..fda929a
--- /dev/null
+++ b/app/player/list.js
@@ -0,0 +1,42 @@
+app.controller('playerListController', PlayerListController);
+
+function PlayerListController($scope, connectionService, $interval) {
+ $scope.orderBy = '-ConnectedSeconds';
+ $scope.players = [];
+
+ $scope.refresh = function () {
+ connectionService.getPlayers((players) => {
+ $scope.players = players;
+ }, $scope);
+ }
+
+ $scope.order = function (field) {
+ if ($scope.orderBy === field) {
+ field = '-' + field;
+ }
+
+ $scope.orderBy = field;
+ }
+
+ $scope.sortClass = function (field) {
+ if ($scope.orderBy === field) return 'sorting';
+ if ($scope.orderBy === '-' + field) return 'sorting descending';
+
+ return null;
+ }
+
+ $scope.kickPlayer = function (id) {
+ connectionService.command('kick ' + id);
+
+ $scope.refresh();
+ }
+
+ connectionService.installService($scope, $scope.refresh)
+
+ // var timer = $interval( function ()
+ // {
+ // //$scope.Refresh();
+ // }.bind( this ), 1000 );
+
+ //$scope.$on( '$destroy', function () { $interval.cancel( timer ) } )
+}
diff --git a/app/server/info.html b/app/server/info.html
new file mode 100644
index 0000000..464a5da
--- /dev/null
+++ b/app/server/info.html
@@ -0,0 +1,68 @@
+
+
+
+
+
+
{{serverinfo.Hostname}}
+
+
+
+
+ {{key}}:
+ {{value}}
+
+
+
+
+
+
+
+
+
+
+
+
Server Performance
+
+
+
+
+
+
+
+
+
Server Networking
+
+
+
+
+
+
+
+
Players
+
+
+
+
+
+
+
+
+
diff --git a/js/serverInfo.js b/app/server/info.js
similarity index 68%
rename from js/serverInfo.js
rename to app/server/info.js
index 8dacc45..6d3cb0f 100644
--- a/js/serverInfo.js
+++ b/app/server/info.js
@@ -1,9 +1,9 @@
-app.controller('ServerInfoController', ServerInfoController);
+app.controller('serverInfoController', ServerInfoController);
var DATA_LIMIT = 100;
var recordedData = [];
-function ServerInfoController($scope, rconService, $routeParams, $interval) {
+function ServerInfoController($scope, connectionService, $routeParams, $interval) {
$scope.useCharts = false;
// TODO: move serverinfo to service
@@ -21,24 +21,24 @@ function ServerInfoController($scope, rconService, $routeParams, $interval) {
left: 75
},
donut: true,
- x: function(d) {
+ x: function (d) {
return d.key;
},
- y: function(d) {
+ y: function (d) {
return d.y;
},
yAxis: {
axisLabel: 'Slots',
- tickFormat: function(d) {
+ tickFormat: function (d) {
return d3.format('.d')(d);
}
},
showLabels: true,
pie: {
- startAngle: function(d) {
+ startAngle: function (d) {
return d.startAngle / 2 - Math.PI / 2
},
- endAngle: function(d) {
+ endAngle: function (d) {
return d.endAngle / 2 - Math.PI / 2
}
},
@@ -72,40 +72,38 @@ function ServerInfoController($scope, rconService, $routeParams, $interval) {
useInteractiveGuideline: true,
yAxis1: {
axisLabel: 'Framerate',
- tickFormat: function(d) {
+ tickFormat: function (d) {
return d3.format(',d')(d);
}
},
yAxis2: {
axisLabel: 'Entities',
- tickFormat: function(d) {
+ tickFormat: function (d) {
return d3.format(',d')(d);
},
// axisLabelDistance: 12
},
xAxis: {
axisLabel: "Time",
- tickFormat: function(d) {
+ tickFormat: function (d) {
return d3.time.format('%H:%M:%S')(new Date(d))
}
}
}
},
- data: [
- {
- key: 'Framerate',
- type: "line",
- duration: 0,
- yAxis: 1,
- values: []
- }, {
- key: 'Entities',
- type: 'line',
- duration: 0,
- yAxis: 2,
- values: []
- }
- ]
+ data: [{
+ key: 'Framerate',
+ type: "line",
+ duration: 0,
+ yAxis: 1,
+ values: []
+ }, {
+ key: 'Entities',
+ type: 'line',
+ duration: 0,
+ yAxis: 2,
+ values: []
+ }]
};
$scope.netChart = {
@@ -124,7 +122,7 @@ function ServerInfoController($scope, rconService, $routeParams, $interval) {
useInteractiveGuideline: true,
yAxis: {
axisLabel: 'Network',
- tickFormat: function(bytes) {
+ tickFormat: function (bytes) {
var fmt = d3.format('.0f');
if (bytes < 1024) {
return fmt(bytes) + 'B';
@@ -139,34 +137,32 @@ function ServerInfoController($scope, rconService, $routeParams, $interval) {
},
xAxis: {
axisLabel: "Time",
- tickFormat: function(d) {
+ tickFormat: function (d) {
return d3.time.format('%H:%M:%S')(new Date(d))
}
}
}
},
- data: [
- {
- key: 'IN',
- values: []
- }, {
- key: 'OUT',
- values: []
- }
- ]
+ data: [{
+ key: 'IN',
+ values: []
+ }, {
+ key: 'OUT',
+ values: []
+ }]
};
- rconService.InstallService($scope, _refresh);
+ connectionService.installService($scope, _refresh);
// TODO: move updateinterval to service
var timer = $interval(_refresh, 1000);
- $scope.$on("$destroy", function() {
+ $scope.$on("$destroy", function () {
$interval.cancel(timer);
$scope.serverinfo = {};
});
function _refresh() {
- rconService.Request('serverinfo', $scope, function(msg) {
+ connectionService.request('serverinfo', $scope, function (msg) {
_updateData(JSON.parse(msg.Message));
});
}
@@ -182,23 +178,24 @@ function ServerInfoController($scope, rconService, $routeParams, $interval) {
function _collectChartData(data) {
// player chart
- $scope.playersChart.data = [
- {
- key: 'Queued',
- y: data.Queued
- }, {
- key: 'Joining',
- y: data.Joining
- }, {
- key: 'Players',
- y: data.Players
- }, {
- key: 'Free',
- y: (data.MaxPlayers - (data.Joining + data.Players))
- }
- ];
-
- recordedData.push({ts: Date.now(), data: data});
+ $scope.playersChart.data = [{
+ key: 'Queued',
+ y: data.Queued
+ }, {
+ key: 'Joining',
+ y: data.Joining
+ }, {
+ key: 'Players',
+ y: data.Players
+ }, {
+ key: 'Free',
+ y: (data.MaxPlayers - (data.Joining + data.Players))
+ }];
+
+ recordedData.push({
+ ts: Date.now(),
+ data: data
+ });
if (recordedData.length > DATA_LIMIT) {
recordedData = recordedData.slice(Math.max(recordedData.length - DATA_LIMIT, 1));
}
@@ -214,11 +211,23 @@ function ServerInfoController($scope, rconService, $routeParams, $interval) {
for (var i = 0; i < recordedData.length; i++) {
var record = recordedData[i];
- fpsChartValues.push({x: record.ts, y: record.data.Framerate});
- entChartValues.push({x: record.ts, y: record.data.EntityCount});
-
- netInChartValues.push({x: record.ts, y: record.data.NetworkIn});
- netOutChartValues.push({x: record.ts, y: record.data.NetworkOut});
+ fpsChartValues.push({
+ x: record.ts,
+ y: record.data.Framerate
+ });
+ entChartValues.push({
+ x: record.ts,
+ y: record.data.EntityCount
+ });
+
+ netInChartValues.push({
+ x: record.ts,
+ y: record.data.NetworkIn
+ });
+ netOutChartValues.push({
+ x: record.ts,
+ y: record.data.NetworkOut
+ });
}
$scope.performanceChart.data[0].values = fpsChartValues;
diff --git a/image/arrow-right-bold-hexagon-outline.svg b/assets/image/arrow-right-bold-hexagon-outline.svg
similarity index 100%
rename from image/arrow-right-bold-hexagon-outline.svg
rename to assets/image/arrow-right-bold-hexagon-outline.svg
diff --git a/image/menu.svg b/assets/image/menu.svg
similarity index 100%
rename from image/menu.svg
rename to assets/image/menu.svg
diff --git a/assets/rcon.css b/assets/rcon.css
new file mode 100644
index 0000000..7ecc383
--- /dev/null
+++ b/assets/rcon.css
@@ -0,0 +1,181 @@
+@import url(https://fonts.googleapis.com/css?family=Roboto:400,700);
+body {
+ font-family: "Roboto", sans-serif;
+ font-size: 14px;
+ font-weight: 300;
+ line-height: 1.5;
+ color: #cfd2da;
+ background-color: #252830;
+}
+
+#pageloader {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ margin-left: -60px;
+ margin-top: -60px;
+ width: 120px;
+ height: 120px;
+ border: 10px solid #f3f3f3;
+ border-top: 10px solid #1ca8dd;
+ border-radius: 50%;
+ animation: spin 2s linear infinite;
+ z-index: 1000;
+}
+
+a {
+ color: #1ca8dd;
+}
+
+a:hover {
+ color: #fff;
+ text-decoration: none;
+}
+
+.center {
+ text-align: center;
+}
+
+#ConsoleController .Output {
+ font-family: monospace;
+ font-size: 12px;
+ white-space: pre-wrap;
+}
+
+#ConsoleController .Output>.Warning {
+ color: #F8BF57;
+}
+
+#ConsoleController .Output>.Error {
+ color: #BA0000;
+}
+
+.scrollable {
+ overflow: auto;
+}
+
+.nav-sidebar {
+ margin-top: 64px;
+ margin-right: 16px;
+}
+
+.nav-sidebar>li>a {
+ padding-right: 20px;
+ padding-left: 20px;
+ border-radius: 5px;
+}
+
+.nav-sidebar>.active>a,
+.nav-sidebar>.active>a:hover,
+.nav-sidebar>.active>a:focus {
+ color: #fff;
+ background-color: #428bca;
+}
+
+.fade {
+ opacity: 0.5;
+}
+
+.table>tbody>tr:hover {
+ background-color: rgba( 255, 255, 255, 0.3);
+}
+
+.table>thead>tr>th.sorting {
+ color: #1bc98e;
+ border-color: #1bc98e;
+}
+
+.table-responsive {
+ overflow-x: visible !important;
+ overflow-y: visible !important;
+}
+
+.btn-default,
+.btn-default:active,
+.form-control {
+ background: rgba( 255, 255, 255, 0.3);
+ border: none;
+ color: #cfd2da;
+ text-shadow: none;
+}
+
+.btn-default:hover {
+ background: #1ca8dd;
+ color: #fff;
+}
+
+.panel {
+ background-color: #434857;
+}
+
+.flex-middle {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.chattime {
+ min-width: 60px;
+ display: inline-block;
+}
+
+.chatname {
+ min-width: 130px;
+ display: inline-block;
+ text-align: right;
+ /*
+ display: block;
+ width: 200px;
+ float: left;
+ text-align: right;
+ padding-right: 8px;
+ */
+}
+
+.navbar-default {
+ background-color: #428bca;
+ background-image: none;
+ border: none;
+ border-radius: 0;
+ color: white;
+}
+
+.navbar-default .navbar-brand,
+.navbar-default .navbar-brand:hover {
+ color: #fff;
+}
+
+.navbar-default .navbar-text,
+.navbar-default .navbar-nav>li>a,
+.navbar-default .navbar-nav>li>a:hover,
+.navbar-default .navbar-nav>li>a:focus {
+ color: #fff;
+}
+
+.navbar-default .navbar-nav>li>a:hover {
+ background-color: rgba( 255, 255, 255, 0.25);
+}
+
+.navbar-default .navbar-nav>.open>a,
+.navbar-default .navbar-nav>.active>a {
+ background-color: white;
+ background-image: none;
+ border: none;
+ color: #428bca;
+}
+
+.navbar-info {
+ position: relative;
+ display: block;
+ padding: 15px;
+ line-height: 20px;
+}
+
+@keyframes spin {
+ 0% {
+ transform: rotate(0deg);
+ }
+ 100% {
+ transform: rotate(360deg);
+ }
+}
diff --git a/html/chat.html b/html/chat.html
deleted file mode 100644
index 5ab4c69..0000000
--- a/html/chat.html
+++ /dev/null
@@ -1,17 +0,0 @@
-
\ No newline at end of file
diff --git a/html/connect.html b/html/connect.html
deleted file mode 100644
index 56edec3..0000000
--- a/html/connect.html
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
Connect
-
-
- {{LastErrorMessage}}
-
-
-
Enter the address (including rcon port) and the rcon password below to connect.
-
-
-
-
-
-
-
-
Saved Connections
-
-
-
-
-
-
-
-
-
diff --git a/html/console.html b/html/console.html
deleted file mode 100644
index e5ed7e6..0000000
--- a/html/console.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
\ No newline at end of file
diff --git a/html/playerInfo.html b/html/playerInfo.html
deleted file mode 100644
index f3a211e..0000000
--- a/html/playerInfo.html
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
- Player: {{getUsername()}}
-
-
-
-
-
-
-
-
-
-
-
- Info
-
-
-
- This Player is currently not connected to this server!
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/html/playerlist.html b/html/playerlist.html
deleted file mode 100644
index 297abea..0000000
--- a/html/playerlist.html
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- | Actions |
-
- Username |
- Steam ID |
- Violation Level |
- Address |
- Ping |
- Duration |
-
-
-
-
- |
-
-
-
-
- |
-
-
- {{line.DisplayName}}
- |
-
-
- {{line.SteamID}}
- |
-
-
- {{line.VoiationLevel}}
- |
-
-
- {{line.Address}}
- |
-
-
- {{line.Ping}}
- |
-
-
- {{line.ConnectedSeconds | SecondsToDuration}}
- |
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/html/serverInfo.html b/html/serverInfo.html
deleted file mode 100644
index ecdd567..0000000
--- a/html/serverInfo.html
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
{{serverinfo.Hostname}}
-
-
-
-
- {{key}}:
- {{value}}
-
-
-
-
-
-
-
-
-
-
-
-
- Server Performance
-
-
-
-
-
-
-
-
-
-
- Server Networking
-
-
-
-
-
-
-
-
-
- Players
-
-
-
-
-
-
-
-
-
-
diff --git a/index.html b/index.html
index 76ecddf..e698b43 100644
--- a/index.html
+++ b/index.html
@@ -1,71 +1,51 @@
-
-
-
-
-
-
Websocket Rcon
-
-
-
-
-
-
+
+
+
+
+
+
+
Websocket Rcon
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/js/app.js b/js/app.js
deleted file mode 100644
index 8e03643..0000000
--- a/js/app.js
+++ /dev/null
@@ -1,114 +0,0 @@
-var app = angular.module('RconApp', ['ngRoute', 'nvd3']);
-
-app.service('rconService', [RconService]);
-
-app.config(function($routeProvider) {
- $routeProvider.when("/home", {Title: "Home"});
- $routeProvider.when("/:address/info", {
- Title: "Server",
- templateUrl: "html/serverInfo.html",
- Nav: true
- });
- $routeProvider.when("/:address/console", {
- Title: "Console",
- templateUrl: "html/console.html",
- Nav: true
- });
- $routeProvider.when("/:address/chat", {
- Title: "Chat",
- templateUrl: "html/chat.html",
- Nav: true
- });
- $routeProvider.when("/:address/playerlist", {
- Title: "Player List",
- templateUrl: "html/playerlist.html",
- Nav: true
- });
- $routeProvider.when("/:address/player/:userid", {
- Title: "Player Info",
- templateUrl: "html/playerInfo.html"
- });
- $routeProvider.otherwise({redirectTo: '/home'});
-});
-
-app.controller('RconController', RconController);
-
-function RconController($scope, $rootScope, rconService, $timeout, $route) {
- $scope.$route = $route;
-
- $scope.pages = $.map($route.routes, function(value, index) {
- if (value.Nav) {
- return [value];
- }
- });
-
- $scope.OpenLeftMenu = function() {
- $mdSidenav('left').toggle();
- };
-
- $scope.IsConnected = function() {
- return rconService.IsConnected();
- }
-
- $rootScope.Nav = function(url) {
- return url.replace(":address", rconService.Address);
- }
-
- $rootScope.$on('$stateChangeStart', function(next, current) {
- console.log(next);
- });
-
- rconService.OnOpen = function() {
- $scope.Connected = true;
- $scope.$broadcast("OnConnected");
- $scope.$digest();
- $scope.address = rconService.Address;
- }
-
- rconService.OnClose = function(ev) {
- $scope.$broadcast("OnDisconnected", ev);
- $scope.$digest();
- }
-
- rconService.OnError = function(ev) {
- $scope.$broadcast("OnConnectionError", ev);
- $scope.$digest();
- }
-
- rconService.OnMessage = function(msg) {
- $scope.$apply(function() {
- $scope.$broadcast("OnMessage", msg);
- });
- }
-
- $scope.Disconnect = function() {
- if (confirm('Do you really want to disconnect?')) {
- rconService.Disconnect();
- $scope.Connected = false;
-
- $scope.address = '#/home';
- }
- }
-}
-
-app.filter('SecondsToDuration', [SecondsToDuration]);
-
-function SecondsToDuration() {
- return function(input) {
- input = parseInt(input);
-
- var out = "";
- var hours = Math.floor(input / 3600);
- if (input > 3600)
- out += hours + "h";
-
- var minutes = Math.floor(input / 60) % 60;
- if (input > 60)
- out += minutes + "m";
-
- var seconds = input % 60;
- out += seconds + "s";
-
- return out;
- }
-}
diff --git a/js/chat.js b/js/chat.js
deleted file mode 100644
index 8a3c2d6..0000000
--- a/js/chat.js
+++ /dev/null
@@ -1,88 +0,0 @@
-
-app.controller( 'ChatController', ChatController );
-
-function ChatController( $scope, rconService, $timeout )
-{
- $scope.Output = [];
-
- $scope.SubmitCommand = function ()
- {
- rconService.Command( "say " + $scope.Command, 1 );
- $scope.Command = "";
- }
-
- $scope.$on( "OnMessage", function ( event, msg )
- {
- if ( msg.Type !== "Chat" ) return;
-
- $scope.OnMessage( JSON.parse( msg.Message ) );
- });
-
- $scope.OnMessage = function( msg )
- {
- msg.Message = stripHtml(msg.Message);
- $scope.Output.push( msg );
-
- if($scope.isOnBottom()) {
- $scope.ScrollToBottom();
- }
- }
-
- $scope.ScrollToBottom = function()
- {
- var element = $( "#ChatController .Output" );
-
- $timeout( function() {
- element.scrollTop( element.prop('scrollHeight') );
- }, 50 );
- }
-
- $scope.isOnBottom = function()
- {
- // get jquery element
- var element = $( "#ChatController .Output" );
-
- // height of the element
- var height = element.height();
-
- // scroll position from top position
- var scrollTop = element.scrollTop();
-
- // full height of the element
- var scrollHeight = element.prop('scrollHeight');
-
- if((scrollTop + height) > (scrollHeight - 10)) {
- return true;
- }
-
- return false;
- }
-
- //
- // Calls console.tail - which returns the last 256 entries from the console.
- // This is then added to the console
- //
- $scope.GetHistory = function ()
- {
- rconService.Request( "chat.tail 512", $scope, function ( msg )
- {
- var messages = JSON.parse( msg.Message );
-
- messages.forEach( function ( message ) {
- $scope.OnMessage( message );
- });
-
- $scope.ScrollToBottom();
- } );
- }
-
- rconService.InstallService( $scope, $scope.GetHistory )
-}
-
-function stripHtml(html)
-{
- if (html == null) return "";
- var tmp = document.createElement("div");
- tmp.innerHTML = html;
- return tmp.textContent || tmp.innerText || "";
-}
\ No newline at end of file
diff --git a/js/connection.js b/js/connection.js
deleted file mode 100644
index f11882d..0000000
--- a/js/connection.js
+++ /dev/null
@@ -1,135 +0,0 @@
-
-app.controller( 'ConnectionController', ConnectionController );
-
-function ConnectionController( $scope, rconService, $routeParams, $timeout, $location )
-{
- $scope.Address = "";
- $scope.Password = "";
- $scope.SaveConnection = true;
-
- $scope.connectionsLimit = 5;
-
- function _loadFromLocalStorage() {
- var connections = [];
-
- // load and parse from local storage
- if ( localStorage && localStorage.previousConnections ) {
- connections = angular.fromJson( localStorage.previousConnections );
- }
-
- // double check
- if ( !connections ) {
- connections = [];
- }
-
- return connections;
- }
-
- function _addWithoutDuplicates(connections, connection) {
- // prepare new array
- var filteredConnections = [];
-
- for(var i in connections) {
- if(connections[i].Address !== connection.Address && connections[i].Password !== connection.Password) {
- // add old connection info to our new array
- filteredConnections.push(connections[i]);
- }
- }
-
- // add new connection
- filteredConnections.push(connection);
-
- return filteredConnections;
- }
-
- $scope.toggleConnectionsLimit = function ()
- {
- // toggle limit between undefined and 5
- // undefined sets limit to max
- if($scope.connectionsLimit === undefined) {
- $scope.connectionsLimit = 5;
- } else {
- $scope.connectionsLimit = undefined;
- }
- }
-
- $scope.Connect = function ()
- {
- $scope.Address = $scope.Address.trim();
- $scope.Password = $scope.Password.trim();
-
- $scope.LastErrorMessage = null;
- rconService.Connect( $scope.Address, $scope.Password );
-
- $location.path('/' + $scope.Address + '/info');
- }
-
- $scope.ConnectTo = function ( c )
- {
- $scope.SaveConnection = false;
- $scope.LastErrorMessage = null;
- rconService.Connect( c.Address, c.Password );
- }
-
- $scope.$on( "OnDisconnected", function ( x, ev )
- {
- console.log( ev );
- $scope.LastErrorMessage = "Connection was closed - Error " + ev.code;
- $scope.$digest();
- } );
-
- $scope.$on( "OnConnected", function ( x, ev )
- {
- if ( $scope.SaveConnection )
- {
- // new connection to add
- var connection = { Address: $scope.Address, Password: $scope.Password, date: new Date() };
-
- // remove old entries and add our new connection info
- var connections = _addWithoutDuplicates(_loadFromLocalStorage(), connection);
-
- // push to scope and save data
- $scope.PreviousConnects = connections;
- localStorage.previousConnections = angular.toJson( $scope.PreviousConnects );
- }
- } );
-
- $scope.PreviousConnects = _loadFromLocalStorage();
-
- //
- // If a server address is passed in.. try to connect if we have a saved entry
- //
- $timeout( function ()
- {
- $scope.Address = $routeParams.address;
-
- //
- // If a password was passed as a search param, use that
- //
- var pw = $location.search().password;
- if ( pw )
- {
- $scope.Password = pw;
- $location.search( "password", null );
- }
-
- if ( $scope.Address != null )
- {
- // If we have a password (passed as a search param) then connect using that
- if ( $scope.Password != "" )
- {
- $scope.Connect();
- return;
- }
-
- var foundAddress = Enumerable.From( $scope.PreviousConnects ).Where( function ( x ) { return x.Address == $scope.Address } ).First();
- if ( foundAddress != null )
- {
- $scope.ConnectTo( foundAddress );
- }
-
- }
-
- }, 20 );
-
-}
diff --git a/js/console.js b/js/console.js
deleted file mode 100644
index af065a3..0000000
--- a/js/console.js
+++ /dev/null
@@ -1,145 +0,0 @@
-
-app.controller( 'ConsoleController', ConsoleController );
-
-function ConsoleController( $scope, rconService, $timeout )
-{
- $scope.Output = [];
- $scope.commandHistory = [];
- $scope.commandHistoryIndex = 0;
-
- $scope.KeyUp = function (event)
- {
- switch(event.keyCode) {
-
- // Arrow Key Up
- case 38:
-
- // rotate through commandHistory
- $scope.commandHistoryIndex--;
- if($scope.commandHistoryIndex < 0) {
- $scope.commandHistoryIndex = $scope.commandHistory.length;
- }
-
- // set command from history
- if($scope.commandHistory[$scope.commandHistoryIndex]) {
- $scope.Command = $scope.commandHistory[$scope.commandHistoryIndex];
- }
-
- break;
-
- // Arrow Key Down
- case 40:
-
- // rotate through commandHistory
- $scope.commandHistoryIndex++;
- if($scope.commandHistoryIndex >= $scope.commandHistory.length) {
- $scope.commandHistoryIndex = 0;
- }
-
- // set command from history
- if($scope.commandHistory[$scope.commandHistoryIndex]) {
- $scope.Command = $scope.commandHistory[$scope.commandHistoryIndex];
- }
-
- break;
-
- default:
- // reset command history index
- $scope.commandHistoryIndex = $scope.commandHistory.length;
- break;
- }
- }
-
- $scope.SubmitCommand = function ()
- {
- $scope.OnMessage( { Message: $scope.Command, Type: 'Command' } );
-
- $scope.commandHistory.push($scope.Command);
-
- rconService.Command( $scope.Command, 1 );
- $scope.Command = "";
- $scope.commandHistoryIndex = 0;
- }
- $scope.$on( "OnMessage", function ( event, msg ) { $scope.OnMessage( msg ); } );
-
- $scope.OnMessage = function( msg )
- {
-
- if ( msg.Message.startsWith( "[rcon] " ) ) {
- return;
- }
-
- switch(msg.Type) {
- case 'Generic':
- case 'Log':
- case 'Error':
- case 'Warning':
- $scope.addOutput(msg);
- break;
-
- default:
- console.log( msg );
- return;
- }
- }
-
- $scope.ScrollToBottom = function()
- {
- var element = $( "#ConsoleController .Output" );
-
- $timeout( function() {
- element.scrollTop( element.prop('scrollHeight') );
- }, 50 );
- }
-
- $scope.isOnBottom = function()
- {
- // get jquery element
- var element = $( "#ConsoleController .Output" );
-
- // height of the element
- var height = element.height();
-
- // scroll position from top position
- var scrollTop = element.scrollTop();
-
- // full height of the element
- var scrollHeight = element.prop('scrollHeight');
-
- if((scrollTop + height) > (scrollHeight - 10)) {
- return true;
- }
-
- return false;
- }
-
- //
- // Calls console.tail - which returns the last 128 entries from the console.
- // This is then added to the console
- //
- $scope.GetHistory = function ()
- {
- rconService.Request( "console.tail 128", $scope, function ( msg )
- {
- var messages = JSON.parse( msg.Message );
-
- messages.forEach( function ( msg ) {
- $scope.OnMessage( msg );
- });
-
- $scope.ScrollToBottom();
- } );
- }
-
- $scope.addOutput = function (msg)
- {
- msg.Class = msg.Type;
- $scope.Output.push( msg );
-
- if($scope.isOnBottom()) {
- $scope.ScrollToBottom();
- }
- }
-
- rconService.InstallService( $scope, $scope.GetHistory )
-}
\ No newline at end of file
diff --git a/js/linq.min.js b/js/linq.min.js
deleted file mode 100644
index 7fe4ee1..0000000
--- a/js/linq.min.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/*--------------------------------------------------------------------------
-* linq.js - LINQ for JavaScript
-* ver 2.2.0.2 (Jan. 21th, 2011)
-*
-* created and maintained by neuecc
-* licensed under Microsoft Public License(Ms-PL)
-* http://neue.cc/
-* http://linqjs.codeplex.com/
-*--------------------------------------------------------------------------*/
-Enumerable=function(){var m="Single:sequence contains more than one element.",e=true,b=null,a=false,c=function(a){this.GetEnumerator=a};c.Choice=function(){var a=arguments[0]instanceof Array?arguments[0]:arguments;return new c(function(){return new f(g.Blank,function(){return this.Yield(a[Math.floor(Math.random()*a.length)])},g.Blank)})};c.Cycle=function(){var a=arguments[0]instanceof Array?arguments[0]:arguments;return new c(function(){var b=0;return new f(g.Blank,function(){if(b>=a.length)b=0;return this.Yield(a[b++])},g.Blank)})};c.Empty=function(){return new c(function(){return new f(g.Blank,function(){return a},g.Blank)})};c.From=function(j){if(j==b)return c.Empty();if(j instanceof c)return j;if(typeof j==i.Number||typeof j==i.Boolean)return c.Repeat(j,1);if(typeof j==i.String)return new c(function(){var b=0;return new f(g.Blank,function(){return b=e})};c.Repeat=function(d,a){return a!=b?c.Repeat(d).Take(a):new c(function(){return new f(g.Blank,function(){return this.Yield(d)},g.Blank)})};c.RepeatWithFinalize=function(a,e){a=d.CreateLambda(a);e=d.CreateLambda(e);return new c(function(){var c;return new f(function(){c=a()},function(){return this.Yield(c)},function(){if(c!=b){e(c);c=b}})})};c.Generate=function(a,e){if(e!=b)return c.Generate(a).Take(e);a=d.CreateLambda(a);return new c(function(){return new f(g.Blank,function(){return this.Yield(a())},g.Blank)})};c.ToInfinity=function(d,a){if(d==b)d=0;if(a==b)a=1;return new c(function(){var b;return new f(function(){b=d-a},function(){return this.Yield(b+=a)},g.Blank)})};c.ToNegativeInfinity=function(d,a){if(d==b)d=0;if(a==b)a=1;return new c(function(){var b;return new f(function(){b=d+a},function(){return this.Yield(b-=a)},g.Blank)})};c.Unfold=function(h,b){b=d.CreateLambda(b);return new c(function(){var d=e,c;return new f(g.Blank,function(){if(d){d=a;c=h;return this.Yield(c)}c=b(c);return this.Yield(c)},g.Blank)})};c.prototype={CascadeBreadthFirst:function(g,b){var h=this;g=d.CreateLambda(g);b=d.CreateLambda(b);return new c(function(){var i,k=0,j=[];return new f(function(){i=h.GetEnumerator()},function(){while(e){if(i.MoveNext()){j.push(i.Current());return this.Yield(b(i.Current(),k))}var f=c.From(j).SelectMany(function(a){return g(a)});if(!f.Any())return a;else{k++;j=[];d.Dispose(i);i=f.GetEnumerator()}}},function(){d.Dispose(i)})})},CascadeDepthFirst:function(g,b){var h=this;g=d.CreateLambda(g);b=d.CreateLambda(b);return new c(function(){var j=[],i;return new f(function(){i=h.GetEnumerator()},function(){while(e){if(i.MoveNext()){var f=b(i.Current(),j.length);j.push(i);i=c.From(g(i.Current())).GetEnumerator();return this.Yield(f)}if(j.length<=0)return a;d.Dispose(i);i=j.pop()}},function(){try{d.Dispose(i)}finally{c.From(j).ForEach(function(a){a.Dispose()})}})})},Flatten:function(){var h=this;return new c(function(){var j,i=b;return new f(function(){j=h.GetEnumerator()},function(){while(e){if(i!=b)if(i.MoveNext())return this.Yield(i.Current());else i=b;if(j.MoveNext())if(j.Current()instanceof Array){d.Dispose(i);i=c.From(j.Current()).SelectMany(g.Identity).Flatten().GetEnumerator();continue}else return this.Yield(j.Current());return a}},function(){try{d.Dispose(j)}finally{d.Dispose(i)}})})},Pairwise:function(b){var e=this;b=d.CreateLambda(b);return new c(function(){var c;return new f(function(){c=e.GetEnumerator();c.MoveNext()},function(){var d=c.Current();return c.MoveNext()?this.Yield(b(d,c.Current())):a},function(){d.Dispose(c)})})},Scan:function(i,g,j){if(j!=b)return this.Scan(i,g).Select(j);var h;if(g==b){g=d.CreateLambda(i);h=a}else{g=d.CreateLambda(g);h=e}var k=this;return new c(function(){var b,c,j=e;return new f(function(){b=k.GetEnumerator()},function(){if(j){j=a;if(!h){if(b.MoveNext())return this.Yield(c=b.Current())}else return this.Yield(c=i)}return b.MoveNext()?this.Yield(c=g(c,b.Current())):a},function(){d.Dispose(b)})})},Select:function(b){var e=this;b=d.CreateLambda(b);return new c(function(){var c,g=0;return new f(function(){c=e.GetEnumerator()},function(){return c.MoveNext()?this.Yield(b(c.Current(),g++)):a},function(){d.Dispose(c)})})},SelectMany:function(g,e){var h=this;g=d.CreateLambda(g);if(e==b)e=function(b,a){return a};e=d.CreateLambda(e);return new c(function(){var j,i=undefined,k=0;return new f(function(){j=h.GetEnumerator()},function(){if(i===undefined)if(!j.MoveNext())return a;do{if(i==b){var f=g(j.Current(),k++);i=c.From(f).GetEnumerator()}if(i.MoveNext())return this.Yield(e(j.Current(),i.Current()));d.Dispose(i);i=b}while(j.MoveNext());return a},function(){try{d.Dispose(j)}finally{d.Dispose(i)}})})},Where:function(b){b=d.CreateLambda(b);var e=this;return new c(function(){var c,g=0;return new f(function(){c=e.GetEnumerator()},function(){while(c.MoveNext())if(b(c.Current(),g++))return this.Yield(c.Current());return a},function(){d.Dispose(c)})})},OfType:function(c){var a;switch(c){case Number:a=i.Number;break;case String:a=i.String;break;case Boolean:a=i.Boolean;break;case Function:a=i.Function;break;default:a=b}return a===b?this.Where(function(a){return a instanceof c}):this.Where(function(b){return typeof b===a})},Zip:function(e,b){b=d.CreateLambda(b);var g=this;return new c(function(){var i,h,j=0;return new f(function(){i=g.GetEnumerator();h=c.From(e).GetEnumerator()},function(){return i.MoveNext()&&h.MoveNext()?this.Yield(b(i.Current(),h.Current(),j++)):a},function(){try{d.Dispose(i)}finally{d.Dispose(h)}})})},Join:function(m,i,h,k,j){i=d.CreateLambda(i);h=d.CreateLambda(h);k=d.CreateLambda(k);j=d.CreateLambda(j);var l=this;return new c(function(){var n,q,o=b,p=0;return new f(function(){n=l.GetEnumerator();q=c.From(m).ToLookup(h,g.Identity,j)},function(){while(e){if(o!=b){var c=o[p++];if(c!==undefined)return this.Yield(k(n.Current(),c));c=b;p=0}if(n.MoveNext()){var d=i(n.Current());o=q.Get(d).ToArray()}else return a}},function(){d.Dispose(n)})})},GroupJoin:function(l,h,e,j,i){h=d.CreateLambda(h);e=d.CreateLambda(e);j=d.CreateLambda(j);i=d.CreateLambda(i);var k=this;return new c(function(){var m=k.GetEnumerator(),n=b;return new f(function(){m=k.GetEnumerator();n=c.From(l).ToLookup(e,g.Identity,i)},function(){if(m.MoveNext()){var b=n.Get(h(m.Current()));return this.Yield(j(m.Current(),b))}return a},function(){d.Dispose(m)})})},All:function(b){b=d.CreateLambda(b);var c=e;this.ForEach(function(d){if(!b(d)){c=a;return a}});return c},Any:function(c){c=d.CreateLambda(c);var b=this.GetEnumerator();try{if(arguments.length==0)return b.MoveNext();while(b.MoveNext())if(c(b.Current()))return e;return a}finally{d.Dispose(b)}},Concat:function(e){var g=this;return new c(function(){var i,h;return new f(function(){i=g.GetEnumerator()},function(){if(h==b){if(i.MoveNext())return this.Yield(i.Current());h=c.From(e).GetEnumerator()}return h.MoveNext()?this.Yield(h.Current()):a},function(){try{d.Dispose(i)}finally{d.Dispose(h)}})})},Insert:function(h,b){var g=this;return new c(function(){var j,i,l=0,k=a;return new f(function(){j=g.GetEnumerator();i=c.From(b).GetEnumerator()},function(){if(l==h&&i.MoveNext()){k=e;return this.Yield(i.Current())}if(j.MoveNext()){l++;return this.Yield(j.Current())}return!k&&i.MoveNext()?this.Yield(i.Current()):a},function(){try{d.Dispose(j)}finally{d.Dispose(i)}})})},Alternate:function(a){a=c.Return(a);return this.SelectMany(function(b){return c.Return(b).Concat(a)}).TakeExceptLast()},Contains:function(f,b){b=d.CreateLambda(b);var c=this.GetEnumerator();try{while(c.MoveNext())if(b(c.Current())===f)return e;return a}finally{d.Dispose(c)}},DefaultIfEmpty:function(b){var g=this;return new c(function(){var c,h=e;return new f(function(){c=g.GetEnumerator()},function(){if(c.MoveNext()){h=a;return this.Yield(c.Current())}else if(h){h=a;return this.Yield(b)}return a},function(){d.Dispose(c)})})},Distinct:function(a){return this.Except(c.Empty(),a)},Except:function(e,b){b=d.CreateLambda(b);var g=this;return new c(function(){var h,i;return new f(function(){h=g.GetEnumerator();i=new n(b);c.From(e).ForEach(function(a){i.Add(a)})},function(){while(h.MoveNext()){var b=h.Current();if(!i.Contains(b)){i.Add(b);return this.Yield(b)}}return a},function(){d.Dispose(h)})})},Intersect:function(e,b){b=d.CreateLambda(b);var g=this;return new c(function(){var h,i,j;return new f(function(){h=g.GetEnumerator();i=new n(b);c.From(e).ForEach(function(a){i.Add(a)});j=new n(b)},function(){while(h.MoveNext()){var b=h.Current();if(!j.Contains(b)&&i.Contains(b)){j.Add(b);return this.Yield(b)}}return a},function(){d.Dispose(h)})})},SequenceEqual:function(h,f){f=d.CreateLambda(f);var g=this.GetEnumerator();try{var b=c.From(h).GetEnumerator();try{while(g.MoveNext())if(!b.MoveNext()||f(g.Current())!==f(b.Current()))return a;return b.MoveNext()?a:e}finally{d.Dispose(b)}}finally{d.Dispose(g)}},Union:function(e,b){b=d.CreateLambda(b);var g=this;return new c(function(){var j,h,i;return new f(function(){j=g.GetEnumerator();i=new n(b)},function(){var b;if(h===undefined){while(j.MoveNext()){b=j.Current();if(!i.Contains(b)){i.Add(b);return this.Yield(b)}}h=c.From(e).GetEnumerator()}while(h.MoveNext()){b=h.Current();if(!i.Contains(b)){i.Add(b);return this.Yield(b)}}return a},function(){try{d.Dispose(j)}finally{d.Dispose(h)}})})},OrderBy:function(b){return new j(this,b,a)},OrderByDescending:function(a){return new j(this,a,e)},Reverse:function(){var b=this;return new c(function(){var c,d;return new f(function(){c=b.ToArray();d=c.length},function(){return d>0?this.Yield(c[--d]):a},g.Blank)})},Shuffle:function(){var b=this;return new c(function(){var c;return new f(function(){c=b.ToArray()},function(){if(c.length>0){var b=Math.floor(Math.random()*c.length);return this.Yield(c.splice(b,1)[0])}return a},g.Blank)})},GroupBy:function(i,h,e,g){var j=this;i=d.CreateLambda(i);h=d.CreateLambda(h);if(e!=b)e=d.CreateLambda(e);g=d.CreateLambda(g);return new c(function(){var c;return new f(function(){c=j.ToLookup(i,h,g).ToEnumerable().GetEnumerator()},function(){while(c.MoveNext())return e==b?this.Yield(c.Current()):this.Yield(e(c.Current().Key(),c.Current()));return a},function(){d.Dispose(c)})})},PartitionBy:function(j,i,g,h){var l=this;j=d.CreateLambda(j);i=d.CreateLambda(i);h=d.CreateLambda(h);var k;if(g==b){k=a;g=function(b,a){return new o(b,a)}}else{k=e;g=d.CreateLambda(g)}return new c(function(){var b,n,o,m=[];return new f(function(){b=l.GetEnumerator();if(b.MoveNext()){n=j(b.Current());o=h(n);m.push(i(b.Current()))}},function(){var d;while((d=b.MoveNext())==e)if(o===h(j(b.Current())))m.push(i(b.Current()));else break;if(m.length>0){var f=k?g(n,c.From(m)):g(n,m);if(d){n=j(b.Current());o=h(n);m=[i(b.Current())]}else m=[];return this.Yield(f)}return a},function(){d.Dispose(b)})})},BufferWithCount:function(e){var b=this;return new c(function(){var c;return new f(function(){c=b.GetEnumerator()},function(){var b=[],d=0;while(c.MoveNext()){b.push(c.Current());if(++d>=e)return this.Yield(b)}return b.length>0?this.Yield(b):a},function(){d.Dispose(c)})})},Aggregate:function(c,b,a){return this.Scan(c,b,a).Last()},Average:function(a){a=d.CreateLambda(a);var c=0,b=0;this.ForEach(function(d){c+=a(d);++b});return c/b},Count:function(a){a=a==b?g.True:d.CreateLambda(a);var c=0;this.ForEach(function(d,b){if(a(d,b))++c});return c},Max:function(a){if(a==b)a=g.Identity;return this.Select(a).Aggregate(function(a,b){return a>b?a:b})},Min:function(a){if(a==b)a=g.Identity;return this.Select(a).Aggregate(function(a,b){return aa(c)?b:c})},MinBy:function(a){a=d.CreateLambda(a);return this.Aggregate(function(b,c){return a(b)")})},Force:function(){var a=this.GetEnumerator();try{while(a.MoveNext());}finally{d.Dispose(a)}},Let:function(b){b=d.CreateLambda(b);var e=this;return new c(function(){var g;return new f(function(){g=c.From(b(e)).GetEnumerator()},function(){return g.MoveNext()?this.Yield(g.Current()):a},function(){d.Dispose(g)})})},Share:function(){var e=this,d;return new c(function(){return new f(function(){if(d==b)d=e.GetEnumerator()},function(){return d.MoveNext()?this.Yield(d.Current()):a},g.Blank)})},MemoizeAll:function(){var h=this,e,d;return new c(function(){var c=-1;return new f(function(){if(d==b){d=h.GetEnumerator();e=[]}},function(){c++;return e.length<=c?d.MoveNext()?this.Yield(e[c]=d.Current()):a:this.Yield(e[c])},g.Blank)})},Catch:function(b){b=d.CreateLambda(b);var e=this;return new c(function(){var c;return new f(function(){c=e.GetEnumerator()},function(){try{return c.MoveNext()?this.Yield(c.Current()):a}catch(d){b(d);return a}},function(){d.Dispose(c)})})},Finally:function(b){b=d.CreateLambda(b);var e=this;return new c(function(){var c;return new f(function(){c=e.GetEnumerator()},function(){return c.MoveNext()?this.Yield(c.Current()):a},function(){try{d.Dispose(c)}finally{b()}})})},Trace:function(c,a){if(c==b)c="Trace";a=d.CreateLambda(a);return this.Do(function(b){console.log(c,":",a(b))})}};var g={Identity:function(a){return a},True:function(){return e},Blank:function(){}},i={Boolean:typeof e,Number:typeof 0,String:typeof"",Object:typeof{},Undefined:typeof undefined,Function:typeof function(){}},d={CreateLambda:function(a){if(a==b)return g.Identity;if(typeof a==i.String)if(a=="")return g.Identity;else if(a.indexOf("=>")==-1)return new Function("$,$$,$$$,$$$$","return "+a);else{var c=a.match(/^[(\s]*([^()]*?)[)\s]*=>(.*)/);return new Function(c[1],"return "+c[2])}return a},IsIEnumerable:function(b){if(typeof Enumerator!=i.Undefined)try{new Enumerator(b);return e}catch(c){}return a},Compare:function(a,b){return a===b?0:a>b?1:-1},Dispose:function(a){a!=b&&a.Dispose()}},k={Before:0,Running:1,After:2},f=function(d,f,g){var c=new p,b=k.Before;this.Current=c.Current;this.MoveNext=function(){try{switch(b){case k.Before:b=k.Running;d();case k.Running:if(f.apply(c))return e;else{this.Dispose();return a}case k.After:return a}}catch(g){this.Dispose();throw g;}};this.Dispose=function(){if(b!=k.Running)return;try{g()}finally{b=k.After}}},p=function(){var a=b;this.Current=function(){return a};this.Yield=function(b){a=b;return e}},j=function(f,b,c,e){var a=this;a.source=f;a.keySelector=d.CreateLambda(b);a.descending=c;a.parent=e};j.prototype=new c;j.prototype.CreateOrderedEnumerable=function(a,b){return new j(this.source,a,b,this)};j.prototype.ThenBy=function(b){return this.CreateOrderedEnumerable(b,a)};j.prototype.ThenByDescending=function(a){return this.CreateOrderedEnumerable(a,e)};j.prototype.GetEnumerator=function(){var h=this,d,c,e=0;return new f(function(){d=[];c=[];h.source.ForEach(function(b,a){d.push(b);c.push(a)});var a=l.Create(h,b);a.GenerateKeys(d);c.sort(function(b,c){return a.Compare(b,c)})},function(){return e0:c.prototype.Any.apply(this,arguments)};h.prototype.Count=function(a){return a==b?this.source.length:c.prototype.Count.apply(this,arguments)};h.prototype.ElementAt=function(a){return 0<=a&&a0?this.source[0]:c.prototype.First.apply(this,arguments)};h.prototype.FirstOrDefault=function(a,d){return d!=b?c.prototype.FirstOrDefault.apply(this,arguments):this.source.length>0?this.source[0]:a};h.prototype.Last=function(d){var a=this;return d==b&&a.source.length>0?a.source[a.source.length-1]:c.prototype.Last.apply(a,arguments)};h.prototype.LastOrDefault=function(d,e){var a=this;return e!=b?c.prototype.LastOrDefault.apply(a,arguments):a.source.length>0?a.source[a.source.length-1]:d};h.prototype.Skip=function(d){var b=this.source;return new c(function(){var c;return new f(function(){c=d<0?0:d},function(){return c0?this.Yield(b[--c]):a},g.Blank)})};h.prototype.SequenceEqual=function(d,e){return(d instanceof h||d instanceof Array)&&e==b&&c.From(d).Count()!=this.Count()?a:c.prototype.SequenceEqual.apply(this,arguments)};h.prototype.ToString=function(a,d){if(d!=b||!(this.source instanceof Array))return c.prototype.ToString.apply(this,arguments);if(a==b)a="";return this.source.join(a)};h.prototype.GetEnumerator=function(){var b=this.source,c=0;return new f(g.Blank,function(){return c 1000) {
- var cb = Service.Callbacks[data.Identifier];
- if (cb != null) {
- cb.scope.$apply(function() {
- cb.callback(data);
- });
- }
- Service.Callbacks[data.Identifier] = null;
-
- return;
- }
-
- //
- // Generic console message, let OnMessage catch it
- //
- if (Service.OnMessage != null) {
- Service.OnMessage(data);
- }
- };
-
- this.Socket.onopen = this.OnOpen;
- this.Socket.onclose = this.OnClose;
- this.Socket.onerror = this.OnError;
- }
-
- Service.Disconnect = function() {
- if (this.Socket) {
- this.Socket.close();
- this.Socket = null;
- }
-
- this.Callbacks = {};
- }
-
- Service.Command = function(msg, identifier) {
- if (this.Socket === null)
- return;
-
- if (!this.IsConnected())
- return;
-
- if (identifier === null)
- identifier = -1;
-
- var packet = {
- Identifier: identifier,
- Message: msg,
- Name: "WebRcon"
- };
-
- this.Socket.send(JSON.stringify(packet));
- };
-
- //
- // Make a request, call this function when it returns
- //
- Service.Request = function(msg, scope, callback) {
- LastIndex++;
- this.Callbacks[LastIndex] = {
- scope: scope,
- callback: callback
- };
- Service.Command(msg, LastIndex);
- }
-
- //
- // Returns true if websocket is connected
- //
- Service.IsConnected = function() {
- if (this.Socket == null)
- return false;
-
- return this.Socket.readyState === ConnectionStatus.OPEN;
- }
-
- //
- // Helper for installing connectivity logic
- //
- // Basically if not connected, call this function when we are
- // And if we are - then call it right now.
- //
- Service.InstallService = function(scope, func) {
- scope.$on("OnConnected", function() {
- func();
- });
-
- if (this.IsConnected()) {
- func();
- }
- }
-
- Service.getPlayers = function(scope, success) {
- this.Request("playerlist", scope, function(response) {
- var players = JSON.parse(response.Message);
-
- if (typeof success === 'function') {
- success.call(scope, players);
- }
- });
- }
-
- return Service;
-}
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..f32ccab
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,175 @@
+{
+ "name": "webrcon",
+ "requires": true,
+ "lockfileVersion": 1,
+ "dependencies": {
+ "corser": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz",
+ "integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=",
+ "dev": true
+ },
+ "ecstatic": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-1.4.1.tgz",
+ "integrity": "sha1-Mst7b6LikNWGaGdNEV6PDD1WfWo=",
+ "dev": true,
+ "requires": {
+ "he": "0.5.0",
+ "mime": "1.3.6",
+ "minimist": "1.2.0",
+ "url-join": "1.1.0"
+ }
+ },
+ "eventemitter3": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz",
+ "integrity": "sha1-HIaZHYFq0eUEdQ5zh0Ik7PO+xQg=",
+ "dev": true
+ },
+ "he": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/he/-/he-0.5.0.tgz",
+ "integrity": "sha1-LAX/rvkLaOhg8/0rVO9YCYknfuI=",
+ "dev": true
+ },
+ "http-proxy": {
+ "version": "1.16.2",
+ "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.16.2.tgz",
+ "integrity": "sha1-Bt/ykpUr9k2+hHH6nfcwZtTzd0I=",
+ "dev": true,
+ "requires": {
+ "eventemitter3": "1.2.0",
+ "requires-port": "1.0.0"
+ }
+ },
+ "http-server": {
+ "version": "0.9.0",
+ "resolved": "https://registry.npmjs.org/http-server/-/http-server-0.9.0.tgz",
+ "integrity": "sha1-jxsGvcczYY1NxCgxx7oa/04GABo=",
+ "dev": true,
+ "requires": {
+ "colors": "1.0.3",
+ "corser": "2.0.1",
+ "ecstatic": "1.4.1",
+ "http-proxy": "1.16.2",
+ "opener": "1.4.3",
+ "optimist": "0.6.1",
+ "portfinder": "0.4.0",
+ "union": "0.4.6"
+ },
+ "dependencies": {
+ "colors": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
+ "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=",
+ "dev": true
+ }
+ }
+ },
+ "mime": {
+ "version": "1.3.6",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.6.tgz",
+ "integrity": "sha1-WR2E02U6awtKO5343lqoEI5y5eA=",
+ "dev": true
+ },
+ "minimist": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
+ "dev": true
+ },
+ "mkdirp": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
+ "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
+ "dev": true,
+ "requires": {
+ "minimist": "0.0.8"
+ },
+ "dependencies": {
+ "minimist": {
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
+ "dev": true
+ }
+ }
+ },
+ "opener": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz",
+ "integrity": "sha1-XG2ixdflgx6P+jlklQ+NZnSskLg=",
+ "dev": true
+ },
+ "optimist": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
+ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=",
+ "dev": true,
+ "requires": {
+ "minimist": "0.0.10",
+ "wordwrap": "0.0.3"
+ },
+ "dependencies": {
+ "minimist": {
+ "version": "0.0.10",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
+ "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=",
+ "dev": true
+ }
+ }
+ },
+ "portfinder": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-0.4.0.tgz",
+ "integrity": "sha1-o/+t/6/k+5jgYBqF7aJ8J86Eyh4=",
+ "dev": true,
+ "requires": {
+ "async": "0.9.0",
+ "mkdirp": "0.5.1"
+ },
+ "dependencies": {
+ "async": {
+ "version": "0.9.0",
+ "resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz",
+ "integrity": "sha1-rDYTsdqb7RtHUQu0ZRuJMeRxRsc=",
+ "dev": true
+ }
+ }
+ },
+ "qs": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz",
+ "integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=",
+ "dev": true
+ },
+ "requires-port": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
+ "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=",
+ "dev": true
+ },
+ "union": {
+ "version": "0.4.6",
+ "resolved": "https://registry.npmjs.org/union/-/union-0.4.6.tgz",
+ "integrity": "sha1-GY+9rrolTniLDvy2MLwR8kopWeA=",
+ "dev": true,
+ "requires": {
+ "qs": "2.3.3"
+ }
+ },
+ "url-join": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz",
+ "integrity": "sha1-dBxsL0WWxIMNZxhGCSDQySIC3Hg=",
+ "dev": true
+ },
+ "wordwrap": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
+ "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=",
+ "dev": true
+ }
+ }
+}
diff --git a/rcon.css b/rcon.css
deleted file mode 100644
index 90b6a00..0000000
--- a/rcon.css
+++ /dev/null
@@ -1,151 +0,0 @@
-@import url(https://fonts.googleapis.com/css?family=Roboto:400,700);
-
-body
-{
- font-family: "Roboto", sans-serif;
- font-size: 14px;
- font-weight: 300;
- line-height: 1.5;
- color: #cfd2da;
- background-color: #252830;
-}
-
-a
-{
- color: #1ca8dd;
-}
-
-a:hover
-{
- color: #fff;
- text-decoration: none;
-}
-
-.center
-{
- text-align: center;
-}
-
-#ConsoleController .Output
-{
- font-family: monospace;
- font-size: 12px;
- white-space: pre-wrap;
-}
-
-.scrollable
-{
- overflow: auto;
-}
-
-
-.nav-sidebar
-{
- margin-top: 64px;
- margin-right: 16px;
-}
-
-.nav-sidebar > li > a
-{
- padding-right: 20px;
- padding-left: 20px;
- border-radius: 5px;
-}
-
-.nav-sidebar > .active > a,
-.nav-sidebar > .active > a:hover,
-.nav-sidebar > .active > a:focus
-{
- color: #fff;
- background-color: #428bca;
-}
-
-.fade
-{
- opacity: 0.5;
-}
-
-.table > tbody > tr:hover
-{
- background-color: rgba( 255, 255, 255, 0.3 );
-}
-
-.table > thead > tr > th.sorting
-{
- color: #1bc98e;
- border-color: #1bc98e;
-}
-
-.table-responsive {
- overflow-x: visible !important;
- overflow-y: visible !important;
-}
-
-.btn-default, .btn-default:active, .form-control
-{
- background: rgba( 255, 255, 255, 0.3 );
- border: none;
- color: #cfd2da;
- text-shadow: none;
-}
-
-.btn-default:hover
-{
- background: #1ca8dd;
- color: #fff;
-}
-
-.panel
-{
- background-color: #434857;
-}
-
-.chatname
-{
- display: block;
- width: 200px;
- float: left;
- text-align: right;
- padding-right: 8px;
-}
-
-.navbar-default
-{
- background-color: #428bca;
- background-image: none;
- border: none;
- border-radius: 0;
- color: white;
-}
-
-.navbar-default .navbar-brand, .navbar-default .navbar-brand:hover
-{
- color: #fff;
-}
-
-.navbar-default .navbar-text,
-.navbar-default .navbar-nav > li > a, .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus
-{
- color: #fff;
-}
-
-.navbar-default .navbar-nav > li > a:hover
-{
- background-color: rgba( 255, 255, 255, 0.25 );
-}
-
-.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .active > a
-{
- background-color: white;
- background-image: none;
- border: none;
- color: #428bca;
-}
-
-.navbar-info
-{
- position: relative;
- display: block;
- padding: 15px;
- line-height: 20px;
-}
\ No newline at end of file