mirror of
https://github.com/portainer/portainer.git
synced 2025-08-07 14:55:27 +02:00
feat(edge/jobs): migrate item view to react [EE-2220] (#11887)
Some checks failed
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:arm platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:s390x platform:linux version:]) (push) Has been cancelled
/ triage (push) Has been cancelled
Lint / Run linters (push) Has been cancelled
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
ci / build_manifests (push) Has been cancelled
Some checks failed
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:arm platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:s390x platform:linux version:]) (push) Has been cancelled
/ triage (push) Has been cancelled
Lint / Run linters (push) Has been cancelled
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
ci / build_manifests (push) Has been cancelled
This commit is contained in:
parent
62c2bf86aa
commit
eb6d251a73
44 changed files with 778 additions and 886 deletions
|
@ -1,79 +0,0 @@
|
|||
import angular from 'angular';
|
||||
import _ from 'lodash-es';
|
||||
|
||||
import { ScheduleCreateRequest, ScheduleUpdateRequest } from '@/portainer/models/schedule';
|
||||
|
||||
function EdgeJobService(EdgeJobs, EdgeJobResults, FileUploadService) {
|
||||
var service = {};
|
||||
|
||||
service.edgeJob = edgeJob;
|
||||
async function edgeJob(edgeJobId) {
|
||||
try {
|
||||
return await EdgeJobs.get({ id: edgeJobId }).$promise;
|
||||
} catch (err) {
|
||||
throw { msg: 'Unable to retrieve edgeJob', err: err };
|
||||
}
|
||||
}
|
||||
|
||||
service.edgeJobs = edgeJobs;
|
||||
async function edgeJobs() {
|
||||
try {
|
||||
return await EdgeJobs.query().$promise;
|
||||
} catch (err) {
|
||||
throw { msg: 'Unable to retrieve edgeJobs', err: err };
|
||||
}
|
||||
}
|
||||
|
||||
service.jobResults = jobResults;
|
||||
async function jobResults(edgeJobId) {
|
||||
try {
|
||||
const results = await EdgeJobResults.query({ id: edgeJobId }).$promise;
|
||||
|
||||
return _.sortBy(results, ['Id']);
|
||||
} catch (err) {
|
||||
throw { msg: 'Unable to retrieve results associated to the edgeJob', err: err };
|
||||
}
|
||||
}
|
||||
|
||||
service.logFile = logFile;
|
||||
function logFile(id, taskId) {
|
||||
return EdgeJobResults.logFile({ id, taskId }).$promise;
|
||||
}
|
||||
|
||||
service.collectLogs = collectLogs;
|
||||
function collectLogs(id, taskId) {
|
||||
return EdgeJobResults.collectLogs({ id, taskId }).$promise;
|
||||
}
|
||||
|
||||
service.clearLogs = clearLogs;
|
||||
function clearLogs(id, taskId) {
|
||||
return EdgeJobResults.clearLogs({ id, taskId }).$promise;
|
||||
}
|
||||
|
||||
service.createEdgeJobFromFileContent = function (model) {
|
||||
var payload = new ScheduleCreateRequest(model);
|
||||
return EdgeJobs.create({}, { method: 'string', ...payload }).$promise;
|
||||
};
|
||||
|
||||
service.createEdgeJobFromFileUpload = function (model) {
|
||||
var payload = new ScheduleCreateRequest(model);
|
||||
return FileUploadService.createSchedule(payload);
|
||||
};
|
||||
|
||||
service.updateEdgeJob = function (model) {
|
||||
var payload = new ScheduleUpdateRequest(model);
|
||||
return EdgeJobs.update(payload).$promise;
|
||||
};
|
||||
|
||||
service.remove = function (edgeJobId) {
|
||||
return EdgeJobs.remove({ id: edgeJobId }).$promise;
|
||||
};
|
||||
|
||||
service.getScriptFile = function (edgeJobId) {
|
||||
return EdgeJobs.file({ id: edgeJobId }).$promise;
|
||||
};
|
||||
|
||||
return service;
|
||||
}
|
||||
|
||||
angular.module('portainer.edge').factory('EdgeJobService', EdgeJobService);
|
Loading…
Add table
Add a link
Reference in a new issue