machineservice.js 696 B

12345678910111213141516171819202122232425
  1. var app = angular.module('sentinelDashboardApp');
  2. app.service('MachineService', ['$http', '$httpParamSerializerJQLike',
  3. function ($http, $httpParamSerializerJQLike) {
  4. this.getAppMachines = function (app) {
  5. return $http({
  6. url: 'app/' + app + '/machines.json',
  7. method: 'GET'
  8. });
  9. };
  10. this.removeAppMachine = function (app, ip, port) {
  11. return $http({
  12. url: 'app/' + app + '/machine/remove.json',
  13. method: 'POST',
  14. headers: {
  15. 'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
  16. },
  17. data: $httpParamSerializerJQLike({
  18. ip: ip,
  19. port: port
  20. })
  21. });
  22. };
  23. }]
  24. );