Added a couple of useful services to rconservice
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
|
||||
app.controller( 'ConsoleController', ['$scope', 'rconService', ConsoleController] );
|
||||
|
||||
function ConsoleController( $scope, rconService )
|
||||
{
|
||||
$scope.Output = rconService.Output;
|
||||
|
||||
$scope.SubmitCommand = function ()
|
||||
{
|
||||
rconService.Command( $scope.Command, 0 );
|
||||
$scope.Command = "";
|
||||
}
|
||||
|
||||
$scope.$on( "OnMessage", function ( event, msg )
|
||||
{
|
||||
if ( msg.Message.startsWith( "[CHAT] " ) )
|
||||
msg.Class = "Chat";
|
||||
|
||||
if ( msg.Identifier == 1 )
|
||||
msg.Class = "Requested";
|
||||
|
||||
if ( msg.Identifier > 1 )
|
||||
return;
|
||||
|
||||
$( "#ConsoleController .Output" ).scrollTop( $( "#ConsoleController .Output" )[0].scrollHeight );
|
||||
|
||||
} );
|
||||
}
|
||||
Reference in New Issue
Block a user