Jetzt das Frontend richtig hinzugefügt
This commit is contained in:
parent
feac7f596c
commit
11674df1b5
4
frontend/.gitignore
vendored
Normal file
4
frontend/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
node_modules/
|
||||||
|
.angular/
|
||||||
|
dist/
|
||||||
|
node/
|
||||||
105
frontend/angular.json
Normal file
105
frontend/angular.json
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
|
"version": 1,
|
||||||
|
"newProjectRoot": "projects",
|
||||||
|
"projects": {
|
||||||
|
"test1": {
|
||||||
|
"projectType": "application",
|
||||||
|
"schematics": {},
|
||||||
|
"root": "",
|
||||||
|
"sourceRoot": "src",
|
||||||
|
"prefix": "app",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-angular:application",
|
||||||
|
"options": {
|
||||||
|
"outputPath": {
|
||||||
|
"base": "../target/classes/public/rest-vz",
|
||||||
|
"browser": ""
|
||||||
|
},
|
||||||
|
"index": "src/index.html",
|
||||||
|
"browser": "src/main.ts",
|
||||||
|
"polyfills": [
|
||||||
|
"zone.js",
|
||||||
|
"@angular/localize/init"
|
||||||
|
],
|
||||||
|
"tsConfig": "tsconfig.app.json",
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "public"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"node_modules/bootstrap/dist/css/bootstrap.min.css",
|
||||||
|
"src/styles.css"
|
||||||
|
],
|
||||||
|
"scripts": []
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "1MB",
|
||||||
|
"maximumError": "2MB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "2kB",
|
||||||
|
"maximumError": "4kB"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputHashing": "all"
|
||||||
|
},
|
||||||
|
"development": {
|
||||||
|
"optimization": false,
|
||||||
|
"extractLicenses": false,
|
||||||
|
"sourceMap": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": "production"
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"buildTarget": "test1:build:production"
|
||||||
|
},
|
||||||
|
"development": {
|
||||||
|
"buildTarget": "test1:build:development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": "development"
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"builder": "@angular-devkit/build-angular:extract-i18n"
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular-devkit/build-angular:karma",
|
||||||
|
"options": {
|
||||||
|
"polyfills": [
|
||||||
|
"zone.js",
|
||||||
|
"zone.js/testing",
|
||||||
|
"@angular/localize/init"
|
||||||
|
],
|
||||||
|
"tsConfig": "tsconfig.spec.json",
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "public"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"src/styles.css"
|
||||||
|
],
|
||||||
|
"scripts": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"cli": {
|
||||||
|
"analytics": false
|
||||||
|
}
|
||||||
|
}
|
||||||
22045
frontend/package-lock.json
generated
Normal file
22045
frontend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
46
frontend/package.json
Normal file
46
frontend/package.json
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"name": "test1",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"scripts": {
|
||||||
|
"ng": "ng",
|
||||||
|
"start": "ng serve",
|
||||||
|
"build": "ng build",
|
||||||
|
"watch": "ng build --watch --configuration development",
|
||||||
|
"test": "ng test"
|
||||||
|
},
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@angular/animations": "^18.2.0",
|
||||||
|
"@angular/common": "^18.2.0",
|
||||||
|
"@angular/compiler": "^18.2.0",
|
||||||
|
"@angular/core": "^18.2.0",
|
||||||
|
"@angular/forms": "^18.2.0",
|
||||||
|
"@angular/platform-browser": "^18.2.0",
|
||||||
|
"@angular/platform-browser-dynamic": "^18.2.0",
|
||||||
|
"@angular/router": "^18.2.0",
|
||||||
|
"@ng-bootstrap/ng-bootstrap": "^17.0.1",
|
||||||
|
"@popperjs/core": "^2.11.8",
|
||||||
|
"bootstrap": "^5.3.2",
|
||||||
|
"chart.js": "~4.0.0",
|
||||||
|
"chartjs-adapter-date-fns": "^3.0.0",
|
||||||
|
"date-fns": "^4.1.0",
|
||||||
|
"rxjs": "~7.8.0",
|
||||||
|
"tslib": "^2.3.0",
|
||||||
|
"zone.js": "~0.14.10"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@angular-devkit/build-angular": "^18.2.15",
|
||||||
|
"@angular/cli": "^18.2.15",
|
||||||
|
"@angular/compiler-cli": "^18.2.0",
|
||||||
|
"@angular/localize": "^18.2.0",
|
||||||
|
"@types/jasmine": "~5.1.0",
|
||||||
|
"@types/lodash": "^4.17.16",
|
||||||
|
"jasmine-core": "~5.2.0",
|
||||||
|
"karma": "~6.4.0",
|
||||||
|
"karma-chrome-launcher": "~3.2.0",
|
||||||
|
"karma-coverage": "~2.2.0",
|
||||||
|
"karma-jasmine": "~5.1.0",
|
||||||
|
"karma-jasmine-html-reporter": "~2.1.0",
|
||||||
|
"typescript": "~5.5.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
frontend/public/favicon.ico
Normal file
BIN
frontend/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
8
frontend/src/app/aggregate.ts
Normal file
8
frontend/src/app/aggregate.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
export interface Aggregate {
|
||||||
|
houseId: number,
|
||||||
|
timestampStart: number,
|
||||||
|
timestampEnd: number,
|
||||||
|
producedEnergy: number,
|
||||||
|
injectedEnergy: number,
|
||||||
|
obtainedEnergy: number,
|
||||||
|
}
|
||||||
0
frontend/src/app/app.component.css
Normal file
0
frontend/src/app/app.component.css
Normal file
57
frontend/src/app/app.component.html
Normal file
57
frontend/src/app/app.component.html
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<main class="main">
|
||||||
|
<div ngbAccordion>
|
||||||
|
<div ngbAccordionItem>
|
||||||
|
<h2 ngbAccordionHeader>
|
||||||
|
<button ngbAccordionButton>Diagramm der letzten 24h</button>
|
||||||
|
</h2>
|
||||||
|
<div ngbAccordionCollapse>
|
||||||
|
<div ngbAccordionBody>
|
||||||
|
<div style="border: 1px solid blueviolet;width: 100%; height: 100%;">
|
||||||
|
<canvas id="canvas"></canvas>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ngbAccordionItem>
|
||||||
|
<h2 ngbAccordionHeader>
|
||||||
|
<button ngbAccordionButton>Letzte 24 Stunden</button>
|
||||||
|
</h2>
|
||||||
|
<div ngbAccordionCollapse>
|
||||||
|
<div ngbAccordionBody>
|
||||||
|
<ng-template><app-test duration="P1D"></app-test></ng-template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ngbAccordionItem>
|
||||||
|
<h2 ngbAccordionHeader>
|
||||||
|
<button ngbAccordionButton>Letzte 7 Tage</button>
|
||||||
|
</h2>
|
||||||
|
<div ngbAccordionCollapse>
|
||||||
|
<div ngbAccordionBody>
|
||||||
|
<ng-template><app-test duration="P7D"></app-test></ng-template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ngbAccordionItem>
|
||||||
|
<h2 ngbAccordionHeader>
|
||||||
|
<button ngbAccordionButton>Letzte 30 Tage</button>
|
||||||
|
</h2>
|
||||||
|
<div ngbAccordionCollapse>
|
||||||
|
<div ngbAccordionBody>
|
||||||
|
<ng-template><app-test duration="P30D"></app-test></ng-template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ngbAccordionItem>
|
||||||
|
<h2 ngbAccordionHeader>
|
||||||
|
<button ngbAccordionButton>Letzte 365 Tage</button>
|
||||||
|
</h2>
|
||||||
|
<div ngbAccordionCollapse>
|
||||||
|
<div ngbAccordionBody>
|
||||||
|
<ng-template><app-test duration="P365D"></app-test></ng-template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<!--<router-outlet />-->
|
||||||
29
frontend/src/app/app.component.spec.ts
Normal file
29
frontend/src/app/app.component.spec.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
|
describe('AppComponent', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [AppComponent],
|
||||||
|
}).compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create the app', () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
const app = fixture.componentInstance;
|
||||||
|
expect(app).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should have the 'test1' title`, () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
const app = fixture.componentInstance;
|
||||||
|
expect(app.title).toEqual('test1');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render title', () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
fixture.detectChanges();
|
||||||
|
const compiled = fixture.nativeElement as HTMLElement;
|
||||||
|
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, test1');
|
||||||
|
});
|
||||||
|
});
|
||||||
77
frontend/src/app/app.component.ts
Normal file
77
frontend/src/app/app.component.ts
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { RouterOutlet } from '@angular/router';
|
||||||
|
import { TestComponent } from "./test/test.component";
|
||||||
|
import { RestService } from './rest.service';
|
||||||
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import { Chart } from 'chart.js/auto';
|
||||||
|
import 'chartjs-adapter-date-fns';
|
||||||
|
import { de } from 'date-fns/locale';
|
||||||
|
import { Aggregate } from './aggregate';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-root',
|
||||||
|
standalone: true,
|
||||||
|
imports: [RouterOutlet, TestComponent, NgbModule,],
|
||||||
|
templateUrl: './app.component.html',
|
||||||
|
styleUrl: './app.component.css'
|
||||||
|
})
|
||||||
|
export class AppComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor(private rest: RestService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.rest.getLatestData().subscribe((data: Aggregate[]) => {
|
||||||
|
this.chart = new Chart('canvas', {
|
||||||
|
type: 'line',
|
||||||
|
options: {
|
||||||
|
scales: {
|
||||||
|
x: {
|
||||||
|
type: 'time',
|
||||||
|
time: {
|
||||||
|
tooltipFormat: 'HH:mm',
|
||||||
|
displayFormats: {
|
||||||
|
hour: 'HH:mm',
|
||||||
|
minute: 'HH:mm'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: 'Zeitpunkt'
|
||||||
|
},
|
||||||
|
adapters: {
|
||||||
|
date: {
|
||||||
|
locale: de
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
y: {
|
||||||
|
type: 'linear'
|
||||||
|
//stacked: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
labels: data.map(row => row.timestampStart),
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
label: 'Bezug',
|
||||||
|
pointRadius: 0,
|
||||||
|
data: data.map(row => row.obtainedEnergy/60000)
|
||||||
|
}, {
|
||||||
|
label: 'Erzeugt',
|
||||||
|
pointRadius: 0,
|
||||||
|
data: data.map(row => row.producedEnergy/60000)
|
||||||
|
}, {
|
||||||
|
label: 'Eingespeist',
|
||||||
|
pointRadius: 0,
|
||||||
|
data: data.map(row => row.injectedEnergy/60000)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
title = 'test1';
|
||||||
|
chart: Chart | null = null;
|
||||||
|
}
|
||||||
13
frontend/src/app/app.config.ts
Normal file
13
frontend/src/app/app.config.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
|
||||||
|
import { provideRouter } from '@angular/router';
|
||||||
|
import { provideHttpClient } from '@angular/common/http';
|
||||||
|
|
||||||
|
import { routes } from './app.routes';
|
||||||
|
|
||||||
|
export const appConfig: ApplicationConfig = {
|
||||||
|
providers: [
|
||||||
|
provideZoneChangeDetection({ eventCoalescing: true }),
|
||||||
|
provideRouter(routes),
|
||||||
|
provideHttpClient(),
|
||||||
|
]
|
||||||
|
};
|
||||||
10
frontend/src/app/app.routes.ts
Normal file
10
frontend/src/app/app.routes.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { Routes } from '@angular/router';
|
||||||
|
import { TestComponent } from './test/test.component';
|
||||||
|
|
||||||
|
export const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: TestComponent,
|
||||||
|
title: 'My Page'
|
||||||
|
}
|
||||||
|
];
|
||||||
16
frontend/src/app/rest.service.spec.ts
Normal file
16
frontend/src/app/rest.service.spec.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { RestService } from './rest.service';
|
||||||
|
|
||||||
|
describe('RestService', () => {
|
||||||
|
let service: RestService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(RestService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
31
frontend/src/app/rest.service.ts
Normal file
31
frontend/src/app/rest.service.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { Statistics } from './statistics';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { Aggregate } from './aggregate';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class RestService {
|
||||||
|
|
||||||
|
constructor(private http: HttpClient) {
|
||||||
|
}
|
||||||
|
|
||||||
|
getStatistics(): Observable<Statistics> {
|
||||||
|
return this.http.get<Statistics>('https://vz.home.peper.info/rest-vz/stats?houseId=1&duration=P7D');
|
||||||
|
}
|
||||||
|
|
||||||
|
getLatestData(): Observable<Aggregate[]> {
|
||||||
|
return this.http.get<Aggregate[]>('https://vz.home.peper.info/rest-vz/latest-data?houseId=2&timeWindow=1440');
|
||||||
|
}
|
||||||
|
|
||||||
|
getStatisticsWithDuration(duration: string | undefined): Observable<Statistics> {
|
||||||
|
if (duration) {
|
||||||
|
return this.http.get<Statistics>('https://vz.home.peper.info/rest-vz/stats?houseId=1&duration=' + duration);
|
||||||
|
} else {
|
||||||
|
return this.http.get<Statistics>('https://vz.home.peper.info/rest-vz/stats?houseId=1');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
9
frontend/src/app/statistics.ts
Normal file
9
frontend/src/app/statistics.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
export interface Statistics {
|
||||||
|
timestampStart: number,
|
||||||
|
timestampEnd: number,
|
||||||
|
producedEnergy: number,
|
||||||
|
injectedEnergy: number,
|
||||||
|
obtainedEnergy: number,
|
||||||
|
savedMoney: number,
|
||||||
|
payedMoney: number,
|
||||||
|
}
|
||||||
0
frontend/src/app/test/test.component.css
Normal file
0
frontend/src/app/test/test.component.css
Normal file
12
frontend/src/app/test/test.component.html
Normal file
12
frontend/src/app/test/test.component.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<div *ngIf="!statistics">
|
||||||
|
Lade Daten - bitte warten...
|
||||||
|
</div>
|
||||||
|
<div *ngIf="statistics">
|
||||||
|
<p>Zeitraum: {{ getTimestamp(statistics.timestampStart) }} - {{ getTimestamp(statistics.timestampEnd) }}</p>
|
||||||
|
<p>Aus dem Netz bezogene Energie: {{ getKwh(statistics.obtainedEnergy) }} kWh</p>
|
||||||
|
<p>Ins Netz eingespeiste Energie: {{ getKwh(statistics.injectedEnergy) }} kWh</p>
|
||||||
|
<p>Mit Photovoltaik erzeugte Energie: {{ getKwh(statistics.producedEnergy) }} kWh</p>
|
||||||
|
<p>- davon selbst genutzt: {{ getKwh(statistics.producedEnergy - statistics.injectedEnergy) }} kWh</p>
|
||||||
|
<p>Kosten: {{ getMoney(statistics.payedMoney) }} €</p>
|
||||||
|
<p>Gespartes Geld: {{ getMoney(statistics.savedMoney) }} €</p>
|
||||||
|
</div>
|
||||||
23
frontend/src/app/test/test.component.spec.ts
Normal file
23
frontend/src/app/test/test.component.spec.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { TestComponent } from './test.component';
|
||||||
|
|
||||||
|
describe('TestComponent', () => {
|
||||||
|
let component: TestComponent;
|
||||||
|
let fixture: ComponentFixture<TestComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [TestComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(TestComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
54
frontend/src/app/test/test.component.ts
Normal file
54
frontend/src/app/test/test.component.ts
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
|
import { Statistics } from '../statistics';
|
||||||
|
import { RestService } from '../rest.service';
|
||||||
|
import { formatDate, formatNumber } from '@angular/common';
|
||||||
|
import { NgIf } from '@angular/common';
|
||||||
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-test',
|
||||||
|
standalone: true,
|
||||||
|
imports: [NgIf],
|
||||||
|
templateUrl: './test.component.html',
|
||||||
|
styleUrl: './test.component.css'
|
||||||
|
})
|
||||||
|
export class TestComponent implements OnInit {
|
||||||
|
statistics!: Statistics;
|
||||||
|
@Input() duration!: string;
|
||||||
|
|
||||||
|
constructor(private rest: RestService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.rest.getStatisticsWithDuration(this.duration).subscribe((data: Statistics) => {
|
||||||
|
this.statistics = data;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getTimestamp(value: number): string {
|
||||||
|
if (this.statistics) {
|
||||||
|
return formatDate(
|
||||||
|
value,
|
||||||
|
'dd.MM.yyyy HH:mm:ss',
|
||||||
|
'de-DE');
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getKwh(value: number): string {
|
||||||
|
if (this.statistics) {
|
||||||
|
return formatNumber(value/1000000, 'de-DE', '1.2-2');
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getMoney(value: number): string {
|
||||||
|
if (this.statistics) {
|
||||||
|
return formatNumber(value / 100, 'de-DE', '1.2-2');
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
16
frontend/src/index.html
Normal file
16
frontend/src/index.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test1</title>
|
||||||
|
<base href="/">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<app-root></app-root>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js" integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" integrity="sha384-0pUGZvbkm6XF6gxjEnlmuGrJXVbNuzT9qBBavbLwCsOGabYfZo0T0to5eqruptLy" crossorigin="anonymous"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
9
frontend/src/main.ts
Normal file
9
frontend/src/main.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
/// <reference types="@angular/localize" />
|
||||||
|
|
||||||
|
import { bootstrapApplication } from '@angular/platform-browser';
|
||||||
|
import { appConfig } from './app/app.config';
|
||||||
|
import { AppComponent } from './app/app.component';
|
||||||
|
import '@angular/common/locales/global/de';
|
||||||
|
|
||||||
|
bootstrapApplication(AppComponent, appConfig)
|
||||||
|
.catch((err) => console.error(err));
|
||||||
1
frontend/src/styles.css
Normal file
1
frontend/src/styles.css
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* You can add global styles to this file, and also import other style files */
|
||||||
17
frontend/tsconfig.app.json
Normal file
17
frontend/tsconfig.app.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
||||||
|
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./out-tsc/app",
|
||||||
|
"types": [
|
||||||
|
"@angular/localize"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/main.ts"
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
"src/**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
33
frontend/tsconfig.json
Normal file
33
frontend/tsconfig.json
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
||||||
|
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
||||||
|
{
|
||||||
|
"compileOnSave": false,
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./dist/out-tsc",
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"declaration": false,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"importHelpers": true,
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ES2022",
|
||||||
|
"lib": [
|
||||||
|
"ES2022",
|
||||||
|
"dom"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"enableI18nLegacyMessageIdFormat": false,
|
||||||
|
"strictInjectionParameters": true,
|
||||||
|
"strictInputAccessModifiers": true,
|
||||||
|
"strictTemplates": true
|
||||||
|
}
|
||||||
|
}
|
||||||
16
frontend/tsconfig.spec.json
Normal file
16
frontend/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
||||||
|
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./out-tsc/spec",
|
||||||
|
"types": [
|
||||||
|
"jasmine",
|
||||||
|
"@angular/localize"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src/**/*.spec.ts",
|
||||||
|
"src/**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user