This commit is contained in:
2023-12-28 00:20:02 +01:00
14 changed files with 922 additions and 757 deletions

View File

@@ -1,6 +1,6 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:7.0.10-bookworm-slim-amd64 AS base
FROM mcr.microsoft.com/dotnet/aspnet:7.0.14-bookworm-slim-amd64 AS base
EXPOSE 80
RUN apt-get -y update

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,14 @@
import { BrowserModule } from "@angular/platform-browser";
import { APP_INITIALIZER, NgModule } from "@angular/core";
import { RouterModule, Routes } from "@angular/router";
import { HttpClient, HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http";
import { DatePipe } from '@angular/common';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import {
HttpClient,
HttpClientModule,
HTTP_INTERCEPTORS,
} from "@angular/common/http";
import { DatePipe } from "@angular/common";
import { TranslateLoader, TranslateModule } from "@ngx-translate/core";
import { TranslateHttpLoader } from "@ngx-translate/http-loader";
import { AppComponent } from "./app.component";
import { environment } from "../environments/environment";
@@ -26,9 +30,9 @@ import { CreateUserComponent } from "./create-user/create-user.component";
import { LoginUserComponent } from "./login-user/login-user.component";
import { UserProfileComponent } from "./user-profile/user-profile.component";
import { ListOfImagesComponent } from "./list-of-images/list-of-images.component";
import { JumpInfosComponent } from './jump-infos/jump-infos.component';
import { NewTunnelFlightComponent } from './new-tunnel-flight/new-tunnel-flight.component';
import { ListOfTunnelFlightsComponent } from './list-of-tunnel-flights/list-of-tunnel-flights.component';
import { JumpInfosComponent } from "./jump-infos/jump-infos.component";
import { NewTunnelFlightComponent } from "./new-tunnel-flight/new-tunnel-flight.component";
import { ListOfTunnelFlightsComponent } from "./list-of-tunnel-flights/list-of-tunnel-flights.component";
import { DateService } from "../services/date.service";
import { AircraftService } from "../services/aircraft.service";
@@ -65,67 +69,71 @@ import { MatTabsModule } from "@angular/material/tabs";
import { MatDialogModule } from "@angular/material/dialog";
import { MatCardModule } from "@angular/material/card";
import { MatRadioModule } from "@angular/material/radio";
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatListModule } from '@angular/material/list';
import { MatToolbarModule } from '@angular/material/toolbar';
import { NgChartsModule } from 'ng2-charts';
import { MatSidenavModule } from "@angular/material/sidenav";
import { MatListModule } from "@angular/material/list";
import { MatToolbarModule } from "@angular/material/toolbar";
import { NgChartsModule } from "ng2-charts";
import { JwtAuthInterceptor } from "../interceptor/jwt-auth.interceptor";
import { ErrorInterceptor } from "../interceptor/error.interceptor";
const appRoutes: Routes = [
{ path: "", component: DefaultComponent, canActivate: [AuthGuardService] },
{
path: "",
component: DefaultComponent,
canActivate: [AuthGuardService],
},
{
path: "summary",
component: SummaryComponent,
canActivate: [AuthGuardService]
canActivate: [AuthGuardService],
},
{
path: "jumps",
component: ListOfJumpsComponent,
canActivate: [AuthGuardService]
canActivate: [AuthGuardService],
},
{
path: "dzs",
component: ListOfDzsComponent,
canActivate: [AuthGuardService]
canActivate: [AuthGuardService],
},
{
path: "newjump",
component: NewJumpComponent,
canActivate: [AuthGuardService]
canActivate: [AuthGuardService],
},
{
path: "aircrafts",
component: ListOfAircraftsComponent,
canActivate: [AuthGuardService]
canActivate: [AuthGuardService],
},
{
path: "jumpTypes",
component: ListOfJumpTypesComponent,
canActivate: [AuthGuardService]
canActivate: [AuthGuardService],
},
{
path: "gears",
component: ListOfGearsComponent,
canActivate: [AuthGuardService]
canActivate: [AuthGuardService],
},
{
path: "user",
component: UserProfileComponent,
canActivate: [AuthGuardService]
canActivate: [AuthGuardService],
},
{
path: "newTunnelFlight",
component: NewTunnelFlightComponent,
canActivate: [AuthGuardService]
canActivate: [AuthGuardService],
},
{
path: "tunnelFlights",
component: ListOfTunnelFlightsComponent,
canActivate: [AuthGuardService]
canActivate: [AuthGuardService],
},
{ path: "login", component: LoginComponent },
];
@@ -161,7 +169,7 @@ export function initConfig(configService: ConfigurationHelper) {
ListOfImagesComponent,
JumpInfosComponent,
NewTunnelFlightComponent,
ListOfTunnelFlightsComponent
ListOfTunnelFlightsComponent,
],
imports: [
RouterModule.forRoot(
@@ -173,8 +181,8 @@ export function initConfig(configService: ConfigurationHelper) {
loader: {
provide: TranslateLoader,
useFactory: httpTranslateLoader,
deps: [HttpClient]
}
deps: [HttpClient],
},
}),
ReactiveFormsModule,
FormsModule,
@@ -201,7 +209,7 @@ export function initConfig(configService: ConfigurationHelper) {
MatSidenavModule,
MatListModule,
MatToolbarModule,
NgChartsModule
NgChartsModule,
],
exports: [HttpClientModule],
providers: [
@@ -220,11 +228,15 @@ export function initConfig(configService: ConfigurationHelper) {
ConfigurationHelper,
DatePipe,
ServiceCacheApi,
{ provide: APP_INITIALIZER, useFactory: initConfig, deps: [ConfigurationHelper], multi: true },
{
provide: APP_INITIALIZER,
useFactory: initConfig,
deps: [ConfigurationHelper],
multi: true,
},
{ provide: HTTP_INTERCEPTORS, useClass: JwtAuthInterceptor, multi: true },
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true }
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
],
bootstrap: [AppComponent],
})
export class AppModule {
}
export class AppModule {}

View File

@@ -1 +1,23 @@
<div class="content"></div>
<div class="content">
<p>
<a class="nostyle" routerLink="/summary" routerLinkActive="active" skipLocationChange>
<mat-icon aria-hidden="false" aria-label="Summary" style="width: 128px; height:128px; font-size: 128px;">timeline</mat-icon>
</a>
</p>
<p>
<a class="nostyle" routerLink="/newjump" routerLinkActive="active" skipLocationChange>
<mat-icon aria-hidden="false" aria-label="Add jumps" style="width: 128px; height:128px; font-size: 128px;">add_circle</mat-icon>
</a>
</p>
<p>
<a class="nostyle" routerLink="/jumps" routerLinkActive="active" skipLocationChange>
<mat-icon aria-hidden="false" aria-label="List of jumps" style="width: 128px; height:128px; font-size: 128px;">list_alt</mat-icon>
</a>
</p>
<p>
<a class="nostyle" routerLink="/tunnelFlights" routerLinkActive="active" skipLocationChange>
<img src="assets/img/tunnel.jpg" alt="Tunnel flights" style="width: 128px; height:128px; font-size: 128px;" />
</a>
</p>
</div>

View File

@@ -64,7 +64,7 @@
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef style="min-width: 70px;"></th>
<th mat-header-cell *matHeaderCellDef style="min-width: 80px;"></th>
<td mat-cell *matCellDef="let element" style="text-align: left;">
<mat-icon aria-hidden="false" aria-label="Delete this jump" style="cursor: pointer;"
(click)='delete(element)'>delete</mat-icon>

View File

@@ -12,7 +12,7 @@
<mat-radio-button value="all">{{ 'ListTunnelFlight_AllFlights' | translate }}</mat-radio-button>
</mat-radio-group>
<div style="display: block; width: 55%;">
<div style="display: inline-block; position: relative; width: 100%;">
<canvas baseChart
[data]="barChartData"
[options]="barChartOptions"
@@ -68,6 +68,14 @@
</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef style="min-width: 80px;"></th>
<td mat-cell *matCellDef="let element" style="text-align: left;">
<mat-icon aria-hidden="false" aria-label="Delete this jump" style="cursor: pointer;"
(click)='delete(element)'>delete</mat-icon>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>

View File

@@ -29,7 +29,8 @@ export class ListOfTunnelFlightsComponent implements OnInit {
"jumpType",
"nbMinutes",
"notes",
"flightDate"
"flightDate",
"actions"
];
constructor(private serviceComm: ServiceComm,
@@ -66,6 +67,7 @@ export class ListOfTunnelFlightsComponent implements OnInit {
this.barChartOptions = {
responsive: true,
maintainAspectRatio: true,
plugins: {
legend: {
display: true
@@ -202,4 +204,12 @@ export class ListOfTunnelFlightsComponent implements OnInit {
return beginDate;
}
public delete(item: TunnelFlight) {
let data: Array<TunnelFlight> = this.dataSourceTable.data;
data = data.filter((d) => d.id !== item.id);
this.dataSourceTable.data = data;
this.serviceTunnelFlight.deleteTunnelFlight(item);
}
}

View File

@@ -63,6 +63,7 @@ export class NewJumpComponent implements OnInit {
private countDatasLoaded: number;
private pendingAddRequest: boolean;
private listOfDropZone: Array<DropZoneResp>;
public maxDate: Date;
constructor(private serviceComm: ServiceComm,
private serviceJump: JumpService,
@@ -81,6 +82,8 @@ export class NewJumpComponent implements OnInit {
}
});
this.updateTitle();
this.maxDate = this.dateService.addDays(new Date(), 1);
this.pendingAddRequest = false;
this.initForm();

View File

@@ -33,7 +33,7 @@
<mat-form-field>
<mat-label>{{ 'NewTunnelFlight_Date_Lbl' | translate }}</mat-label>
<input matInput [matDatepicker]="flightDateDp" [(ngModel)]="flightDate" name="flightDate" disabled>
<input matInput [max]="maxDate" [matDatepicker]="flightDateDp" [(ngModel)]="flightDate" name="flightDate" disabled>
<mat-datepicker-toggle matSuffix [for]="flightDateDp"></mat-datepicker-toggle>
<mat-datepicker #flightDateDp disabled="false"></mat-datepicker>
</mat-form-field>

View File

@@ -8,9 +8,9 @@ import { TunnelResp } from "../../models/tunnel";
import { JumpTypeResp } from "../../models/jumpType";
import { TunnelService } from '../../services/tunnel.service';
import { ServiceComm } from '../../services/service-comm.service';
import { StatsService } from '../../services/stats.service';
import { TunnelFlightService } from "../../services/tunnel-flight.service";
import { JumpTypeService } from "../../services/jump-type.service";
import { DateService } from "../../services/date.service";
export const PICK_FORMATS = {
parse: { dateInput: 'yy MM dd' },
@@ -48,12 +48,14 @@ export class NewTunnelFlightComponent implements OnInit {
private countDatasLoaded: number;
private pendingAddRequest: boolean;
public listOfJumpType: Array<JumpTypeResp>;
public maxDate: Date;
constructor(private serviceComm: ServiceComm,
private serviceTunnel: TunnelService,
private serviceTunnelFlight: TunnelFlightService,
private serviceJumpType: JumpTypeService,
private translateService: TranslateService) { }
private translateService: TranslateService,
private dateService: DateService) { }
ngOnInit() {
this.serviceComm.forceTranslateTitle.subscribe((data) => {
@@ -63,6 +65,7 @@ export class NewTunnelFlightComponent implements OnInit {
});
this.updateTitle();
this.maxDate = this.dateService.addDays(new Date(), 1);
this.countDatasLoaded = 0;
this.pendingAddRequest = false;
this.initForm();

View File

@@ -16,17 +16,12 @@ mat-form-field{
}
a {
/* background-color: red; */
/* box-shadow: 0 2px 0 darkred; */
color: white;
/* padding: 0.5em 0.5em; */
/* position: relative; */
text-decoration: none;
text-transform: uppercase;
}
a:hover {
/* background-color: #ce0606; */
box-shadow: 0 2px 0 darkred;
}
@@ -34,3 +29,10 @@ a:active {
box-shadow: none;
top: 5px;
}
a.nostyle {
text-decoration: none !important;
}
a.nostyle:hover {
box-shadow: none !important;
}

View File

@@ -101,9 +101,7 @@ export class JumpService extends BaseService {
}
public deleteJump(item: Jump) {
this.http.delete(`${this.apiUrl}/Jump/${item.id}`,
{ headers: this.headers, })
.subscribe();
this.http.delete(`${this.apiUrl}/Jump/${item.id}`, { headers: this.headers }).subscribe();
}
public updateJump(id: number,

View File

@@ -50,6 +50,10 @@ export class TunnelFlightService extends BaseService {
);
}
public deleteTunnelFlight(item: TunnelFlight) {
this.http.delete(`${this.apiUrl}/TunnelFlight/${item.id}`, { headers: this.headers }).subscribe();
}
public getTunnelFlightsByMonth(begin: Date, end: Date): Observable<Array<TunnelFlightByMonth>> {
let beginDate = this.datePipe.transform(begin, "yyyy-MM-dd");
let endDate = this.datePipe.transform(end, "yyyy-MM-dd");

View File

@@ -1,7 +1,7 @@
To build an image "toto" with the version "0.1": docker build . -t skydivelogs:1.4.0
To build an image "toto" with the version "0.1": docker build . -t skydivelogs:1.4.1
To run ab image to container with volume :
docker run -v C:\toto\config:/app/Front/config -v C:\toto\db:/app/API/Data -d -p 5080:80/tcp --name Test -it skydivelogs:1.4.0
docker save --output skydivelogs-1.4.0.tar skydivelogs:1.4.0
docker save --output skydivelogs-1.4.1.tar skydivelogs:1.4.1
scp -P 5022 skydivelogs-1.4.0.tar administrator@51.75.68.58:~
scp -P 5022 skydivelogs-1.4.1.tar administrator@51.75.68.58:~