Commit 3f8c4b35 authored by Aaron Gutierrez's avatar Aaron Gutierrez

creacion de componentes dashboard

parent 592c0764
......@@ -1824,15 +1824,23 @@
}
},
"@xdf/gallery": {
"version": "file:../../XDF/ng-byte-framework/dist/xdf-gallery/xdf-gallery-1.0.8.tgz",
"integrity": "sha512-eOUgs9LGPAVJh/pPBwbNfv+3ZlIlmm7YgO01lFzZUD9bzETOxIfj3DpOluRE4WZxL2UBLB+c3uYjczwoEnEPlg==",
"version": "file:../../XDF/ng-byte-framework/dist/xdf-gallery/xdf-gallery-1.0.15.tgz",
"integrity": "sha512-N+Lca09t72pCmqDBTWD4wMq3EfO5Yh5dhLNUh9GcsnDs4/e3wwoxYOEXVAdNyojpCg6hud3tBoGmr7IR17mhuQ==",
"requires": {
"tslib": "^1.9.0"
}
},
"@xdf/graph": {
"version": "file:../../Cuenta corriente/ccb-workspace/dist/xdf-graph/xdf-graph-0.0.1.tgz",
"integrity": "sha512-Am44vHFa3yrknhS0nzvfHXZIZDuNJq2iKNU6jlcT7HOVdaiVH4cHrHaBxB8OP6u7QaZR3BKi+rUoHHhYNFKzUw==",
"requires": {
"tslib": "^1.9.0"
}
},
"@xdf/layouts": {
"version": "file:../../XDF/ng-byte-framework/dist/xdf-layouts/xdf-layouts-1.0.1.tgz",
"integrity": "sha512-yF8ay/2Yc2/o3AjBIcNkMIY0PmKD/OEfu1GHVymfVUWp3F5BrTXYo3Lvy1Nz/E+GEN9aDtGEkyrZe0zpzO+Irg==",
"version": "1.0.3",
"resolved": "http://192.168.27.7:4873/@xdf%2flayouts/-/layouts-1.0.3.tgz",
"integrity": "sha512-bLcyoQpl3Xk7QSz8jnX/G4RdhuUfOI3+htwZ5iag0dly/tjY3+LclDNMNIRnYo0QVRTYBQQiClOTG2QT0/hWJg==",
"requires": {
"tslib": "^1.9.0"
}
......@@ -2022,6 +2030,15 @@
"integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=",
"dev": true
},
"angular-gauge-chart": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/angular-gauge-chart/-/angular-gauge-chart-0.7.2.tgz",
"integrity": "sha512-KVyf6suQiDrcc7ncjhdXKX23S0INgm4Rv5H2W1zXJoYQXZ7VQ1y742u/yH6faZw1rfBpC2KBx2IqRnBHXWL6Gw==",
"requires": {
"gauge-chart": "^0.5.1",
"tslib": "^1.9.0"
}
},
"angular-highcharts": {
"version": "9.0.11",
"resolved": "https://registry.npmjs.org/angular-highcharts/-/angular-highcharts-9.0.11.tgz",
......@@ -4459,6 +4476,15 @@
"d3-time-format": "2"
}
},
"d3-scale-chromatic": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-1.5.0.tgz",
"integrity": "sha512-ACcL46DYImpRFMBcpk9HhtIyC7bTBR4fNOPxwVSl0LfulDAwyiHyPOTqcDG1+t5d4P9W7t/2NAuWu59aKko/cg==",
"requires": {
"d3-color": "1",
"d3-interpolate": "1"
}
},
"d3-selection": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz",
......@@ -6488,6 +6514,15 @@
"resolved": "http://192.168.27.7:4873/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"gauge-chart": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/gauge-chart/-/gauge-chart-0.5.3.tgz",
"integrity": "sha512-AsupJVuWToUa/3hEp6Q9IRGUQZKyeCBBRRZGJKhZvfsx31QXdPsmifew+L9r5x5TbxXwcrPpaBm7RLBX0p6CMw==",
"requires": {
"d3": "^4.13.0",
"d3-scale-chromatic": "^1.1.1"
}
},
"genfun": {
"version": "5.0.0",
"resolved": "http://192.168.27.7:4873/genfun/-/genfun-5.0.0.tgz",
......
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { BaseLayoutComponent, NotFoundComponent, CustomLayoutComponent } from '@xdf/layouts';
import { CustomLayoutComponent, NotFoundComponent } from '@xdf/layouts';
import { AuthGuard, LoginComponent } from '@xdf/security';
import { BytebotLayoutComponent } from './modules/bytebot-layout/bytebot-layout/bytebot-layout.component';
import { HomeComponent } from './views/home/home.component';
const routes: Routes = [
......@@ -25,6 +26,10 @@ const routes: Routes = [
path: 'configuration', data: { breadcrumb: 'Agentes' }, canLoad: [AuthGuard],
loadChildren: () => import('./modules/agent/agent.module').then(m => m.AgentModule)
},
{
path: 'dashboards', data: { breadcrumb: 'Dashboards' }, canLoad: [AuthGuard],
loadChildren: () => import('./modules/dashboards/dashboards.module').then(m => m.DashboardsModule)
},
],
canActivate: [AuthGuard]
},
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -111,19 +111,19 @@ export function createTranslateLoader(http: HttpClient) {
{ provide: ResourceAuthGuard, useClass: ResourceAuthGuard },
// descomentar estas lineas para OAUTH
{ provide: AuthGuard, useClass: OAuthGuard },
{ provide: AuthenticationService, useClass: OAuthAuthenticationService },
{ provide: APP_INITIALIZER, useFactory: loginLoaderFactory, deps: [AuthenticationService], multi: true },
// { provide: AuthGuard, useClass: OAuthGuard },
// { provide: AuthenticationService, useClass: OAuthAuthenticationService },
// { provide: APP_INITIALIZER, useFactory: loginLoaderFactory, deps: [AuthenticationService], multi: true },
// Para probar mantenimientos
// comentar estas lineas para OAUTH
// { provide: AuthGuard, useClass: AuthGuard},
// { provide: AuthenticationService, useClass: ByteAuthenticationService },
// { provide: HTTP_INTERCEPTORS, useClass: AuthenticationFakeBackendInterceptor, multi: true},
{ provide: AuthGuard, useClass: AuthGuard},
{ provide: AuthenticationService, useClass: ByteAuthenticationService },
{ provide: HTTP_INTERCEPTORS, useClass: AuthenticationFakeBackendInterceptor, multi: true},
{ provide: HTTP_INTERCEPTORS, useClass: SettingsFakeBackendInterceptor, multi: true },
//{ provide: HTTP_INTERCEPTORS, useClass: CustomProgramsFakeBackendInterceptor, multi: true },
// { provide: HTTP_INTERCEPTORS, useClass: AgentFakeBackendInterceptor, multi: true },
{ provide: HTTP_INTERCEPTORS, useClass: CustomProgramsFakeBackendInterceptor, multi: true },
{ provide: HTTP_INTERCEPTORS, useClass: AgentFakeBackendInterceptor, multi: true },
{ provide: APP_INITIALIZER, useFactory: init_app, deps: [InitCommonsService, TranslateService], multi: true }
......
File mode changed from 100644 to 100755
/*
* Inspinia js helpers:
*
* correctHeight() - fix the height of main wrapper
* detectBody() - detect windows size
* smoothlyMenu() - add smooth fade in/out on navigation show/ide
*
*/
// import * as jQuery_ from 'jquery';
// const jQuery = jQuery_;
declare var jQuery: any;
export function correctHeight() {
const pageWrapper = jQuery('#page-wrapper');
const navbarHeight = jQuery('nav.navbar-default').height();
const wrapperHeight = pageWrapper.height();
if (navbarHeight > wrapperHeight) {
pageWrapper.css('min-height', navbarHeight + 'px');
}
if (navbarHeight <= wrapperHeight) {
if (navbarHeight < jQuery(window).height()) {
pageWrapper.css('min-height', jQuery(window).height() + 'px');
} else {
pageWrapper.css('min-height', navbarHeight + 'px');
}
}
if (jQuery('body').hasClass('fixed-nav')) {
if (navbarHeight > wrapperHeight) {
pageWrapper.css('min-height', navbarHeight + 'px');
} else {
pageWrapper.css('min-height', jQuery(window).height() - 60 + 'px');
}
}
}
export function detectBody() {
if (jQuery(document).width() < 769) {
jQuery('body').addClass('body-small');
} else {
jQuery('body').removeClass('body-small');
}
}
export function smoothlyMenu() {
if (!jQuery('body').hasClass('mini-navbar') || jQuery('body').hasClass('body-small')) {
// Hide menu in order to smoothly turn on when maximize menu
jQuery('#side-menu').hide();
// For smoothly turn on menu
setTimeout(
() => {
jQuery('#side-menu').fadeIn(400);
}, 200);
} else if (jQuery('body').hasClass('fixed-sidebar')) {
jQuery('#side-menu').hide();
setTimeout(
() => {
jQuery('#side-menu').fadeIn(400);
}, 100);
} else {
// Remove all inline style from jquery fadeIn function to reset menu state
jQuery('#side-menu').removeAttr('style');
}
}
export function fixHeight() {
const heightWithoutNavbar = jQuery('body > #wrapper').height() - 62;
jQuery('.sidebar-panel').css('min-height', heightWithoutNavbar + 'px');
const navbarheight = jQuery('nav.navbar-default').height();
const wrapperHeight = jQuery('#page-wrapper').height();
if (navbarheight > wrapperHeight) {
jQuery('#page-wrapper').css('min-height', navbarheight + 'px');
}
if (navbarheight < wrapperHeight) {
jQuery('#page-wrapper').css('min-height', jQuery(window).height() + 'px');
}
if (jQuery('body').hasClass('fixed-nav')) {
if (navbarheight > wrapperHeight) {
jQuery('#page-wrapper').css('min-height', navbarheight + 'px');
} else {
jQuery('#page-wrapper').css('min-height', jQuery(window).height() - 60 + 'px');
}
}
}
import { NgModule } from '@angular/core';
import { DirtyGuard, XdfGalleryModule } from '@xdf/gallery';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core';
import { XdfSettingsModule } from '@xdf/settings';
import { BytebotLayoutComponent } from './bytebot-layout/bytebot-layout.component';
import { LayoutModule } from '@angular/cdk/layout';
@NgModule({
declarations: [
BytebotLayoutComponent
],
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
TranslateModule,
LayoutModule
],
entryComponents:[
],
exports: [
BytebotLayoutComponent
]
,
providers: [
{ provide: DirtyGuard, useClass: DirtyGuard }
]
})
export class BytebotLayoutModule { }
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BytebotLayoutComponent } from './bytebot-layout.component';
describe('BytebotLayoutComponent', () => {
let component: BytebotLayoutComponent;
let fixture: ComponentFixture<BytebotLayoutComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ BytebotLayoutComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(BytebotLayoutComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, HostListener, OnInit } from '@angular/core';
import { detectBody } from '../app.helpers';
@Component({
selector: 'byte-bytebot-layout',
templateUrl: './bytebot-layout.component.html',
styleUrls: ['./bytebot-layout.component.scss']
})
export class BytebotLayoutComponent implements OnInit {
constructor(//protected toogleService: ToogleService
) { }
ngOnInit() {
detectBody();
}
@HostListener('window:resize')
public onResize() {
detectBody();
}
gotoTop() {
console.log('custom-layout');
}
onToggle() {
console.log("test");
//this.toogleService.onToggle(true);
}
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CustomerActivityWidgetComponent } from './customer-activity-widget.component';
describe('CustomerActivityWidgetComponent', () => {
let component: CustomerActivityWidgetComponent;
let fixture: ComponentFixture<CustomerActivityWidgetComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CustomerActivityWidgetComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CustomerActivityWidgetComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { Chart } from 'angular-highcharts';
@Component({
selector: 'byte-customer-activity-widget',
templateUrl: './customer-activity-widget.component.html',
styleUrls: ['./customer-activity-widget.component.scss']
})
export class CustomerActivityWidgetComponent implements OnInit {
chart = new Chart({
chart: {
type: 'area'
},
accessibility: {
description: 'Image description: An area chart compares the nuclear stockpiles of the USA and the USSR/Russia between 1945 and 2017. The number of nuclear weapons is plotted on the Y-axis and the years on the X-axis. The chart is interactive, and the year-on-year stockpile levels can be traced for each country. The US has a stockpile of 6 nuclear weapons at the dawn of the nuclear age in 1945. This number has gradually increased to 369 by 1950 when the USSR enters the arms race with 6 weapons. At this point, the US starts to rapidly build its stockpile culminating in 32,040 warheads by 1966 compared to the USSR’s 7,089. From this peak in 1966, the US stockpile gradually decreases as the USSR’s stockpile expands. By 1978 the USSR has closed the nuclear gap at 25,393. The USSR stockpile continues to grow until it reaches a peak of 45,000 in 1986 compared to the US arsenal of 24,401. From 1986, the nuclear stockpiles of both countries start to fall. By 2000, the numbers have fallen to 10,577 and 21,000 for the US and Russia, respectively. The decreases continue until 2017 at which point the US holds 4,018 weapons compared to Russia’s 4,500.'
},
title: {
text: 'US and USSR nuclear stockpiles'
},
subtitle: {
text: 'Sources: <a href="https://thebulletin.org/2006/july/global-nuclear-stockpiles-1945-2006">' +
'thebulletin.org</a> & <a href="https://www.armscontrol.org/factsheets/Nuclearweaponswhohaswhat">' +
'armscontrol.org</a>'
},
xAxis: {
allowDecimals: false,
labels: {
},
accessibility: {
rangeDescription: 'Range: 1940 to 2017.'
}
},
yAxis: {
title: {
text: 'Nuclear weapon states'
},
labels: {
formatter: function () {
return this.value / 1000 + 'k';
}
}
},
tooltip: {
pointFormat: '{series.name} had stockpiled <b>{point.y:,.0f}</b><br/>warheads in {point.x}'
},
plotOptions: {
area: {
pointStart: 1940,
marker: {
enabled: false,
symbol: 'circle',
radius: 2,
states: {
hover: {
enabled: true
}
}
}
}
},
series: [{
name: 'USA',
data: [
null, null, null, null, null, 6, 11, 32, 110, 235,
369, 640, 1005, 1436, 2063, 3057, 4618, 6444, 9822, 15468,
20434, 24126, 27387, 29459, 31056, 31982, 32040, 31233, 29224, 27342,
26662, 26956, 27912, 28999, 28965, 27826, 25579, 25722, 24826, 24605,
24304, 23464, 23708, 24099, 24357, 24237, 24401, 24344, 23586, 22380,
21004, 17287, 14747, 13076, 12555, 12144, 11009, 10950, 10871, 10824,
10577, 10527, 10475, 10421, 10358, 10295, 10104, 9914, 9620, 9326,
5113, 5113, 4954, 4804, 4761, 4717, 4368, 4018
]
}, {
name: 'USSR/Russia',
data: [null, null, null, null, null, null, null, null, null, null,
5, 25, 50, 120, 150, 200, 426, 660, 869, 1060,
1605, 2471, 3322, 4238, 5221, 6129, 7089, 8339, 9399, 10538,
11643, 13092, 14478, 15915, 17385, 19055, 21205, 23044, 25393, 27935,
30062, 32049, 33952, 35804, 37431, 39197, 45000, 43000, 41000, 39000,
37000, 35000, 33000, 31000, 29000, 27000, 25000, 24000, 23000, 22000,
21000, 20000, 19000, 18000, 18000, 17000, 16000, 15537, 14162, 12787,
12600, 11400, 5500, 4512, 4502, 4502, 4500, 4500
]
}] as Array<any>
});
constructor() { }
ngOnInit() {
}
}
<rg-gauge-chart
[canvasWidth]="canvasWidth"
[needleValue]="value"
[centralLabel]="centralLabel"
[options]="options"
[name]="name"
[bottomLabel]="bottomLabel" *ngIf="options"></rg-gauge-chart>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { GaugeChartComponent } from './gauge-chart.component';
describe('GaugeChartComponent', () => {
let component: GaugeChartComponent;
let fixture: ComponentFixture<GaugeChartComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ GaugeChartComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(GaugeChartComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, Input, OnInit } from '@angular/core';
export class GaugeChart {
hasNeedle?: boolean;
needleColor?: string;
needleUpdateSpeed?: number;
arcColors?: Array<string>;
arcDelimiters?: Array<number>;
rangeLabel?: Array<string>;
needleStartValue?: number;
}
export const DEFAULT_OPTIONS_GAUGE_CHART: GaugeChart = {
hasNeedle: true,
needleColor: '#5D2418',
needleUpdateSpeed: 1000,
arcColors: ['#1ab394', '#f8ac59', '#ed5565'],
arcDelimiters: [20, 50],
rangeLabel: ['0', '100'],
needleStartValue: 50,
}
@Component({
selector: 'byte-gauge-chart',
templateUrl: './gauge-chart.component.html',
styleUrls: ['./gauge-chart.component.scss']
})
export class GaugeChartComponent implements OnInit {
@Input()
name: string = "Gauge chart";
@Input()
value: any = 1.2;
@Input()
unit: string = "s";
@Input()
options: GaugeChart;
canvasWidth = 300
centralLabel = ''
bottomLabel = '';
constructor() { }
ngOnInit() {
this.bottomLabel = this.value + ' ' + this.unit;
if (!this.options) {
this.options = DEFAULT_OPTIONS_GAUGE_CHART;
}
}
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HeatMapComponent } from './heat-map.component';
describe('HeatMapComponent', () => {
let component: HeatMapComponent;
let fixture: ComponentFixture<HeatMapComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HeatMapComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(HeatMapComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnDestroy, OnInit } from '@angular/core';
//import { ToogleService } from '@xdf/layouts';
import { Chart } from 'angular-highcharts';
import * as Highcharts from 'highcharts';
import { Subscription } from 'rxjs';
@Component({
selector: 'byte-heat-map',
templateUrl: './heat-map.component.html',
styleUrls: ['./heat-map.component.scss']
})
export class HeatMapComponent implements OnInit, OnDestroy {
subscriptionToogle: Subscription;
constructor(
//protected toogleService: ToogleService
) {
}
ngOnDestroy(): void {
if (this.subscriptionToogle) {
this.subscriptionToogle.unsubscribe();
}
}
chart: Chart;
// chart = new Chart({
// chart: {
// type: 'spline',
// marginRight: 10,
// events: {
// load: function () {
// // set up the updating of the chart each second
// const series = this.series[0];
// setInterval(function () {
// const x = (new Date()).getTime(), // current time
// y = Math.random();
// series.addPoint([x, y], true, true);
// }, 1000);
// }
// }
// },
// title: {
// text: 'Live random data'
// },
// xAxis: {
// type: 'datetime',
// tickPixelInterval: 150
// },
// yAxis: {
// title: {
// text: 'Value'
// },
// plotLines: [{
// value: 0,
// width: 1,
// color: '#808080'
// }]
// },
// tooltip: {
// formatter: function () {
// return '<b>' + this.series.name + '</b><br/>' +
// Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' +
// Highcharts.numberFormat(this.y, 2);
// }
// },
// legend: {
// enabled: false
// },
// exporting: {
// enabled: false
// },
// series: [{
// name: 'Random data',
// data: (function () {
// // generate an array of random data
// const data = [],
// time = (new Date()).getTime();
// let i: any;
// for (i = -19; i <= 0; i += 1) {
// data.push({
// x: time + i * 1000,
// y: Math.random()
// });
// }
// return data;
// }())
// }] as Array<any>
// });
ngOnInit() {
this.chart = new Chart({
chart: {
type: 'heatmap',
events: {
load: function(event:any) {
event.target.reflow();
}
}
},
boost: {
useGPUTranslations: true
},
credits: {
enabled: false
},
title: {
text: 'Cantidad de mensajes por horario de actividad del cliente',
align: 'center',
x: 40
},
xAxis: {
type: 'datetime',
min: Date.UTC(2020, 0, 1),
max: Date.UTC(2020, 0, 10, 59, 59, 59),
labels: {
align: 'left',
x: 5,
y: 14,
format: '{value:%d/%m %H:%M}' // long month
},
showLastLabel: false,
tickLength: 10,
tickWidth: 1
},
yAxis: {
title: {
text: null
},
labels: {
formatter: function () {
return 'H' + (this.value + 1) + ': ' + (3*this.value < 10 ? '0' : '') + 3*this.value + ':00' + ' - ' + ((this.value + 3) < 10 ? '0' : '') + (this.value + 3) + ':00';
},
format: 'H{value:}:{3*value}:00 - {value + 3}:00'
},
minPadding: 0,
maxPadding: 0,
startOnTick: false,
endOnTick: false,
tickPositions: [0, 1, 2, 3, 4, 5, 6, 7],
tickWidth: 1,
min: 0,
max: 7,
reversed: true
},
colorAxis: {
stops: [
[0, '#1c84c6'],
[0.5, '#23c6c8'],
[1, '#E1F5B1']
],
min: -15,
max: 25,
startOnTick: false,
endOnTick: false,
labels: {
format: '{value}'
}
},
series: [{
boostThreshold: 100,
borderWidth: 0,
nullColor: '#DDD',
borderColor: '#ddd',
colsize: 24 * 36e5, // one day
tooltip: {
headerFormat: '{point.x:%e %b}',
pointFormat: '{point.x:%e %b, %Y} {point.y}:00: <b>{point.value} ℃</b>'
},
turboThreshold: Number.MAX_VALUE, // #3404, remove after 4.0.5 release
data: [
[1577854800000, 0, 2.7],
[1577854800000, 1, 2.5],
[1577854800000, 2, 3.5],
[1577854800000, 3, 4.5],
[1577854800000, 4, 5.5],
[1577854800000, 5, 2.5],
[1577854800000, 6, 2.5],
[1577854800000, 7, 2.5],
[1577854800000, 8, 2.5],
[1577854800000, 9, 2.5],
[1577854800000, 10, 2.5],
[1577854800000, 11, 2.5],
[1577854800000, 12, 2.5],
[1577854800000, 13, 2.5],
[1577854800000, 14, 2.5],
[1577854800000, 15, 2.5],
[1577854800000, 16, 2.5],
[1577854800000, 17, 2.5],
[1577854800000, 18, 2.5],
[1577854800000, 19, 2.5],
[1577854800000, 20, 2.5],
[1577854800000, 21, 2.5],
[1577854800000, 22, 2.5],
[1577854800000, 23, 2.5], //1577941200000
[1577941200000, 0, 9],
[1577941200000, 1, 11],
[1577941200000, 2, 12],
[1577941200000, 3, 11],
[1577941200000, 4, 15],
[1577941200000, 5, 16],
[1577941200000, 6, 17],
[1577941200000, 7, 18],
[1577941200000, 8, 19],
[1577941200000, 9, 11],
[1577941200000, 10, 12],
[1577941200000, 11, 13],
[1577941200000, 12, 14],
[1577941200000, 13, 12],
[1577941200000, 14, 15],
[1577941200000, 15, 19],
[1577941200000, 16, 20],
[1577941200000, 17, 16],
[1577941200000, 18, 18],
[1577941200000, 19, 15],
[1577941200000, 20, 15],
[1577941200000, 21, 15],
[1577941200000, 22, 15],
[1577941200000, 23, 15],
[1578027600000, 0, 13],
[1578027600000, 1, 12],
[1578027600000, 2, 3],
[1578027600000, 3, 12],
[1578027600000, 4, 4],
[1578027600000, 5, 8],
[1578027600000, 6, 15],
[1578027600000, 7, 12],
[1578027600000, 8, 19],
[1578027600000, 9, 2],
[1578027600000, 10, 16],
[1578027600000, 11, 16],
[1578027600000, 12, 19],
[1578027600000, 13, 9],
[1578027600000, 14, 7],
[1578027600000, 15, 19],
[1578027600000, 16, 9],
[1578027600000, 17, 13],
[1578027600000, 18, 17],
[1578027600000, 19, 13],
[1578027600000, 20, 16],
[1578027600000, 21, 10],
[1578027600000, 22, 10],
[1578027600000, 23, 19],
[1578114000000, 0, 17], [1578114000000, 1, 6], [1578114000000, 2, 13], [1578114000000, 3, 4], [1578114000000, 4, 7], [1578114000000, 5, 4], [1578114000000, 6, 9], [1578114000000, 7, 9], [1578114000000, 8, 3], [1578114000000, 9, 9], [1578114000000, 10, 11], [1578114000000, 11, 7], [1578114000000, 12, 14], [1578114000000, 13, 15], [1578114000000, 14, 8], [1578114000000, 15, 11], [1578114000000, 16, 14], [1578114000000, 17, 19], [1578114000000, 18, 3], [1578114000000, 19, 20], [1578114000000, 20, 6], [1578114000000, 21, 13], [1578114000000, 22, 10], [1578114000000, 23, 18], [1578114000000, 24, 16]
]
}] as Array<any>
});
// this.subscriptionToogle = this.toogleService.changeEmitted$.subscribe(change => {
// setTimeout(() => {
// Highcharts.charts.forEach(chart => chart.reflow());;
// console.log("test");
// }, 500);
// });
}
}
<div class="ccard h-100 d-flex flex-column px-2 py-3">
<div class="d-flex text-center">
<div class="flex-grow-1 mb-3">
<div class="text-nowrap lh text-100 text-dark-l2">
{{ header | translate }}
</div>
<div class="lh">
<span class="text-170 text-secondary-d4">
{{ value?.value | number:'1.0':'en-US' }}
</span>
<small>min</small>
</div>
</div>
</div>
<div class="align-self-center">
<xdf-peity #peti [values]="value?.history" [type]="'line'" theme="primary" [attributes]='options'></xdf-peity>
</div>
</div>
\ No newline at end of file
.ccard {
box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
border-radius: .5rem;
border: 1px solid #e0e5e8;
background-color: #fff;
position: relative;
}
.text-dark-l2 {
color: #60626a!important;
}
.text-100 {
font-size: 1em!important;
}
.text-secondary-d4 {
color: #4c5b70!important;
}
.text-170 {
font-size: 1.7em!important;
}
.text-blue {
color: #1279cd!important;
}
.text-nowrap {
white-space: nowrap!important;
}
.lh {
line-height: 1.5 !important;
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { InactivitySesionComponent } from './inactivity-sesion.component';
describe('InactivitySesionComponent', () => {
let component: InactivitySesionComponent;
let fixture: ComponentFixture<InactivitySesionComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ InactivitySesionComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(InactivitySesionComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, HostListener, Input, OnInit, ViewChild } from '@angular/core';
import { PeityComponent } from '@xdf/graph';
import { PetyWidgetModel } from '../summary-peti-widget/summary-peti-widget.component';
@Component({
selector: 'byte-inactivity-sesion',
templateUrl: './inactivity-sesion.component.html',
styleUrls: ['./inactivity-sesion.component.scss']
})
export class InactivitySesionComponent implements OnInit {
@Input() options = {
width: 200,
height: 60,
fill: "#dfecf9",
stroke: "#024990",
strokeWidth: 1
};
@Input() values = [1, 12, 3, 15, 5, -1, 10];
@Input() header;
@Input() value: PetyWidgetModel;
@ViewChild('peti', { static: false })
peti: PeityComponent;
constructor() { }
ngOnInit() {
}
@HostListener('window:resize',['$event'])
public onResize(event) {
console.log("asdasdasdsad");
const width = event.target.innerWidth;
if (width >= 1600) {
this.options.width = 300
} else if (width >= 1350) {
this.options.width = 200
} else if (width >= 990){
this.options.width = 150;
}
this.peti.updateSize();
}
}
<!-- <div class="headerpanel border-bottom">
<div class="row">
<div class="col-12">
<div class="subheader">
<h1 class="subheader-title" style="padding-top: 5px;">
<i class="subheader-icon fa fa-area-chart"></i> Panel de gestión de tickets
</h1>
<div class="pull-right" style="text-align: right;">
<span class="header-date">{{ latestDate }}</span>
<br>
<b>Última actualización: </b><span class="header-date">{{ latestDate }}</span>
</div>
</div>
</div>
</div>
</div> -->
<div class="row">
<div class="col-lg-3 col-sm-6 col-xs-12">
<byte-inactivity-sesion header="Inactividad de la sesion" [value]="inactivitySession" [options]="optionsInactivitySesion"></byte-inactivity-sesion>
</div>
<div class="col-lg-3 col-sm-6 col-xs-12">
<byte-summary-peti-widget header="Total de sesiones" [value]="totalSesions" [options]="totalSesionsOptions"></byte-summary-peti-widget>
</div>
<div class="col-lg-3 col-sm-6 col-xs-12">
<byte-summary-peti-widget header="Total de mensajes recibidos" [value]="totalReceivedMessages" [options]="totalReceivedOptions"></byte-summary-peti-widget>
</div>
<div class="col-lg-3 col-sm-6 col-xs-12">
<byte-summary-peti-widget header="Total de mensajes enviados" [value]="totalSentMessages" [options]="totalSentOptions"></byte-summary-peti-widget>
</div>
</div>
<div class="row">
<div class="col-6">
<div class="ibox" style="padding-top: 15px;">
<div class="ibox-content b-s" style="text-align: center;">
<byte-gauge-chart name="Tiempo promedio de respuestas" style="display: inline-block;"></byte-gauge-chart>
</div>
</div>
</div>
<div class="col-6">
<div class="ibox" style="padding-top: 15px;">
<div class="ibox-content b-s" style="text-align: center;">
<byte-gauge-chart name="Tiempo promedio de respuestas" style="display: inline-block;"></byte-gauge-chart>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<xdf-widget-panel [options]="panelOptions">
<div class="row">
<div class="col-12">
<byte-heat-map></byte-heat-map>
</div>
</div>
</xdf-widget-panel>
</div>
</div>
\ No newline at end of file
/* PROGRESS CIRCLE COMPONENT */
.circliful {
margin:auto;
position: relative;
}
.circle-text, .circle-info, .circle-text-half, .circle-info-half {
width: 100%;
position: absolute;
text-align: center;
display: inline-block;
}
.circle-info, .circle-info-half {
color: #999;
}
.circliful .fa {
margin: -10px 3px 0 3px;
position: relative;
bottom: 4px;
}
.b-s {
box-shadow: 0 0 13px 0 rgba(62, 44, 90, 0.08);
// border: 1px solid rgba(0, 0, 0, 0.09);
}
:host.row.wrapper.border-bottom.white-bg.page-heading {
display: none !important;
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { OperativeDashboardComponent } from './operative-dashboard.component';
describe('OperativeDashboardComponent', () => {
let component: OperativeDashboardComponent;
let fixture: ComponentFixture<OperativeDashboardComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ OperativeDashboardComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(OperativeDashboardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { PetyWidgetModel } from '../summary-peti-widget/summary-peti-widget.component';
@Component({
selector: 'byte-operative-dashboard',
templateUrl: './operative-dashboard.component.html',
styleUrls: ['./operative-dashboard.component.scss']
})
export class OperativeDashboardComponent implements OnInit {
latestDate = new Date();
panelOptions = {
elevation: false,
title: {
primary: 'Primary1',
secondary: 'Secondary'
}
}
optionsInactivitySesion = {
width: 300,
height: 60,
fill: "#C8FEFF",
stroke: "#23c6c8",
strokeWidth: 1
};
inactivitySession: any = {
value: 30,
history: [10, 10, 10, 10, 10, 10, 10],
percent: 2,
up: true
};
totalReceivedMessages: PetyWidgetModel = {
value: 120000,
history: [1, 5, 3, 8, 4, 10, 0],
percent: 2,
up: true
};
totalSentMessages: PetyWidgetModel = {
value: 120000,
history: [10, 8, 6, 5, 6, 8, 10],
percent: 2,
up: true
};
totalSesions: PetyWidgetModel = {
value: 120000,
history: [10, 8, 6, 5, 6, 8, 10],
percent: 2,
up: true
};
totalSesionsOptions = {
width: 300,
height: 60,
fill: "#CFECFF",
stroke: "#1c84c6",
strokeWidth: 1
};
totalReceivedOptions = {
width: 300,
height: 60,
fill: "#D2EEE9",
stroke: "#1ab394",
strokeWidth: 1
};
totalSentOptions = {
width: 300,
height: 60,
fill: "#FFD9DD",
stroke: "#ed5565",
strokeWidth: 1
};
constructor() { }
ngOnInit() {
}
}
<div class="ccard h-100 d-flex flex-column px-2 py-3">
<div class="d-flex text-center">
<div class="flex-grow-1 mb-3">
<div class="text-nowrap lh text-100 text-dark-l2">
{{ header | translate }}
</div>
<div class="lh">
<span class="text-170 text-secondary-d4">
{{ value?.value | number:'1.0':'en-US' }}
</span>
<span class="text-blue text-nowrap ml-n1">
&nbsp;+{{value?.percent}}%
<i *ngIf="value?.up" class="fa fa-caret-up"></i>
<i *ngIf="value?.down" class="fa fa-caret-down"></i>
</span>
</div>
</div>
</div>
<div class="align-self-center">
<xdf-peity [values]="value?.history" [type]="'line'" theme="primary" [attributes]='options'></xdf-peity>
</div>
</div>
.ccard {
box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
border-radius: .5rem;
border: 1px solid #e0e5e8;
background-color: #fff;
position: relative;
}
.text-dark-l2 {
color: #60626a!important;
}
.text-100 {
font-size: 1em!important;
}
.text-secondary-d4 {
color: #4c5b70!important;
}
.text-170 {
font-size: 1.7em!important;
}
.text-blue {
color: #1279cd!important;
}
.text-nowrap {
white-space: nowrap!important;
}
.lh {
line-height: 1.5 !important;
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SummaryPetiWidgetComponent } from './summary-peti-widget.component';
describe('SummaryPetiWidgetComponent', () => {
let component: SummaryPetiWidgetComponent;
let fixture: ComponentFixture<SummaryPetiWidgetComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SummaryPetiWidgetComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SummaryPetiWidgetComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, HostListener, Input, OnInit } from '@angular/core';
declare var jQuery: any;
export class PetyWidgetModel {
percent: number;
up?: boolean;
down?: boolean;
value: number;
history: Array<number>;
}
@Component({
selector: 'byte-summary-peti-widget',
templateUrl: './summary-peti-widget.component.html',
styleUrls: ['./summary-peti-widget.component.scss']
})
export class SummaryPetiWidgetComponent implements OnInit {
@Input() options = {
width: 200,
height: 60,
fill: "#dfecf9",
stroke: "#024990",
strokeWidth: 1
};
@Input() values = [1, 12, 3, 15, 5, -1, 10];
@Input() header;
@Input() value: PetyWidgetModel;
constructor() { }
ngOnInit() {
}
@HostListener('window:resize')
public onResize() {
jQuery('')
}
}
<div class="card amount-card o-hidden"><iframe class="chartjs-hidden-iframe" tabindex="-1" style="display: block; overflow: hidden; border: 0px; margin: 0px; top: 0px; left: 0px; bottom: 0px; right: 0px; height: 100%; width: 100%; position: absolute; pointer-events: none; z-index: -1;"></iframe>
<div class="card-block">
<h2 class="f-w-400">$23,567</h2>
<p class="text-muted f-w-600 f-16"><span class="text-c-blue">Amount</span> processed</p>
</div>
<canvas id="amount-processed" height="100" width="475" style="display: block;"></canvas>
</div>
\ No newline at end of file
.amount-card {
overflow: hidden;
}
.o-hidden {
overflow: hidden;
}
.card {
border-radius: 5px;
-webkit-box-shadow: 0 1px 11px 0 rgba(0, 0, 0, 0.12);
box-shadow: 0 1px 11px 0 rgba(0, 0, 0, 0.12);
border: none;
margin-bottom: 30px;
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { WidgetPetiComponent } from './widget-peti.component';
describe('WidgetPetiComponent', () => {
let component: WidgetPetiComponent;
let fixture: ComponentFixture<WidgetPetiComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ WidgetPetiComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(WidgetPetiComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'byte-widget-peti',
templateUrl: './widget-peti.component.html',
styleUrls: ['./widget-peti.component.scss']
})
export class WidgetPetiComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AuthGuard } from '@xdf/security';
import { DirtyGuard, TemplateResolver, CrudGridComponent, EditableDataTableTemplateResolver, CrudDetailComponent, FormViewComponent, ListResolver, RecordResolver } from '@xdf/gallery';
import { ResourceAuthGuard } from '@xdf/security';
import { ApplicationFormComponent, ValposFormComponent } from '@xdf/settings';
import { TabsLayoutComponent, TabsTemplateResolver } from '@xdf/layouts';
import { OperativeDashboardComponent } from './components/operative-dashboard/operative-dashboard.component';
const routes: Routes = [
{
path: 'operative', component: OperativeDashboardComponent,
data: {
program: 'CONVERSATIONAL_AGENT',
breadcrumb: 'Operativo'
}
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class DashboardsRoutingModule { }
import { NgModule } from '@angular/core';
import { DirtyGuard, XdfGalleryModule, EditableDataTableTemplateResolver } from '@xdf/gallery';
import { DashboardsRoutingModule } from './dashboards-routing.module';
import { TranslateModule } from '@ngx-translate/core';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { MatFormFieldModule, MatSelectModule, MatTooltipModule, MatButtonModule } from '@angular/material';
import { XdfSettingsModule } from '@xdf/settings';
import { XdfLayoutsModule } from '@xdf/layouts';
import { OperativeDashboardComponent } from './components/operative-dashboard/operative-dashboard.component';
import { SummaryPetiWidgetComponent } from './components/summary-peti-widget/summary-peti-widget.component';
import { CustomerActivityWidgetComponent } from './components/customer-activity-widget/customer-activity-widget.component';
import { ChartsModule } from 'ng2-charts';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import { ChartModule, HIGHCHARTS_MODULES } from 'angular-highcharts';
import more from 'highcharts/highcharts-more.src';
import exporting from 'highcharts/modules/exporting.src';
import highmaps from 'highcharts/modules/map.src';
import { XdfGraphModule } from '@xdf/graph';
import { WidgetPetiComponent } from './components/widget-peti/widget-peti.component';
import { GaugeChartComponent } from './components/gauge-chart/gauge-chart.component';
import { GaugeChartModule } from 'angular-gauge-chart';
import { InactivitySesionComponent } from './components/inactivity-sesion/inactivity-sesion.component';
import { HeatMapComponent } from './components/heat-map/heat-map.component'
export function highchartsModules() {
// apply Highcharts Modules to this array
return [ more, exporting, highmaps];
}
@NgModule({
declarations: [
OperativeDashboardComponent,
SummaryPetiWidgetComponent,
CustomerActivityWidgetComponent,
WidgetPetiComponent,
GaugeChartComponent,
InactivitySesionComponent,
HeatMapComponent],
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
TranslateModule,
DashboardsRoutingModule,
MatFormFieldModule,
MatSelectModule,
MatTooltipModule,
XdfGalleryModule,
XdfSettingsModule,
XdfLayoutsModule,
MatButtonModule,
ChartModule,
XdfGraphModule,
GaugeChartModule,
NgxChartsModule,
ChartsModule
],
entryComponents: [
],
providers: [
{ provide: DirtyGuard, useClass: DirtyGuard },
EditableDataTableTemplateResolver,
{ provide: HIGHCHARTS_MODULES, useFactory: highchartsModules }
]
})
export class DashboardsModule { }
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment