mirror of
https://github.com/jwetzell/showbridge-webui.git
synced 2026-08-27 08:58:58 +00:00
add autogenerated ID to route and processors
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
(cdkDropListDropped)="drop($event)"
|
(cdkDropListDropped)="drop($event)"
|
||||||
[cdkDropListData]="routes()"
|
[cdkDropListData]="routes()"
|
||||||
>
|
>
|
||||||
@for (route of routes(); track $index + (route.input || ''); let i = $index) {
|
@for (route of routes(); track route.id; let i = $index) {
|
||||||
<div class="m-2" cdkDrag>
|
<div class="m-2" cdkDrag>
|
||||||
<app-route
|
<app-route
|
||||||
[id]="listService.pathToId(`routes/${i}`)"
|
[id]="listService.pathToId(`routes/${i}`)"
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
(cdkDropListDropped)="drop($event)"
|
(cdkDropListDropped)="drop($event)"
|
||||||
[cdkDropListData]="route()?.processors"
|
[cdkDropListData]="route()?.processors"
|
||||||
>
|
>
|
||||||
@for (processor of processors(); track $index + processor.type; let i = $index) {
|
@for (processor of processors(); track processor.id; let i = $index) {
|
||||||
<div cdkDrag>
|
<div cdkDrag>
|
||||||
<app-processor
|
<app-processor
|
||||||
[path]="path() + '/processors/' + i"
|
[path]="path() + '/processors/' + i"
|
||||||
@@ -237,7 +237,7 @@
|
|||||||
(cdkDropListDropped)="drop($event)"
|
(cdkDropListDropped)="drop($event)"
|
||||||
[cdkDropListData]="route()?.processors"
|
[cdkDropListData]="route()?.processors"
|
||||||
>
|
>
|
||||||
@for (processor of processors(); track $index + processor.type; let i = $index) {
|
@for (processor of processors(); track processor.id; let i = $index) {
|
||||||
<div cdkDrag>
|
<div cdkDrag>
|
||||||
<app-processor
|
<app-processor
|
||||||
[path]="path() + '/processors/' + i"
|
[path]="path() + '/processors/' + i"
|
||||||
|
|||||||
@@ -22,11 +22,13 @@ export type ModuleConfig = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type RouteConfig = {
|
export type RouteConfig = {
|
||||||
|
id: string;
|
||||||
input?: string;
|
input?: string;
|
||||||
processors?: ProcessorConfig[];
|
processors?: ProcessorConfig[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ProcessorConfig = {
|
export type ProcessorConfig = {
|
||||||
|
id: string;
|
||||||
type: string;
|
type: string;
|
||||||
params?: Record<string, any>;
|
params?: Record<string, any>;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -139,12 +139,16 @@ export class SchemaService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getSkeletonForRoute(): RouteConfig {
|
getSkeletonForRoute(): RouteConfig {
|
||||||
const template: RouteConfig = {};
|
const template: RouteConfig = {
|
||||||
|
id: crypto.randomUUID(),
|
||||||
|
processors: [],
|
||||||
|
};
|
||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
|
|
||||||
getSkeletonForProcessor(processorType: string): ProcessorConfig {
|
getSkeletonForProcessor(processorType: string): ProcessorConfig {
|
||||||
const template: ProcessorConfig = {
|
const template: ProcessorConfig = {
|
||||||
|
id: crypto.randomUUID(),
|
||||||
type: processorType,
|
type: processorType,
|
||||||
};
|
};
|
||||||
const itemInfo = this.processorTypes.find((itemInfo) => itemInfo.type === processorType);
|
const itemInfo = this.processorTypes.find((itemInfo) => itemInfo.type === processorType);
|
||||||
|
|||||||
Reference in New Issue
Block a user