169 lines
6.0 KiB
HTML
169 lines
6.0 KiB
HTML
<div class="workspace">
|
|
<aside class="pipelines">
|
|
<h2>Canalizaciones</h2>
|
|
<mat-nav-list dense>
|
|
@for (p of list.value() ?? []; track p['pipeline_id']) {
|
|
<a
|
|
mat-list-item
|
|
[activated]="p['pipeline_id'] === pipelineId()"
|
|
(click)="open(p['pipeline_id'])"
|
|
>
|
|
<span matListItemTitle>{{ p['pipeline_id'] }}</span>
|
|
<span matListItemLine>v{{ p['version'] }}</span>
|
|
</a>
|
|
}
|
|
</mat-nav-list>
|
|
<mat-form-field appearance="outline" subscriptSizing="dynamic" class="new">
|
|
<mat-label>Nueva canalización</mat-label>
|
|
<input matInput #name (keydown.enter)="create(name.value)" placeholder="hospital_norte" />
|
|
</mat-form-field>
|
|
</aside>
|
|
|
|
<section class="canvas-area">
|
|
<div class="toolbar">
|
|
<span class="title"
|
|
>{{ pipelineId() ?? 'Elija o cree una canalización' }}
|
|
@if (version()) {
|
|
<span class="muted"> · v{{ version() }}</span>
|
|
}
|
|
</span>
|
|
@if (pipelineId()) {
|
|
@for (k of kinds; track k[0]) {
|
|
<button mat-stroked-button (click)="add(k[0])" [matTooltip]="help[k[0]]">
|
|
<mat-icon>add</mat-icon>{{ k[1] }}
|
|
</button>
|
|
}
|
|
<span class="spacer"></span>
|
|
<button mat-stroked-button (click)="save()">Guardar</button>
|
|
<button mat-flat-button (click)="start()" [disabled]="running()">Ejecutar</button>
|
|
}
|
|
</div>
|
|
@if (message()) {
|
|
<p class="message" role="status">{{ message() }}</p>
|
|
}
|
|
@if (run(); as r) {
|
|
<p class="run" role="status">
|
|
Ejecución <code>{{ r.id.slice(0, 8) }}</code>: <strong>{{ r.status }}</strong> ·
|
|
<a [href]="dagster()" target="_blank" rel="noopener">ver en Dagster</a>
|
|
</p>
|
|
}
|
|
<div class="canvas">
|
|
@if (pipelineId()) {
|
|
<vflow
|
|
[nodes]="nodes()"
|
|
[edges]="edges()"
|
|
[connection]="{ curve: 'smooth-step', marker: { type: 'arrow-closed' } }"
|
|
(connect)="connect($event)"
|
|
(nodesChanges)="changed($event)"
|
|
view="auto"
|
|
background="#f7f8f6"
|
|
/>
|
|
}
|
|
</div>
|
|
</section>
|
|
|
|
@if (doc(); as d) {
|
|
<aside class="panel">
|
|
<div class="panel-head">
|
|
<h2>
|
|
{{ kindLabel(d.kind) }} · <span class="muted">{{ d.id }}</span>
|
|
</h2>
|
|
<button mat-icon-button (click)="remove(d.id)" aria-label="Quitar nodo">
|
|
<mat-icon>delete</mat-icon>
|
|
</button>
|
|
</div>
|
|
<p class="help">{{ help[d.kind ?? 'source'] }}</p>
|
|
@if (d.inputs?.length) {
|
|
<div class="inputs">
|
|
Entradas:
|
|
@for (i of d.inputs; track i) {
|
|
<button mat-stroked-button class="chip" (click)="disconnect(d.id, i)">
|
|
{{ i }} <mat-icon>close</mat-icon>
|
|
</button>
|
|
}
|
|
</div>
|
|
} @else if (d.kind !== 'source') {
|
|
<p class="muted">Conecte una flecha desde otro nodo para darle entrada.</p>
|
|
}
|
|
<mat-tab-group class="panel-tabs" animationDuration="0ms" mat-stretch-tabs="false">
|
|
<mat-tab label="Configuración">
|
|
@if (d.kind === 'source') {
|
|
@if (guided(d)) {
|
|
<div class="source-summary">
|
|
<p>
|
|
<mat-icon>check_circle</mat-icon>
|
|
{{ d.label || d.id }}
|
|
</p>
|
|
<button mat-flat-button (click)="connectSource(d.id)">
|
|
<mat-icon>edit</mat-icon> Editar conexión
|
|
</button>
|
|
</div>
|
|
} @else {
|
|
<p class="muted">
|
|
Esta fuente no corresponde a ningún tipo del asistente. Edítela en «Avanzado» o
|
|
vuelva a conectarla con el asistente.
|
|
</p>
|
|
<button mat-stroked-button (click)="connectSource(d.id)">
|
|
<mat-icon>cable</mat-icon> Conectar con el asistente
|
|
</button>
|
|
}
|
|
}
|
|
<formly-form
|
|
[form]="form"
|
|
[fields]="fields()"
|
|
[model]="model"
|
|
[options]="formOptions"
|
|
(modelChange)="edited($event)"
|
|
/>
|
|
@if (conceptMap(d); as cm) {
|
|
<app-concept-map-editor [id]="cm" />
|
|
}
|
|
</mat-tab>
|
|
<mat-tab label="Avanzado">
|
|
<p class="hint">
|
|
Para personal técnico: el nodo completo como lo guarda la plataforma.
|
|
@if (guided(d)) {
|
|
Si cambia su fuente aquí, deja de editarse con el asistente.
|
|
}
|
|
</p>
|
|
<mat-form-field appearance="outline" subscriptSizing="dynamic" class="full">
|
|
<mat-label>Id</mat-label>
|
|
<input matInput [value]="d.id" (change)="rename($any($event.target).value)" />
|
|
<mat-hint>Nombre interno: minúsculas, números y _.</mat-hint>
|
|
</mat-form-field>
|
|
<mat-form-field appearance="outline" subscriptSizing="dynamic" class="full raw">
|
|
<mat-label>Nodo (JSON)</mat-label>
|
|
<textarea
|
|
matInput
|
|
rows="16"
|
|
[value]="raw(d)"
|
|
(input)="rawDraft.set($any($event.target).value)"
|
|
></textarea>
|
|
</mat-form-field>
|
|
@if (rawError()) {
|
|
<p class="error" role="alert">{{ rawError() }}</p>
|
|
}
|
|
<button mat-stroked-button [disabled]="rawDraft() === undefined" (click)="applyRaw()">
|
|
Aplicar
|
|
</button>
|
|
</mat-tab>
|
|
</mat-tab-group>
|
|
<button mat-stroked-button (click)="show()">Vista previa</button>
|
|
@if (preview(); as rows) {
|
|
<div class="preview">
|
|
<table mat-table [dataSource]="rows">
|
|
@for (c of columns(); track c) {
|
|
<ng-container [matColumnDef]="c">
|
|
<th mat-header-cell *matHeaderCellDef>{{ c }}</th>
|
|
<td mat-cell *matCellDef="let row">{{ cell(row[c]) }}</td>
|
|
</ng-container>
|
|
}
|
|
<tr mat-header-row *matHeaderRowDef="columns()"></tr>
|
|
<tr mat-row *matRowDef="let row; columns: columns()"></tr>
|
|
</table>
|
|
</div>
|
|
}
|
|
</aside>
|
|
}
|
|
</div>
|