Nice header with server status, better chat layout
This commit is contained in:
@@ -88,14 +88,12 @@ function SecondsToDuration()
|
||||
|
||||
var out = "";
|
||||
var hours = Math.floor( input / 3600 );
|
||||
if ( input > 3600 ) out += hours + "h ";
|
||||
if ( input > 3600 ) out += hours + "h";
|
||||
|
||||
var minutes = Math.floor( input / 60 ) % 60;
|
||||
if ( input > 60 ) out += minutes + "m ";
|
||||
if ( input > 60 ) out += minutes + "m";
|
||||
|
||||
var seconds = input % 60;
|
||||
|
||||
if ( input < 3600 )
|
||||
out += seconds + "s";
|
||||
|
||||
return out;
|
||||
|
||||
+5
-2
@@ -1,7 +1,7 @@
|
||||
|
||||
app.controller( 'ServerInfoController', ServerInfoController );
|
||||
|
||||
function ServerInfoController( $scope, rconService, $routeParams )
|
||||
function ServerInfoController( $scope, rconService, $routeParams, $interval )
|
||||
{
|
||||
$scope.info = {};
|
||||
|
||||
@@ -9,8 +9,11 @@ function ServerInfoController( $scope, rconService, $routeParams )
|
||||
{
|
||||
rconService.Request( 'serverinfo', $scope, function ( msg ) {
|
||||
$scope.info = JSON.parse( msg.Message );
|
||||
});
|
||||
} );
|
||||
}
|
||||
|
||||
rconService.InstallService( $scope, $scope.refresh );
|
||||
|
||||
var timer = $interval( $scope.refresh, 500 );
|
||||
$scope.$on( "$destroy", function () { $interval.cancel( timer ); } );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user