-
-
-
+
+
+
-
-
-
-
- | Actions |
+
+
+
+
+
+ | Actions |
- Username |
- Steamid |
- Voilation |
- Level |
- XP |
- Address |
- Ping |
- Duration |
-
-
-
+ | Username |
+ Steamid |
+ Voilation |
+ Level |
+ XP |
+ Address |
+ Ping |
+ Duration |
+
+
+
- |
-
-
-
-
- |
+
+
+
+
+
+ |
-
- {{line.DisplayName}}
- |
+
+ {{line.DisplayName}}
+ |
-
- {{line.SteamID}}
- |
+
+ {{line.SteamID}}
+ |
-
- {{line.VoiationLevel}}
- |
+
+ {{line.VoiationLevel}}
+ |
-
- {{line.CurrentLevel}}
- |
+
+ {{line.CurrentLevel}}
+ |
-
- {{line.UnspentXp}}
- |
+
+ {{line.UnspentXp}}
+ |
-
- {{line.Address}}
- |
+
+ {{line.Address}}
+ |
- {{line.Ping}} |
+
+ {{line.Ping}}
+ |
-
- {{line.ConnectedSeconds | SecondsToDuration}}
- |
-
-
-
-
+
+ {{line.ConnectedSeconds | SecondsToDuration}}
+ |
+
+
+
+
+
\ No newline at end of file
diff --git a/html/serverInfo.html b/html/serverInfo.html
index 9c3a95a..d161e31 100644
--- a/html/serverInfo.html
+++ b/html/serverInfo.html
@@ -3,15 +3,20 @@
diff --git a/js/chat.js b/js/chat.js
index 86ceeca..3f60d1e 100644
--- a/js/chat.js
+++ b/js/chat.js
@@ -3,7 +3,7 @@ app.controller( 'ChatController', ChatController );
function ChatController( $scope, rconService, $timeout )
{
- $scope.Output = new Array();
+ $scope.Output = [];
$scope.SubmitCommand = function ()
{
@@ -13,21 +13,48 @@ function ChatController( $scope, rconService, $timeout )
$scope.$on( "OnMessage", function ( event, msg )
{
- if ( msg.Type != "Chat" ) return;
+ if ( msg.Type !== "Chat" ) return;
$scope.OnMessage( JSON.parse( msg.Message ) );
- } );
+ });
$scope.OnMessage = function( msg )
{
$scope.Output.push( msg );
- $timeout( $scope.ScrollToBottom, 50 );
+
+ if($scope.isOnBottom()) {
+ $scope.ScrollToBottom();
+ }
}
$scope.ScrollToBottom = function()
{
- // TODO - don't scroll if we're not at the bottom !
- $( "#ChatController .Output" ).scrollTop( $( "#ChatController .Output" )[0].scrollHeight );
+ var element = $( "#ChatController .Output" );
+
+ $timeout( function() {
+ element.scrollTop( element.prop('scrollHeight') );
+ }, 50 );
+ }
+
+ $scope.isOnBottom = function()
+ {
+ // get jquery element
+ var element = $( "#ChatController .Output" );
+
+ // height of the element
+ var height = element.height();
+
+ // scroll position from top position
+ var scrollTop = element.scrollTop();
+
+ // full height of the element
+ var scrollHeight = element.prop('scrollHeight');
+
+ if((scrollTop + height) > (scrollHeight - 10)) {
+ return true;
+ }
+
+ return false;
}
//
@@ -36,13 +63,15 @@ function ChatController( $scope, rconService, $timeout )
//
$scope.GetHistory = function ()
{
- console.log( "GetHistory" );
-
rconService.Request( "chat.tail 512", $scope, function ( msg )
{
var messages = JSON.parse( msg.Message );
- messages.forEach( function ( x ) { $scope.OnMessage( x ); } );
+ messages.forEach( function ( message ) {
+ $scope.OnMessage( message );
+ });
+
+ $scope.ScrollToBottom();
} );
}
diff --git a/js/playerlist.js b/js/playerlist.js
index 820faea..013dfcb 100644
--- a/js/playerlist.js
+++ b/js/playerlist.js
@@ -14,20 +14,20 @@ function PlayerListController( $scope, rconService, $interval )
});
}
- $scope.Order = function( o )
+ $scope.Order = function( field )
{
- if ( $scope.OrderBy == o )
+ if ( $scope.OrderBy === field )
{
- o = '-' + o;
+ field = '-' + field;
}
- $scope.OrderBy = o;
+ $scope.OrderBy = field;
}
- $scope.SortClass = function( o )
+ $scope.SortClass = function( field )
{
- if ( $scope.OrderBy == o ) return "active";
- if ( $scope.OrderBy == "-" + o ) return "active descending";
+ if ( $scope.OrderBy === field ) return "sorting";
+ if ( $scope.OrderBy === "-" + field ) return "sorting descending";
return null;
}
@@ -41,10 +41,10 @@ function PlayerListController( $scope, rconService, $interval )
rconService.InstallService( $scope, $scope.Refresh )
- var timer = $interval( function ()
- {
- //$scope.Refresh();
- }.bind( this ), 1000 );
+ // var timer = $interval( function ()
+ // {
+ // //$scope.Refresh();
+ // }.bind( this ), 1000 );
- $scope.$on( '$destroy', function () { $interval.cancel( timer ) } )
+ //$scope.$on( '$destroy', function () { $interval.cancel( timer ) } )
}
\ No newline at end of file
diff --git a/js/serverInfo.js b/js/serverInfo.js
index afe5143..07b9489 100644
--- a/js/serverInfo.js
+++ b/js/serverInfo.js
@@ -5,16 +5,12 @@ function ServerInfoController( $scope, rconService, $routeParams )
{
$scope.info = {};
- $scope.Refresh = function ()
+ $scope.refresh = function ()
{
- rconService.Request( 'serverinfo', $scope, function ( msg )
- {
+ 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 );
+ rconService.InstallService( $scope, $scope.refresh );
}
diff --git a/rcon.css b/rcon.css
index fa4be39..eb15691 100644
--- a/rcon.css
+++ b/rcon.css
@@ -21,19 +21,11 @@ a:hover
text-decoration: none;
}
-.right
-{
- text-align: right;
-}
-
.center
{
text-align: center;
}
-
-.float-left { float: left; }
-
#ConsoleController .Output
{
font-family: monospace;
@@ -68,53 +60,22 @@ a:hover
background-color: #428bca;
}
-table
-{
- border-collapse: collapse;
- border-spacing: 0;
- width: 100%;
-}
-
.fade
{
opacity: 0.5;
}
-th, td
+.table > tbody > tr:hover
{
- padding: 5px 8px;
- border-bottom: 1px solid #414758;
+ background-color: rgba( 255, 255, 255, 0.3 );
}
-th.active
+.table > thead > tr > th.sorting
{
color: #1bc98e;
border-color: #1bc98e;
}
-th
-{
- border-bottom: 2px solid #414758;
- border-radius: 10px;
-}
-
-th:first-child
-{
- border-radius: 6px;
-}
-
-th:last-child
-{
- border-radius: 0 6px 0 0;
-}
-
-th:only-child
-{
- border-radius: 6px 6px 0 0;
-}
-
-
-
.btn-default, .btn-default:active, .form-control
{
background: rgba( 255, 255, 255, 0.3 );