opencode ergebnis V0.1

This commit is contained in:
concierge committed 2026-10-23 00:05:06 +02:00
1 parent 61d86a3d83
commit 7e498ebc3f
71 files changed
+28982 -46

No files matched your search

+100
View File
@@ -0,0 +1,100 @@
{% extends "base.html" %}
{% block title %}Accountverwaltung - CMBNet{% endblock %}
{% block content %}
<h1>Accountverwaltung</h1>
<p><a href="{{ url_for('views.dispatcher', tenant=session.tenant_code) }}">← Zurück</a> | <a href="{{ url_for('auth.logout', tenant=session.tenant_code) }}">Abmelden</a></p>
<table id="accountsTable">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Rolle</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
{% for account in accounts %}
<tr data-id="{{ account.id }}">
<td>{{ account.id }}</td>
<td>{{ account.name }}</td>
<td>
<select onchange="changeRole({{ account.id }}, this.value)">
<option value="Gast" {% if account.role == 'Gast' %}selected{% endif %}>Gast</option>
<option value="Beobachter" {% if account.role == 'Beobachter' %}selected{% endif %}>Beobachter</option>
<option value="Gruppe" {% if account.role == 'Gruppe' %}selected{% endif %}>Gruppe</option>
<option value="Dispatcher" {% if account.role == 'Dispatcher' %}selected{% endif %}>Dispatcher</option>
<option value="Administrator" {% if account.role == 'Administrator' %}selected{% endif %}>Administrator</option>
</select>
</td>
<td>
<button onclick="openPasswordModal({{ account.id }})">Passwort zurücksetzen</button>
<button class="secondary" onclick="deleteAccount({{ account.id }})">Löschen</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<button onclick="openCreateAccountModal()">Neuer Account</button>
<nav>
<ul>
<li><a href="{{ url_for('admin_gruppen.gruppen', tenant=session.tenant_code) }}">Gruppenverwaltung</a></li>
<li><a href="{{ url_for('admin_strassen.strassen', tenant=session.tenant_code) }}">Straßenverwaltung</a></li>
</ul>
</nav>
<!-- Passwort Modal -->
<dialog id="passwordModal">
<article>
<header>
<a href="#close" aria-label="Close" class="close" onclick="closePasswordModal()"></a>
<h3>Passwort zurücksetzen</h3>
</header>
<input type="hidden" id="pwdAccountId">
<label>Neues Passwort
<input type="password" id="newPassword">
</label>
<footer>
<button onclick="closePasswordModal()">Abbrechen</button>
<button onclick="resetPassword()">Zurücksetzen</button>
</footer>
</article>
</dialog>
<!-- Create Account Modal -->
<dialog id="createAccountModal">
<article>
<header>
<a href="#close" aria-label="Close" class="close" onclick="closeCreateAccountModal()"></a>
<h3>Neuer Account</h3>
</header>
<label>Name
<input type="text" id="newAccountName">
</label>
<label>Passwort
<input type="password" id="newAccountPassword">
</label>
<label>Rolle
<select id="newAccountRole">
<option value="Gast">Gast</option>
<option value="Beobachter">Beobachter</option>
<option value="Gruppe">Gruppe</option>
<option value="Dispatcher">Dispatcher</option>
<option value="Administrator">Administrator</option>
</select>
</label>
<footer>
<button onclick="closeCreateAccountModal()">Abbrechen</button>
<button onclick="createAccount()">Anlegen</button>
</footer>
</article>
</dialog>
{% endblock %}
{% block scripts %}
<script src="{{ url_for('static', filename='js/views/admin_accounts.js') }}"></script>
{% endblock %}
+109
View File
@@ -0,0 +1,109 @@
{% extends "base.html" %}
{% block title %}Gruppenverwaltung - CMBNet{% endblock %}
{% block content %}
<h1>Gruppenverwaltung</h1>
<p><a href="{{ url_for('admin.accounts', tenant=session.tenant_code) }}">← Zurück zur Accountverwaltung</a></p>
<table id="gruppenTable">
<thead>
<tr>
<th>ID</th>
<th>Aliasname</th>
<th>State</th>
<th>Account</th>
<th>Position</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
{% for gruppe in gruppen %}
<tr data-id="{{ gruppe.id }}">
<td>{{ gruppe.id }}</td>
<td><input type="text" value="{{ gruppe.aliasname or '' }}" onchange="updateGruppe({{ gruppe.id }}, {aliasname: this.value})"></td>
<td>
<select onchange="updateGruppe({{ gruppe.id }}, {state: this.value})">
<option value="offen" {% if gruppe.state == 'offen' %}selected{% endif %}>offen</option>
<option value="unterwegs" {% if gruppe.state == 'unterwegs' %}selected{% endif %}>unterwegs</option>
<option value="online" {% if gruppe.state == 'online' %}selected{% endif %}>online</option>
<option value="pausierend" {% if gruppe.state == 'pausierend' %}selected{% endif %}>pausierend</option>
<option value="fertig" {% if gruppe.state == 'fertig' %}selected{% endif %}>fertig</option>
</select>
</td>
<td>
<select onchange="updateGruppe({{ gruppe.id }}, {account_id: this.value})">
<option value="">-</option>
{% for acc in accounts %}
<option value="{{ acc.id }}" {% if gruppe.account_id == acc.id %}selected{% endif %}>{{ acc.name }}</option>
{% endfor %}
</select>
</td>
<td class="group-position">{% if gruppe.last_lat is not none and gruppe.last_lon is not none %}{{ gruppe.last_lat }}, {{ gruppe.last_lon }}{% else %}unbekannt{% endif %}</td>
<td>
<button onclick="showHistory({{ gruppe.id }})">Historie</button>
<button class="secondary delete-position" onclick="deleteGroupPosition({{ gruppe.id }})" {% if gruppe.last_lat is none or gruppe.last_lon is none %}disabled{% endif %}>Position löschen</button>
<button class="secondary" onclick="deleteGruppe({{ gruppe.id }})">Löschen</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<button onclick="openCreateGruppeModal()">Neue Gruppe</button>
<!-- Create Gruppe Modal -->
<dialog id="createGruppeModal">
<article>
<header>
<a href="#close" aria-label="Close" class="close" onclick="closeCreateGruppeModal()"></a>
<h3>Neue Gruppe</h3>
</header>
<label>Aliasname
<input type="text" id="gruppeAlias">
</label>
<label>Account (Rolle Gruppe)
<select id="gruppeAccount">
<option value="">-</option>
{% for acc in accounts %}
<option value="{{ acc.id }}">{{ acc.name }}</option>
{% endfor %}
</select>
</label>
<footer>
<button onclick="closeCreateGruppeModal()">Abbrechen</button>
<button onclick="createGruppe()">Anlegen</button>
</footer>
</article>
</dialog>
<!-- History Modal -->
<dialog id="historyModal">
<article style="max-width: 800px;">
<header>
<a href="#close" aria-label="Close" class="close" onclick="closeHistoryModal()"></a>
<h3>Gruppen-Historie</h3>
</header>
<table>
<thead>
<tr>
<th>Datum</th>
<th>Von</th>
<th>Nach</th>
<th>Position</th>
<th>Aktion</th>
</tr>
</thead>
<tbody id="historyBody">
</tbody>
</table>
<footer>
<button onclick="closeHistoryModal()">Schließen</button>
</footer>
</article>
</dialog>
{% endblock %}
{% block scripts %}
<script src="{{ url_for('static', filename='js/views/admin_gruppen.js') }}"></script>
{% endblock %}
+130
View File
@@ -0,0 +1,130 @@
{% extends "base.html" %}
{% block title %}Straßenverwaltung - CMBNet{% endblock %}
{% block content %}
<h1>Straßenverwaltung</h1>
<p><a href="{{ url_for('admin.accounts', tenant=session.tenant_code) }}">← Zurück zur Accountverwaltung</a></p>
<table id="strassenTable">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>State</th>
<th>Gruppe</th>
<th>HN Min</th>
<th>HN Max</th>
<th>BBox</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
{% for strasse in strassen %}
<tr data-id="{{ strasse.id }}">
<td>{{ strasse.id }}</td>
<td>{{ strasse.name }}</td>
<td>
<select onchange="updateStrasse({{ strasse.id }}, {state: this.value})">
<option value="unbearbeitet" {% if strasse.state == 'unbearbeitet' %}selected{% endif %}>unbearbeitet</option>
<option value="zugewiesen" {% if strasse.state == 'zugewiesen' %}selected{% endif %}>zugewiesen</option>
<option value="erledigt" {% if strasse.state == 'erledigt' %}selected{% endif %}>erledigt</option>
</select>
</td>
<td>
<select onchange="updateStrasse({{ strasse.id }}, {group_id: this.value})">
<option value="">-</option>
{% for gruppe in gruppen %}
<option value="{{ gruppe.id }}" {% if strasse.group_id == gruppe.id %}selected{% endif %}>{{ gruppe.aliasname or gruppe.id }}</option>
{% endfor %}
</select>
</td>
<td>{{ strasse.hn_min or '-' }}</td>
<td>{{ strasse.hn_max or '-' }}</td>
<td>{{ strasse.bbox[:20] if strasse.bbox else '-' }}</td>
<td>
<button onclick="editStrasse({{ strasse.id }})">✎</button>
<button onclick="showStreetHistory({{ strasse.id }})">Historie</button>
<button class="secondary" onclick="deleteStrasse({{ strasse.id }})">🗑</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<button onclick="openCreateStrasseModal()">Neue Straße</button>
<button onclick="document.getElementById('csvFile').click()">Import CSV</button>
<input type="file" id="csvFile" accept=".csv" style="display:none" onchange="importCSV(this)">
<!-- Create/Edit Strasse Modal -->
<dialog id="strasseModal">
<article>
<header>
<a href="#close" aria-label="Close" class="close" onclick="closeStrasseModal()"></a>
<h3 id="strasseModalTitle">Straße</h3>
</header>
<input type="hidden" id="strasseId">
<label>Name
<input type="text" id="strasseName">
</label>
<label>Hausnummer minimal
<input type="number" id="strasseHnMin">
</label>
<label>Hausnummer maximal
<input type="number" id="strasseHnMax">
</label>
<label>Bounding Box (JSON Array)
<textarea id="strasseBbox"></textarea>
</label>
<label>State
<select id="strasseState">
<option value="unbearbeitet">unbearbeitet</option>
<option value="zugewiesen">zugewiesen</option>
<option value="erledigt">erledigt</option>
</select>
</label>
<label>Gruppe
<select id="strasseGroup">
<option value="">-</option>
{% for gruppe in gruppen %}
<option value="{{ gruppe.id }}">{{ gruppe.aliasname or gruppe.id }}</option>
{% endfor %}
</select>
</label>
<footer>
<button onclick="closeStrasseModal()">Abbrechen</button>
<button onclick="saveStrasse()">Speichern</button>
</footer>
</article>
</dialog>
<!-- History Modal -->
<dialog id="streetHistoryModal">
<article style="max-width: 800px;">
<header>
<a href="#close" aria-label="Close" class="close" onclick="closeStreetHistoryModal()"></a>
<h3>Straßen-Historie</h3>
</header>
<table>
<thead>
<tr>
<th>Datum</th>
<th>Von</th>
<th>Nach</th>
<th>Gruppe</th>
<th>Aktion</th>
</tr>
</thead>
<tbody id="streetHistoryBody">
</tbody>
</table>
<footer>
<button onclick="closeStreetHistoryModal()">Schließen</button>
</footer>
</article>
</dialog>
{% endblock %}
{% block scripts %}
<script src="{{ url_for('static', filename='js/views/admin_strassen.js') }}"></script>
{% endblock %}
+26
View File
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="de" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}CMBNet{% endblock %}</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@1/css/pico.min.css">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
{% block head %}{% endblock %}
</head>
<body class="{% block body_class %}{% endblock %}">
<main class="container">
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<article class="{{ category }}">{{ message }}</article>
{% endfor %}
{% endif %}
{% endwith %}
{% block content %}{% endblock %}
</main>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
{% block scripts %}{% endblock %}
</body>
</html>
+123
View File
@@ -0,0 +1,123 @@
{% extends "base.html" %}
{% block title %}Dispatcher - {{ session.tenant_code }} - CMBNet{% endblock %}
{% block body_class %}dispatcher-page{% endblock %}
{% block head %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/dispatcher.css') }}">
{% endblock %}
{% block content %}
<div class="dispatcher-layout">
<section class="map-pane" aria-label="Kartenansicht">
<div id="map"></div>
</section>
<aside class="control-pane" aria-label="Kontrollansicht">
<header class="control-header">
<div class="clock" aria-live="off">
<div class="clock-date" id="clockDate"></div>
<div class="clock-time" id="clockTime">--:--:--</div>
</div>
<div class="header-controls">
<label class="map-layer-label">
<span>Hintergrundkarte</span>
<select id="baseLayerSelect">
<option value="osm">OpenStreetMap</option>
<option value="aerial">Luftbild</option>
</select>
</label>
<button type="button" id="speakerButton" class="icon-button"
title="Nachricht an alle senden" aria-label="Nachricht an alle senden">📢</button>
</div>
<div class="connection-status" id="connectionStatus">Verbinde …</div>
</header>
<div class="group-accordion" id="groupAccordion"></div>
<footer class="control-footer">
<label class="slider-control" for="opacitySlider">
<span>Opazität <output id="opacityValue">0.70</output></span>
<input id="opacitySlider" type="range" min="0" max="1" step="0.05" value="0.7">
</label>
<label class="slider-control" for="weightSlider">
<span>Markerbreite <output id="weightValue">20</output></span>
<input id="weightSlider" type="range" min="1" max="100" step="1" value="20">
</label>
<div class="footer-buttons">
<button type="button" id="fitBoundsButton" class="icon-button"
title="Gesamten Straßenbereich anzeigen" aria-label="Gesamten Straßenbereich anzeigen">🌍</button>
<a id="logoutButton" class="icon-button" href="{{ url_for('auth.logout', tenant=session.tenant_code) }}"
title="Session beenden" aria-label="Session beenden">⏻</a>
</div>
</footer>
</aside>
</div>
<!-- Freitext an alle senden -->
<dialog id="speakerModal">
<article>
<header>
<button class="close" type="button" aria-label="Schließen" onclick="closeSpeakerModal()"></button>
<h3>Nachricht an alle</h3>
</header>
<label>Freitext
<textarea id="speakerText" rows="4" placeholder="Nachricht eingeben …"></textarea>
</label>
<footer>
<button type="button" class="secondary" onclick="closeSpeakerModal()">Abbrechen</button>
<button type="button" onclick="sendSpeakerMessage()">Senden</button>
</footer>
</article>
</dialog>
<!-- Straßen-State ändern -->
<dialog id="streetModal">
<article>
<header>
<button class="close" type="button" aria-label="Schließen" onclick="closeStreetModal()"></button>
<h3 id="streetModalTitle">Straße</h3>
</header>
<label>State
<select id="streetStateSelect">
<option value="unbearbeitet">unbearbeitet</option>
<option value="zugewiesen">zugewiesen</option>
<option value="erledigt">erledigt</option>
</select>
</label>
<label id="streetGroupLabel">Gruppe
<select id="streetGroupSelect"></select>
</label>
<footer>
<button type="button" class="secondary" onclick="closeStreetModal()">Abbrechen</button>
<button type="button" onclick="saveStreetState()">Speichern</button>
</footer>
</article>
</dialog>
<!-- Chatverlauf einer Gruppe -->
<dialog id="chatModal">
<article class="chat-dialog">
<header>
<button class="close" type="button" aria-label="Schließen" onclick="closeChatModal()"></button>
<h3 id="chatTitle">Chat</h3>
</header>
<div class="chat-messages" id="chatMessages"></div>
<footer>
<button type="button" onclick="closeChatModal()">Schließen</button>
</footer>
</article>
</dialog>
{% endblock %}
{% block scripts %}
<script>
window.CMBNET_TENANT = {{ session.tenant_code|tojson }};
window.CMBNET_ACCOUNT_ID = {{ session.account_id|tojson }};
window.CMBNET_LOGOUT_URL = {{ url_for('auth.logout', tenant=session.tenant_code)|tojson }};
</script>
<script src="{{ url_for('static', filename='js/str2pl.js') }}"></script>
<script src="{{ url_for('static', filename='js/views/dispatcher.js') }}"></script>
{% endblock %}
+8
View File
@@ -0,0 +1,8 @@
{% extends "base.html" %}
{% block title %}Dispatcher Mobil - CMBNet{% endblock %}
{% block content %}
<h1>Dispatcher Mobil View</h1>
<p>Wird später implementiert</p>
{% endblock %}
+9
View File
@@ -0,0 +1,9 @@
{% extends "base.html" %}
{% block title %}Gruppen View - CMBNet{% endblock %}
{% block content %}
<h1>Gruppen View</h1>
<p>Willkommen, {{ session.username }}</p>
<p><a href="{{ url_for('auth.logout', tenant=session.tenant_code) }}">Abmelden</a></p>
{% endblock %}
+27
View File
@@ -0,0 +1,27 @@
{% extends "base.html" %}
{% block title %}Login - CMBNet ({{ tenant_code }}){% endblock %}
{% block content %}
<article>
<header>
<h1>CMBNet Login</h1>
<p>Mandant: <strong>{{ tenant_code }}</strong></p>
</header>
<form method="post">
<input type="hidden" name="tenant" value="{{ tenant_code }}">
<label for="username">
Benutzername
<input type="text" id="username" name="username" required autofocus>
</label>
<label for="password">
Passwort
<input type="password" id="password" name="password" required>
</label>
<button type="submit">Anmelden</button>
</form>
<footer>
<a href="{{ url_for('auth.login_select', tenant=tenant_code) }}">← Zurück zur Mandantenauswahl</a>
</footer>
</article>
{% endblock %}
+17
View File
@@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block title %}Mandantenauswahl - CMBNet{% endblock %}
{% block content %}
<article>
<header>
<h1>CMBNet - Mandantenauswahl</h1>
</header>
<p>Bitte wählen Sie Ihren Mandanten aus:</p>
<div class="grid">
<a href="{{ url_for('auth.login', tenant='BV') }}" role="button">BV</a>
<a href="{{ url_for('auth.login', tenant='RV') }}" role="button" class="secondary">RV</a>
<a href="{{ url_for('auth.login', tenant='SV') }}" role="button" class="contrast">SV</a>
</div>
</article>
{% endblock %}
+8
View File
@@ -0,0 +1,8 @@
{% extends "base.html" %}
{% block title %}Öffentlicher View - CMBNet{% endblock %}
{% block content %}
<h1>Öffentlicher View</h1>
<p><a href="{{ url_for('auth.login_select', tenant='RV') }}">Login</a></p>
{% endblock %}
+9
View File
@@ -0,0 +1,9 @@
{% extends "base.html" %}
{% block title %}Präsentations View - CMBNet{% endblock %}
{% block content %}
<h1>Präsentations View</h1>
<p>Willkommen, {{ session.username }}</p>
<p><a href="{{ url_for('auth.logout', tenant=session.tenant_code) }}">Abmelden</a></p>
{% endblock %}