Skip to content

Commit bbcbd3d

Browse files
updates application sort list
1 parent a15bffb commit bbcbd3d

File tree

44 files changed

+949
-159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+949
-159
lines changed

src/app/applications/application.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Injectable } from "@angular/core";
2+
import { UserMinimalService } from "@app/admin/users/user-minimal.service";
23
import { Application, ApplicationData, UpdateApplicationOrganization } from "@applications/application.model";
3-
import { RestService } from "../shared/services/rest.service";
44
import { Observable } from "rxjs";
55
import { map } from "rxjs/operators";
6-
import { UserMinimalService } from "@app/admin/users/user-minimal.service";
6+
import { RestService } from "../shared/services/rest.service";
77

88
interface GetApplicationParameters {
99
limit: number;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="map-page thirty-height">
2+
<app-map [coordinateList]="coordinateList" [isFromApplication]="true" [applicationId]="222"></app-map>
3+
</div>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.map-page {
2+
background-color: #ffff;
3+
padding: 20px;
4+
height: 500px;
5+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { Component } from "@angular/core";
2+
import { ApplicationService } from "@applications/application.service";
3+
import { MapCoordinates } from "@shared/components/map/map-coordinates.model";
4+
import { SharedModule } from "../../../shared/shared.module";
5+
6+
@Component({
7+
selector: "app-application-map",
8+
standalone: true,
9+
imports: [SharedModule],
10+
templateUrl: "./application-map.component.html",
11+
styleUrl: "./application-map.component.scss",
12+
})
13+
export class ApplicationMapComponent {
14+
constructor(private applicationService: ApplicationService) {}
15+
16+
17+
18+
coordinateList: MapCoordinates[] = [
19+
{
20+
latitude: 120,
21+
longitude: 120,
22+
draggable: false,
23+
editEnabled: false,
24+
useGeolocation: true,
25+
markerInfo: {
26+
active: true,
27+
id: 22,
28+
internalOrganizationId: 22,
29+
internalOrganizationName: "22",
30+
isDevice: false,
31+
lastActive: new Date(),
32+
name: "test",
33+
networkTechnology: "lora",
34+
},
35+
},
36+
];
37+
38+
getApplications(): void {
39+
const applicationsSubscription = this.applicationService
40+
.getApplications(100000, 0, "asc", "id")
41+
.subscribe(applicationData => { applicationData.data.forEach(
42+
data => this.coordinateList.push() data.
43+
)});
44+
}
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div class="chart-container">
2+
<h2>Top 3 rest codes</h2>
3+
4+
<canvas id="requestChart">{{ chart }}</canvas>
5+
</div>

src/app/applications/applications-list/application-visualization/application-visualization-failed-requests/application-visualization-failed-requests.component.scss

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import { Component, OnInit } from "@angular/core";
2+
import { Chart } from "chart.js";
3+
interface RESTCode {
4+
status: string;
5+
color: string;
6+
}
7+
8+
const codes: RESTCode[] = [
9+
{
10+
status: "200 OK",
11+
color: "green",
12+
},
13+
{
14+
status: "201 Created",
15+
color: "blue",
16+
},
17+
{
18+
status: "400 Bad Request",
19+
color: "yellow",
20+
},
21+
{
22+
status: "401 Unauthorized",
23+
color: "red",
24+
},
25+
{
26+
status: "403 Forbidden",
27+
color: "red",
28+
},
29+
{
30+
status: "404 Not Found",
31+
color: "orange",
32+
},
33+
{
34+
status: "500 Internal Server Error",
35+
color: "dark red",
36+
},
37+
];
38+
39+
@Component({
40+
selector: "app-application-visualization-failed-requests",
41+
standalone: true,
42+
imports: [],
43+
templateUrl: "./application-visualization-failed-requests.component.html",
44+
styleUrl: "./application-visualization-failed-requests.component.scss",
45+
})
46+
export class ApplicationVisualizationFailedRequestsComponent implements OnInit {
47+
public chart: any;
48+
49+
ngOnInit(): void {
50+
this.createChart();
51+
}
52+
53+
createChart() {
54+
this.chart = new Chart("requestChart", {
55+
type: "doughnut", //this denotes tha type of chart
56+
data: {
57+
// values on X-Axis
58+
labels: ["Red", "Pink", "Green", "Yellow", "Orange", "Blue"],
59+
datasets: [
60+
{
61+
label: "My First Dataset",
62+
63+
data: [300, 240, 100, 432, 253, 34],
64+
backgroundColor: ["200 OK", "201 Created", "400 Bad Request", "yellow", "orange", "blue"],
65+
hoverOffset: 4,
66+
},
67+
],
68+
},
69+
options: {
70+
aspectRatio: 2.5,
71+
},
72+
});
73+
}
74+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div class="chart-container">
2+
<h2>Top 3 rest codes</h2>
3+
4+
<canvas id="MyChart">{{ chart }}</canvas>
5+
</div>

src/app/applications/applications-list/application-visualization/application-visualization-top-codes/application-visualization-top-codes.component.scss

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import { Component, OnInit } from "@angular/core";
2+
import { Chart } from "chart.js";
3+
interface RESTCode {
4+
status: string;
5+
color: string;
6+
}
7+
8+
const codes: RESTCode[] = [
9+
{
10+
status: "200 OK",
11+
color: "green",
12+
},
13+
{
14+
status: "201 Created",
15+
color: "blue",
16+
},
17+
{
18+
status: "400 Bad Request",
19+
color: "yellow",
20+
},
21+
{
22+
status: "401 Unauthorized",
23+
color: "red",
24+
},
25+
{
26+
status: "403 Forbidden",
27+
color: "red",
28+
},
29+
{
30+
status: "404 Not Found",
31+
color: "orange",
32+
},
33+
{
34+
status: "500 Internal Server Error",
35+
color: "dark red",
36+
},
37+
];
38+
39+
@Component({
40+
selector: "app-application-visualization-top-codes",
41+
standalone: true,
42+
imports: [],
43+
templateUrl: "./application-visualization-top-codes.component.html",
44+
styleUrl: "./application-visualization-top-codes.component.scss",
45+
})
46+
export class ApplicationVisualizationTopCodesComponent implements OnInit {
47+
public chart: any;
48+
49+
ngOnInit(): void {
50+
this.createChart();
51+
}
52+
53+
createChart() {
54+
this.chart = new Chart("MyChart", {
55+
type: "doughnut", //this denotes tha type of chart
56+
data: {
57+
// values on X-Axis
58+
labels: ["Red", "Pink", "Green", "Yellow", "Orange", "Blue"],
59+
datasets: [
60+
{
61+
label: "My First Dataset",
62+
63+
data: [300, 240, 100, 432, 253, 34],
64+
backgroundColor: ["200 OK", "201 Created", "400 Bad Request", "yellow", "orange", "blue"],
65+
hoverOffset: 4,
66+
},
67+
],
68+
},
69+
options: {
70+
aspectRatio: 2.5,
71+
},
72+
});
73+
}
74+
}

0 commit comments

Comments
 (0)