update
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
Rollback: empfang.html nach ..\\web\\empfang.html
|
||||
|
||||
Patch: Kontext Kopieren=Einfügen in Nachricht; Pinsel Patienten-Nr.; kein Basis14/pywebview Änderungen in diesem Stand.
|
||||
@@ -0,0 +1,73 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
AzA Empfang Web-Huelle: eigener Desktop-Prozess (pywebview).
|
||||
|
||||
Wird vom Desktop per subprocess gestartet, damit keine GUI-Kollision mit Tkinter entsteht.
|
||||
Argument: erste Start-URL (z.B. GET /empfang/shell/launch?token=...).
|
||||
|
||||
WebView2-Profil: pywebview nutzt standardmaessig ``private_mode=True`` (ephemeral) und
|
||||
speichert keine Site-Permissions zwischen Sessions. Für die Huelle setzen wir einen
|
||||
festen ``storage_path`` unter %APPDATA%\\AzA\\EmpfangWebView und ``private_mode=False``,
|
||||
damit z. B. Mikrofon-Erlaubnis für die App-URL persistiert (wie im normalen Edge-Profil),
|
||||
ohne den Systembrowser zu verwenden.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def _empfang_webview_storage_dir() -> str:
|
||||
"""Eigener User-Data-Ordner, isoliert vom normalen Browser."""
|
||||
appdata = (os.environ.get("APPDATA") or "").strip()
|
||||
if appdata:
|
||||
return str(Path(appdata) / "AzA" / "EmpfangWebView")
|
||||
return str(Path.home() / ".aza_empfang_webview")
|
||||
|
||||
|
||||
def main(argv: list[str] | None = None) -> int:
|
||||
argv = argv if argv is not None else sys.argv[1:]
|
||||
if not argv or not argv[0].strip():
|
||||
print(
|
||||
"Usage:\n"
|
||||
' python aza_empfang_webview.py "https://host/empfang/shell/launch?token=..."',
|
||||
file=sys.stderr,
|
||||
)
|
||||
return 2
|
||||
url = argv[0].strip()
|
||||
w = int(argv[1]) if len(argv) > 1 and str(argv[1]).isdigit() else 1180
|
||||
h = int(argv[2]) if len(argv) > 2 and str(argv[2]).isdigit() else 820
|
||||
|
||||
storage_path = _empfang_webview_storage_dir()
|
||||
try:
|
||||
Path(storage_path).mkdir(parents=True, exist_ok=True)
|
||||
except OSError as exc:
|
||||
print(
|
||||
f"WebView-Profil-Ordner konnte nicht angelegt werden ({storage_path}): {exc}",
|
||||
file=sys.stderr,
|
||||
)
|
||||
return 13
|
||||
|
||||
try:
|
||||
import webview # noqa: WPS433 (runtime dependency)
|
||||
except ImportError:
|
||||
print(
|
||||
"pywebview fehlt. Bitte installieren:\n"
|
||||
" pip install pywebview>=5",
|
||||
file=sys.stderr,
|
||||
)
|
||||
return 11
|
||||
|
||||
try:
|
||||
webview.create_window("AzA-Empfang", url, width=w, height=h)
|
||||
webview.start(storage_path=storage_path, private_mode=False)
|
||||
return 0
|
||||
except Exception as exc:
|
||||
print(str(exc), file=sys.stderr)
|
||||
return 12
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 40px;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
header {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
main {
|
||||
background: white;
|
||||
padding: 30px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.button {
|
||||
display: inline-block;
|
||||
padding: 10px 18px;
|
||||
background: #2d6cdf;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
background: #1b4fad;
|
||||
}
|
||||
|
||||
footer {
|
||||
margin-top: 40px;
|
||||
font-size: 12px;
|
||||
color: #777;
|
||||
}
|
||||
Reference in New Issue
Block a user