/** Give the message for the loading @public */
public message: string = 'PLEASEWAIT';
- /** List of NS Success Instances @private */
+ /** List of NS Success Instances @public */
public nsRunningInstance: string[] = [];
+ /** 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 */
this.nsFailedInstances.push(nsdInstanceData);
} else if (operationalStatus === 'running' && configStatus === 'configured') {
this.nsRunningInstance.push(nsdInstanceData.name);
+ 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';
+ }
+ },
legend: { display: false },
scales: {
xAxes: [{
display: true,
- ticks: {
- // tslint:disable-next-line: no-any
- 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;
- } else {
- return label;
- }
- }
- },
scaleLabel: {
display: true,
labelString: this.translateService.instant('INSTANCES')