You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/edge/services/edge-template.js

24 lines
510 B

import angular from 'angular';
class EdgeTemplateService {
/* @ngInject */
constructor(EdgeTemplates) {
this.EdgeTemplates = EdgeTemplates;
}
edgeTemplates() {
return this.EdgeTemplates.query().$promise;
}
async edgeTemplate(template) {
const response = await fetch(template.stackFile);
if (!response.ok) {
throw new Error(response.statusText);
}
return response.text();
}
}
angular.module('portainer.edge').service('EdgeTemplateService', EdgeTemplateService);