2020-05-14 02:14:28 +00:00
|
|
|
import angular from 'angular';
|
|
|
|
|
2024-02-15 11:29:55 +00:00
|
|
|
import { AccessHeaders } from '@/portainer/authorization-guard';
|
2022-05-17 04:22:44 +00:00
|
|
|
import { reactModule } from './react';
|
2022-04-19 18:43:36 +00:00
|
|
|
|
|
|
|
angular
|
2024-05-09 15:02:20 +00:00
|
|
|
.module('portainer.edge', [reactModule])
|
2022-11-21 07:51:55 +00:00
|
|
|
|
2022-04-19 18:43:36 +00:00
|
|
|
.config(function config($stateRegistryProvider) {
|
|
|
|
const edge = {
|
|
|
|
name: 'edge',
|
|
|
|
url: '/edge',
|
|
|
|
parent: 'root',
|
|
|
|
abstract: true,
|
2024-02-15 11:29:55 +00:00
|
|
|
data: {
|
|
|
|
access: AccessHeaders.EdgeAdmin,
|
|
|
|
},
|
2022-04-19 18:43:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const groups = {
|
|
|
|
name: 'edge.groups',
|
|
|
|
url: '/groups',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
component: 'edgeGroupsView',
|
|
|
|
},
|
2020-05-14 02:14:28 +00:00
|
|
|
},
|
2023-10-11 07:38:57 +00:00
|
|
|
data: {
|
|
|
|
docs: '/user/edge/groups',
|
|
|
|
},
|
2022-04-19 18:43:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const groupsNew = {
|
|
|
|
name: 'edge.groups.new',
|
|
|
|
url: '/new',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
2024-06-02 12:43:37 +00:00
|
|
|
component: 'edgeGroupsCreateView',
|
2022-04-19 18:43:36 +00:00
|
|
|
},
|
2020-05-14 02:14:28 +00:00
|
|
|
},
|
2022-04-19 18:43:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const groupsEdit = {
|
|
|
|
name: 'edge.groups.edit',
|
|
|
|
url: '/:groupId',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
2024-06-02 12:43:37 +00:00
|
|
|
component: 'edgeGroupsItemView',
|
2022-04-19 18:43:36 +00:00
|
|
|
},
|
2020-05-14 02:14:28 +00:00
|
|
|
},
|
2022-04-19 18:43:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const stacks = {
|
|
|
|
name: 'edge.stacks',
|
|
|
|
url: '/stacks',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
component: 'edgeStacksView',
|
|
|
|
},
|
2020-05-14 02:14:28 +00:00
|
|
|
},
|
2023-10-11 07:38:57 +00:00
|
|
|
data: {
|
|
|
|
docs: '/user/edge/stacks',
|
|
|
|
},
|
2022-04-19 18:43:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const stacksNew = {
|
|
|
|
name: 'edge.stacks.new',
|
2024-02-15 07:01:01 +00:00
|
|
|
url: '/new?templateId&templateType',
|
2022-04-19 18:43:36 +00:00
|
|
|
views: {
|
|
|
|
'content@': {
|
2024-05-06 05:08:03 +00:00
|
|
|
component: 'edgeStacksCreateView',
|
2022-04-19 18:43:36 +00:00
|
|
|
},
|
2020-05-14 02:14:28 +00:00
|
|
|
},
|
2024-03-01 02:37:21 +00:00
|
|
|
data: {
|
|
|
|
docs: '/user/edge/stacks/add',
|
|
|
|
},
|
2022-04-19 18:43:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const stacksEdit = {
|
|
|
|
name: 'edge.stacks.edit',
|
2023-06-25 05:38:43 +00:00
|
|
|
url: '/:stackId?tab&status',
|
2022-04-19 18:43:36 +00:00
|
|
|
views: {
|
|
|
|
'content@': {
|
2024-05-09 15:02:20 +00:00
|
|
|
component: 'edgeStacksItemView',
|
2022-04-19 18:43:36 +00:00
|
|
|
},
|
2020-05-14 02:14:28 +00:00
|
|
|
},
|
2023-08-16 07:22:41 +00:00
|
|
|
params: {
|
|
|
|
status: {
|
|
|
|
dynamic: true,
|
|
|
|
},
|
|
|
|
},
|
2022-04-19 18:43:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const edgeJobs = {
|
|
|
|
name: 'edge.jobs',
|
|
|
|
url: '/jobs',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
component: 'edgeJobsView',
|
|
|
|
},
|
2020-06-25 03:25:51 +00:00
|
|
|
},
|
2023-10-11 07:38:57 +00:00
|
|
|
data: {
|
|
|
|
docs: '/user/edge/jobs',
|
|
|
|
},
|
2022-04-19 18:43:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const edgeJob = {
|
|
|
|
name: 'edge.jobs.job',
|
2024-06-06 18:07:39 +00:00
|
|
|
url: '/:id?tab',
|
2022-04-19 18:43:36 +00:00
|
|
|
views: {
|
|
|
|
'content@': {
|
2024-06-06 18:07:39 +00:00
|
|
|
component: 'edgeJobsItemView',
|
2022-04-19 18:43:36 +00:00
|
|
|
},
|
2020-06-25 03:25:51 +00:00
|
|
|
},
|
2022-04-19 18:43:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const edgeJobCreation = {
|
|
|
|
name: 'edge.jobs.new',
|
|
|
|
url: '/new',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
2024-06-02 08:10:38 +00:00
|
|
|
component: 'edgeJobsCreateView',
|
2022-04-19 18:43:36 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2022-05-23 07:57:22 +00:00
|
|
|
$stateRegistryProvider.register({
|
2022-04-19 18:43:36 +00:00
|
|
|
name: 'edge.devices',
|
|
|
|
url: '/devices',
|
2022-12-20 21:07:34 +00:00
|
|
|
abstract: true,
|
2022-05-23 07:57:22 +00:00
|
|
|
});
|
2022-04-19 18:43:36 +00:00
|
|
|
|
|
|
|
if (process.env.PORTAINER_EDITION === 'BE') {
|
|
|
|
$stateRegistryProvider.register({
|
|
|
|
name: 'edge.devices.waiting-room',
|
|
|
|
url: '/waiting-room',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
component: 'waitingRoomView',
|
|
|
|
},
|
|
|
|
},
|
2023-10-11 07:38:57 +00:00
|
|
|
data: {
|
2024-03-01 02:37:21 +00:00
|
|
|
docs: '/user/edge/waiting-room',
|
2023-10-11 07:38:57 +00:00
|
|
|
},
|
2022-04-19 18:43:36 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-11-14 12:54:44 +00:00
|
|
|
$stateRegistryProvider.register({
|
|
|
|
name: 'edge.templates',
|
|
|
|
url: '/templates?template',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
2024-04-11 06:29:30 +00:00
|
|
|
component: 'appTemplatesView',
|
2023-11-14 12:54:44 +00:00
|
|
|
},
|
|
|
|
},
|
2023-11-15 08:45:07 +00:00
|
|
|
data: {
|
2024-03-01 02:37:21 +00:00
|
|
|
docs: '/user/edge/templates/application',
|
2023-11-15 08:45:07 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
$stateRegistryProvider.register({
|
|
|
|
name: 'edge.templates.custom',
|
|
|
|
url: '/custom',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
2024-05-30 09:04:28 +00:00
|
|
|
component: 'customTemplatesView',
|
2023-11-15 08:45:07 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
data: {
|
|
|
|
docs: '/user/edge/templates/custom',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
$stateRegistryProvider.register({
|
|
|
|
name: 'edge.templates.custom.new',
|
|
|
|
url: '/new?appTemplateId&type',
|
|
|
|
|
|
|
|
views: {
|
|
|
|
'content@': {
|
2023-12-06 13:11:02 +00:00
|
|
|
component: 'createCustomTemplatesView',
|
2023-11-15 08:45:07 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
$stateRegistryProvider.register({
|
|
|
|
name: 'edge.templates.custom.edit',
|
2023-11-15 12:43:18 +00:00
|
|
|
url: '/:id',
|
2023-11-15 08:45:07 +00:00
|
|
|
|
|
|
|
views: {
|
|
|
|
'content@': {
|
2024-01-08 07:32:32 +00:00
|
|
|
component: 'editCustomTemplatesView',
|
2023-11-15 08:45:07 +00:00
|
|
|
},
|
|
|
|
},
|
2023-11-14 12:54:44 +00:00
|
|
|
});
|
|
|
|
|
2022-04-19 18:43:36 +00:00
|
|
|
$stateRegistryProvider.register(edge);
|
|
|
|
|
|
|
|
$stateRegistryProvider.register(groups);
|
|
|
|
$stateRegistryProvider.register(groupsNew);
|
|
|
|
$stateRegistryProvider.register(groupsEdit);
|
|
|
|
|
|
|
|
$stateRegistryProvider.register(stacks);
|
|
|
|
$stateRegistryProvider.register(stacksNew);
|
|
|
|
$stateRegistryProvider.register(stacksEdit);
|
|
|
|
|
|
|
|
$stateRegistryProvider.register(edgeJobs);
|
|
|
|
$stateRegistryProvider.register(edgeJob);
|
|
|
|
$stateRegistryProvider.register(edgeJobCreation);
|
|
|
|
});
|