Added ServerInfo Page
ConnectionController.Connect redirects automatically to ServerInfo
This commit is contained in:
@@ -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 } )
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
Reference in New Issue
Block a user