mirror of
https://github.com/jwetzell/showbridge-webui.git
synced 2026-09-05 13:28:59 +00:00
format
This commit is contained in:
+9
-1
@@ -2,7 +2,15 @@
|
|||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
<mat-toolbar color="primary">
|
<mat-toolbar color="primary">
|
||||||
@if (eventsService.status() === 'open') {
|
@if (eventsService.status() === 'open') {
|
||||||
<div [matTooltip]="'Connected' + (eventsService.socketRoundTripLatency() !== null ? ' (' + eventsService.socketRoundTripLatency() + ' ms)' : '')" class="h-3 w-3 rounded-full bg-green-400 mr-2"></div>
|
<div
|
||||||
|
[matTooltip]="
|
||||||
|
'Connected' +
|
||||||
|
(eventsService.socketRoundTripLatency() !== null
|
||||||
|
? ' (' + eventsService.socketRoundTripLatency() + ' ms)'
|
||||||
|
: '')
|
||||||
|
"
|
||||||
|
class="h-3 w-3 rounded-full bg-green-400 mr-2"
|
||||||
|
></div>
|
||||||
} @else if (eventsService.status() === 'closed') {
|
} @else if (eventsService.status() === 'closed') {
|
||||||
<div matTooltip="Disconnected" class="h-3 w-3 rounded-full bg-orange-400 mr-2"></div>
|
<div matTooltip="Disconnected" class="h-3 w-3 rounded-full bg-orange-400 mr-2"></div>
|
||||||
} @else if (eventsService.status() === 'error') {
|
} @else if (eventsService.status() === 'error') {
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *cdkDragPlaceholder class="flex items-start m-2 w-fit">
|
<div *cdkDragPlaceholder class="flex items-start m-2 w-fit">
|
||||||
<div
|
<div
|
||||||
class="flex flex-col bg-gray-800 border-2 {{
|
class="flex flex-col bg-gray-800 border-2 {{
|
||||||
isInError() ? 'border-red-500' : 'border-gray-600'
|
isInError() ? 'border-red-500' : 'border-gray-600'
|
||||||
}} border-dotted w-fit h-full"
|
}} border-dotted w-fit h-full"
|
||||||
|
|||||||
@@ -63,10 +63,11 @@
|
|||||||
<div class="text-md text-white text-center">Processors</div>
|
<div class="text-md text-white text-center">Processors</div>
|
||||||
</div>
|
</div>
|
||||||
@if (processors() !== undefined && processors()!.length > 0) {
|
@if (processors() !== undefined && processors()!.length > 0) {
|
||||||
<div class="border-2 border-gray-500 m-2"
|
<div
|
||||||
cdkDropList
|
class="border-2 border-gray-500 m-2"
|
||||||
(cdkDropListDropped)="drop($event)"
|
cdkDropList
|
||||||
[cdkDropListData]="route()?.processors"
|
(cdkDropListDropped)="drop($event)"
|
||||||
|
[cdkDropListData]="route()?.processors"
|
||||||
>
|
>
|
||||||
@for (processor of processors(); track $index; let i = $index) {
|
@for (processor of processors(); track $index; let i = $index) {
|
||||||
<div cdkDrag>
|
<div cdkDrag>
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { CdkDrag, CdkDragDrop, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop';
|
||||||
CdkDrag,
|
|
||||||
CdkDragDrop,
|
|
||||||
CdkDropList,
|
|
||||||
moveItemInArray
|
|
||||||
} from '@angular/cdk/drag-drop';
|
|
||||||
import { JsonPipe } from '@angular/common';
|
import { JsonPipe } from '@angular/common';
|
||||||
import { Component, computed, inject, input, model, output, signal } from '@angular/core';
|
import { Component, computed, inject, input, model, output, signal } from '@angular/core';
|
||||||
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
export type RouterEvent<T, D> = {
|
export type RouterEvent<T, D> = {
|
||||||
type: T;
|
type: T;
|
||||||
data?: D;
|
data?: D;
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { computed, effect, inject, Injectable, signal } from '@angular/core';
|
import { computed, effect, inject, Injectable, signal } from '@angular/core';
|
||||||
import { cloneDeep, isEqual } from 'lodash-es';
|
import { cloneDeep, isEqual } from 'lodash-es';
|
||||||
import { Config, ConfigError, ModuleConfig, ModuleError, RouteConfig, RouteError } from '../models/config';
|
import {
|
||||||
|
Config,
|
||||||
|
ConfigError,
|
||||||
|
ModuleConfig,
|
||||||
|
ModuleError,
|
||||||
|
RouteConfig,
|
||||||
|
RouteError,
|
||||||
|
} from '../models/config';
|
||||||
import { EventsService } from './events';
|
import { EventsService } from './events';
|
||||||
import { SchemaService } from './schema';
|
import { SchemaService } from './schema';
|
||||||
import { SettingsService } from './settings';
|
import { SettingsService } from './settings';
|
||||||
@@ -75,7 +82,7 @@ export class ConfigService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uploadConfig(config: Config) {
|
uploadConfig(config: Config) {
|
||||||
if (this.schemaService.validate(this.schemaService.configSchemaId,config)) {
|
if (this.schemaService.validate(this.schemaService.configSchemaId, config)) {
|
||||||
this.updateCurrentlyShownConfig(config);
|
this.updateCurrentlyShownConfig(config);
|
||||||
const configUrl = this.settingsService.configUrl();
|
const configUrl = this.settingsService.configUrl();
|
||||||
if (!configUrl) {
|
if (!configUrl) {
|
||||||
|
|||||||
@@ -38,7 +38,9 @@ export class EventsService {
|
|||||||
this.pingInterval = setInterval(() => {
|
this.pingInterval = setInterval(() => {
|
||||||
if (this.socket && this.socket.readyState === WebSocket.OPEN) {
|
if (this.socket && this.socket.readyState === WebSocket.OPEN) {
|
||||||
this.lastPingTimestamp = Date.now();
|
this.lastPingTimestamp = Date.now();
|
||||||
this.socket.send(JSON.stringify({ type: 'ping', data: {timestamp: this.lastPingTimestamp} }));
|
this.socket.send(
|
||||||
|
JSON.stringify({ type: 'ping', data: { timestamp: this.lastPingTimestamp } }),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}, 5000);
|
}, 5000);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { computed, effect, inject, Injectable, signal } from '@angular/core';
|
import { computed, effect, inject, Injectable, signal } from '@angular/core';
|
||||||
import {
|
import { AbstractControl, ValidationErrors } from '@angular/forms';
|
||||||
AbstractControl,
|
|
||||||
ValidationErrors
|
|
||||||
} from '@angular/forms';
|
|
||||||
import { Ajv2020, JSONSchemaType } from 'ajv/dist/2020';
|
import { Ajv2020, JSONSchemaType } from 'ajv/dist/2020';
|
||||||
import { SomeJSONSchema } from 'ajv/dist/types/json-schema';
|
import { SomeJSONSchema } from 'ajv/dist/types/json-schema';
|
||||||
import { sortBy } from 'lodash-es';
|
import { sortBy } from 'lodash-es';
|
||||||
|
|||||||
Reference in New Issue
Block a user