From c9b2ee83354e81dcfec841e0af80487bd52f2e77 Mon Sep 17 00:00:00 2001 From: alexfriesen Date: Sat, 30 Apr 2016 17:03:19 +0200 Subject: [PATCH 1/2] KickPlayer function added in playerlist --- html/playerlist.html | 16 ++++++++++++++++ js/playerlist.js | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/html/playerlist.html b/html/playerlist.html index 83730a4..4feacba 100644 --- a/html/playerlist.html +++ b/html/playerlist.html @@ -13,6 +13,8 @@ + + @@ -24,6 +26,20 @@ + + + diff --git a/js/playerlist.js b/js/playerlist.js index f2f8588..390ab88 100644 --- a/js/playerlist.js +++ b/js/playerlist.js @@ -32,6 +32,13 @@ function PlayerListController( $scope, rconService, $interval ) return null; } + $scope.KickPlayer = function ( id ) + { + rconService.Command( 'kick ' + id ); + + $scope.Refresh(); + } + rconService.InstallService( $scope, $scope.Refresh ) var timer = $interval( function () From 4087a9f5912231b7cf9e8ca66091e23a108ec56c Mon Sep 17 00:00:00 2001 From: alexfriesen Date: Sat, 30 Apr 2016 19:07:44 +0200 Subject: [PATCH 2/2] Added ServerInfo Page ConnectionController.Connect redirects automatically to ServerInfo --- html/serverInfo.html | 75 ++++++++++++++++++++++++++++++++++++++++++++ index.html | 64 ++++++++++++++++++------------------- js/app.js | 1 + js/connection.js | 2 ++ js/serverInfo.js | 20 ++++++++++++ 5 files changed, 130 insertions(+), 32 deletions(-) create mode 100644 html/serverInfo.html create mode 100644 js/serverInfo.js diff --git a/html/serverInfo.html b/html/serverInfo.html new file mode 100644 index 0000000..25ec4d9 --- /dev/null +++ b/html/serverInfo.html @@ -0,0 +1,75 @@ + +
+ +
+ +
+

+ {{info.Hostname}} +
+ +
+

+
+ +
+
+

Map: {{info.Map}}

+
+
+ +
+
+

Max Players: {{info.MaxPlayers}}

+
+
+ +
+
+

GameTime: {{info.GameTime}}

+
+
+ +
+
+

Framerate: {{info.Framerate}}

+
+
+ +
+
+

EntityCount: {{info.EntityCount}}

+
+
+ +
+
+

Uptime: {{info.Uptime}}s

+
+
+ +
+
+

Players: {{info.Players}}

+
+
+ +
+
+

Joining: {{info.Joining}}

+
+
+ +
+
+

Queued: {{info.Queued}}

+
+
+ +
+ +
+ +
+ +
diff --git a/index.html b/index.html index 363d606..71d83f7 100644 --- a/index.html +++ b/index.html @@ -5,10 +5,10 @@ Websocket Rcon - + - + @@ -27,44 +27,44 @@ -
+

{{$route.current.Title}}

-
- - - - - - - - - - - - - - - - - - - + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/js/app.js b/js/app.js index d23e2ea..68cf755 100644 --- a/js/app.js +++ b/js/app.js @@ -7,6 +7,7 @@ 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 } ) diff --git a/js/connection.js b/js/connection.js index 2585378..d4781f8 100644 --- a/js/connection.js +++ b/js/connection.js @@ -20,6 +20,8 @@ function ConnectionController( $scope, rconService, $routeParams, $timeout, $loc $scope.LastErrorMessage = null; rconService.Connect( $scope.Address, $scope.Password ); + + $location.path('/' + $scope.Address + '/info'); } $scope.ConnectTo = function ( c ) diff --git a/js/serverInfo.js b/js/serverInfo.js new file mode 100644 index 0000000..afe5143 --- /dev/null +++ b/js/serverInfo.js @@ -0,0 +1,20 @@ + +app.controller( 'ServerInfoController', ServerInfoController ); + +function ServerInfoController( $scope, rconService, $routeParams ) +{ + $scope.info = {}; + + $scope.Refresh = function () + { + rconService.Request( 'serverinfo', $scope, function ( msg ) + { + $scope.info = JSON.parse( msg.Message ); + // $scope.Players = JSON.parse( msg.Message ); + + console.log($scope.info); + }); + } + + rconService.InstallService( $scope, $scope.Refresh ); +}
ActionsUsername Steamid Voilation
+
+ + +
+
{{line.DisplayName}}