Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/resources and mod #6292

Merged
merged 8 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export class ApplicationListComponent implements OnInit, OnChanges {
}

setDataTestId(): void {
console.log('set data test id')
switch (this.tabState) {
case ApplicationTabStates.SUBMITTED: {
this.dataTestId = 'submitted_applications_container'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class ApplicationVoActionsComponent extends AbstractBaseClass implements

this.bsModalRef = this.modalService.show(ModificationRequestComponent, {
initialState,
class: 'modal-lg'
class: 'modal-xl'
})
this.subscribeToBsModalRef()
// this.subscribeForExtensionResult(this.ExtensionRequestType.MODIFICATION);
Expand Down
250 changes: 115 additions & 135 deletions src/app/facility_manager/resources/resources.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
<button
style="margin: 5px"
class="btn btn-outline-primary"
(click)="setAllTabsFalse(); MACHINE_DEFINITION_TAB_ACTIVE = true; factorModal.show()"
(click)="setAllTabsFalse(); MACHINE_DEFINITION_TAB_ACTIVE = true; showModificationCollapse = !showModificationCollapse"
>
Modify Resources
{{showModificationCollapse ? 'Close' : 'Open'}} Resouce Modification
</button>
<div style="margin: 5px">
<select
Expand Down Expand Up @@ -143,149 +143,129 @@
</table>
</div>
</div>
<div>
<!-- <button (click)="tableToPDF()">Download PDF</button> -->
<button (click)="tableToCSV()">Download CSV</button>
</div>
<!-- DivTable.com -->
</div>
<!--/.col-->
</div>
</div>
<div class="card-footer">
<!-- <button (click)="tableToPDF()">Download PDF</button> -->
<button class="btn btn-primary" (click)="tableToCSV()">Download CSV</button>

<div
bsModal
#factorModal="bs-modal"
class="modal fade"
tabindex="-1"
role="dialog"
aria-labelledby="myModalLabel"
aria-hidden="true"
>
<div class="modal-dialog modal-info modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Resources Factors</h4>
<button
type="button"
class="btn-close"
style="cursor: pointer"
(click)="factorModal.hide()"
aria-label="Close"
></button>
</div>

<div class="modal-body">
<div class="nav-tabs-boxed">
<ul class="nav nav-tabs" style="overflow-x: visible !important">
<li class="nav-item">
<a
class="nav-link"
id="ram_tab"
[ngClass]="{ active: MACHINE_DEFINITION_TAB_ACTIVE }"
(click)="setTab(MACHINE_DEFINITION_TAB)"
>Machine Definitions <b>[{{ resourceMachines.length }}]</b></a
>
</li>
<li class="nav-item">
<a
class="nav-link"
id="storage_tab"
[ngClass]="{ active: STORAGE_TAB_ACTIVE }"
(click)="setTab(STORAGE_TAB)"
>Storage
<b
>[{{ generalStorageFactors.length + objectStorageFactors.length + volumeStorageFactors.length }}]</b
></a
>
</li>
<li class="nav-item">
<a class="nav-link" id="gpu_tab" [ngClass]="{ active: GPU_TAB_ACTIVE }" (click)="setTab(GPU_TAB)"
>Graphic Processing Units<b>[{{ gpuSpecifications.length }}]</b></a
>
</li>
</ul>
<div class="collapse" [ngClass]="{ show: showModificationCollapse }"
id="resourceModifactionCollapse">
<div class="card">
<div class="card-header">
<h4 class="modal-title">Modify Facility Resources</h4>
</div>
</div>

<div class="tab-content">
<div *ngIf="MACHINE_DEFINITION_TAB_ACTIVE && selectedFacility">
<app-resourcemachine-overview
(factorChanged)="getSelectedFacilityResources()"
[facility_id]="selectedFacility['FacilityId']"
></app-resourcemachine-overview>

<div class="card-body">
<div class="nav-tabs-boxed">
<ul class="nav nav-tabs" style="overflow-x: visible !important">
<li class="nav-item">
<a
class="nav-link"
id="ram_tab"
[ngClass]="{ active: MACHINE_DEFINITION_TAB_ACTIVE }"
(click)="setTab(MACHINE_DEFINITION_TAB)"
>Machine Definitions <b>[{{ resourceMachines.length }}]</b></a
>
</li>
<li class="nav-item">
<a
class="nav-link"
id="storage_tab"
[ngClass]="{ active: STORAGE_TAB_ACTIVE }"
(click)="setTab(STORAGE_TAB)"
>Storage
<b
>[{{ generalStorageFactors.length + objectStorageFactors.length + volumeStorageFactors.length }}]</b
></a
>
</li>
<li class="nav-item">
<a class="nav-link" id="gpu_tab" [ngClass]="{ active: GPU_TAB_ACTIVE }" (click)="setTab(GPU_TAB)"
>Graphic Processing Units<b>[{{ gpuSpecifications.length }}]</b></a
>
</li>
</ul>
</div>
<div *ngIf="STORAGE_TAB_ACTIVE && selectedFacility">
<div class="alert alert-primary">
You can <b>either</b> define general storage <b>or</b> specify object and volume storage separately.<br />
If one of the two is defined, the other is disabled as long as the other is defined.

<div class="tab-content">
<div *ngIf="MACHINE_DEFINITION_TAB_ACTIVE && selectedFacility">
<app-resourcemachine-overview
(factorChanged)="getSelectedFacilityResources()"
[facility_id]="selectedFacility['FacilityId']"
></app-resourcemachine-overview>
</div>
<div class="nav-tabs-boxed">
<ul class="nav nav-tabs" style="overflow-x: visible !important">
<li class="nav-item">
<a
class="nav-link"
id="general_storage_tab"
[ngClass]="{
active: GENERAL_STORAGE_TAB_ACTIVE,
disabled: objectStorageFactors.length > 0 || volumeStorageFactors.length > 0
}"
(click)="setTab(GENERAL_STORAGE_TAB)"
>General Storage <b>[{{ generalStorageFactors.length }}]</b></a
>
</li>
<li class="nav-item">
<a
class="nav-link"
id="object_storage_tab"
[ngClass]="{ active: OBJECT_STORAGE_TAB_ACTIVE, disabled: generalStorageFactors.length > 0 }"
(click)="setTab(OBJECT_STORAGE_TAB)"
>Object Storage <b>[{{ objectStorageFactors.length }}]</b></a
>
</li>
<li class="nav-item">
<a
class="nav-link"
id="volume_storage_tab"
[ngClass]="{ active: VOLUME_STORAGE_TAB_ACTIVE, disabled: generalStorageFactors.length > 0 }"
(click)="setTab(VOLUME_STORAGE_TAB)"
>Volume Storage <b>[{{ volumeStorageFactors.length }}] </b></a
>
</li>
</ul>
<div class="tab-content">
<div *ngIf="GENERAL_STORAGE_TAB_ACTIVE && selectedFacility">
<app-generalstoragefactor-overview
(factorChanged)="getSelectedFacilityResources()"
[facility_id]="selectedFacility['FacilityId']"
></app-generalstoragefactor-overview>
</div>
<div *ngIf="OBJECT_STORAGE_TAB_ACTIVE && selectedFacility">
<app-objectstoragefactor-overview
(factorChanged)="getSelectedFacilityResources()"
[facility_id]="selectedFacility['FacilityId']"
></app-objectstoragefactor-overview>
</div>
<div *ngIf="VOLUME_STORAGE_TAB_ACTIVE && selectedFacility">
<app-volumestoragefactor-overview
(factorChanged)="getSelectedFacilityResources()"
[facility_id]="selectedFacility['FacilityId']"
></app-volumestoragefactor-overview>
<div *ngIf="STORAGE_TAB_ACTIVE && selectedFacility">
<div class="alert alert-primary">
You can <b>either</b> define general storage <b>or</b> specify object and volume storage separately.<br />
If one of the two is defined, the other is disabled as long as the other is defined.
</div>
<div class="nav-tabs-boxed">
<ul class="nav nav-tabs" style="overflow-x: visible !important">
<li class="nav-item">
<a
class="nav-link"
id="general_storage_tab"
[ngClass]="{
active: GENERAL_STORAGE_TAB_ACTIVE,
disabled: objectStorageFactors.length > 0 || volumeStorageFactors.length > 0
}"
(click)="setTab(GENERAL_STORAGE_TAB)"
>General Storage <b>[{{ generalStorageFactors.length }}]</b></a
>
</li>
<li class="nav-item">
<a
class="nav-link"
id="object_storage_tab"
[ngClass]="{ active: OBJECT_STORAGE_TAB_ACTIVE, disabled: generalStorageFactors.length > 0 }"
(click)="setTab(OBJECT_STORAGE_TAB)"
>Object Storage <b>[{{ objectStorageFactors.length }}]</b></a
>
</li>
<li class="nav-item">
<a
class="nav-link"
id="volume_storage_tab"
[ngClass]="{ active: VOLUME_STORAGE_TAB_ACTIVE, disabled: generalStorageFactors.length > 0 }"
(click)="setTab(VOLUME_STORAGE_TAB)"
>Volume Storage <b>[{{ volumeStorageFactors.length }}] </b></a
>
</li>
</ul>
<div class="tab-content">
<div *ngIf="GENERAL_STORAGE_TAB_ACTIVE && selectedFacility">
<app-generalstoragefactor-overview
(factorChanged)="getSelectedFacilityResources()"
[facility_id]="selectedFacility['FacilityId']"
></app-generalstoragefactor-overview>
</div>
<div *ngIf="OBJECT_STORAGE_TAB_ACTIVE && selectedFacility">
<app-objectstoragefactor-overview
(factorChanged)="getSelectedFacilityResources()"
[facility_id]="selectedFacility['FacilityId']"
></app-objectstoragefactor-overview>
</div>
<div *ngIf="VOLUME_STORAGE_TAB_ACTIVE && selectedFacility">
<app-volumestoragefactor-overview
(factorChanged)="getSelectedFacilityResources()"
[facility_id]="selectedFacility['FacilityId']"
></app-volumestoragefactor-overview>
</div>
</div>
</div>
</div>
<div *ngIf="GPU_TAB_ACTIVE && selectedFacility">
<app-gpu-specification-overview
[facility_id]="selectedFacility['FacilityId']"
></app-gpu-specification-overview>
</div>
</div>
<div *ngIf="GPU_TAB_ACTIVE && selectedFacility">
<app-gpu-specification-overview
[facility_id]="selectedFacility['FacilityId']"
></app-gpu-specification-overview>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" (click)="factorModal.hide()">Close</button>
</div>
</div>

<!-- DivTable.com -->
</div>
<!-- /.modal-content -->
<!--/.col-->
</div>
<!-- /.modal-dialog -->
</div>

2 changes: 2 additions & 0 deletions src/app/facility_manager/resources/resources.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class ResourcesComponent implements OnInit {
isLoaded: boolean = false
resources: Resources[]
visible_resources: Resources[]
showModificationCollapse: boolean = false;

/**
* Id of the table which will be converted to pdf or csv.
Expand Down Expand Up @@ -146,6 +147,7 @@ export class ResourcesComponent implements OnInit {
}

onChangeSelectedFacility(): void {
this.showModificationCollapse = false;
this.setAllTabsFalse()
this.getSelectedFacilityResources()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4>Adjust application for {{ application?.project_application_shortname }}</h4>
Expand Down Expand Up @@ -461,5 +460,3 @@ <h6 class="col-md-8 form-control-label">Project Data</h6>
}
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class AdjustApplicationComponent implements OnInit {
application
}
const bsModalRef: BsModalRef = this.modalService.show(AdjustApplicationComponent, { initialState })
bsModalRef.setClass('modal-lg')
bsModalRef.setClass('modal-xl')
this.modalId = bsModalRef.id

return bsModalRef.content.eventSuccess
Expand Down
Loading
Loading