diff --git a/glance-system/glance-helper.yaml b/glance-system/glance-helper.yaml index 21c7802..856a232 100644 --- a/glance-system/glance-helper.yaml +++ b/glance-system/glance-helper.yaml @@ -24,9 +24,19 @@ data: import requests from bs4 import BeautifulSoup from fastapi import FastAPI, Response + from fastapi.middleware.cors import CORSMiddleware from prometheus_client import Counter, Histogram, Gauge, generate_latest, CONTENT_TYPE_LATEST APP = FastAPI() + + # Add CORS middleware to allow cross-origin requests from Glance dashboards + APP.add_middleware( + CORSMiddleware, + allow_origins=["https://kisfenyo.dooplex.hu", "https://orsi.dooplex.hu", "https://glance-helper.dooplex.hu"], + allow_credentials=True, + allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"], + allow_headers=["*"], + ) # ================================ # Időkép configuration @@ -1246,7 +1256,6 @@ data: }, ensure_ascii=False), media_type="application/json; charset=utf-8" ) - --- apiVersion: apps/v1 kind: Deployment diff --git a/glance-system/glance-kisfenyo.yaml b/glance-system/glance-kisfenyo.yaml index 2d4e9aa..1227147 100644 --- a/glance-system/glance-kisfenyo.yaml +++ b/glance-system/glance-kisfenyo.yaml @@ -777,14 +777,13 @@ data: {{ $user := .Options.StringOr "user" "kisfenyo" }} {{ $apiKey := .Options.StringOr "api_key" "" }} {{ $todos := .JSON.Array "todos" }} - {{ $widgetId := "todo-kisfenyo" }} -
+
- + - + +
-
+
{{ if eq (len $todos) 0 }}
No tasks yet
{{ else }} {{ range $todos }} - {{ $id := .String "id" }} - {{ $text := .String "text" }} - {{ $done := .Bool "done" }} -
-
- {{ $text }} - +
+
+ {{ .String "text" }} +
{{ end }} {{ end }} @@ -856,76 +848,69 @@ data: # Outline Notes iframe @@ -1026,7 +1011,6 @@ data: {{ $apiKey := .Options.StringOr "api_key" "" }} {{ $quote := .JSON.String "quote" }} {{ $total := .JSON.Int "total" }} - {{ $widgetId := "motiv-kisfenyo" }} -
+
{{ $quote }}
{{ $total }} quotes - ⚙️ Manage +
-
- - -
-
-
- Manage Motivation Quotes - -
-
-
- - +
+
+
+ Manage Motivation Quotes +
-
Your Quotes
-
-
Loading quotes...
+
+
+ + +
+
Your Quotes
+
Click Manage to load quotes
@@ -1156,111 +1111,121 @@ data: