-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cobbler-Frontend: Add basic overview and detail pages
- Loading branch information
Showing
120 changed files
with
3,977 additions
and
1,333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 29 additions & 2 deletions
31
projects/cobbler-frontend/src/app/items/distro/edit/distro-edit.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
projects/cobbler-frontend/src/app/items/file/edit/file-edit.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<div class="title-table"> | ||
<div class="title-row"> | ||
<h1 class="title title-cell-text">Name: {{ name }}</h1> | ||
<span class="title-cell-button"> | ||
<button | ||
mat-icon-button | ||
(click)="this.refreshData()" | ||
matTooltip="Refresh data" | ||
><mat-icon>refresh</mat-icon></button> | ||
</span> | ||
<span class="title-cell-button"> | ||
<button | ||
mat-icon-button | ||
(click)="this.copyFile()" | ||
matTooltip="Copy" | ||
><mat-icon>content_copy</mat-icon></button> | ||
</span> | ||
<span class="title-cell-button"> | ||
<button | ||
mat-icon-button | ||
(click)="this.editFile()" | ||
matTooltip="Edit" | ||
><mat-icon>edit</mat-icon></button> | ||
</span> | ||
<span class="title-cell-button"> | ||
<button | ||
mat-icon-button | ||
(click)="this.removeFile()" | ||
matTooltip="Delete" | ||
><mat-icon>delete</mat-icon></button> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<form class="form-replicate" [formGroup]="fileFormGroup"> | ||
<mat-form-field class="form-field-full-width"> | ||
<mat-label>Name</mat-label> | ||
<input matInput type="text" formControlName="name"/> | ||
</mat-form-field> | ||
<mat-form-field class="form-field-full-width"> | ||
<mat-label>UID</mat-label> | ||
<input matInput type="text" formControlName="uid"/> | ||
</mat-form-field> | ||
<mat-form-field class="form-field-full-width"> | ||
<mat-label>Last modified time</mat-label> | ||
<input matInput type="text" formControlName="mtime"/> | ||
</mat-form-field> | ||
<mat-form-field class="form-field-full-width"> | ||
<mat-label>Creation time</mat-label> | ||
<input matInput type="text" formControlName="ctime"/> | ||
</mat-form-field> | ||
<mat-form-field class="form-field-full-width"> | ||
<mat-label>Depth</mat-label> | ||
<input matInput type="number" formControlName="depth"/> | ||
</mat-form-field> | ||
<mat-checkbox class="form-field-full-width" formControlName="is_subobject">Is Subobject?</mat-checkbox> | ||
<mat-form-field class="form-field-full-width"> | ||
<mat-label>Comment</mat-label> | ||
<input matInput type="text" formControlName="comment"/> | ||
</mat-form-field> | ||
@if (isEditMode) { | ||
<button mat-button (click)="saveFile()">Save Distro</button> | ||
} | ||
</form> | ||
|
30 changes: 30 additions & 0 deletions
30
projects/cobbler-frontend/src/app/items/file/edit/file-edit.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.title-table { | ||
display: table; | ||
width: 100%; | ||
} | ||
|
||
.title-row { | ||
display: table-cell; | ||
width: 100%; | ||
} | ||
|
||
.title-cell-text { | ||
display: table-cell; | ||
width: 100%; | ||
vertical-align: middle; | ||
} | ||
|
||
.title-cell-button { | ||
display: table-cell; | ||
} | ||
|
||
.form-replicate { | ||
min-width: 150px; | ||
max-width: 600px; | ||
width: 100%; | ||
} | ||
|
||
.form-field-full-width { | ||
width: 100%; | ||
} | ||
|
50 changes: 50 additions & 0 deletions
50
projects/cobbler-frontend/src/app/items/file/edit/file-edit.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import {provideHttpClient} from '@angular/common/http'; | ||
import {provideHttpClientTesting} from '@angular/common/http/testing'; | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import {NoopAnimationsModule} from '@angular/platform-browser/animations'; | ||
import {ActivatedRoute, provideRouter} from '@angular/router'; | ||
import {COBBLER_URL} from 'cobbler-api'; | ||
|
||
import { FileEditComponent } from './file-edit.component'; | ||
|
||
describe('FileEditComponent', () => { | ||
let component: FileEditComponent; | ||
let fixture: ComponentFixture<FileEditComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [ | ||
FileEditComponent, | ||
NoopAnimationsModule, | ||
], | ||
providers: [ | ||
provideRouter([]), | ||
provideHttpClient(), | ||
provideHttpClientTesting(), | ||
{ | ||
provide: COBBLER_URL, | ||
useValue: new URL('http://localhost/cobbler_api') | ||
}, | ||
{ | ||
provide: ActivatedRoute, | ||
useValue: { | ||
snapshot: { | ||
paramMap: { | ||
get: () => "testfile" | ||
}, | ||
}, | ||
}, | ||
}, | ||
] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(FileEditComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.