Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
[DLAB-1991]: Implemented set of UI tasks (#858)
Browse files Browse the repository at this point in the history
[DLAB-1991]: Implemented set of UI tasks
  • Loading branch information
DG1202 committed Aug 13, 2020
1 parent 0b754e8 commit 95e1fa1
Show file tree
Hide file tree
Showing 16 changed files with 84 additions and 56 deletions.
Expand Up @@ -80,10 +80,10 @@ public class ProjectServiceImpl implements ProjectService {
private static final String STOP_ACTION = "stop";
private static final String TERMINATE_ACTION = "terminate";

private static final String AUDIT_ADD_ENDPOINT = "Added endpoint(s) %s";
private static final String AUDIT_ADD_GROUP = "Added group(s) %s ";
private static final String AUDIT_REMOVE_GROUP = "Removed group(s) %s";
private static final String AUDIT_UPDATE_BUDGET = "Update quota %d->%d. Is monthly period: %b";
private static final String AUDIT_ADD_ENDPOINT = "Add endpoint(s): %s\n";
private static final String AUDIT_ADD_GROUP = "Add group(s): %s\n";
private static final String AUDIT_REMOVE_GROUP = "Remove group(s): %s\n";
private static final String AUDIT_UPDATE_BUDGET = "Update quota: %d->%d\nUpdate period: %b";
private static final String AUDIT_ADD_EDGE_NODE = "Create edge node for endpoint %s, requested in project %s";

private final ProjectDAO projectDAO;
Expand Down
Expand Up @@ -96,7 +96,7 @@
display: flex;
align-self: center;
width: 490px;
height: 36px;
height: 32px;
padding-left: 0;
font-family: 'Open Sans', sans-serif;
font-size: 15px;
Expand Down
Expand Up @@ -154,7 +154,6 @@ export class RolesComponent implements OnInit {
}

public manageRolesGroups($event) {
console.log($event);
switch ($event.action) {
case 'create':
this.rolesService.setupNewGroup($event.value).subscribe(() => {
Expand Down
Expand Up @@ -25,6 +25,6 @@ export const PATTERNS = {
nodeCountPattern: '^[1-9]\\d*$',
integerRegex: '^[0-9]*$',
folderRegex: /^[a-zA-Z0-9!@$^&*()_+\-=\[\]{};':|,.<>~` ]*$/,
libVersion: /^[a-zA-Z0-9_\-:/~.+`]*$/,
libVersion: /^[a-zA-Z0-9_\-:/~.+]*$/,
fullUrl: /^(http?|ftp|https):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+([.:])(\d{4}|com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*\/$/
};
Expand Up @@ -21,6 +21,7 @@ import {Component, EventEmitter, Inject, OnInit, Output} from '@angular/core';
import {FilterAuditModel} from '../filter-audit.model';
import {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from '@angular/material/dialog';
import {AuditService} from '../../../core/services/audit.service';
import {SortUtils} from '../../../core/util';


export interface AuditItem {
Expand Down Expand Up @@ -286,23 +287,35 @@ export class AuditInfoDialogComponent {
this.info = JSON.parse(data.element.info);
}
if (data.element.info.indexOf('Update quota') !== -1) {
this.data.element.info.replace(/->/g, ' ').split('/n').forEach( (val, j) => {
this.updateBudget[j] = [];
val.split(' ')
.forEach((v, i, arr) => {
if (arr[0] === 'Update') {
if (i === 1) {
this.updateBudget[j].push(`${arr[0]} ${arr[1]}`);
}
if (i > 1) {
this.updateBudget[j].push(arr[i]);
}
} else {
this.updateBudget[j].push(arr[i]);
}

});
});
this.updateBudget = data.element.info.split('\n').reduce((acc, v, i, arr) => {
const row = v.split(':').map((el, index) => {
if (el.indexOf('->') !== -1) {
el = el.split('->');
} else if (index === 1 && el.indexOf('->') === -1) {
el = ['', el];
}
return el;
});
acc.push(SortUtils.flatDeep(row, 1));
return acc;
}, []);
// this.data.element.info.replace(/->/g, ' ').split('\n').forEach( (val, j) => {
// this.updateBudget[j] = [];
// val.split(' ')
// .forEach((v, i, arr) => {
// if (arr[0] === 'Update') {
// if (i === 1) {
// this.updateBudget[j].push(`${arr[0]} ${arr[1]}`);
// }
// if (i > 1) {
// this.updateBudget[j].push(arr[i]);
// }
// } else {
// this.updateBudget[j].push(arr[i]);
// }
//
// });
// });
}
this.actionList = data.element.info.split('\n').map(v => v.split(':')).filter(v => v[0] !== '');
}
Expand Down
Expand Up @@ -100,7 +100,7 @@ <h4 class="modal-title">Bucket browser</h4>
</div>
<p class="path"><span>Bucket path:</span>
<span class="url ellipsis" [ngClass]="{'cursor-not-allow': bucketDataService.emptyFolder}">
<span *ngFor="let folder of this.objectPath">
<span class="path-folder" *ngFor="let folder of this.objectPath">
<span class="url-icon" *ngIf="this.objectPath.indexOf(folder) !== 0"> <i class="material-icons">
chevron_right
</i> </span>
Expand Down
Expand Up @@ -98,6 +98,10 @@
white-space: nowrap;
display: flex;

&-folder{
position: relative;
}

.url{
font-weight: 600;
overflow: hidden;
Expand All @@ -119,6 +123,7 @@
transform: translateY(1px);
font-size: 15px;
position: absolute;
left: 0;
}
}
}
Expand Down
Expand Up @@ -44,24 +44,24 @@ export class BucketDataService {

public refreshBucketdata(bucket, endpoint) {
let backetData = [];
this.bucketBrowserService.getBucketData(bucket, endpoint).subscribe(v => {
const copiedData = JSON.parse(JSON.stringify(v));
this.serverData = v;
// this.bucketBrowserService.getBucketData(bucket, endpoint).subscribe(v => {
// const copiedData = JSON.parse(JSON.stringify(v));
// this.serverData = v;
// if (this.emptyFolder) {
// copiedData.unshift(this.emptyFolder);
// }
//
// backetData = this.convertToFolderTree(copiedData);
// const data = this.buildFileTree({[bucket]: backetData}, 0);
// this._bucketData.next(data);
// });
if (this.emptyFolder) {
copiedData.unshift(this.emptyFolder);
array.unshift(this.emptyFolder);
}

backetData = this.convertToFolderTree(copiedData);
this.serverData = array;
backetData = this.convertToFolderTree(array);
const data = this.buildFileTree({[bucket]: backetData}, 0);
this._bucketData.next(data);
});
// if (this.emptyFolder) {
// array.unshift(this.emptyFolder);
// }
// this.serverData = array;
// backetData = this.convertToFolderTree(array);
// const data = this.buildFileTree({[bucket]: backetData}, 0);
// this._bucketData.next(data);
}

public buildFileTree(obj: {[key: string]: any}, level: number): TodoItemNode[] {
Expand Down
Expand Up @@ -291,7 +291,7 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
this.selectedImage = this.clusterTypes[0];
}
} else if (this.notebook_instance.template_name.toLowerCase().indexOf('jupyter notebook') !== -1 &&
this.selectedImage.image === 'docker.dlab-dataengine-service') {
this.selectedImage.image === 'docker.dlab-dataengine-service' && this.notebook_instance.cloud_provider !== 'gcp') {
filtered = filterShapes(v => v);
} else {
filtered = filterShapes(key => !(allowed.includes(key)));
Expand Down
Expand Up @@ -336,8 +336,11 @@ mat-chip.mat-chip:not(.mat-basic-chip) {
}

/* Tab info */
.list-header{
line-height: 40px;

.install-libraries{
.list-header{
line-height: 40px;
}
}

.mat-dialog-container {
Expand Down
Expand Up @@ -326,7 +326,9 @@ export class ResourcesGridComponent implements OnInit {
return list.filter((item: any) => { if (selectedItems.indexOf(item.status) !== -1) return item; });
};

if (filteredData.length) this.filtering = true;
if (filteredData.some((v) => v.exploratory.length)) {
this.filtering = true;
}
if (config) {
this.activeProject = config.project;
filteredData = filteredData
Expand Down
Expand Up @@ -25,7 +25,7 @@

.dropdown-list button,
.dropdown-multiselect button {
height: 38px;

width: 100%;
background: #fff;
padding-left: 15px;
Expand Down Expand Up @@ -66,13 +66,18 @@

.dropdown-multiselect {
button {
span {
span{
color: #999;
font-weight: 300;
display: inline-block;
max-width: 80%;
}

span:not(.caret-btn){
padding-top: 3px;
font-size: 14px;
}

.selected-items {
color: #4a5c89;
max-width: 477px;
Expand Down
Expand Up @@ -57,7 +57,7 @@ import {Endpoint} from '../../../administration/project/project.component';
<span class="strong blue">by a schedule in less than 15 minutes.</span>
</div>
<div class="alert" *ngIf="data.type === 'message'">
<span [innerHTML]="data.template"></span>
<span class='highlight'[innerHTML]="data.template"></span>
</div>
<div *ngIf="data.type === 'confirmation'" class="confirm-dialog">
<p *ngIf="data.template; else label">
Expand Down Expand Up @@ -172,8 +172,6 @@ import {Endpoint} from '../../../administration/project/project.component';
.bottom-message{padding-top: 15px;}
.table-header{padding-bottom: 10px;}
.alert{text-align: left; line-height: 22px; padding-bottom: 25px;padding-top: 15px;}
`]
})
export class NotificationDialogComponent {
Expand Down
Expand Up @@ -237,24 +237,24 @@ export class NavbarComponent implements OnInit, OnDestroy {
total_quota_and_project_inform_and_exceed: `Dear <span class="strong">${this.currentUserName}</span>,<br /><br />
DLab cloud infrastructure usage quota has been used for <span class="strong">${total_quota}%</span>.
Once quota is depleted all your analytical environment will be stopped.<br /><br />
Quota associated with project(s) <span class="strong">${exideedProjects}</span> has been exceeded. All your analytical environment will be stopped.<br /><br />
Quota associated with project(s) <span class="strong">${informProjects}</span> has been used over <span class="strong">${this.quotesLimit}%</span>.
Quota associated with project(s) <span class="strong">${exideedProjects.join(', ')}</span> has been exceeded. All your analytical environment will be stopped.<br /><br />
Quota associated with project(s) <span class="strong">${informProjects.join(', ')}</span> has been used over <span class="strong">${this.quotesLimit}%</span>.
If quota is depleted all your analytical environment will be stopped.<br /><br />
To proceed working with environment you'll have to request increase of quota from DLab administrator. `,

total_quota_and_project_exceed: `Dear <span class="strong">${this.currentUserName}</span>,<br /><br />
DLab cloud infrastructure usage quota has been used for <span class="strong">${total_quota}%</span>.
Once quota is depleted all your analytical environment will be stopped.<br /><br />
Quota associated with project(s) <span class="strong">${exideedProjects}</span> has been exceeded. All your analytical environment will be stopped.<br /><br />
Quota associated with project(s) <span class="strong">${exideedProjects.join(', ')}</span> has been exceeded. All your analytical environment will be stopped.<br /><br />
To proceed working with environment you'll have to request increase of quota from DLab administrator. `,

project_inform_and_exceed: `Dear <span class="strong">${this.currentUserName}</span>,<br /><br />
DLab cloud infrastructure usage quota associated with project(s) <span class="strong">${exideedProjects}</span> has been exceeded. All your analytical environment will be stopped.<br /><br />
Quota associated with project(s) <span class="strong">${informProjects}</span> has been used over <span class="strong">${this.quotesLimit}%</span>.
DLab cloud infrastructure usage quota associated with project(s) <span class="strong">${exideedProjects.join(', ')}</span> has been exceeded. All your analytical environment will be stopped.<br /><br />
Quota associated with project(s) <span class="strong">${informProjects.join(', ')}</span> has been used over <span class="strong">${this.quotesLimit}%</span>.
If quota is depleted all your analytical environment will be stopped.<br /><br />
To proceed working with environment, request increase of project quota from DLab administrator.`,
project_exceed: `Dear <span class="strong">${this.currentUserName}</span>,<br /><br />
DLab cloud infrastructure usage quota associated with project(s) <span class="strong">${exideedProjects}</span> has been exceeded.
DLab cloud infrastructure usage quota associated with project(s) <span class="strong">${exideedProjects.join(', ')}</span> has been exceeded.
All your analytical environment will be stopped.<br /><br />
To proceed working with environment,
request increase of project(s) quota from DLab administrator.`,
Expand All @@ -264,7 +264,7 @@ export class NavbarComponent implements OnInit, OnDestroy {
To proceed working with environment,
request increase application quota from DLab administrator.`,
project_quota: `Dear <span class="strong">${this.currentUserName}</span>,<br /><br />
Cloud infrastructure usage quota associated with project(s) <span class="strong">${informProjects}</span> has been used over <span class="strong">${this.quotesLimit}%</span>.
Cloud infrastructure usage quota associated with project(s) <span class="strong">${informProjects.join(', ')}</span> has been used over <span class="strong">${this.quotesLimit}%</span>.
Once quota is depleted all your analytical environment will be stopped.<br /><br />
To proceed working with environment you'll have to request increase of project(s) quota from DLab administrator.`,
total_quota: `Dear <span class="strong">${this.currentUserName}</span>,<br /><br />
Expand Down
Expand Up @@ -36,7 +36,7 @@ body.modal-open {
.mt-5 {margin-top: 5px}


.pr-3{padding-right: 3pxr7}
.pr-3{padding-right: 3px}

.pb-50 {padding-bottom: 50px;}

Expand Down
Expand Up @@ -850,6 +850,7 @@ mat-progress-bar {
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
0 2px 2px 0 rgba(0, 0, 0, 0.14),
0 1px 5px 0 rgba(0, 0, 0, 0.12);
top: 58px;

&.is-to:after {
left: 250px;
Expand Down Expand Up @@ -983,5 +984,7 @@ mat-progress-bar {
}
}

.alert .highlight .strong{ color: #35afd5}



0 comments on commit 95e1fa1

Please sign in to comment.