diff --git a/.gitignore b/.gitignore index cf073b0..82a5c77 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,6 @@ build/ /app/src/main/resources/tiny.prop.json /config/config-sbc2ha-new/.gitignore /config/config-typescript/* -/config/editor/* /docs/* /docker/ha/sbc2ha.jar +/config/editor/node/* diff --git a/config/.gitignore b/config/.gitignore new file mode 100644 index 0000000..c935ee1 --- /dev/null +++ b/config/.gitignore @@ -0,0 +1,42 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store + +/example-configs/* + +/converter/src/main/resources/tools/* \ No newline at end of file diff --git a/config/editor/src/app/modules/config-editor/component/save-dialog/save-dialog.component.html b/config/editor/src/app/modules/config-editor/component/save-dialog/save-dialog.component.html new file mode 100644 index 0000000..58b5c13 --- /dev/null +++ b/config/editor/src/app/modules/config-editor/component/save-dialog/save-dialog.component.html @@ -0,0 +1,16 @@ +

Save editor content

+
+
+ + Reload + + + Show logs + + +
+
+
+ + +
diff --git a/config/editor/src/app/modules/config-editor/component/save-dialog/save-dialog.component.scss b/config/editor/src/app/modules/config-editor/component/save-dialog/save-dialog.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/config/editor/src/app/modules/config-editor/component/save-dialog/save-dialog.component.spec.ts b/config/editor/src/app/modules/config-editor/component/save-dialog/save-dialog.component.spec.ts new file mode 100644 index 0000000..d34f59d --- /dev/null +++ b/config/editor/src/app/modules/config-editor/component/save-dialog/save-dialog.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SaveDialogComponent } from './save-dialog.component'; + +describe('SaveDialogComponent', () => { + let component: SaveDialogComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [SaveDialogComponent] + }); + fixture = TestBed.createComponent(SaveDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/config/editor/src/app/modules/config-editor/component/save-dialog/save-dialog.component.ts b/config/editor/src/app/modules/config-editor/component/save-dialog/save-dialog.component.ts new file mode 100644 index 0000000..ff245aa --- /dev/null +++ b/config/editor/src/app/modules/config-editor/component/save-dialog/save-dialog.component.ts @@ -0,0 +1,56 @@ +import {Component, Inject} from '@angular/core'; +import {FormBuilder, FormControl, Validators} from "@angular/forms"; +import {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from "@angular/material/dialog"; +import {CoverConfig} from "../../../../definition/actuator/CoverConfig"; +import {ExtensionsService} from "../../extensions.service"; + +@Component({ + selector: 'app-save-dialog', + templateUrl: './save-dialog.component.html', + styleUrls: ['./save-dialog.component.scss'] +}) +export class SaveDialogComponent { + + + reloadCtrl = new FormControl(true, Validators.required); + showLogsCtrl = new FormControl(true, Validators.required); + + + platform = this._formBuilder.group({ + reload: this.reloadCtrl, + showLogs: this.showLogsCtrl, + }); + + constructor(private _formBuilder: FormBuilder, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: { config: CoverConfig }, + public es: ExtensionsService, + public dialog: MatDialog + ) { + } + + + uploadCache() { + let rawValue = this.platform.getRawValue(); + this.dialogRef.close({ + target: "cache", + reload: (rawValue.reload) as boolean, + showLogs: (rawValue.showLogs) as boolean + }) + } + + uploadConfig() { + let rawValue = this.platform.getRawValue(); + this.dialogRef.close({ + target: "config", + reload: (rawValue.reload) as boolean, + showLogs: (rawValue.showLogs) as boolean + }) + } +} + +export interface SaveCommand { + target: string; + reload: boolean; + showLogs: boolean +}