-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web.privatedabase): move metrics to mimir (#12299)
ref: MANAGER-15467 Signed-off-by: cyril.biencourt <[email protected]>
- Loading branch information
Showing
7 changed files
with
280 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/manager/apps/web/client/app/private-database/logs/logs.routing.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 49 additions & 43 deletions
92
...ges/manager/apps/web/client/app/private-database/logs/private-database-logs.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,49 @@ | ||
angular.module('App').controller( | ||
'PrivateDatabaseLogsCtrl', | ||
class PrivateDatabaseLogsCtrl { | ||
/* @ngInject */ | ||
constructor($scope, $stateParams, TailLogs, PrivateDatabaseLogsService) { | ||
this.$scope = $scope; | ||
this.$stateParams = $stateParams; | ||
this.TailLogs = TailLogs; | ||
this.privateDatabaseLogsService = PrivateDatabaseLogsService; | ||
} | ||
|
||
$onInit() { | ||
this.productId = this.$stateParams.productId; | ||
|
||
this.logger = new this.TailLogs({ | ||
source: () => | ||
this.privateDatabaseLogsService | ||
.getLogs(this.productId) | ||
.then((logs) => logs.url), | ||
delay: 2000, | ||
}); | ||
|
||
this.startLog(); | ||
} | ||
|
||
$onDestroy() { | ||
this.logger.stop(); | ||
} | ||
|
||
stopLog() { | ||
this.logger.stop(); | ||
} | ||
|
||
startLog() { | ||
this.logger.log(); | ||
} | ||
|
||
getLogs() { | ||
this.logger = this.logger.logs; | ||
return this.logger; | ||
} | ||
}, | ||
); | ||
export default class PrivateDatabaseLogsCtrl { | ||
/* @ngInject */ | ||
constructor($scope, $stateParams, TailLogs, PrivateDatabaseLogsService) { | ||
this.$scope = $scope; | ||
this.$stateParams = $stateParams; | ||
this.TailLogs = TailLogs; | ||
this.privateDatabaseLogsService = PrivateDatabaseLogsService; | ||
this.loader = true; | ||
|
||
$scope.$on('$destroy', () => { | ||
if (this.logger) { | ||
this.logger.stop(); | ||
} | ||
}); | ||
} | ||
|
||
$onInit() { | ||
this.loader = true; | ||
this.productId = this.$stateParams.productId; | ||
|
||
this.logger = new this.TailLogs({ | ||
source: () => | ||
this.privateDatabaseLogsService | ||
.getLogs(this.productId) | ||
.then((logs) => logs.url), | ||
delay: 2000, | ||
}); | ||
|
||
this.startLog(); | ||
this.loader = false; | ||
} | ||
|
||
$onDestroy() { | ||
this.logger.stop(); | ||
} | ||
|
||
stopLog() { | ||
this.logger.stop(); | ||
} | ||
|
||
startLog() { | ||
this.logger.log(); | ||
} | ||
|
||
getLogs() { | ||
this.logger = this.logger.logs; | ||
return this.logger; | ||
} | ||
} |
Oops, something went wrong.