Skip to content

Commit

Permalink
Cobbler-Frontend: Progress View/Edit screens
Browse files Browse the repository at this point in the history
  • Loading branch information
SchoolGuy committed Jul 24, 2024
1 parent 0eb806f commit 47117d0
Show file tree
Hide file tree
Showing 14 changed files with 487 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,31 @@ <h1 class="title title-cell-text">Name: {{ name }}</h1>
<mat-label>Comment</mat-label>
<input matInput type="text" formControlName="comment"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Action</mat-label>
<input matInput type="text" formControlName="action"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Group</mat-label>
<input matInput type="text" formControlName="group"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Mode</mat-label>
<input matInput type="text" formControlName="mode"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Owner</mat-label>
<input matInput type="text" formControlName="owner"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Path</mat-label>
<input matInput type="text" formControlName="path"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Template</mat-label>
<input matInput type="text" formControlName="template"/>
</mat-form-field>
<mat-checkbox class="form-field-full-width" formControlName="is_dir">Is Directory?</mat-checkbox>
@if (isEditMode) {
<button mat-button (click)="saveFile()">Save Distro</button>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,15 @@ export class FileEditComponent implements OnInit {
ctime: new FormControl({value: "", disabled: true}),
depth: new FormControl({value: 0, disabled: true}),
is_subobject: new FormControl({value: false, disabled: true}),
is_dir: new FormControl({value: false, disabled: true}),
comment: new FormControl({value: "", disabled: true}),
redhat_management_key: new FormControl({value: "", disabled: true}),
action: new FormControl({value: "", disabled: true}),
group: new FormControl({value: "", disabled: true}),
mode: new FormControl({value: "", disabled: true}),
owner: new FormControl({value: "", disabled: true}),
path: new FormControl({value: "", disabled: true}),
template: new FormControl({value: "", disabled: true}),
});
isEditMode: boolean = false;

Expand Down Expand Up @@ -73,6 +80,12 @@ export class FileEditComponent implements OnInit {
this.fileFormGroup.controls.depth.setValue(this.file.depth)
this.fileFormGroup.controls.is_subobject.setValue(this.file.is_subobject)
this.fileFormGroup.controls.comment.setValue(this.file.comment)
this.fileFormGroup.controls.action.setValue(this.file.action)
this.fileFormGroup.controls.group.setValue(this.file.group)
this.fileFormGroup.controls.mode.setValue(this.file.mode)
this.fileFormGroup.controls.owner.setValue(this.file.owner)
this.fileFormGroup.controls.path.setValue(this.file.path)
this.fileFormGroup.controls.template.setValue(this.file.template)
}, error => {
// HTML encode the error message since it originates from XML
this._snackBar.open(this.toHTML(error.message), 'Close');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,39 @@ <h1 class="title title-cell-text">Name: {{ name }}</h1>
<mat-label>Comment</mat-label>
<input matInput type="text" formControlName="comment"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Network Count</mat-label>
<input matInput type="number" formControlName="network_count"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Parent</mat-label>
<input matInput type="text" formControlName="parent"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Arch</mat-label>
<input matInput type="text" formControlName="arch"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Autoinstall</mat-label>
<input matInput type="text" formControlName="autoinstall"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Operating System Breed</mat-label>
<input matInput type="text" formControlName="breed"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Image File</mat-label>
<input matInput type="text" formControlName="file"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Image Type</mat-label>
<input matInput type="text" formControlName="image_type"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Operating System Version</mat-label>
<input matInput type="text" formControlName="os_version"/>
</mat-form-field>
@if (isEditMode) {
<button mat-button (click)="saveImage()">Save Distro</button>
}
</form>

Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,17 @@ export class ImageEditComponent implements OnInit{
mtime: new FormControl({value: "", disabled: true}),
ctime: new FormControl({value: "", disabled: true}),
depth: new FormControl({value: 0, disabled: true}),
network_count: new FormControl({value: 0, disabled: true}),
is_subobject: new FormControl({value: false, disabled: true}),
comment: new FormControl({value: "", disabled: true}),
redhat_management_key: new FormControl({value: "", disabled: true}),
parent: new FormControl({value: "", disabled: true}),
arch: new FormControl({value: "", disabled: true}),
autoinstall: new FormControl({value: "", disabled: true}),
breed: new FormControl({value: "", disabled: true}),
file: new FormControl({value: "", disabled: true}),
image_type: new FormControl({value: "", disabled: true}),
os_version: new FormControl({value: "", disabled: true}),
boot_loaders: new FormControl({value: [], disabled: true}),
bootloader_inherited: new FormControl({value: false, disabled: true}),
});
Expand Down Expand Up @@ -73,8 +81,16 @@ export class ImageEditComponent implements OnInit{
this.profileFormGroup.controls.mtime.setValue(new Date(this.image.mtime * 1000).toString())
this.profileFormGroup.controls.ctime.setValue(new Date(this.image.ctime * 1000).toString())
this.profileFormGroup.controls.depth.setValue(this.image.depth)
this.profileFormGroup.controls.network_count.setValue(this.image.network_count)
this.profileFormGroup.controls.is_subobject.setValue(this.image.is_subobject)
this.profileFormGroup.controls.comment.setValue(this.image.comment)
this.profileFormGroup.controls.parent.setValue(this.image.parent)
this.profileFormGroup.controls.arch.setValue(this.image.arch)
this.profileFormGroup.controls.autoinstall.setValue(this.image.autoinstall)
this.profileFormGroup.controls.breed.setValue(this.image.breed)
this.profileFormGroup.controls.file.setValue(this.image.file)
this.profileFormGroup.controls.image_type.setValue(this.image.image_type)
this.profileFormGroup.controls.os_version.setValue(this.image.os_version)
if (typeof this.image.boot_loaders === "string") {
this.profileFormGroup.controls.bootloader_inherited.setValue(true)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,16 @@ <h1 class="title title-cell-text">Name: {{ name }}</h1>
<mat-label>Comment</mat-label>
<input matInput type="text" formControlName="comment"/>
</mat-form-field>
<mat-checkbox class="form-field-full-width" formControlName="is_definition">Is Definition?</mat-checkbox>
<mat-form-field class="form-field-full-width">
<mat-label>Class Name</mat-label>
<input matInput type="text" formControlName="class_name"/>
</mat-form-field>
<!-- TODO: Files Array -->
<!-- TODO: Owners Array -->
<!-- TODO: Packages Array -->
<!-- TODO: Params Map -->
@if (isEditMode) {
<button mat-button (click)="saveProfile()">Save Distro</button>
}
</form>

Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ export class ManagementClassEditComponent implements OnInit {
ctime: new FormControl({value: "", disabled: true}),
depth: new FormControl({value: 0, disabled: true}),
is_subobject: new FormControl({value: false, disabled: true}),
is_definition: new FormControl({value: false, disabled: true}),
comment: new FormControl({value: "", disabled: true}),
redhat_management_key: new FormControl({value: "", disabled: true}),
class_name: new FormControl({value: "", disabled: true}),
});
isEditMode: boolean = false;

Expand All @@ -72,7 +74,9 @@ export class ManagementClassEditComponent implements OnInit {
this.managementClassFormGroup.controls.ctime.setValue(new Date(this.managementClass.ctime * 1000).toString())
this.managementClassFormGroup.controls.depth.setValue(this.managementClass.depth)
this.managementClassFormGroup.controls.is_subobject.setValue(this.managementClass.is_subobject)
this.managementClassFormGroup.controls.is_definition.setValue(this.managementClass.is_definition)
this.managementClassFormGroup.controls.comment.setValue(this.managementClass.comment)
this.managementClassFormGroup.controls.class_name.setValue(this.managementClass.class_name)
}, error => {
// HTML encode the error message since it originates from XML
this._snackBar.open(this.toHTML(error.message), 'Close');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,39 @@ <h1 class="title title-cell-text">Name: {{ name }}</h1>
<mat-label>Comment</mat-label>
<input matInput type="text" formControlName="comment"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Mode</mat-label>
<input matInput type="text" formControlName="mode"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Owner</mat-label>
<input matInput type="text" formControlName="owner"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Group</mat-label>
<input matInput type="text" formControlName="group"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Path</mat-label>
<input matInput type="text" formControlName="path"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Template</mat-label>
<input matInput type="text" formControlName="template"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Action</mat-label>
<input matInput type="text" formControlName="action"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Installer</mat-label>
<input matInput type="text" formControlName="installer"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Version</mat-label>
<input matInput type="text" formControlName="version"/>
</mat-form-field>
<!-- TODO: Owners field -->
@if (isEditMode) {
<button mat-button (click)="savePackage()">Save Distro</button>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ export class PackageEditComponent implements OnInit {
is_subobject: new FormControl({value: false, disabled: true}),
comment: new FormControl({value: "", disabled: true}),
redhat_management_key: new FormControl({value: "", disabled: true}),
mode: new FormControl({value: "", disabled: true}),
owner: new FormControl({value: "", disabled: true}),
group: new FormControl({value: "", disabled: true}),
path: new FormControl({value: "", disabled: true}),
template: new FormControl({value: "", disabled: true}),
action: new FormControl({value: "", disabled: true}),
installer: new FormControl({value: "", disabled: true}),
version: new FormControl({value: "", disabled: true}),
});
isEditMode: boolean = false;

Expand Down Expand Up @@ -73,6 +81,14 @@ export class PackageEditComponent implements OnInit {
this.packageFormGroup.controls.depth.setValue(this.package.depth)
this.packageFormGroup.controls.is_subobject.setValue(this.package.is_subobject)
this.packageFormGroup.controls.comment.setValue(this.package.comment)
this.packageFormGroup.controls.mode.setValue(this.package.mode)
this.packageFormGroup.controls.owner.setValue(this.package.owner)
this.packageFormGroup.controls.group.setValue(this.package.group)
this.packageFormGroup.controls.path.setValue(this.package.path)
this.packageFormGroup.controls.template.setValue(this.package.template)
this.packageFormGroup.controls.action.setValue(this.package.action)
this.packageFormGroup.controls.installer.setValue(this.package.installer)
this.packageFormGroup.controls.version.setValue(this.package.version)
}, error => {
// HTML encode the error message since it originates from XML
this._snackBar.open(this.toHTML(error.message), 'Close');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,63 @@ <h1 class="title title-cell-text">Name: {{ name }}</h1>
<mat-label>Comment</mat-label>
<input matInput type="text" formControlName="comment"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Autoinstall</mat-label>
<input matInput type="text" formControlName="autoinstall"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>DHCP Tag</mat-label>
<input matInput type="text" formControlName="dhcp_tag"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Distribution</mat-label>
<input matInput type="text" formControlName="distro"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Menu</mat-label>
<input matInput type="text" formControlName="menu"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Next-Server IPv4</mat-label>
<input matInput type="text" formControlName="next_server_v4"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Next-Server IPv6</mat-label>
<input matInput type="text" formControlName="next_server_v6"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Filename</mat-label>
<input matInput type="text" formControlName="filename"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Parent</mat-label>
<input matInput type="text" formControlName="parent"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Proxy</mat-label>
<input matInput type="text" formControlName="proxy"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>RedHat Management Key</mat-label>
<input matInput type="text" formControlName="redhat_management_key"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Server</mat-label>
<input matInput type="text" formControlName="server"/>
</mat-form-field>
<!-- TODO: autoinstall_meta -->
<!-- TODO: boot_files -->
<!-- TODO: fetchable_files -->
<!-- TODO: kernel_options -->
<!-- TODO: kernel_options_post -->
<!-- TODO: mgmt_classes -->
<!-- TODO: mgmt_parameters -->
<!-- TODO: name_servers -->
<!-- TODO: name_servers_search -->
<!-- TODO: owners -->
<!-- TODO: repos -->
<!-- TODO: template_files -->
<!-- TODO: virt options -->
@if (isEditMode) {
<button mat-button (click)="saveProfile()">Save Distro</button>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ export class ProfileEditComponent implements OnInit{
is_subobject: new FormControl({value: false, disabled: true}),
comment: new FormControl({value: "", disabled: true}),
redhat_management_key: new FormControl({value: "", disabled: true}),
autoinstall: new FormControl({value: "", disabled: true}),
dhcp_tag: new FormControl({value: "", disabled: true}),
distro: new FormControl({value: "", disabled: true}),
menu: new FormControl({value: "", disabled: true}),
next_server_v4: new FormControl({value: "", disabled: true}),
next_server_v6: new FormControl({value: "", disabled: true}),
filename: new FormControl({value: "", disabled: true}),
parent: new FormControl({value: "", disabled: true}),
proxy: new FormControl({value: "", disabled: true}),
server: new FormControl({value: "", disabled: true}),
boot_loaders: new FormControl({value: [], disabled: true}),
bootloader_inherited: new FormControl({value: false, disabled: true}),
});
Expand Down Expand Up @@ -75,6 +85,17 @@ export class ProfileEditComponent implements OnInit{
this.profileFormGroup.controls.depth.setValue(this.profile.depth)
this.profileFormGroup.controls.is_subobject.setValue(this.profile.is_subobject)
this.profileFormGroup.controls.comment.setValue(this.profile.comment)
this.profileFormGroup.controls.redhat_management_key.setValue(this.profile.redhat_management_key)
this.profileFormGroup.controls.autoinstall.setValue(this.profile.autoinstall)
this.profileFormGroup.controls.dhcp_tag.setValue(this.profile.dhcp_tag)
this.profileFormGroup.controls.distro.setValue(this.profile.distro)
this.profileFormGroup.controls.menu.setValue(this.profile.menu)
this.profileFormGroup.controls.next_server_v4.setValue(this.profile.next_server_v4)
this.profileFormGroup.controls.next_server_v6.setValue(this.profile.next_server_v6)
this.profileFormGroup.controls.filename.setValue(this.profile.filename)
this.profileFormGroup.controls.parent.setValue(this.profile.parent)
this.profileFormGroup.controls.proxy.setValue(this.profile.proxy)
this.profileFormGroup.controls.server.setValue(this.profile.server)
if (typeof this.profile.boot_loaders === "string") {
this.profileFormGroup.controls.bootloader_inherited.setValue(true)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,40 @@ <h1 class="title title-cell-text">Name: {{ name }}</h1>
<mat-label>Comment</mat-label>
<input matInput type="text" formControlName="comment"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Operating System Version</mat-label>
<input matInput type="text" formControlName="os_version"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Operating System Breed</mat-label>
<input matInput type="text" formControlName="breed"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Mirror</mat-label>
<input matInput type="text" formControlName="mirror"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Mirror Type</mat-label>
<input matInput type="text" formControlName="mirror_type"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Proxy</mat-label>
<input matInput type="text" formControlName="proxy"/>
</mat-form-field>
<mat-form-field class="form-field-full-width">
<mat-label>Priority</mat-label>
<input matInput type="number" formControlName="priority"/>
</mat-form-field>
<mat-checkbox class="form-field-full-width" formControlName="keep_updated">Keep updated?</mat-checkbox>
<mat-checkbox class="form-field-full-width" formControlName="mirror_locally">Mirror Locally?</mat-checkbox>
<!-- TODO: apt_components -->
<!-- TODO: environment -->
<!-- TODO: apt_dists -->
<!-- TODO: createrepo_flags -->
<!-- TODO: owners -->
<!-- TODO: rpm_list -->
<!-- TODO: yumopts -->
<!-- TODO: rsyncopts -->
@if (isEditMode) {
<button mat-button (click)="saveRepository()">Save Distro</button>
}
Expand Down
Loading

0 comments on commit 47117d0

Please sign in to comment.