diff --git a/src/composer/src/app/app.module.ts b/src/composer/src/app/app.module.ts index d4fd593..0083051 100644 --- a/src/composer/src/app/app.module.ts +++ b/src/composer/src/app/app.module.ts @@ -67,6 +67,7 @@ import { GlobalDialogComponent } from './core/components/dialogs/global-dialog/g import { CodemirrorModule } from '@ctrl/ngx-codemirror'; import { RecipeComponent, DialogPublishRecipe, DialogRecipeDetails } from './core/components/recipe/recipe.component'; +import { BuildDialogComponent } from './core/components/dialogs/build-dialog/build-dialog.component'; export function getHighlightLanguages() { return { @@ -103,7 +104,8 @@ export function getHighlightLanguages() { GlobalDialogComponent, RecipeComponent, DialogPublishRecipe, - DialogRecipeDetails + DialogRecipeDetails, + BuildDialogComponent ], imports: [ BrowserModule, diff --git a/src/composer/src/app/core/components/canvas/jsplumb/node/node.component.html b/src/composer/src/app/core/components/canvas/jsplumb/node/node.component.html index 4b975b1..58a3f8f 100644 --- a/src/composer/src/app/core/components/canvas/jsplumb/node/node.component.html +++ b/src/composer/src/app/core/components/canvas/jsplumb/node/node.component.html @@ -28,6 +28,9 @@ + diff --git a/src/composer/src/app/core/components/canvas/jsplumb/node/node.component.ts b/src/composer/src/app/core/components/canvas/jsplumb/node/node.component.ts index 445e7a8..36b7e5d 100644 --- a/src/composer/src/app/core/components/canvas/jsplumb/node/node.component.ts +++ b/src/composer/src/app/core/components/canvas/jsplumb/node/node.component.ts @@ -6,6 +6,7 @@ import { RestService } from 'src/app/core/services/rest.service' import { MatDialog } from '@angular/material/dialog' import { ManageProjectDialogComponent } from '../../../dialogs/manage-project-dialog/manage-project-dialog.component' import { ConfirmDialogComponent } from '../../../dialogs/confirm-dialog/confirm-dialog.component' +import { BuildDialogComponent } from '../../../dialogs/build-dialog/build-dialog.component' import * as ProjectActions from './../../../../store/project.actions' import { NodeService } from '../node.service' import { EventEmitterService } from 'src/app/core/services/event-emitter.service' @@ -126,6 +127,14 @@ export class NodeComponent implements AfterViewInit, OnDestroy { }) } + buildDialogOpen() { + this.dialog.open(BuildDialogComponent, { + width: '50%', + minWidth: '740px', + data: this.currentService, + }) + } + ngOnDestroy() { this.unSubscribe$.next(true) this.unSubscribe$.complete() diff --git a/src/composer/src/app/core/components/dialogs/build-dialog/build-dialog.component.html b/src/composer/src/app/core/components/dialogs/build-dialog/build-dialog.component.html new file mode 100644 index 0000000..df35c9a --- /dev/null +++ b/src/composer/src/app/core/components/dialogs/build-dialog/build-dialog.component.html @@ -0,0 +1,62 @@ +

Build Config

+ + + +
+ + Build + + + + + Context + + + + + Dockerfile + + + + + Network + + + + + SHM size + + + + + Target + + +
+
+ +

Arguments

+ +
+ + +

Cache from

+ +
+ + +

Labels

+ +
+
+
+ + + + + + diff --git a/src/composer/src/app/core/components/dialogs/build-dialog/build-dialog.component.scss b/src/composer/src/app/core/components/dialogs/build-dialog/build-dialog.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/composer/src/app/core/components/dialogs/build-dialog/build-dialog.component.spec.ts b/src/composer/src/app/core/components/dialogs/build-dialog/build-dialog.component.spec.ts new file mode 100644 index 0000000..689e821 --- /dev/null +++ b/src/composer/src/app/core/components/dialogs/build-dialog/build-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BuildDialogComponent } from './build-dialog.component'; + +describe('BuildDialogComponent', () => { + let component: BuildDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ BuildDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BuildDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/composer/src/app/core/components/dialogs/build-dialog/build-dialog.component.ts b/src/composer/src/app/core/components/dialogs/build-dialog/build-dialog.component.ts new file mode 100644 index 0000000..258080a --- /dev/null +++ b/src/composer/src/app/core/components/dialogs/build-dialog/build-dialog.component.ts @@ -0,0 +1,47 @@ +import { Component, OnInit, ViewChild, Inject } from '@angular/core' +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog' +import { FormControl, Validators, FormGroup, FormBuilder, AbstractControl } from '@angular/forms' +import { KeyValueComponent } from '../../common/key-value/key-value/key-value.component' +import { Service, Project, Volume, ServicePort, Network } from '../../../store/models' +import { CheckCircleComponent } from '../../widgets/check-circle/check-circle.component' + +@Component({ + selector: 'app-build-dialog', + templateUrl: './build-dialog.component.html', + styleUrls: ['./build-dialog.component.scss'] +}) +export class BuildDialogComponent implements OnInit { + @ViewChild(CheckCircleComponent) checkCircle: CheckCircleComponent + @ViewChild('args') args: KeyValueComponent + @ViewChild('cache_from') cache_from: KeyValueComponent + @ViewChild('labels') labels: KeyValueComponent + + formGeneral: FormGroup + currentArgs: [] = [] + currentCacheFrom: [] = [] + currentLabels: [] = [] + constructor(public dialogRef: MatDialogRef, private formBuilder: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: Service) { } + + ngOnInit(): void { + this.formGeneral = this.formBuilder.group({ + build: new FormControl(''), + context: new FormControl(''), + dockerfile: new FormControl(''), + network: new FormControl(''), + shm_size: new FormControl(''), + target: new FormControl(''), + }) + } + + onSave() { + const fields = { + ...this.formGeneral.getRawValue(), + args: this.args.getKeyValuePaies(), + cache_from: this.cache_from.getKeyValuePaies(), + labels: this.labels.getKeyValuePaies() + } + this.checkCircle.showCircle() + console.log(fields) + } + +}