This is an automated email from the ASF dual-hosted git repository.
hshpak pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
The following commit(s) were added to refs/heads/develop by this push:
new 0834059f2 minor fix
new ad40c1ecf Merge pull request #1500 from
GennadiyShpak/feat/DATALAB-2771/create-image-action-action-list
0834059f2 is described below
commit 0834059f2c0de29be5bf3ba344a17304325d2c13
Author: Hennadii_Shpak <[email protected]>
AuthorDate: Tue Apr 26 13:21:27 2022 +0300
minor fix
---
.../management/management.component.html | 38 ++++++------
.../management/management.component.ts | 69 +++++++++++-----------
.../webapp/src/app/core/models/statusTypes.enum.ts | 4 +-
3 files changed, 55 insertions(+), 56 deletions(-)
diff --git
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
index 481eb7da5..9de4cea78 100644
---
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
+++
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
@@ -23,7 +23,7 @@
<div class="action-select-wrapper admin-group" >
<span class="action-button-wrapper">
<button
- type="button"
+ type="button"
class="butt actions-btn"
mat-raised-button
[disabled]="!selected.length"
@@ -35,32 +35,32 @@
</span>
<div class="action-menu" *ngIf="isActionsOpen">
<button
- type="button"
+ type="button"
class="butt action-menu-item"
[ngClass]="{'disabled': !selectedStopped }"
mat-raised-button
[disabled]="!selectedStopped"
- (click)="resourseAction('start');$event.stopPropagation()"
+ (click)="resourceAction('start');$event.stopPropagation()"
>
Run
</button>
<span>
<button
- type="button"
+ type="button"
class="butt action-menu-item"
[ngClass]="{'disabled': !selectedRunning }"
mat-raised-button
[disabled]="!selectedRunning"
- (click)="resourseAction('stop');$event.stopPropagation()"
+ (click)="resourceAction('stop');$event.stopPropagation()"
>
Stop
</button>
</span>
<button
- type="button"
+ type="button"
class="butt action-menu-item"
mat-raised-button
- (click)="resourseAction('terminate');$event.stopPropagation()"
+ (click)="resourceAction('terminate');$event.stopPropagation()"
>
Terminate
</button>
@@ -68,8 +68,8 @@
</div>
<button
*ngIf="healthStatus?.admin"
- mat-raised-button
- class="butt ssn"
+ mat-raised-button
+ class="butt ssn"
(click)="showEndpointsDialog()"
>
<i class="material-icons"></i>Endpoints
@@ -78,9 +78,9 @@
<i class="material-icons"></i>SSN Monitor
</button> -->
<button
- *ngIf="healthStatus?.admin"
- mat-raised-button
- class="butt env"
+ *ngIf="healthStatus?.admin"
+ mat-raised-button
+ class="butt env"
(click)="openManageEnvironmentDialog()"
>
Manage DataLab quotas
@@ -89,21 +89,21 @@
<i class="material-icons">backup</i>Backup
</button> -->
</div>
- <button
- mat-raised-button
- class="butt"
+ <button
+ mat-raised-button
+ class="butt"
(click)="refreshGrid()"
>
<i class="material-icons refresh-icon">autorenew</i>Refresh
</button>
</div>
<mat-divider></mat-divider>
- <management-grid
- [currentUser]="user.toLowerCase()"
+ <management-grid
+ [currentUser]="user.toLowerCase()"
[isAdmin]="healthStatus?.admin"
- [environmentsHealthStatuses]="healthStatus?.list_resources"
+ [environmentsHealthStatuses]="healthStatus?.list_resources"
(refreshGrid)="buildGrid()"
- (actionToggle)="toggleResourceAction($event)"
+ (actionToggle)="toggleResourceAction($event)"
(emitSelectedList)="selectedList($event)"
></management-grid>
</div>
diff --git
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
index 00c8d96ca..d6c414c58 100644
---
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
+++
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
@@ -58,7 +58,7 @@ export class ManagementComponent implements OnInit {
public isActionsOpen: boolean = false;
public selectedRunning: boolean;
public selectedStopped: boolean;
- public resourseStaus = StatusTypes;
+ public resourceStatus = StatusTypes;
@ViewChild(ManagementGridComponent, { static: true }) managementGrid;
@@ -119,7 +119,7 @@ export class ManagementComponent implements OnInit {
total => {
this.dialogRef = this.dialog.open(ManageEnvironmentComponent, {
data: { projectsList, total }, panelClass: 'modal-xl-s' });
this.dialogRef.afterClosed().subscribe(result => result &&
this.setBudgetLimits(result));
- },
+ },
() => this.toastr.error('Failed users list loading!', 'Oops!')
);
});
@@ -152,7 +152,7 @@ export class ManagementComponent implements OnInit {
result.status === HTTP_STATUS_CODES.OK &&
this.toastr.success('Budget limits updated!', 'Success!');
this.buildGrid();
}
- },
+ },
error => this.toastr.error(error.message, 'Oops!'));
} else {
this.healthStatusService.updateTotalBudgetData($event.total)
@@ -217,8 +217,8 @@ export class ManagementComponent implements OnInit {
this.isActionsOpen = false;
}
- this.selectedRunning = this.selected.every(item => item.status ===
this.resourseStaus.running);
- this.selectedStopped = this.selected.every(item => item.status ===
this.resourseStaus.stopped);
+ this.selectedRunning = this.selected.every(item => item.status ===
this.resourceStatus.running);
+ this.selectedStopped = this.selected.every(item => item.status ===
this.resourceStatus.stopped);
}
public toogleActions() {
@@ -239,72 +239,71 @@ export class ManagementComponent implements OnInit {
}
}
- public resourseAction(action) {
+ public resourceAction(action) {
this.toggleResourceAction({ environment: this.selected, action: action });
}
private openDialog(environment, action, resource) {
- let config: ModalData = {
- type: '',
- action
+ let config: ModalData = {
+ type: '',
+ action
};
- let observer = {
+ const observer = {
next: (res) => {}
};
- if(resource) {
+ if (resource) {
config.resource_name = resource.computational_name;
config.user = environment.user;
- config.type = ModalDataType.cluster
+ config.type = ModalDataType.cluster;
observer.next = (res) => {
- res && this.manageEnvironmentAction({ action, environment, resource })
- }
+ res && this.manageEnvironmentAction({ action, environment, resource });
+ };
} else {
const notebooks = this.selected.length ? this.selected : [environment];
config = this.getModalConfig(config, action, notebooks);
observer.next = (res) => {
if (res) {
notebooks.forEach((env) => {
- this.getNotebookAction(env, action)
+ this.getNotebookAction(env, action);
});
}
this.clearSelection();
- }
+ };
this.isActionsOpen = false;
}
- //TODO if action run and recreate are restored, uncomment this piece of
code
+ // TODO if action run and recreate are restored, uncomment this piece of
code
// if(action === 'run' || action === 'recreate') {
// this.getHealthAction(action);
// } else {
// this.dialog.open(ReconfirmationDialogComponent, {
// data: config,
- // width: '550px',
+ // width: '550px',
// panelClass: 'error-modalbox'
// }).afterClosed().subscribe(observer);
// }
- //TODO if action run and recreate are restored remove this piece of code
-
+ // TODO if action run and recreate are restored remove this piece of code
this.dialog.open(ReconfirmationDialogComponent, {
data: config,
- width: '550px',
+ width: '550px',
panelClass: 'error-modalbox'
}).afterClosed().subscribe(observer);
}
private getModalConfig(config: ModalData, action: ActionsType, notebooks:
EnvironmentModel[]): ModalData {
- config = {...config, type: ModalDataType.notebook}
- if(action === ActionsType.stop) {
- notebooks = notebooks.filter(note => note.status !==
this.resourseStaus.stopped);
- return {...config, notebooks}
+ config = {...config, type: ModalDataType.notebook};
+ if (action === ActionsType.stop) {
+ notebooks = notebooks.filter(note => note.status !==
this.resourceStatus.stopped);
+ return {...config, notebooks};
}
- if(action === ActionsType.start) {
- notebooks = notebooks.filter(note => note.status ===
this.resourseStaus.stopped);
- return {...config, notebooks}
+ if (action === ActionsType.start) {
+ notebooks = notebooks.filter(note => note.status ===
this.resourceStatus.stopped);
+ return {...config, notebooks};
}
- return {...config, notebooks}
+ return {...config, notebooks};
}
private getNotebookAction(env: EnvironmentModel, action: ActionsType) {
@@ -323,14 +322,14 @@ export class ManagementComponent implements OnInit {
this.toastr.success(`Edge Node ${nodeAction} is processing!`,
'Processing!');
},
error: () => this.toastr.error(`Edge Node ${nodeAction} failed!`,
'Oops!')
- }
- if(action === ActionsType.run) {
+ };
+ if (action === ActionsType.run) {
nodeAction = ActionsType.run;
- this.healthStatusService.runEdgeNode().subscribe(observer)
+ this.healthStatusService.runEdgeNode().subscribe(observer);
}
- if(action === ActionsType.recreate) {
- nodeAction = ActionsType.recreate
- this.healthStatusService.recreateEdgeNode().subscribe(observer)
+ if (action === ActionsType.recreate) {
+ nodeAction = ActionsType.recreate;
+ this.healthStatusService.recreateEdgeNode().subscribe(observer);
}
}
}
diff --git
a/services/self-service/src/main/resources/webapp/src/app/core/models/statusTypes.enum.ts
b/services/self-service/src/main/resources/webapp/src/app/core/models/statusTypes.enum.ts
index e0849e797..9b6427bfd 100644
---
a/services/self-service/src/main/resources/webapp/src/app/core/models/statusTypes.enum.ts
+++
b/services/self-service/src/main/resources/webapp/src/app/core/models/statusTypes.enum.ts
@@ -18,11 +18,11 @@
*/
export enum StatusTypes {
- creating = 'creating',
+ creating = 'creating',
running = 'running',
stopping = 'stopping',
stopped = 'stopped',
terminating = 'terminating',
terminated = 'terminated',
failed = 'failed'
-}
\ No newline at end of file
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]