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