mirror of
https://github.com/jwetzell/showbridge-webui.git
synced 2026-08-24 15:39:00 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b9950c64e7 | |||
| 31f42e696d |
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@showbridge/webui",
|
"name": "@showbridge/webui",
|
||||||
"version": "0.14.1",
|
"version": "0.14.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@showbridge/webui",
|
"name": "@showbridge/webui",
|
||||||
"version": "0.14.1",
|
"version": "0.14.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/cdk": "21.2.13",
|
"@angular/cdk": "21.2.13",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@showbridge/webui",
|
"name": "@showbridge/webui",
|
||||||
"version": "0.14.1",
|
"version": "0.14.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import { MatSnackBar } from '@angular/material/snack-bar';
|
|||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
import { ModuleConfig } from '../../models/config';
|
import { ModuleConfig } from '../../models/config';
|
||||||
|
import { ListsService } from '../../services/lists';
|
||||||
import { SchemaService } from '../../services/schema';
|
import { SchemaService } from '../../services/schema';
|
||||||
import { ModuleComponent } from '../module/module';
|
import { ModuleComponent } from '../module/module';
|
||||||
import { ListsService } from '../../services/lists';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-module-list',
|
selector: 'app-module-list',
|
||||||
@@ -75,7 +75,6 @@ export class ModuleListComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
drop(event: CdkDragDrop<ModuleConfig[] | undefined>) {
|
drop(event: CdkDragDrop<ModuleConfig[] | undefined>) {
|
||||||
console.log('Drop event:', event);
|
|
||||||
if (event.previousContainer === event.container) {
|
if (event.previousContainer === event.container) {
|
||||||
const currentModules = this.modules();
|
const currentModules = this.modules();
|
||||||
if (currentModules === undefined) {
|
if (currentModules === undefined) {
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ import { MatSnackBar } from '@angular/material/snack-bar';
|
|||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
import { RouteConfig } from '../../models/config';
|
import { RouteConfig } from '../../models/config';
|
||||||
|
import { ListsService } from '../../services/lists';
|
||||||
import { SchemaService } from '../../services/schema';
|
import { SchemaService } from '../../services/schema';
|
||||||
import { RouteComponent } from '../route/route';
|
import { RouteComponent } from '../route/route';
|
||||||
import { ListsService } from '../../services/lists';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-route-list',
|
selector: 'app-route-list',
|
||||||
@@ -123,7 +123,6 @@ export class RouteListComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
drop(event: CdkDragDrop<RouteConfig[] | undefined>) {
|
drop(event: CdkDragDrop<RouteConfig[] | undefined>) {
|
||||||
console.log('Drop event:', event);
|
|
||||||
if (event.previousContainer === event.container) {
|
if (event.previousContainer === event.container) {
|
||||||
const currentRoutes = this.routes();
|
const currentRoutes = this.routes();
|
||||||
if (currentRoutes === undefined) {
|
if (currentRoutes === undefined) {
|
||||||
|
|||||||
+12
-16
@@ -17,17 +17,18 @@ import { SettingsService } from './settings';
|
|||||||
})
|
})
|
||||||
export class ConfigService {
|
export class ConfigService {
|
||||||
pendingConfigIsValid = computed(() => {
|
pendingConfigIsValid = computed(() => {
|
||||||
const config = this.currentlyShownConfig();
|
const config = this._currentlyShownConfig();
|
||||||
if (config === undefined) {
|
if (config === undefined) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return this.schemaService.validate(this.schemaService.configSchemaId, config);
|
return this.schemaService.validate(this.schemaService.configSchemaId, config);
|
||||||
});
|
});
|
||||||
currentlyShownConfig = signal<Config | undefined>(undefined);
|
private runningConfig = signal<Config | undefined>(undefined);
|
||||||
runningConfig = signal<Config | undefined>(undefined);
|
private _currentlyShownConfig = signal<Config | undefined>(undefined);
|
||||||
|
readonly currentlyShownConfig = this._currentlyShownConfig.asReadonly();
|
||||||
|
|
||||||
configIsDirty = computed(() => {
|
configIsDirty = computed(() => {
|
||||||
const currentlyShown = this.currentlyShownConfig();
|
const currentlyShown = this._currentlyShownConfig();
|
||||||
const running = this.runningConfig();
|
const running = this.runningConfig();
|
||||||
if (currentlyShown === undefined || running === undefined) {
|
if (currentlyShown === undefined || running === undefined) {
|
||||||
return false;
|
return false;
|
||||||
@@ -44,7 +45,7 @@ export class ConfigService {
|
|||||||
|
|
||||||
constructor(private schemaService: SchemaService) {
|
constructor(private schemaService: SchemaService) {
|
||||||
effect(() => {
|
effect(() => {
|
||||||
console.log('config state changed', this.currentlyShownConfig());
|
console.log('config state changed', this._currentlyShownConfig());
|
||||||
});
|
});
|
||||||
|
|
||||||
effect(() => {
|
effect(() => {
|
||||||
@@ -124,27 +125,22 @@ export class ConfigService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateCurrentlyShownConfig(config: Config) {
|
updateCurrentlyShownConfig(config: Config) {
|
||||||
if (isEqual(config, this.currentlyShownConfig())) {
|
this._currentlyShownConfig.set(cloneDeep(config));
|
||||||
// NOTE(jwetzell): no update
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.currentlyShownConfig.set(cloneDeep(config));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateModules(modules: ModuleConfig[]) {
|
updateModules(modules: ModuleConfig[]) {
|
||||||
const currentConfig = this.currentlyShownConfig();
|
var newConfig = cloneDeep(this._currentlyShownConfig());
|
||||||
if (!currentConfig) {
|
if (!newConfig) {
|
||||||
console.error('No currently shown config to update modules on');
|
console.error('No currently shown config to update modules on');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
newConfig.modules = cloneDeep(modules);
|
||||||
|
|
||||||
currentConfig.modules = cloneDeep(modules);
|
this.updateCurrentlyShownConfig(newConfig);
|
||||||
|
|
||||||
this.updateCurrentlyShownConfig(currentConfig);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateRoutes(routes: RouteConfig[]) {
|
updateRoutes(routes: RouteConfig[]) {
|
||||||
const currentConfig = this.currentlyShownConfig();
|
const currentConfig = this._currentlyShownConfig();
|
||||||
if (!currentConfig) {
|
if (!currentConfig) {
|
||||||
console.error('No currently shown config to update routes on');
|
console.error('No currently shown config to update routes on');
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user