Skip to content

Commit

Permalink
feat(dashbaord): スリープ復帰時のローディング画面 (#997)
Browse files Browse the repository at this point in the history
Co-authored-by: pirosiki <[email protected]>
Co-authored-by: pirosiki197 <[email protected]>
  • Loading branch information
3 people authored Jan 18, 2025
1 parent cbeb1b2 commit 467eae4
Show file tree
Hide file tree
Showing 5 changed files with 356 additions and 80 deletions.
24 changes: 12 additions & 12 deletions .local-dev/config/ns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ image:
registry:
scheme: http
addr: registry.local
username: ""
password: ""
username: ''
password: ''
namePrefix: ns-apps/
tmpNamePrefix: ns-apps-tmp/

Expand All @@ -35,20 +35,20 @@ components:
address: http://buildpack:1235
listenPort: 1235
remoteDir: /workspace
platformAPI: "0.11"
platformAPI: '0.11'
controller:
url: http://ns-controller:10000
priority: 0
stepTimeout: "1h"
stepTimeout: '1h'

controller:
port: 10000
token: "my-super-secret-token"
token: 'my-super-secret-token'
mode: docker
docker:
confDir: /opt/traefik/conf
domains:
- domain: "*.local.trapti.tech"
- domain: '*.local.trapti.tech'
excludes: []
auth:
available: true
Expand Down Expand Up @@ -81,7 +81,7 @@ components:
url: http://sablier:10000
sessionDuration: 5m
dynamic:
theme: ghost
theme: neoshowcase
blocking:
timeout: 1m
tls:
Expand All @@ -102,7 +102,7 @@ components:

k8s:
domains:
- domain: "*.local.trapti.tech"
- domain: '*.local.trapti.tech'
excludes: []
auth:
available: true
Expand Down Expand Up @@ -145,7 +145,7 @@ components:
url: http://sablier.sablier.svc.cluster.local
sessionDuration: 5m
dynamic:
theme: ghost
theme: neoshowcase
blocking:
timeout: 1m
tls:
Expand All @@ -156,7 +156,7 @@ components:
domains: []

namespace: ns-apps
imagePullSecret: ""
imagePullSecret: ''
# extra labels
labels:
- key: app.kubernetes.io/instance
Expand Down Expand Up @@ -197,7 +197,7 @@ components:
type: loki
loki:
endpoint: http://loki:3100
queryTemplate: "{ns_trap_jp_app_id=\"{{ .App.ID }}\"}"
queryTemplate: '{ns_trap_jp_app_id="{{ .App.ID }}"}'
metrics:
type: prometheus
prometheus:
Expand All @@ -214,7 +214,7 @@ components:
giteaIntegration:
url: https://git.trap.jp
token: ""
token: ''
controller:
url: http://ns-controller:10000

Expand Down
5 changes: 5 additions & 0 deletions .local-dev/config/sablier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ sessions:
expiration-interval: 20s
logging:
level: trace
strategy:
dynamic:
custom-themes-path: /etc/sablier/themes
default-theme: neoshowcase
default-refresh-frequency: 5s
3 changes: 3 additions & 0 deletions .local-manifest/sablier/sablier-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ spec:
- name: project
subPath: .local-dev/config/sablier.yaml
mountPath: /etc/sablier/sablier.yaml
- name: project
subPath: dashboard/sablier-theme
mountPath: /etc/sablier/themes
138 changes: 70 additions & 68 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ services:
- ./.local-dev/keys:/keys
- ~/.ssh/known_hosts:/root/.ssh/known_hosts
labels:
- "traefik.enable=true"
- "traefik.http.routers.ns-gateway.rule=Host(`ns.local.trapti.tech`) && PathPrefix(`/neoshowcase.protobuf.APIService`)"
- 'traefik.enable=true'
- 'traefik.http.routers.ns-gateway.rule=Host(`ns.local.trapti.tech`) && PathPrefix(`/neoshowcase.protobuf.APIService`)'
# - "traefik.http.routers.ns-gateway.middlewares=ns_auth@file"
- "traefik.http.routers.ns-gateway.middlewares=ns_auth_dev@file"
- "traefik.http.routers.ns-gateway.service=ns-gateway"
- "traefik.http.services.ns-gateway.loadbalancer.server.port=8080"
- 'traefik.http.routers.ns-gateway.middlewares=ns_auth_dev@file'
- 'traefik.http.routers.ns-gateway.service=ns-gateway'
- 'traefik.http.services.ns-gateway.loadbalancer.server.port=8080'
depends_on:
mysql:
condition: service_healthy
Expand All @@ -36,12 +36,12 @@ services:
- ./dashboard:/work
- /work/node_modules
labels:
- "traefik.enable=true"
- "traefik.http.routers.ns_dashboard.rule=Host(`ns.local.trapti.tech`)"
- 'traefik.enable=true'
- 'traefik.http.routers.ns_dashboard.rule=Host(`ns.local.trapti.tech`)'
# - "traefik.http.routers.ns_dashboard.middlewares=ns_auth@file"
- "traefik.http.routers.ns_dashboard.middlewares=ns_auth_dev@file"
- "traefik.http.routers.ns_dashboard.service=ns_dashboard"
- "traefik.http.services.ns_dashboard.loadbalancer.server.port=80"
- 'traefik.http.routers.ns_dashboard.middlewares=ns_auth_dev@file'
- 'traefik.http.routers.ns_dashboard.service=ns_dashboard'
- 'traefik.http.services.ns_dashboard.loadbalancer.server.port=80'
networks:
- default

Expand All @@ -68,14 +68,14 @@ services:
ns-migrate:
condition: service_completed_successfully
labels:
- "traefik.enable=true"
- "traefik.http.routers.ns_controller_webhook.rule=Host(`ns.local.trapti.tech`) && PathPrefix(`/api/webhook`)"
- "traefik.http.routers.ns_controller_webhook.service=ns_controller_webhook"
- "traefik.http.services.ns_controller_webhook.loadbalancer.server.port=8080"
- "traefik.tcp.routers.ns_controller.entrypoints=ns-ssh"
- "traefik.tcp.routers.ns_controller.rule=HostSNI(`*`)"
- "traefik.tcp.routers.ns_controller.service=ns_controller"
- "traefik.tcp.services.ns_controller.loadbalancer.server.port=2201"
- 'traefik.enable=true'
- 'traefik.http.routers.ns_controller_webhook.rule=Host(`ns.local.trapti.tech`) && PathPrefix(`/api/webhook`)'
- 'traefik.http.routers.ns_controller_webhook.service=ns_controller_webhook'
- 'traefik.http.services.ns_controller_webhook.loadbalancer.server.port=8080'
- 'traefik.tcp.routers.ns_controller.entrypoints=ns-ssh'
- 'traefik.tcp.routers.ns_controller.rule=HostSNI(`*`)'
- 'traefik.tcp.routers.ns_controller.service=ns_controller'
- 'traefik.tcp.services.ns_controller.loadbalancer.server.port=2201'
networks:
- default

Expand Down Expand Up @@ -105,10 +105,10 @@ services:
volumes:
- ./.local-dev/config/ns-auth.yaml:/config.yaml
labels:
- "traefik.enable=true"
- "traefik.http.routers.ns_auth.rule=Host(`auth.local.trapti.tech`)"
- "traefik.http.routers.ns_auth.service=ns_auth"
- "traefik.http.services.ns_auth.loadbalancer.server.port=4181"
- 'traefik.enable=true'
- 'traefik.http.routers.ns_auth.rule=Host(`auth.local.trapti.tech`)'
- 'traefik.http.routers.ns_auth.service=ns_auth'
- 'traefik.http.services.ns_auth.loadbalancer.server.port=4181'
networks:
- default

Expand All @@ -120,7 +120,7 @@ services:
restart: always
environment:
HEADER: X-Showcase-User
USER: "toki"
USER: 'toki'
networks:
- default

Expand Down Expand Up @@ -152,7 +152,7 @@ services:
context: .
target: ns
image: ghcr.io/traptitech/ns:main
restart: "no"
restart: 'no'
entrypoint: cp /app/ns /ns-bin
volumes:
- binary:/ns-bin
Expand Down Expand Up @@ -188,14 +188,14 @@ services:
deploy:
resources:
limits:
cpus: "1"
cpus: '1'

static-server:
image: caddy:2-alpine
restart: always
environment:
# Do not bind to all addresses in production!
CADDY_ADMIN: ":2019"
CADDY_ADMIN: ':2019'
volumes:
- ./.local-dev/staticsite/artifacts:/artifacts
networks:
Expand Down Expand Up @@ -225,13 +225,13 @@ services:
context: .
target: ns-migrate
image: ghcr.io/traptitech/ns-migrate:main
restart: "no"
restart: 'no'
environment:
DB_HOST: "mysql"
DB_PORT: "3306"
DB_USER: "root"
DB_PASS: "password"
DB_NAME: "neoshowcase"
DB_HOST: 'mysql'
DB_PORT: '3306'
DB_USER: 'root'
DB_PASS: 'password'
DB_NAME: 'neoshowcase'
depends_on:
mysql:
condition: service_healthy
Expand All @@ -242,36 +242,36 @@ services:
image: registry:2
restart: always
environment:
REGISTRY_STORAGE_DELETE_ENABLED: "true"
REGISTRY_STORAGE_DELETE_ENABLED: 'true'
REGISTRY_HTTP_ADDR: :80
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
GC_SCRIPT: /gc.sh
labels:
- "traefik.enable=true"
- "traefik.http.routers.registry.rule=Host(`registry.local`)"
- "traefik.http.services.registry.loadbalancer.server.port=80"
- 'traefik.enable=true'
- 'traefik.http.routers.registry.rule=Host(`registry.local`)'
- 'traefik.http.services.registry.loadbalancer.server.port=80'
volumes:
- ./.local-dev/registry/entrypoint.sh:/entrypoint.sh
- ./.local-dev/registry/gc.sh:/gc.sh
- ./.local-dev/registry-data:/var/lib/registry
networks:
default:
aliases:
- "registry.local"
- 'registry.local'

registry-frontend:
image: joxit/docker-registry-ui:2
restart: always
environment:
SINGLE_REGISTRY: "true"
SINGLE_REGISTRY: 'true'
REGISTRY_TITLE: registry.local
NGINX_PROXY_PASS_URL: http://registry.local
SHOW_CONTENT_DIGEST: "true"
DELETE_IMAGES: "true"
SHOW_CONTENT_DIGEST: 'true'
DELETE_IMAGES: 'true'
labels:
- "traefik.enable=true"
- "traefik.http.routers.registry_frontend.rule=Host(`registry-frontend.local.trapti.tech`)"
- "traefik.http.services.registry_frontend.loadbalancer.server.port=80"
- 'traefik.enable=true'
- 'traefik.http.routers.registry_frontend.rule=Host(`registry-frontend.local.trapti.tech`)'
- 'traefik.http.services.registry_frontend.loadbalancer.server.port=80'
networks:
- default

Expand All @@ -290,7 +290,7 @@ services:
volumes:
- ./.local-dev/mysql:/var/lib/mysql
ports:
- "5004:3306"
- '5004:3306'
networks:
- default
- apps
Expand All @@ -304,7 +304,7 @@ services:
volumes:
- ./.local-dev/mongo:/data/db
ports:
- "5010:27017"
- '5010:27017'
networks:
- default
- apps
Expand All @@ -316,19 +316,19 @@ services:
ADMINER_DEFAULT_SERVER: mysql
ADMINER_DESIGN: nette
labels:
- "traefik.enable=true"
- "traefik.http.routers.adminer.rule=Host(`adminer.local.trapti.tech`)"
- "traefik.http.services.adminer.loadbalancer.server.port=8080"
- 'traefik.enable=true'
- 'traefik.http.routers.adminer.rule=Host(`adminer.local.trapti.tech`)'
- 'traefik.http.services.adminer.loadbalancer.server.port=8080'
networks:
- default

grafana:
image: grafana/grafana:11.1.3
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.grafana.rule=Host(`grafana.local.trapti.tech`)"
- "traefik.http.services.grafana.loadbalancer.server.port=3000"
- 'traefik.enable=true'
- 'traefik.http.routers.grafana.rule=Host(`grafana.local.trapti.tech`)'
- 'traefik.http.services.grafana.loadbalancer.server.port=3000'
volumes:
- ./.local-dev/grafana:/var/lib/grafana
- ./.local-dev/config/grafana.ini:/etc/grafana/grafana.ini:ro
Expand All @@ -337,13 +337,13 @@ services:

loki:
image: grafana/loki:3.1.0
command: "-config.file /etc/loki/loki.yaml"
command: '-config.file /etc/loki/loki.yaml'
restart: always
labels:
# for debug
- "traefik.enable=true"
- "traefik.http.routers.loki.rule=Host(`loki.local.trapti.tech`)"
- "traefik.http.services.loki.loadbalancer.server.port=3100"
- 'traefik.enable=true'
- 'traefik.http.routers.loki.rule=Host(`loki.local.trapti.tech`)'
- 'traefik.http.services.loki.loadbalancer.server.port=3100'
volumes:
- ./.local-dev/loki:/var/lib/loki
- ./.local-dev/config/loki.yaml:/etc/loki/loki.yaml:ro
Expand All @@ -352,7 +352,7 @@ services:

promtail:
image: grafana/promtail:3.1.0
command: "-config.file /etc/promtail/promtail.yaml"
command: '-config.file /etc/promtail/promtail.yaml'
restart: always
volumes:
- ./.local-dev/config/promtail.yaml:/etc/promtail/promtail.yaml
Expand Down Expand Up @@ -396,6 +396,8 @@ services:
- --provider.name=docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./.local-dev/config/sablier.yaml:/etc/sablier/sablier.yaml
- ./dashboard/sablier-theme:/etc/sablier/themes

traefik:
image: traefik:3.1
Expand All @@ -420,22 +422,22 @@ services:
- --experimental.plugins.sablier.modulename=github.com/sablierapp/sablier
- --experimental.plugins.sablier.version=v1.8.1
ports:
- "80:80"
- "443:443"
- "2201:2201"
- "8080:8080"
- "9100:9100"
- '80:80'
- '443:443'
- '2201:2201'
- '8080:8080'
- '9100:9100'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./.local-dev/traefik:/opt/neoshowcase/conf
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik_dashboard.rule=Host(`traefik.local.trapti.tech`)"
- "traefik.http.routers.traefik_dashboard.service=traefik_dashboard"
- "traefik.http.services.traefik_dashboard.loadbalancer.server.port=8080"
- "traefik.http.routers.traefik_metrics.rule=Host(`traefik.local.trapti.tech`) && PathPrefix(`/metrics`)"
- "traefik.http.routers.traefik_metrics.service=traefik_metrics"
- "traefik.http.services.traefik_metrics.loadbalancer.server.port=9100"
- 'traefik.enable=true'
- 'traefik.http.routers.traefik_dashboard.rule=Host(`traefik.local.trapti.tech`)'
- 'traefik.http.routers.traefik_dashboard.service=traefik_dashboard'
- 'traefik.http.services.traefik_dashboard.loadbalancer.server.port=8080'
- 'traefik.http.routers.traefik_metrics.rule=Host(`traefik.local.trapti.tech`) && PathPrefix(`/metrics`)'
- 'traefik.http.routers.traefik_metrics.service=traefik_metrics'
- 'traefik.http.services.traefik_metrics.loadbalancer.server.port=9100'
networks:
- default
- apps
Expand Down
Loading

0 comments on commit 467eae4

Please sign in to comment.