Mise à jours du dashboard

This commit is contained in:
Julien Gautier
2023-09-14 18:28:02 +02:00
parent 0e6b3ef1c7
commit 92b204c769
41 changed files with 981 additions and 852 deletions
+1
View File
@@ -19,6 +19,7 @@ export interface AeronefByImat {
export interface AeronefByYear {
_id: {
aeronef: string,
imat: string,
year: number
},
count: number
+21 -21
View File
@@ -1,11 +1,16 @@
export interface WeightSize {
export interface CalcResult {
weight: number;
active?: string;
ranges: Range[];
jumps: number;
minSize: number;
minSize11: number;
minSize21: number;
error?: string;
}
export interface WeightSizes {
data: WeightSize[];
export interface InputParams {
jumps: number;
weight: number;
gear: number;
current: number;
}
export interface Range {
@@ -18,6 +23,16 @@ export interface Range {
value: number;
}
export interface WeightSize {
weight: number;
active?: string;
ranges: Range[];
}
export interface WeightSizes {
data: WeightSize[];
}
export const weightSizes: WeightSize[] = [
{active: '', weight: 60, ranges: [{num: 1, active: '', name: 'range_1', label: '0 à 99', start: 0, end: 99, value: 175}, {num: 2, active: '', name: 'range_2', label: '100 à 249', start: 100, end: 249, value: 161}, {num: 3, active: '', name: 'range_3', label: '250 à 399', start: 250, end: 399, value: 147}, {num: 4, active: '', name: 'range_4', label: '400 à 599', start: 400, end: 599, value: 133}, {num: 5, active: '', name: 'range_5', label: '600 à 799', start: 600, end: 799, value: 124}, {num: 6, active: '', name: 'range_6', label: '800 à 999', start: 800, end: 999, value: 115}, {num: 7, active: '', name: 'range_7', label: '1000 à 1399', start: 1000, end: 1399, value: 107}, {num: 8, active: '', name: 'range_8', label: '1400 à 1799', start: 1400, end: 1799, value: 97}, {num: 9, active: '', name: 'range_9', label: '1800 à 2000', start: 1800, end: 2000, value: 89}] },
{active: '', weight: 61, ranges: [{num: 1, active: '', name: 'range_1', label: '0 à 99', start: 0, end: 99, value: 178}, {num: 2, active: '', name: 'range_2', label: '100 à 249', start: 100, end: 249, value: 163}, {num: 3, active: '', name: 'range_3', label: '250 à 399', start: 250, end: 399, value: 149}, {num: 4, active: '', name: 'range_4', label: '400 à 599', start: 400, end: 599, value: 135}, {num: 5, active: '', name: 'range_5', label: '600 à 799', start: 600, end: 799, value: 126}, {num: 6, active: '', name: 'range_6', label: '800 à 999', start: 800, end: 999, value: 116}, {num: 7, active: '', name: 'range_7', label: '1000 à 1399', start: 1000, end: 1399, value: 108}, {num: 8, active: '', name: 'range_8', label: '1400 à 1799', start: 1400, end: 1799, value: 98}, {num: 9, active: '', name: 'range_9', label: '1800 à 2000', start: 1800, end: 2000, value: 90}] },
@@ -71,18 +86,3 @@ export const weightSizes: WeightSize[] = [
{active: '', weight: 109, ranges: [{num: 1, active: '', name: 'range_1', label: '0 à 99', start: 0, end: 99, value: 298}, {num: 2, active: '', name: 'range_2', label: '100 à 249', start: 100, end: 249, value: 274}, {num: 3, active: '', name: 'range_3', label: '250 à 399', start: 250, end: 399, value: 247}, {num: 4, active: '', name: 'range_4', label: '400 à 599', start: 400, end: 599, value: 219}, {num: 5, active: '', name: 'range_5', label: '600 à 799', start: 600, end: 799, value: 199}, {num: 6, active: '', name: 'range_6', label: '800 à 999', start: 800, end: 999, value: 179}, {num: 7, active: '', name: 'range_7', label: '1000 à 1399', start: 1000, end: 1399, value: 161}, {num: 8, active: '', name: 'range_8', label: '1400 à 1799', start: 1400, end: 1799, value: 138}, {num: 9, active: '', name: 'range_9', label: '1800 à 2000', start: 1800, end: 2000, value: 120}] },
{active: '', weight: 110, ranges: [{num: 1, active: '', name: 'range_1', label: '0 à 99', start: 0, end: 99, value: 300}, {num: 2, active: '', name: 'range_2', label: '100 à 249', start: 100, end: 249, value: 276}, {num: 3, active: '', name: 'range_3', label: '250 à 399', start: 250, end: 399, value: 249}, {num: 4, active: '', name: 'range_4', label: '400 à 599', start: 400, end: 599, value: 220}, {num: 5, active: '', name: 'range_5', label: '600 à 799', start: 600, end: 799, value: 201}, {num: 6, active: '', name: 'range_6', label: '800 à 999', start: 800, end: 999, value: 180}, {num: 7, active: '', name: 'range_7', label: '1000 à 1399', start: 1000, end: 1399, value: 162}, {num: 8, active: '', name: 'range_8', label: '1400 à 1799', start: 1400, end: 1799, value: 138}, {num: 9, active: '', name: 'range_9', label: '1800 à 2000', start: 1800, end: 2000, value: 120}] }
]
export interface CalcResult {
weight: number;
jumps: number;
minSize: number;
minSize11: number;
minSize21: number;
error?: string;
}
export interface InputParams {
jumps: number;
weight: number;
gear: number;
current: number;
}
+19 -3
View File
@@ -1,16 +1,32 @@
import { Profile } from './profile.model';
export interface Canopy {
canopy: string;
voile: string;
taille: number;
author: Profile;
createdAt: string;
updatedAt: string;
}
export interface CanopyModelBySize {
_id: {
voile: string,
taille: number
},
count: number
}
export interface CanopyModelByYear {
_id: {
voile: string,
taille: number,
year: number
},
count: number
}
export interface CanopyBySize {
_id: {
canopy: string,
taille: number
},
count: number
@@ -18,7 +34,7 @@ export interface CanopyBySize {
export interface CanopyByYear {
_id: {
canopy: string,
taille: number,
year: number
},
count: number
+80
View File
@@ -0,0 +1,80 @@
import { Configuration } from 'ng-chartist';
export const chartPieDonute: Configuration = {
type: 'Pie',
data: {
"labels": [],
"series": []
},
options: {
donut: true,
height: 260,
donutWidth: 46,
startAngle: 270,
showLabel: true
}
};
export const chartBar: Configuration = {
type: 'Bar',
data: {
"labels": [],
"series": []
},
options: {},
responsiveOptions: []
};
/*
export const chartBar: Configuration = {
type: 'Bar',
data: {
"labels": [],
"series": []
},
options: {
seriesBarDistance: 5,
high: 170,
axisX: {
showGrid: false,
offset: 20
},
axisY: {
showGrid: true,
offset: 40
},
height: 207
},
responsiveOptions: [
['screen and (min-width: 1024px)', {
axisX: {
labelInterpolationFnc: function(value: number, index: number): string {
return index % 1 === 0 ? `${value}` : '';
}
}
}],
['screen and (min-width: 641px) and (max-width: 1024px)', {
seriesBarDistance: 10,
axisY: {
offset: 30
},
axisX: {
labelInterpolationFnc: function(value: any, index: number): string {
return index % 1 === 0 ? `${value[2]}${value[3]}` : '';
}
}
}],
['screen and (max-width: 640px)', {
seriesBarDistance: 5,
axisY: {
offset: 20
},
axisX: {
labelInterpolationFnc: function(value: any, index: number): string {
return index % 1 === 0 ? `${value[2]}${value[3]}` : '';
}
}
}]
]
};
*/
+1
View File
@@ -19,6 +19,7 @@ export interface DropZoneByOaci {
export interface DropZoneByYear {
_id: {
lieu: string,
oaci: string,
year: number
},
count: number
+1
View File
@@ -5,6 +5,7 @@ export * from './application-list-config.model';
export * from './calculator.model';
export * from './canopy.model';
export * from './canopysize.model';
export * from './chart.model';
export * from './reducerow.model';
export * from './dropzone.model';
export * from './errors.model';
+8
View File
@@ -25,6 +25,14 @@ export interface Jump {
updatedAt: string;
}
export interface JumpByDate {
_id: {
month: number,
year: number
},
count: number
}
export interface JumpDoc {
_id?: string;
_rev?: string;
+6 -2
View File
@@ -1,10 +1,9 @@
import { Injectable } from '@angular/core';
import { HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { ApiService } from './api.service';
import { Aeronef, AeronefByImat, AeronefList, JumpList, JumpListConfig, JumpListFilters } from 'src/app/core/models';
import { Aeronef, AeronefByImat, AeronefByYear } from 'src/app/core/models';
@Injectable({ providedIn: 'root' })
export class AeronefsService {
@@ -27,4 +26,9 @@ export class AeronefsService {
*/
}
getAllByDate(): Observable<Array<AeronefByYear>> {
return this.apiService.get('/aeronefs/allByDate')
.pipe(map(data => data.aeronefs));
}
}
+17 -3
View File
@@ -1,10 +1,9 @@
import { Injectable } from '@angular/core';
import { HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { ApiService } from './api.service';
import { Canopy, CanopyBySize ,JumpList, JumpListConfig, JumpListFilters } from 'src/app/core/models';
import { Canopy, CanopyBySize, CanopyByYear, CanopyModelBySize, CanopyModelByYear } from 'src/app/core/models';
@Injectable({ providedIn: 'root' })
export class CanopiesService {
@@ -13,7 +12,22 @@ export class CanopiesService {
) { }
getAllBySize(): Observable<Array<CanopyBySize>> {
return this.apiService.get('/canopies')
return this.apiService.get('/canopies/allBySize')
.pipe(map(data => data.canopies));
}
getAllByYear(): Observable<Array<CanopyByYear>> {
return this.apiService.get('/canopies/allByYear')
.pipe(map(data => data.canopies));
}
getAllModelBySize(): Observable<Array<CanopyModelBySize>> {
return this.apiService.get('/canopies/allModelBySize')
.pipe(map(data => data.canopies));
}
getAllModelByYear(): Observable<Array<CanopyModelByYear>> {
return this.apiService.get('/canopies/allModelByYear')
.pipe(map(data => data.canopies));
}
+6 -1
View File
@@ -4,7 +4,7 @@ import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { ApiService } from './api.service';
import { DropZone, DropZoneByOaci, JumpList, JumpListConfig, JumpListFilters } from 'src/app/core/models';
import { DropZone, DropZoneByOaci, DropZoneByYear, JumpListConfig, JumpListFilters } from 'src/app/core/models';
@Injectable({ providedIn: 'root' })
export class DropZonesService {
@@ -17,4 +17,9 @@ export class DropZonesService {
.pipe(map(data => data.dropzones));
}
getAllByDate(): Observable<Array<DropZoneByYear>> {
return this.apiService.get('/dropzones/allByDate')
.pipe(map(data => data.dropzones));
}
}
+6 -1
View File
@@ -4,7 +4,7 @@ import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { ApiService } from './api.service';
import { Jump, JumpList, JumpListConfig, JumpListFilters } from 'src/app/core/models';
import { Jump, JumpByDate, JumpList, JumpListConfig, JumpListFilters } from 'src/app/core/models';
@Injectable({ providedIn: 'root' })
export class JumpsService {
@@ -50,6 +50,11 @@ export class JumpsService {
.pipe(map(data => data.jumps));
}
getAllByDate(): Observable<Array<JumpByDate>> {
return this.apiService.get('/jumps/allByDate')
.pipe(map(data => data.jumps));
}
create(jump: Jump): Observable<Jump> {
return this.apiService.post('/jumps/', { jump: jump })
.pipe(map(data => data.jump));