Added ServerInfo Page

ConnectionController.Connect redirects automatically to ServerInfo
This commit is contained in:
alexfriesen
2016-04-30 19:07:44 +02:00
parent c9b2ee8335
commit 4087a9f591
5 changed files with 130 additions and 32 deletions
+1
View File
@@ -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 } )
+2
View File
@@ -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 )
+20
View File
@@ -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 );
}