import angular from 'angular';
import { AccessHeaders } from '@/portainer/authorization-guard';
import edgeStackModule from './views/edge-stacks';
import { reactModule } from './react';
angular
.module('portainer.edge', [edgeStackModule, reactModule])
.config(function config($stateRegistryProvider) {
const edge = {
name: 'edge',
url: '/edge',
parent: 'root',
abstract: true,
data: {
access: AccessHeaders.EdgeAdmin,
},
};
const groups = {
name: 'edge.groups',
url: '/groups',
views: {
'content@': {
component: 'edgeGroupsView',
docs: '/user/edge/groups',
const groupsNew = {
name: 'edge.groups.new',
url: '/new',
component: 'createEdgeGroupView',
const groupsEdit = {
name: 'edge.groups.edit',
url: '/:groupId',
component: 'editEdgeGroupView',
const stacks = {
name: 'edge.stacks',
url: '/stacks',
component: 'edgeStacksView',
docs: '/user/edge/stacks',
const stacksNew = {
name: 'edge.stacks.new',
url: '/new?templateId&templateType',
component: 'createEdgeStackView',
docs: '/user/edge/stacks/add',
const stacksEdit = {
name: 'edge.stacks.edit',
url: '/:stackId?tab&status',
component: 'editEdgeStackView',
params: {
status: {
dynamic: true,
const edgeJobs = {
name: 'edge.jobs',
url: '/jobs',
component: 'edgeJobsView',
docs: '/user/edge/jobs',
const edgeJob = {
name: 'edge.jobs.job',
url: '/:id',
component: 'edgeJobView',
tab: 0,
const edgeJobCreation = {
name: 'edge.jobs.new',
component: 'createEdgeJobView',
$stateRegistryProvider.register({
name: 'edge.devices',
url: '/devices',
});
if (process.env.PORTAINER_EDITION === 'BE') {
name: 'edge.devices.waiting-room',
url: '/waiting-room',
component: 'waitingRoomView',
docs: '/user/edge/waiting-room',
}
name: 'edge.templates',
url: '/templates?template',
component: 'edgeAppTemplatesView',
docs: '/user/edge/templates/application',
name: 'edge.templates.custom',
url: '/custom',
component: 'edgeCustomTemplatesView',
docs: '/user/edge/templates/custom',
name: 'edge.templates.custom.new',
url: '/new?appTemplateId&type',
component: 'createCustomTemplatesView',
name: 'edge.templates.custom.edit',
component: 'editCustomTemplatesView',
$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);