Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Add clear log button in Run dialog
Browse files Browse the repository at this point in the history
This patch removes some unused console log

Signed-off-by: Bruno Bottazzini <bruno.bottazzini@intel.com>
  • Loading branch information
Bruno Bottazzini committed May 6, 2016
1 parent 26908ca commit a74cd7a
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions client/js/controllers/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
var schemaDiag;
var filePath;
var isLeaf;
$scope.clearTimeStamp = 0;
$scope.clipboard = "";
$scope.syntaxCheckRefreshPeriod = 1100;
$scope.runConf = false;
Expand Down Expand Up @@ -277,6 +278,11 @@
resizable: 'disable',
scrollable: 'disable',
buttons: {
Clear: function () {
var len = $scope.RunViewer.length -1;
$scope.clearTimeStamp = $scope.RunViewer[len].__REALTIME_TIMESTAMP;
$scope.RunViewer = [];
},
Close: function() {
$interval.cancel(promiseRunViewer);
$(this).dialog("close");
Expand All @@ -301,7 +307,17 @@
"unit_name": "fbp-runner@",
}
}).success(function(data) {
$scope.RunViewer = data;
if ($scope.clearTimeStamp === 0) {
$scope.RunViewer = data;
} else {
var array = [];
for(var i in data){
if (data[i].__REALTIME_TIMESTAMP > $scope.clearTimeStamp) {
array.push(data[i]);
}
}
$scope.RunViewer = array;
}
$scope.isJournaldReturn = false;
}).error(function(){
$scope.RunViewer = "Erro getting systemd journald";
Expand Down Expand Up @@ -925,7 +941,6 @@
break;
case "edit.copy":
$scope.clipboard = editor.getCopyText();
console.log($scope.clipboard);
break;
case "edit.paste":
editor.insert($scope.clipboard, true);
Expand Down

0 comments on commit a74cd7a

Please sign in to comment.