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
19
client/app/services/system/system.service.js
Normal file
19
client/app/services/system/system.service.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
'use strict';
|
||||
const angular = require('angular');
|
||||
|
||||
/*@ngInject*/
|
||||
export function systemService($http) {
|
||||
// AngularJS will instantiate a singleton by calling "new" on this function
|
||||
|
||||
const api_system = '/api/system';
|
||||
const api_get_logs = api_system + '/logs';
|
||||
|
||||
this.getLogs = function(type, successCallback, errorCallback){
|
||||
$http.get(api_get_logs + '/' + type).then(successCallback, errorCallback);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default angular.module('webAppApp.system', [])
|
||||
.service('system', systemService)
|
||||
.name;
|
16
client/app/services/system/system.service.spec.js
Normal file
16
client/app/services/system/system.service.spec.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
'use strict';
|
||||
|
||||
describe('Service: system', function() {
|
||||
// load the service's module
|
||||
beforeEach(module('webAppApp.system'));
|
||||
|
||||
// instantiate service
|
||||
var system;
|
||||
beforeEach(inject(function(_system_) {
|
||||
system = _system_;
|
||||
}));
|
||||
|
||||
it('should do something', function() {
|
||||
expect(!!system).to.be.true;
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue