mirror of
https://github.com/mmumshad/ansible-playable.git
synced 2025-03-09 23:38:54 +00:00
Feature - Integrate System API to view logs in UI
This commit is contained in:
parent
1690470269
commit
bf6c8743c5
15 changed files with 353 additions and 26 deletions
|
|
@ -2,9 +2,36 @@
|
|||
|
||||
export default class AdminController {
|
||||
/*@ngInject*/
|
||||
constructor(User) {
|
||||
constructor($scope, $sce, User, system, ansi2html) {
|
||||
'ngInject';
|
||||
const admin_ctrl = this;
|
||||
|
||||
// Use the User $resource to fetch all users
|
||||
this.users = User.query();
|
||||
|
||||
/**
|
||||
* Fetch Server Logs
|
||||
*/
|
||||
this.fetchServerLogs = function(){
|
||||
system.getLogs('server', (response) => {
|
||||
admin_ctrl.logsServer = $scope.result = $sce.trustAsHtml(ansi2html.toHtml(response.data).replace(/\n/g, "<br>"));
|
||||
}, (response) => {
|
||||
admin_ctrl.logsServer = $scope.result = $sce.trustAsHtml(ansi2html.toHtml(response.data).replace(/\n/g, "<br>"));
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Fetch API Logs
|
||||
*/
|
||||
this.fetchAPILogs = function(){
|
||||
system.getLogs('api', (response) => {
|
||||
admin_ctrl.logsAPI = $scope.result = $sce.trustAsHtml(ansi2html.toHtml(response.data).replace(/\n/g, "<br>"));
|
||||
}, (response) => {
|
||||
admin_ctrl.logsAPI = $scope.result = $sce.trustAsHtml(ansi2html.toHtml(response.data).replace(/\n/g, "<br>"));
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
delete(user) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue