Compare commits
76 commits
Author | SHA1 | Date | |
---|---|---|---|
5c22207f0a | |||
034d9d4c37 | |||
14363c721b | |||
20bfd3116e | |||
b6c4cd280a | |||
f5828ae1e6 | |||
674fd71de9 | |||
fd9dc302cb | |||
780bf3b6c9 | |||
3874e84a6e | |||
00767ac20b | |||
4caf0cf44f | |||
cd5093899f | |||
af559b7faa | |||
9531634c62 | |||
48ee872208 | |||
b2a3feb58c | |||
1a061e3f20 | |||
63c980095e | |||
d72ea0da6f | |||
b726fb1daa | |||
db769c70ae | |||
6aaf93b098 | |||
ed1a9242c9 | |||
fd6e67b332 | |||
6949d96117 | |||
1bf7ef7e28 | |||
4ed8fc7d55 | |||
8c272ab6ff | |||
b2c5a9062e | |||
a1bb5b1e3a | |||
5409616530 | |||
839159e59a | |||
08a5d07c4d | |||
d343f413e3 | |||
73430a0fe9 | |||
963d3437c0 | |||
c4c5fd9f11 | |||
41697d0290 | |||
3252d2c940 | |||
db7b2ef6e0 | |||
cc7256dbad | |||
cff2d0f5eb | |||
7e38cf9b46 | |||
bcb9807f6f | |||
8994329deb | |||
eecb3b98c4 | |||
3fc7a60bc5 | |||
5ff4f33a01 | |||
c9768a4040 | |||
a6f3e3c800 | |||
4f8c764fbe | |||
7f037dcbf8 | |||
c3cbafbae3 | |||
b77ae05fcf | |||
4cafbd7a0a | |||
df802c24a0 | |||
aacf0f535b | |||
9a0406d9e8 | |||
09f487ea2b | |||
3635e4303a | |||
f0b61d150f | |||
55fdde94a9 | |||
50601d86cf | |||
ea8f037888 | |||
f82978ae70 | |||
77de1077d7 | |||
543600297b | |||
16a99ba875 | |||
882109eb82 | |||
f7c2a384dc | |||
12f9eead0e | |||
7d29b89f65 | |||
b9d1bb1116 | |||
55e8f9d02d | |||
d2eb7f7a1d |
22 changed files with 210 additions and 54 deletions
|
@ -1,29 +0,0 @@
|
|||
on: [push]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: container
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
name: Install pnpm
|
||||
with:
|
||||
run_install: false
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Build package (transpile ts => js)
|
||||
run: ng build
|
||||
|
||||
- name: Store build
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Package
|
||||
path: dist/
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -44,3 +44,5 @@ testem.log
|
|||
# System Files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
.npmrc
|
||||
|
|
50
.woodpecker/build.yaml
Normal file
50
.woodpecker/build.yaml
Normal file
|
@ -0,0 +1,50 @@
|
|||
when:
|
||||
- event: manual
|
||||
- event: tag
|
||||
|
||||
#depends_on:
|
||||
#- test
|
||||
|
||||
steps:
|
||||
npm:
|
||||
image: code.philo.ydns.eu/philorg/pnpm-deb
|
||||
environment:
|
||||
ORG: philorg
|
||||
REGISTRY_TOKEN:
|
||||
from_secret: registry_token
|
||||
volumes:
|
||||
- pnpm:/root/.local/share/pnpm
|
||||
commands:
|
||||
- pnpm install --frozen-lockfile
|
||||
- pnpm set "//code.philo.ydns.eu/api/packages/$ORG/npm/:_authToken=$REGISTRY_TOKEN"
|
||||
- pnpm publish --no-git-checks
|
||||
failure: ignore
|
||||
|
||||
build:
|
||||
image: code.philo.ydns.eu/philorg/pnpm-deb
|
||||
commands:
|
||||
- pnpm build
|
||||
|
||||
build_publish:
|
||||
image: quay.io/podman/stable:latest
|
||||
# Caution: This image is built daily. It might fill up your image store quickly.
|
||||
#pull: true
|
||||
volumes:
|
||||
- containers:/var/lib/containers
|
||||
- pnpm:/root/.local/share/pnpm
|
||||
# Fill in the trusted checkbox in Woodpecker's settings as well
|
||||
privileged: true
|
||||
environment:
|
||||
registry: code.philo.ydns.eu
|
||||
org: philorg
|
||||
container_name: treetrail-frontend
|
||||
registry_token:
|
||||
from_secret: registry_token
|
||||
commands:
|
||||
# Login at the registry
|
||||
- podman login -u __token__ --password $registry_token $registry
|
||||
# Build the container image
|
||||
- podman build --volume=/var/lib/containers:/var/lib/containers --tag $registry/$org/$container_name:latest --tag $registry/$org/$container_name:$CI_COMMIT_TAG .
|
||||
# Push the image
|
||||
- podman push $registry/$org/$container_name:latest
|
||||
- podman push $registry/$org/$container_name:$CI_COMMIT_TAG
|
|
@ -1,7 +1,6 @@
|
|||
FROM docker.io/library/nginx:alpine
|
||||
MAINTAINER philo email phil.dev@philome.mooo.com
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY treetrail-app/dist/treetrail/browser /usr/share/nginx/html
|
||||
COPY dist/treetrail/browser /usr/share/nginx/html
|
||||
|
|
11
README.md
11
README.md
|
@ -1 +1,10 @@
|
|||
Front-end for *Tree Trail*, a fun and pedagogic tool to discover the trails and trees around.
|
||||
# Treetrail web front-end
|
||||
|
||||
Front-end for *Tree Trail*, a fun and pedagogic tool
|
||||
to discover the trails and trees around.
|
||||
|
||||
Home page (source, bugs, etc):
|
||||
<https://code.philo.ydns.eu/philorg/treetrail-frontend> .
|
||||
|
||||
The main documentation for Tree Trail is:
|
||||
<https://code.philo.ydns.eu/philorg/treetrail-backend> .
|
||||
|
|
49
build.yaml
Normal file
49
build.yaml
Normal file
|
@ -0,0 +1,49 @@
|
|||
- name: Build container image
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
vars:
|
||||
repository: tiptop:5000
|
||||
force_rm: false
|
||||
cache: false
|
||||
|
||||
tasks:
|
||||
- name: Install dependencies
|
||||
command: pnpm install
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}"
|
||||
|
||||
- name: Build the Angular app
|
||||
command: ng build
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}"
|
||||
|
||||
- name: Get the version from git
|
||||
command: git describe --dirty --tags
|
||||
register: version
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}"
|
||||
|
||||
- name: Update version.json
|
||||
command: pnpm run version
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}"
|
||||
|
||||
- name: Build frontend container
|
||||
containers.podman.podman_image:
|
||||
name: "treetrail-frontend:{{ version.stdout }}"
|
||||
state: build
|
||||
force: true
|
||||
path: "{{ playbook_dir }}"
|
||||
build:
|
||||
format: oci
|
||||
force_rm: "{{ force_rm }}"
|
||||
cache: "{{ cache }}"
|
||||
file: Containerfile
|
||||
extra_args: "--build-arg APP_VERSION={{ version.stdout }}"
|
||||
push: true
|
||||
push_args:
|
||||
dest: "{{ repository }}/treetrail-frontend:{{ version.stdout }}"
|
||||
#quadlet_options:
|
||||
# - |
|
||||
# [Install]
|
||||
# WantedBy=default.target
|
66
nginx.conf
Normal file
66
nginx.conf
Normal file
|
@ -0,0 +1,66 @@
|
|||
events {
|
||||
worker_connections 1024; ## Default: 1024
|
||||
}
|
||||
|
||||
http {
|
||||
|
||||
## use mime types
|
||||
include /etc/nginx/mime.types;
|
||||
|
||||
server {
|
||||
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
location = / {
|
||||
## Convevience redirect to redirect to the web root
|
||||
return 301 /treetrail/;
|
||||
}
|
||||
|
||||
location = /treetrail {
|
||||
## Convevience redirect to redirect to the web root
|
||||
return 301 /treetrail/;
|
||||
}
|
||||
|
||||
location /treetrail/ {
|
||||
alias /usr/share/nginx/html/;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /treetrail/v1/ {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_redirect off;
|
||||
proxy_buffering off;
|
||||
proxy_pass http://127.0.0.1:8081;
|
||||
}
|
||||
}
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
## enable gzip compression
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 256;
|
||||
gzip_proxied any;
|
||||
|
||||
gzip_types
|
||||
## text/html is always compressed : https://nginx.org/en/docs/http/ngx_http_gzip_module.html
|
||||
text/plain
|
||||
text/css
|
||||
text/javascript
|
||||
application/javascript
|
||||
application/x-javascript
|
||||
application/xml
|
||||
application/json
|
||||
application/ld+json;
|
||||
}
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "treetrail",
|
||||
"version": "0.0.0",
|
||||
"version": "0.4.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "treetrail",
|
||||
"version": "0.0.0",
|
||||
"version": "0.4.5",
|
||||
"dependencies": {
|
||||
"@angular/animations": "^18.2.6",
|
||||
"@angular/cdk": "^18.2.6",
|
||||
|
|
12
package.json
12
package.json
|
@ -1,15 +1,14 @@
|
|||
{
|
||||
"name": "treetrail",
|
||||
"version": "0.0.0",
|
||||
"name": "treetrail-frontend",
|
||||
"version": "0.4.5",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve --proxy-config proxy.conf.json --port 4201",
|
||||
"start": "ng serve --proxy-config proxy.conf.json --port 4201 --serve-path /treetrail --host 0.0.0.0",
|
||||
"build": "ng build",
|
||||
"watch": "ng build --watch --configuration development",
|
||||
"test": "ng test",
|
||||
"openapi-ts": "openapi-ts"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^18.2.6",
|
||||
"@angular/cdk": "^18.2.6",
|
||||
|
@ -61,5 +60,8 @@
|
|||
"karma-jasmine-html-reporter": "^2.1.0",
|
||||
"typescript": "~5.4.5"
|
||||
},
|
||||
"packageManager": "pnpm@9.12.2"
|
||||
"packageManager": "pnpm@9.12.2",
|
||||
"publishConfig": {
|
||||
"registry": "http://code.philo.ydns.eu/api/packages/philorg/npm/"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
{
|
||||
"/static": {
|
||||
"/treetrail/static": {
|
||||
"target": "http://127.0.0.1:5002",
|
||||
"secure": false
|
||||
},
|
||||
"/v1": {
|
||||
"/treetrail/v1": {
|
||||
"target": "http://127.0.0.1:5002",
|
||||
"secure": false
|
||||
},
|
||||
"/attachment": {
|
||||
"/treetrail/attachment": {
|
||||
"target": "http://127.0.0.1:5002",
|
||||
"secure": false
|
||||
},
|
||||
"/tiles": {
|
||||
"/treetrail/tiles": {
|
||||
"target": "http://127.0.0.1:5002",
|
||||
"secure": false
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
</mat-card-title>
|
||||
<mat-card-content>
|
||||
<h2>Version</h2>
|
||||
<p><span class='h'>Client: </span>{{ (configService.conf | async).bootstrap.client.version }}></p>
|
||||
<p><span class='h'>Client: </span>{{ version }}></p>
|
||||
<p><span class='h'>Server: </span>{{ (configService.conf | async).bootstrap.server.version }}</p>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
|
@ -1,6 +1,7 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit } from '@angular/core'
|
||||
|
||||
import { ConfigService } from '../config.service'
|
||||
import packageJson from '../../../package.json'
|
||||
|
||||
@Component({
|
||||
selector: 'app-about',
|
||||
|
@ -12,6 +13,8 @@ export class AboutComponent implements OnInit {
|
|||
public configService: ConfigService,
|
||||
) { }
|
||||
|
||||
public version: string = packageJson.version
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { Component, OnInit,
|
||||
ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core'
|
||||
import {
|
||||
Component, OnInit,
|
||||
ChangeDetectorRef, ChangeDetectionStrategy
|
||||
} from '@angular/core'
|
||||
import { DataService } from './data.service'
|
||||
|
||||
import { ActionService } from './action.service'
|
||||
|
@ -10,7 +12,6 @@ import { combineLatest } from 'rxjs'
|
|||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class AppComponent implements OnInit {
|
||||
|
@ -20,7 +21,7 @@ export class AppComponent implements OnInit {
|
|||
public actionService: ActionService,
|
||||
public appUpdateService: AppUpdateService,
|
||||
public cdr: ChangeDetectorRef,
|
||||
) {}
|
||||
) { }
|
||||
title = 'treetrail'
|
||||
|
||||
ngOnInit(): void {
|
||||
|
|
|
@ -80,7 +80,7 @@ export class MapComponent implements AfterContentInit, OnInit {
|
|||
let conf = this.configService.conf.value
|
||||
let bms = conf.background
|
||||
if (conf.bootstrap.baseMapStyles.embedded.indexOf(bms) >= 0) {
|
||||
this.styleUrl = `/tiles/style/${bms}`
|
||||
this.styleUrl = `tiles/style/${bms}`
|
||||
}
|
||||
else {
|
||||
this.styleUrl = conf.bootstrap.baseMapStyles.external[bms]
|
||||
|
|
|
@ -3,7 +3,6 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
selector: 'app-profile',
|
||||
templateUrl: './profile.component.html',
|
||||
styleUrls: ['./profile.component.scss']
|
||||
})
|
||||
export class ProfileComponent {
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<div>
|
||||
<mat-button-toggle-group #background="matButtonToggleGroup"
|
||||
[value]="conf.background || conf.map?.background"
|
||||
(change)="configService.setUserPref('background', background.value)"
|
||||
(change)="configService.setUserPref('background', background.value) ; router.navigate(['/map'])"
|
||||
>
|
||||
<mat-button-toggle
|
||||
*ngFor="let bms of conf.bootstrap.baseMapStyles.embedded"
|
||||
|
@ -55,7 +55,7 @@
|
|||
<mat-label>Types of zones displayed on the map</mat-label>
|
||||
<div class="settings">
|
||||
<mat-checkbox *ngFor="let item of conf.showZones | keyvalue" [checked]="item.value"
|
||||
(change)="configService.setUserPrefValue('showZones', item.key, $event.checked)">
|
||||
(change)="configService.setUserPrefValue('showZones', item.key, $event.checked) ; router.navigate(['/map'])">
|
||||
{{ item.key }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
|
@ -108,7 +108,7 @@
|
|||
<li><span class='h'>Dave Storey</span>: communication</li>
|
||||
</ul>
|
||||
<p><span class='h'>Contact</span>: phil.treetrail at philome.mooo.com</p>
|
||||
<p><span class='h'>Version</span>: {{conf.bootstrap?.client.version }}</p>
|
||||
<p><span class='h'>Version</span>: {{conf.bootstrap?.client.version }}, frontend: {{ version }}</p>
|
||||
</mat-expansion-panel>
|
||||
|
||||
<mat-expansion-panel>
|
||||
|
|
|
@ -3,6 +3,7 @@ import { Router } from '@angular/router'
|
|||
|
||||
import { ActionService } from '../action.service'
|
||||
import { ConfigService, Config } from '../config.service'
|
||||
import packageJson from '../../../package.json'
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
|
@ -17,6 +18,8 @@ export class SettingsComponent implements OnInit {
|
|||
public router: Router,
|
||||
) { }
|
||||
|
||||
public version: string = packageJson.version
|
||||
|
||||
ngOnInit(): void {
|
||||
this.configService.conf.subscribe(
|
||||
conf => this.conf = conf
|
||||
|
|
0
src/assets/fonts/.gitignore
vendored
0
src/assets/fonts/.gitignore
vendored
|
@ -15,6 +15,8 @@
|
|||
"importHelpers": true,
|
||||
"target": "ES2022",
|
||||
"module": "es2020",
|
||||
//"allowSyntheticDefaultImports": true,
|
||||
"resolveJsonModule": true,
|
||||
"lib": [
|
||||
"es2019",
|
||||
"dom"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue