von single Page hin zur mehreren Seiten geändert
This commit is contained in:
1 parent
8c94fc91f6
commit
31c4bd47cd
36 files changed
+207
-97
No files matched your search
@@ -30,7 +30,7 @@ user-facing text.
|
||||
├── .vscode/extensions.json
|
||||
├── public/
|
||||
│ ├── Test.html # main app (served at /)
|
||||
│ ├── js/ # main app modules (classic scripts, global fns)
|
||||
│ ├── js/ # shared modules (classic scripts, global fns)
|
||||
│ │ ├── globals.js # Konstanten (LPHS, ROLES, LPH-Farben, DEPARTMENTS) + db/currentDepartment
|
||||
│ │ ├── utils.js # esc, uid, Datum-/Differenz-Helfer, personIdForName, weekSortKey-Quelle
|
||||
│ │ ├── ui.js # LocalStorage-UI-State, Header-Collapse, Theme
|
||||
@@ -39,15 +39,19 @@ user-facing text.
|
||||
│ │ ├── server.js # baseUrl, sendCsvToServer, deleteCsvFromServer, blobToDataUrl
|
||||
│ │ ├── store.js # save/syncAllToServer, switchDepartment, load, seed
|
||||
│ │ ├── weeks.js # Wochen-Auswahl, -Erzeugung, -Klonen, Auto-Lock, -Löschung
|
||||
│ │ ├── board.js # Projektboard-Rendering, Status-Editor, Anwesenheit, Zuordnung
|
||||
│ │ ├── people.js # Personen-Tab-Rendering + Drag-and-Drop + Abwesenheiten
|
||||
│ │ ├── projects.js # Projekte-Tab-Rendering + Drag-and-Drop
|
||||
│ │ ├── load.js # Auslastungs-Tab, LP-Modal, Neues-Projekt-Modal
|
||||
│ │ ├── gantt.js # GANTT-Diagramm (buildGanttHtml, openProjectPlan), geshared
|
||||
│ │ ├── showmode.js # Show-Mode (Präsentationsmodus)
|
||||
│ │ ├── tabs-auth.js # showTab, confirmPassword (SHA256-Passwortschutz)
|
||||
│ │ ├── pdf.js # PDF-Export (pdfmake, A3 quer)
|
||||
│ │ └── init.js # renderAll/initUiState + Seiteneinstieg (nur Test.html)
|
||||
│ │ ├── board/ # tab-specific: Projektboard
|
||||
│ │ │ └── board.js # Projektboard-Rendering, Status-Editor, Anwesenheit, Zuordnung
|
||||
│ │ ├── people/ # tab-specific: Projektbeteiligte
|
||||
│ │ │ └── people.js # Personen-Tab-Rendering + Drag-and-Drop + Abwesenheiten
|
||||
│ │ ├── projects/ # tab-specific: Projekte
|
||||
│ │ │ └── projects.js # Projekte-Tab-Rendering + Drag-and-Drop
|
||||
│ │ ├── load/ # tab-specific: Auslastung
|
||||
│ │ │ └── load.js # Auslastungs-Tab, LP-Modal, Neues-Projekt-Modal
|
||||
│ ├── project-plan.html # Gantt/TODO planning view
|
||||
│ ├── js/plan/ # planning modules (nur von project-plan.html geladen)
|
||||
│ │ ├── plan-state.js # PlanApp-Zustand, Datenladepath, savePlan, Toasts
|
||||
@@ -79,6 +83,16 @@ docker compose up --build # Docker variant (compose file is at repo root)
|
||||
## Server API (`server.js`)
|
||||
|
||||
- `GET /` → `Test.html`; `GET /health`.
|
||||
- Deep links per department + tab: `GET /<Dept>/<Tab>` → `Test.html`, e.g.
|
||||
`/HLS/Auslastung` or `/ELT/Projektübersicht`. Tab slugs (`TAB_SLUGS` in
|
||||
`js/globals.js`) are `Projektübersicht|Auslastung|Projekte|Projektbeteiligte`;
|
||||
anything else returns 404. Exception: `GET /<Dept>/Projektplan(/<ProjName>)?`
|
||||
(`PLAN_SLUG`) serves `project-plan.html`, the GANTT view, with
|
||||
`weekLabel|projNr` as query params (the project name is a readable path
|
||||
segment only; identification happens via weekLabel + projNr). The frontend
|
||||
reads/writes these routes via `applyUrlRoute()`/`updateRouteUrl()` in
|
||||
`js/ui.js` and all static assets in the HTML use **absolute** paths
|
||||
(`/js/...`, `/styles.css`) so they resolve on nested routes.
|
||||
- `GET /load-all?department=` → `{sessions:[{filename,content}], people}` with
|
||||
`_people.csv` content in `people`; sessions sorted by filename.
|
||||
- `POST /save-csv {filename, csv, department}` → writes UTF-8 BOM CSV.
|
||||
@@ -112,8 +126,9 @@ docker compose up --build # Docker variant (compose file is at repo root)
|
||||
them via `<script src>` tags; load order in the HTML defines dependencies,
|
||||
since there is no bundler:
|
||||
- `Test.html` loads `globals → utils → ui → date-picker → csv → server →
|
||||
store → weeks → board → people → projects → load → gantt → showmode →
|
||||
tabs-auth → pdf → init`. See the exact list in `Test.html`.
|
||||
store → weeks` (shared modules), then the tab-specific folders `board →
|
||||
people → projects → load`, finally `gantt → showmode → tabs-auth → pdf →
|
||||
init`. See the exact list in `Test.html`.
|
||||
- `project-plan.html` loads only `globals → utils → ui → date-picker → csv →
|
||||
server → gantt` plus the `js/plan/*` modules. It must NOT load modules that
|
||||
touch main-only page elements (`store`, `weeks`, `board`, …, `init`).
|
||||
@@ -122,8 +137,10 @@ docker compose up --build # Docker variant (compose file is at repo root)
|
||||
`db`/`currentDepartment` live in `js/globals.js`.
|
||||
- State: `let db = { weeks, currentWeek, globalPeople }` (in-memory only).
|
||||
- Project IDs are regenerated on every CSV load, so projects are addressed
|
||||
cross-page by `department` + week `label` + `projNr` + `projName` via URL
|
||||
params (`openProjectPlan`, `findProjectForPlan`).
|
||||
cross-page by `department` + week `label` + `projNr` (+ readable projName path
|
||||
segment) via URL params: `openProjectPlan()` builds
|
||||
`/HLS/Projektplan/<ProjName>?weekLabel=…&projNr=…`, `findProjectForPlan`
|
||||
resolves them.
|
||||
- Person IDs are stable across reloads via `personIdForName(name)` →
|
||||
`p_<lowercased alnum>`.
|
||||
- `save()` debounces 500 ms then `syncAllToServer()` writes **all** weeks plus
|
||||
@@ -135,8 +152,12 @@ docker compose up --build # Docker variant (compose file is at repo root)
|
||||
- `applyAutoLock()` locks every week except the chronologically last one after
|
||||
load/clone/new-week; `localStorage` UI state is not restored for locked tabs.
|
||||
- `localStorage` keys: `projuebersicht_v1` (department only — tab is never
|
||||
restored), `projuebersicht-theme`, header-collapse key. Do **not** store data
|
||||
in `localStorage`; it is UI state only.
|
||||
restored from storage; at startup the tab comes from the deep-link URL if
|
||||
present, otherwise `board`), `projuebersicht-theme`, header-collapse key. Do
|
||||
**not** store data in `localStorage`; it is UI state only.
|
||||
- Deep-link URLs (`/<Dept>/<Tab>`) are shared via the address bar:
|
||||
`updateRouteUrl()` rewrites the path via `history.replaceState` on tab and
|
||||
department switches; protected tabs keep the URL but open the password modal.
|
||||
|
||||
## Auth / security quirk
|
||||
|
||||
@@ -147,7 +168,7 @@ docker compose up --build # Docker variant (compose file is at repo root)
|
||||
loaded from `cdnjs.cloudflare.com` in `Test.html`, so those features need
|
||||
internet access and won't work offline. `project-plan.html` loads neither.
|
||||
- User-provided status HTML is sanitized on render via a small whitelist
|
||||
(`sanitizeStatusHtml` in `js/board.js`) to mitigate XSS.
|
||||
(`sanitizeStatusHtml` in `js/board/board.js`) to mitigate XSS.
|
||||
|
||||
## Docker
|
||||
|
||||
|
||||
Reference in new issue
Block a user