/** Give the message for the loading @public */
public message: string = 'PLEASEWAIT';
- /** List of NS Success Instances @private */
- public nsRunningInstance: string[] = [];
+ /** List of NS Success Instances @public */
+ public nsRunningInstance: {}[] = [];
+
+ /** List of color for Instances @private */
+ private backgroundColor: string[] = [];
/** Utilizes rest service for any CRUD operations @private */
private restService: RestService;
/** Contians hour converter @private */
private hourConverter: number = 3600;
- /** Contians color code for chart @private */
- private chartColorPink: string = '#e4397c';
-
- /** Contians color code for chart @private */
- private chartColorPurple: string = '#605ca8';
-
- /** Contians color code for chart @private */
- private chartColorCyan: string = '#00c0ef';
-
- /** Contians color code for chart @private */
- private chartColorBlue: string = '#054C8C';
-
- /** Contians color code for chart @private */
- private chartColorYellow: string = '#ffce56';
-
constructor(injector: Injector) {
this.injector = injector;
this.restService = this.injector.get(RestService);
public getVnfdPackageCount(): void {
this.vnfdPackageCountSub = this.restService.getResource(environment.VNFPACKAGESCONTENT_URL)
.subscribe((vnfdPackageData: VNFDDetails[]) => {
- this.vnfdPackageCount = vnfdPackageData.length;
- }, (error: ERRORDATA) => {
- this.restService.handleError(error, 'get');
- });
+ this.vnfdPackageCount = vnfdPackageData.length;
+ }, (error: ERRORDATA) => {
+ this.restService.handleError(error, 'get');
+ });
}
/** Get NSD Package details @public */
public getNsdPackageCount(): void {
this.nsdPackageCountSub = this.restService.getResource(environment.NSDESCRIPTORSCONTENT_URL)
.subscribe((nsdPackageData: NSDDetails[]) => {
- this.nsdPackageCount = nsdPackageData.length;
- }, (error: ERRORDATA) => {
- this.restService.handleError(error, 'get');
- });
+ this.nsdPackageCount = nsdPackageData.length;
+ }, (error: ERRORDATA) => {
+ this.restService.handleError(error, 'get');
+ });
}
/** Get NS Instance details @public */
if (operationalStatus === 'failed' || configStatus === 'failed') {
this.nsFailedInstances.push(nsdInstanceData);
} else if (operationalStatus === 'running' && configStatus === 'configured') {
- this.nsRunningInstance.push(nsdInstanceData.name);
+ this.nsRunningInstance.push({ name: nsdInstanceData.name, id: nsdInstanceData.id });
+ this.backgroundColor.push(this.sharedService.generateColor());
this.createdTimes.push(((nsdInstanceData._admin.created).toString()).slice(0, this.sliceLimit));
}
});
datasets: [{
data: this.noOfHours,
label: this.translateService.instant('NOOFHOURS'),
- borderColor: [this.chartColorPurple, this.chartColorPink, this.chartColorCyan,
- this.chartColorBlue, this.chartColorYellow],
+ borderColor: this.backgroundColor,
fill: false,
- backgroundColor: [this.chartColorPurple, this.chartColorPink, this.chartColorCyan,
- this.chartColorBlue, this.chartColorYellow]
+ backgroundColor: this.backgroundColor
}]
},
options: {
+ hover: {
+ onHover(evt: Event, item: {}): void {
+ const el: HTMLElement = document.getElementById('canvas');
+ el.style.cursor = item[0] ? 'pointer' : 'default';
+ }
+ },
+ onClick(evt: Event, item: {}): void {
+ if (item[0] !== undefined) {
+ const location: string = '/instances/ns/' + item[0]._chart.data.labels[item[0]._index].id;
+ window.open(location);
+ }
+ },
legend: { display: false },
scales: {
xAxes: [{
callback: (label: any, index: number, labels: string): string => {
const length: number = 20;
const ending: string = '...';
- if (label.length > length) {
- return label.substring(0, length - ending.length) + ending;
+ if (label.name.length > length) {
+ return label.name.substring(0, length - ending.length) + ending;
} else {
- return label;
+ return label.name;
}
}
},
.content-section {
@include wh-value(100%, null);
@include transition(all, 0.3s, null, null);
+ @include flexbox(block, null, null, null, null, null);
overflow-x: auto;
}
}
<tr>
<td>
<b>{{'OPERATIONALSTATE' | translate}}:</b>
- <span class="badge ml-1" [ngClass]="{'badge-info':sdnDetails._admin.operationalState === operationalStateFirstStep,
+ <span class="badge ml-1" [ngClass]="{'badge-warning text-white':sdnDetails._admin.operationalState === operationalStateFirstStep,
'badge-success':sdnDetails._admin.operationalState === operationalStateSecondStep,
'badge-danger':sdnDetails._admin.operationalState === operationalStateThirdStep}">
{{(sdnDetails._admin.operationalState)?sdnDetails._admin.operationalState:''}}</span>
container="body" ngbTooltip="{{'DELETE' | translate}}">
<i class="far fa-trash-alt icons"></i>
</button>
- <div ngbDropdown class="btn-group">
+ <div class="btn-group" ngbDropdown display="dynamic" container="body">
<button type="button" class="btn btn-primary dropdown-toggle action-button" ngbDropdownToggle>
{{'ACTION' | translate}}
</button>
- <div class="dropdown-menu" ngbDropdownMenu>
+ <div class="dropdown-menu list-action-dropdown" ngbDropdownMenu>
<button type="button" class="btn btn-primary dropdown-item" (click)="historyOfOperations()" placement="left"
container="body" ngbTooltip="{{'HISTORYOFOPERATIONS' | translate}}">
<i class="fas fa-history"></i> {{'HISTORYOFOPERATIONS' | translate}}
ngbTooltip="{{'DELETE' | translate}}">
<i class="far fa-trash-alt icons"></i>
</button>
- <div ngbDropdown class="btn-group">
+ <div class="btn-group" ngbDropdown display="dynamic" container="body">
<button type="button" class="btn btn-primary dropdown-toggle action-button" ngbDropdownToggle>
{{'ACTION' | translate}}
</button>
- <div class="dropdown-menu" ngbDropdownMenu>
+ <div class="dropdown-menu list-action-dropdown" ngbDropdownMenu>
<button type="button" class="btn btn-primary dropdown-item" (click)="infoNs()" placement="left"
container="body" ngbTooltip="{{'INFO' | translate}}">
<i class="fas fa-info icons list" title="info"></i> {{'INFO' | translate}}
ngbTooltip="{{'DELETE' | translate}}">
<i class="far fa-trash-alt icons"></i>
</button>
- <div ngbDropdown class="btn-group">
+ <div class="btn-group" ngbDropdown display="dynamic" container="body">
<button type="button" class="btn btn-primary dropdown-toggle action-button" ngbDropdownToggle>
{{'ACTION' | translate}}
</button>
- <div class="dropdown-menu" ngbDropdownMenu>
+ <div class="dropdown-menu list-action-dropdown" ngbDropdownMenu>
<button type="button" class="btn btn-primary dropdown-item" (click)="nsdEdit()" placement="left"
container="body" ngbTooltip="{{'EDIT' | translate}}">
<i class="fa fa-edit icons"></i> {{'EDIT' | translate}}
Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
-->
<div class="btn-group list action" role="group">
- <div ngbDropdown class="btn-group">
+ <div class="btn-group" ngbDropdown display="dynamic" container="body">
<button type="button" class="btn btn-primary dropdown-toggle action-button" ngbDropdownToggle>
{{'ACTION' | translate}}
</button>
- <div class="dropdown-menu" ngbDropdownMenu>
+ <div class="dropdown-menu list-action-dropdown" ngbDropdownMenu>
<button type="button" class="btn btn-primary dropdown-item" (click)="projectEdit()" placement="left"
container="body" ngbTooltip="{{'RENAME' | translate}}">
<i class="fa fa-edit icons"></i> {{'RENAME' | translate}}
Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
-->
<div class="btn-group list action" role="group">
- <div ngbDropdown class="btn-group">
+ <div class="btn-group" ngbDropdown display="dynamic" container="body">
<button type="button" class="btn btn-primary dropdown-toggle action-button" ngbDropdownToggle>
{{'ACTION' | translate}}
</button>
- <div class="dropdown-menu" ngbDropdownMenu>
+ <div class="dropdown-menu list-action-dropdown" ngbDropdownMenu>
<button type="button" class="btn btn-primary dropdown-item" (click)="editRole()" placement="left"
container="body" ngbTooltip="{{'EDIT' | translate}}">
<i class="fa fa-edit icons"></i> {{'EDIT' | translate}}
Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
-->
<div class="btn-group list action" role="group">
- <div ngbDropdown class="btn-group">
+ <div class="btn-group" ngbDropdown display="dynamic" container="body">
<button type="button" class="btn btn-primary dropdown-toggle action-button" ngbDropdownToggle>
{{'ACTION' | translate}}
</button>
- <div class="dropdown-menu" ngbDropdownMenu>
+ <div class="dropdown-menu list-action-dropdown" ngbDropdownMenu>
<button type="button" class="btn btn-primary dropdown-item" (click)="editUserModal('editPassword')" placement="left" container="body"
ngbTooltip="{{'PAGE.USERS.EDITCREDENTIALS' | translate}}">
<i class="fa fa-edit icons"></i> {{'PAGE.USERS.EDITCREDENTIALS' | translate}}
ngbTooltip="{{'DELETE' | translate}}">
<i class="far fa-trash-alt icons"></i>
</button>
- <div ngbDropdown class="btn-group">
+ <div class="btn-group" ngbDropdown display="dynamic" container="body">
<button type="button" class="btn btn-primary dropdown-toggle action-button" ngbDropdownToggle>
{{'ACTION' | translate}}
</button>
- <div class="dropdown-menu" ngbDropdownMenu>
+ <div class="dropdown-menu list-action-dropdown" ngbDropdownMenu>
<button type="button" class="btn btn-primary dropdown-item" (click)="vnfdEdit()" placement="left"
container="body" ngbTooltip="{{'EDIT' | translate}}">
<i class="fa fa-edit icons"></i> {{'EDIT' | translate}}
</tr>
<tr>
<td>
- <b>{{'OPERATIONALSTATE' | translate}}:</b><span class="ml-1 badge" [ngClass]="{'badge-info':wimDetails._admin.operationalState === operationalStateFirstStep,
+ <b>{{'OPERATIONALSTATE' | translate}}:</b><span class="ml-1 badge" [ngClass]="{'badge-warning text-white':wimDetails._admin.operationalState === operationalStateFirstStep,
'badge-success':wimDetails._admin.operationalState === operationalStateSecondStep,
'badge-danger':wimDetails._admin.operationalState === operationalStateThirdStep}">
{{(wimDetails._admin.operationalState)?wimDetails._admin.operationalState:''}}
* {
outline: 0;
}
-button[type=submit]:focus, .sidebar-body button[type=button]:focus {
+button[type="submit"]:focus,
+.sidebar-body button[type="button"]:focus {
@include box-shadow(0, 0, 0, 0.2rem, lighten($primary, 50%) !important);
}
-.btn-danger:focus{
+.btn-danger:focus {
@include box-shadow(0, 0, 0, 0.2rem, lighten($danger, 30%) !important);
}
body,
.scroll-box,
.smarttable-style,
.modal-body-custom-height,
-.layout-wrapper, .CodeMirror-vscrollbar, .ng-sidebar, .runninginstances .popover-body {
+.layout-wrapper,
+.CodeMirror-vscrollbar,
+.ng-sidebar,
+.runninginstances .popover-body {
&::-webkit-scrollbar {
@include wh-value(10px, null);
}
@include background(null, $theme-bg-color, null, null, null);
}
/** Vim Show running instance Details **/
- .runninginstances{
- width:200px;
- .popover-body{
+ .runninginstances {
+ width: 200px;
+ .popover-body {
max-height: 200px;
overflow-y: scroll;
- }
+ }
}
/****************************************************************************/
/************************** Smart table custom design ***********************/
}
}
}
- .dropdown-menu {
- @include border(all, 1, solid, $primary);
- @include padding-value(0, 0, 0, 0);
- button.btn.btn-primary {
- @include background(null, transparent, null, null, null);
- @include padding-value(8, 8, 8, 8);
- @include roundedCorners(0);
- &:hover {
- @include background(null, $primary, null, null, null);
- color: $white;
- }
- &:not(:last-child) {
- @include border(bottom, 1, solid, $primary);
- }
+ }
+ /****************************************************************************/
+ /*********************** List Action Dropdown section ***********************/
+ /****************************************************************************/
+ .list-action-dropdown {
+ @include border(all, 1, solid, $primary);
+ @include padding-value(0, 0, 0, 0);
+ button.btn.btn-primary {
+ @include background(null, transparent, null, null, null);
+ @include padding-value(8, 8, 8, 8);
+ @include roundedCorners(0);
+ color: $primary;
+ &:hover {
+ @include background(null, $primary, null, null, null);
+ color: $white;
+ }
+ &:not(:last-child) {
+ @include border(bottom, 1, solid, $primary);
}
}
}
/****************************************************************************/
@media (max-width: map-get($grid-breakpoints, md)) {
.smarttable-style {
+ @include flexbox(block, null, null, null, null, null);
overflow-x: auto;
white-space: nowrap;
}
/** Service holds the router information @private */
private router: Router;
+ /** Random color string generator length @private */
+ private colorStringLength: number = 256;
+
/** Check for the root directory @private */
private directoryCount: number = 2;
this.restService.handleError(error, 'get');
});
}
+ /** Random RGB color code generator @public */
+ public generateColor(): string {
+ const x: number = Math.floor(Math.random() * this.colorStringLength);
+ const y: number = Math.floor(Math.random() * this.colorStringLength);
+ const z: number = Math.floor(Math.random() * this.colorStringLength);
+ return 'rgb(' + x + ',' + y + ',' + z + ')';
+ }
/** Method to validate file extension and size @private */
private vaildataFileInfo(fileInfo: File, fileType: string): boolean {
const extension: string = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);