diff --git a/src/Vegasco-Web/angular.json b/src/Vegasco-Web/angular.json index 69eea0e..54594d0 100644 --- a/src/Vegasco-Web/angular.json +++ b/src/Vegasco-Web/angular.json @@ -59,6 +59,9 @@ }, "serve": { "builder": "@angular/build:dev-server", + "options": { + "proxyConfig": "proxy.config.js" + }, "configurations": { "production": { "buildTarget": "Vegasco-Web:build:production" diff --git a/src/Vegasco-Web/proxy.config.js b/src/Vegasco-Web/proxy.config.js new file mode 100644 index 0000000..dc3fb38 --- /dev/null +++ b/src/Vegasco-Web/proxy.config.js @@ -0,0 +1,11 @@ +module.exports = { + "/api": { + target: + process.env["services__Vegasco-Server-Api__https__0"] || + process.env["services__Vegasco-Server-Api__http__0"], + secure: process.env["NODE_ENV"] !== "development", + pathRewrite: { + "^/api": "", + }, + }, +}; diff --git a/src/Vegasco-Web/src/app/app.config.ts b/src/Vegasco-Web/src/app/app.config.ts index d953f4c..72e9f2c 100644 --- a/src/Vegasco-Web/src/app/app.config.ts +++ b/src/Vegasco-Web/src/app/app.config.ts @@ -2,11 +2,13 @@ import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChang import { provideRouter } from '@angular/router'; import { routes } from './app.routes'; +import {provideHttpClient} from '@angular/common/http'; export const appConfig: ApplicationConfig = { providers: [ provideBrowserGlobalErrorListeners(), provideZoneChangeDetection({ eventCoalescing: true }), - provideRouter(routes) + provideRouter(routes), + provideHttpClient(), ] }; diff --git a/src/Vegasco-Web/src/app/app.html b/src/Vegasco-Web/src/app/app.html index 36093e1..7cb32c6 100644 --- a/src/Vegasco-Web/src/app/app.html +++ b/src/Vegasco-Web/src/app/app.html @@ -37,8 +37,8 @@ --pill-accent: var(--bright-blue); font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, - Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", - "Segoe UI Symbol"; + Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol"; box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -52,8 +52,8 @@ letter-spacing: -0.125rem; margin: 0; font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, - Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", - "Segoe UI Symbol"; + Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol"; } p { @@ -133,9 +133,11 @@ .pill-group .pill:nth-child(6n + 1) { --pill-accent: var(--bright-blue); } + .pill-group .pill:nth-child(6n + 2) { --pill-accent: var(--french-violet); } + .pill-group .pill:nth-child(6n + 3), .pill-group .pill:nth-child(6n + 4), .pill-group .pill:nth-child(6n + 5) { @@ -158,6 +160,10 @@ fill: var(--gray-400); } + td, th { + padding: .5rem; + } + .social-links a:hover svg path { fill: var(--gray-900); } @@ -205,9 +211,9 @@ gradientTransform="rotate(118.122 171.182 60.81) scale(205.794)" gradientUnits="userSpaceOnUse" > - - - + + + - - - - + + + + - + + +

Hello, {{ title }}

Congratulations! Your app is running. 🎉

+
+ @if (serverInfo$ | async; as serverInfo) { + + + + + + + + + + + + + + + + + +
VersionCommit IDCommit DateEnvironment
{{ serverInfo.fullVersion }}{{ serverInfo.commitId }}{{ serverInfo.commitDate | date:"dd.MM.yyyy HH:mm:ss" }}{{ serverInfo.environment }}
+ } +
@for (item of [ - { title: 'Explore the Docs', link: 'https://angular.dev' }, - { title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' }, - { title: 'CLI Docs', link: 'https://angular.dev/tools/cli' }, - { title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service' }, - { title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' }, + {title: 'Explore the Docs', link: 'https://angular.dev'}, + {title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials'}, + {title: 'CLI Docs', link: 'https://angular.dev/tools/cli'}, + {title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service'}, + {title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools'}, ]; track item.title) { - + diff --git a/src/Vegasco-Web/src/app/app.ts b/src/Vegasco-Web/src/app/app.ts index 98798e3..b9a2c0a 100644 --- a/src/Vegasco-Web/src/app/app.ts +++ b/src/Vegasco-Web/src/app/app.ts @@ -1,12 +1,33 @@ -import { Component } from '@angular/core'; -import { RouterOutlet } from '@angular/router'; +import {Component, inject} from '@angular/core'; +import {RouterOutlet} from '@angular/router'; +import {HttpClient} from '@angular/common/http'; +import {takeUntilDestroyed} from '@angular/core/rxjs-interop'; +import {AsyncPipe, DatePipe} from '@angular/common'; +import {tap} from 'rxjs'; @Component({ selector: 'app-root', - imports: [RouterOutlet], + imports: [AsyncPipe, DatePipe, RouterOutlet], templateUrl: './app.html', styleUrl: './app.scss' }) export class App { protected title = 'Vegasco-Web'; + + private readonly http = inject(HttpClient); + + protected readonly serverInfo$; + + constructor() { + this.serverInfo$ = this.http.get('/api/v1/info/server') + .pipe(takeUntilDestroyed()); + } } + +interface ServerInfo { + fullVersion: string; + commitId: string; + commitDate: string; + environment: string; +} +