Compare commits
32 Commits
Author | SHA1 | Date | |
---|---|---|---|
8e7d3da07f | |||
35e0d0a783 | |||
40196fa28f | |||
7b5e90e3bd | |||
3c48988e88 | |||
869acdcb18 | |||
91af1dfca0 | |||
c271bc1f60 | |||
9c04bb973e | |||
6d7298548b | |||
42a11abe61 | |||
3c6d2f7c45 | |||
d143d6c7b6 | |||
e6638b737d | |||
1f493e0a37 | |||
469ad0ce05 | |||
8a8c13e407 | |||
18974eb69b | |||
9e406ed7a3 | |||
8b82a44ad8 | |||
528baff7b5 | |||
e105dc4663 | |||
3f69ba6198 | |||
7e812eb835 | |||
ece7f984f7 | |||
6cfc2e0162 | |||
bbcd04fd21 | |||
89a5152ada | |||
e6f43ca10a | |||
da3ef358d2 | |||
d77ee8ef04 | |||
cbc95c0d29 |
16
.env.example
Normal file
16
.env.example
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Flask-Konfiguration
|
||||||
|
FLASK_APP=app.py
|
||||||
|
FLASK_ENV=development
|
||||||
|
SECRET_KEY=your-secret-key-here
|
||||||
|
|
||||||
|
# Datenbank-Konfiguration
|
||||||
|
DATABASE_URL=sqlite:///customers.db
|
||||||
|
|
||||||
|
# Authentifizierung
|
||||||
|
STATIC_PASSWORD=your-static-password-here
|
||||||
|
|
||||||
|
# IP-Bereiche für direkten Zugriff (ohne Login)
|
||||||
|
ALLOWED_IP_RANGES=192.168.0.0/24,192.168.177.0/24,213.178.68.218/29
|
||||||
|
|
||||||
|
# Logging-Konfiguration
|
||||||
|
LOG_LEVEL=INFO
|
66
CHANGELOG.md
66
CHANGELOG.md
@@ -5,49 +5,39 @@ Alle wichtigen Änderungen an diesem Projekt werden in dieser Datei dokumentiert
|
|||||||
Das Format basiert auf [Keep a Changelog](https://keepachangelog.com/de/1.0.0/),
|
Das Format basiert auf [Keep a Changelog](https://keepachangelog.com/de/1.0.0/),
|
||||||
und dieses Projekt adhäriert zu [Semantic Versioning](https://semver.org/lang/de/).
|
und dieses Projekt adhäriert zu [Semantic Versioning](https://semver.org/lang/de/).
|
||||||
|
|
||||||
## [1.0.2] - 2024-03-19
|
## [v1.2.0] - 2024-03-18
|
||||||
|
|
||||||
### Hinzugefügt
|
|
||||||
- Wetterinformationen für jeden Suchtreffer
|
|
||||||
- Integration der OpenWeather API
|
|
||||||
- Wetter-Icons und Temperaturanzeige
|
|
||||||
- Umgebungsvariablen für API-Keys
|
|
||||||
|
|
||||||
### Geändert
|
### Geändert
|
||||||
- Anpassung der API-Antwortstruktur
|
- IP-Subnetz-Prüfung korrigiert (CIDR-Notation wird jetzt korrekt ausgewertet)
|
||||||
- Verbesserte Fehlerbehandlung für API-Anfragen
|
- Debug-Logging für IP-Adressen hinzugefügt
|
||||||
|
- Beispiel-Umgebungsvariablen (.env.example) hinzugefügt
|
||||||
## [1.0.1] - 2024-03-19
|
|
||||||
|
|
||||||
### Hinzugefügt
|
### Hinzugefügt
|
||||||
- Neues Suchfeld für Telefonnummer
|
- IP-basierte Zugriffssteuerung für medisoftware-Links
|
||||||
- Reset-Icons für alle Suchfelder
|
- IP-basierte Zugriffssteuerung für Telefonnummern-Links
|
||||||
- Trefferzähler für Suchergebnisse
|
- Google Maps Integration für Adressen
|
||||||
|
- Version im Footer angezeigt
|
||||||
|
|
||||||
### Geändert
|
### Verbessert
|
||||||
- Verbesserte Positionierung der UI-Elemente
|
- Verbesserte Fehlerbehandlung bei der IP-Überprüfung
|
||||||
- Optimierte Suchlogik im Backend
|
- Bessere Dokumentation der Konfigurationsmöglichkeiten
|
||||||
- CSV-Datei in data-Verzeichnis verschoben
|
|
||||||
- Allgemeine Suche um Telefonnummer erweitert
|
|
||||||
|
|
||||||
### Behoben
|
## [v1.1.0] - 2024-03-17
|
||||||
- Korrektur der Icon-Anzeige in Suchfeldern
|
|
||||||
- Verbesserte Fehlerbehandlung beim Laden der CSV-Datei
|
|
||||||
|
|
||||||
## [1.0.0] - 2024-03-18
|
|
||||||
|
|
||||||
### Hinzugefügt
|
### Hinzugefügt
|
||||||
- Grundlegende Suchfunktionalität
|
- Benutzer-Login für nicht-autorisierte IPs
|
||||||
- Spezifische Suchfelder für:
|
- Verbesserte Darstellung der Telefonnummern
|
||||||
- Name
|
- Responsive Design für mobile Geräte
|
||||||
- Ort
|
|
||||||
- Kundennummer
|
### Verbessert
|
||||||
- Fachrichtung
|
- Optimierte Suchfunktion
|
||||||
- Allgemeine Suche über alle Felder
|
- Verbesserte Benutzeroberfläche
|
||||||
- Klickbare Links für:
|
|
||||||
- Telefonnummern
|
## [v1.0.0] - 2024-03-17
|
||||||
- E-Mail-Adressen
|
|
||||||
- Google Maps Integration
|
### Hinzugefügt
|
||||||
- Share-Funktion für Suchergebnisse
|
- Erste Version mit grundlegenden Suchfunktionen
|
||||||
- Responsive Design mit Bootstrap
|
- Echtzeit-Suche über Kundendaten
|
||||||
- Live-Suche während der Eingabe
|
- Hervorhebung von Suchbegriffen in den Ergebnissen
|
||||||
|
- Klickbare Links für Telefonnummern, E-Mail-Adressen und Adressen
|
||||||
|
- Docker-Container für einfache Installation und Deployment
|
131
README.md
131
README.md
@@ -1,23 +1,15 @@
|
|||||||
# medisoftware Kundensuche
|
# medisoftware Kundensuche
|
||||||
|
|
||||||
Eine Webanwendung zur Suche in Kundendaten der medisoftware.
|
Eine einfache Webanwendung zur Suche nach medisoftware Kunden mit IP-basierter Zugriffssteuerung.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Live-Suche in Kundendaten
|
- Kundensuche nach verschiedenen Kriterien (Name, Ort, Kundennummer, etc.)
|
||||||
- Spezifische Suchfelder für:
|
- Direkte Links zu Kundendaten in medisoftware (für autorisierte IPs)
|
||||||
- Name
|
- Telefonnummern-Links für autorisierte IPs
|
||||||
- Ort
|
- Adress-Links mit Google Maps Integration
|
||||||
- Kundennummer
|
- IP-basierte Zugriffssteuerung
|
||||||
- Fachrichtung
|
- Responsive Design
|
||||||
- Telefonnummer
|
|
||||||
- Allgemeine Suche über alle Felder
|
|
||||||
- Klickbare Telefonnummern
|
|
||||||
- Klickbare E-Mail-Adressen
|
|
||||||
- Google Maps Integration für Adressen
|
|
||||||
- Share-Funktion für Suchergebnisse
|
|
||||||
- Trefferzähler
|
|
||||||
- Reset-Funktion für alle Suchfelder
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -27,81 +19,88 @@ git clone https://gitea.elpatron.me/elpatron/medi-customers.git
|
|||||||
cd medi-customers
|
cd medi-customers
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Python-Abhängigkeiten installieren:
|
2. Umgebungsvariablen einrichten:
|
||||||
```bash
|
```bash
|
||||||
pip install -r requirements.txt
|
cp .env.example .env
|
||||||
|
# Bearbeiten Sie die .env-Datei mit Ihren Einstellungen
|
||||||
```
|
```
|
||||||
|
|
||||||
3. CSV-Datei in das `data`-Verzeichnis kopieren:
|
3. Docker Container starten:
|
||||||
```bash
|
```bash
|
||||||
mkdir data
|
docker-compose up -d
|
||||||
cp spezexpo.csv data/customers.csv
|
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Anwendung starten:
|
## Konfiguration
|
||||||
```bash
|
|
||||||
python app.py
|
|
||||||
```
|
|
||||||
|
|
||||||
Die Anwendung ist dann unter `http://localhost:5001` erreichbar.
|
Die Anwendung kann über folgende Umgebungsvariablen konfiguriert werden:
|
||||||
|
|
||||||
|
- `FLASK_APP`: Die Hauptanwendungsdatei (Standard: app.py)
|
||||||
|
- `FLASK_ENV`: Die Flask-Umgebung (development/production)
|
||||||
|
- `SECRET_KEY`: Der geheime Schlüssel für Flask-Sessions
|
||||||
|
- `DATABASE_URL`: Die URL zur SQLite-Datenbank
|
||||||
|
- `STATIC_PASSWORD`: Das Passwort für die Login-Seite
|
||||||
|
- `ALLOWED_IP_RANGES`: Komma-getrennte Liste von IP-Bereichen, die direkten Zugriff haben
|
||||||
|
- `LOG_LEVEL`: Das Logging-Level (INFO/DEBUG)
|
||||||
|
|
||||||
|
## IP-Bereiche
|
||||||
|
|
||||||
|
Die Anwendung unterstützt CIDR-Notation für IP-Bereiche. Beispiele:
|
||||||
|
- Einzelne IP: 192.168.1.1/32
|
||||||
|
- Subnetz: 192.168.1.0/24
|
||||||
|
- Größeres Netzwerk: 10.0.0.0/8
|
||||||
|
|
||||||
|
## Version
|
||||||
|
|
||||||
|
Aktuelle Version: v1.2.0
|
||||||
|
|
||||||
|
## Lizenz
|
||||||
|
|
||||||
|
Alle Rechte vorbehalten. © 2025 medisoftware
|
||||||
|
|
||||||
## API-Beispiele
|
## API-Beispiele
|
||||||
|
|
||||||
Die Such-API unterstützt folgende Parameter:
|
### Suche nach Name
|
||||||
|
|
||||||
### Spezifische Suche
|
|
||||||
```bash
|
```bash
|
||||||
# Nach Name suchen
|
curl "http://localhost:5001/search?name=Mustermann"
|
||||||
curl "http://localhost:5001/search?name=Schmidt"
|
```
|
||||||
|
|
||||||
# Nach Ort suchen
|
### Suche nach Ort
|
||||||
|
```bash
|
||||||
curl "http://localhost:5001/search?ort=Berlin"
|
curl "http://localhost:5001/search?ort=Berlin"
|
||||||
|
```
|
||||||
|
|
||||||
# Nach Kundennummer suchen
|
### Suche nach Kundennummer
|
||||||
|
```bash
|
||||||
curl "http://localhost:5001/search?kundennummer=12345"
|
curl "http://localhost:5001/search?kundennummer=12345"
|
||||||
|
```
|
||||||
|
|
||||||
# Nach Fachrichtung suchen
|
### Suche nach Fachrichtung
|
||||||
curl "http://localhost:5001/search?fachrichtung=Allgemeinmedizin"
|
```bash
|
||||||
|
curl "http://localhost:5001/search?fachrichtung=Zahnarzt"
|
||||||
|
```
|
||||||
|
|
||||||
# Nach Telefonnummer suchen
|
### Suche nach Telefon
|
||||||
|
```bash
|
||||||
curl "http://localhost:5001/search?telefon=030"
|
curl "http://localhost:5001/search?telefon=030"
|
||||||
|
|
||||||
# Kombinierte Suche
|
|
||||||
curl "http://localhost:5001/search?name=Schmidt&ort=Berlin&fachrichtung=Allgemeinmedizin"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Allgemeine Suche
|
### Allgemeine Suche
|
||||||
```bash
|
```bash
|
||||||
# Suche in allen Feldern
|
curl "http://localhost:5001/search?q=Suchbegriff"
|
||||||
curl "http://localhost:5001/search?q=Schmidt"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Beispiel-Response
|
### Kombinierte Suche
|
||||||
```json
|
```bash
|
||||||
[
|
# Suche nach Fachrichtung und Ort
|
||||||
{
|
curl "http://localhost:5001/search?fachrichtung=Zahnarzt&ort=Berlin"
|
||||||
"Vorname": "Max",
|
|
||||||
"Nachname": "Mustermann",
|
# Suche nach Name und Telefon
|
||||||
"Nummer": "12345",
|
curl "http://localhost:5001/search?name=Mustermann&telefon=030"
|
||||||
"Ort": "Berlin",
|
|
||||||
"Fachrichtung": "Allgemeinmedizin",
|
# Suche nach mehreren Kriterien
|
||||||
"Tel": "030123456",
|
curl "http://localhost:5001/search?fachrichtung=Zahnarzt&ort=Berlin&name=Schmidt"
|
||||||
"Email": "max@example.com"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Versionen
|
## Version
|
||||||
|
|
||||||
### v1.0.1
|
Aktuelle Version: [v1.2.0](CHANGELOG.md#v120---2024-03-17)
|
||||||
- Telefonnummer-Suchfeld hinzugefügt
|
|
||||||
- Reset-Icons für alle Suchfelder
|
|
||||||
- Verbesserte Positionierung der UI-Elemente
|
|
||||||
- Optimierte Suchlogik
|
|
||||||
- CSV-Datei in data-Verzeichnis verschoben
|
|
||||||
|
|
||||||
### v1.0.0
|
|
||||||
- Erste Version
|
|
||||||
- Grundlegende Suchfunktionalität
|
|
||||||
- Klickbare Links für Telefon, E-Mail und Adressen
|
|
||||||
- Share-Funktion für Suchergebnisse
|
|
65
app.py
65
app.py
@@ -1,4 +1,4 @@
|
|||||||
from flask import Flask, render_template, request, jsonify, url_for
|
from flask import Flask, render_template, request, jsonify, url_for, redirect, session
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
@@ -7,13 +7,15 @@ from datetime import datetime, timedelta
|
|||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
import requests
|
import requests
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
import ipaddress
|
||||||
|
|
||||||
app = Flask(__name__, static_folder='static')
|
app = Flask(__name__, static_folder='static')
|
||||||
|
app.secret_key = 'your_secret_key' # Setzen Sie einen sicheren geheimen Schlüssel für die Session
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# Version der Anwendung
|
# Version der Anwendung
|
||||||
VERSION = "1.0.3"
|
VERSION = "1.0.6"
|
||||||
|
|
||||||
# Pfad zur CSV-Datei
|
# Pfad zur CSV-Datei
|
||||||
CSV_FILE = "data/customers.csv"
|
CSV_FILE = "data/customers.csv"
|
||||||
@@ -21,6 +23,9 @@ CSV_FILE = "data/customers.csv"
|
|||||||
# Lade Umgebungsvariablen
|
# Lade Umgebungsvariablen
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
|
# Statisches Passwort aus der .env Datei
|
||||||
|
STATIC_PASSWORD = os.getenv('LOGIN_PASSWORD', 'changeme')
|
||||||
|
|
||||||
def clean_dataframe(df):
|
def clean_dataframe(df):
|
||||||
"""Konvertiert NaN-Werte in None für JSON-Kompatibilität"""
|
"""Konvertiert NaN-Werte in None für JSON-Kompatibilität"""
|
||||||
return df.replace({np.nan: None})
|
return df.replace({np.nan: None})
|
||||||
@@ -48,12 +53,51 @@ def load_data():
|
|||||||
logger.error(f"Fehler beim Laden der CSV-Datei: {str(e)}")
|
logger.error(f"Fehler beim Laden der CSV-Datei: {str(e)}")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@app.route('/login', methods=['GET', 'POST'])
|
||||||
|
def login():
|
||||||
|
# Versuche, die tatsächliche Client-IP aus dem X-Forwarded-For-Header zu erhalten
|
||||||
|
client_ip = request.headers.get('X-Forwarded-For', request.remote_addr)
|
||||||
|
allowed_ip_ranges = os.getenv('ALLOWED_IP_RANGES', '').split(',')
|
||||||
|
|
||||||
|
logger.info(f"Client-IP: {client_ip}")
|
||||||
|
logger.info(f"Erlaubte IP-Bereiche: {allowed_ip_ranges}")
|
||||||
|
|
||||||
|
# Überprüfen, ob die IP-Adresse in einem der erlaubten Subnetze liegt
|
||||||
|
client_ip_obj = ipaddress.ip_address(client_ip)
|
||||||
|
for ip_range in allowed_ip_ranges:
|
||||||
|
try:
|
||||||
|
network = ipaddress.ip_network(ip_range.strip(), strict=False)
|
||||||
|
logger.info(f"Überprüfe Netzwerk: {network}")
|
||||||
|
if client_ip_obj in network:
|
||||||
|
logger.info("Client-IP ist im erlaubten Bereich.")
|
||||||
|
session['logged_in'] = True
|
||||||
|
return redirect(url_for('index'))
|
||||||
|
except ValueError:
|
||||||
|
logger.error(f"Ungültiges Netzwerkformat: {ip_range}")
|
||||||
|
|
||||||
|
if request.method == 'POST':
|
||||||
|
password = request.form.get('password')
|
||||||
|
if password == STATIC_PASSWORD:
|
||||||
|
session['logged_in'] = True
|
||||||
|
return redirect(url_for('index'))
|
||||||
|
else:
|
||||||
|
return render_template('login.html', error="Falsches Passwort")
|
||||||
|
return render_template('login.html')
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def index():
|
def index():
|
||||||
return render_template('index.html')
|
if not session.get('logged_in'):
|
||||||
|
return redirect(url_for('login'))
|
||||||
|
allowed_ip_ranges = os.getenv('ALLOWED_IP_RANGES', '')
|
||||||
|
client_ip = request.headers.get('X-Forwarded-For', request.remote_addr)
|
||||||
|
logger.info(f"Client-IP: {client_ip}")
|
||||||
|
logger.info(f"Erlaubte IP-Bereiche: {allowed_ip_ranges}")
|
||||||
|
return render_template('index.html', allowed_ip_ranges=allowed_ip_ranges)
|
||||||
|
|
||||||
@app.route('/search')
|
@app.route('/search')
|
||||||
def search():
|
def search():
|
||||||
|
if not session.get('logged_in'):
|
||||||
|
return redirect(url_for('login'))
|
||||||
try:
|
try:
|
||||||
# CSV-Datei laden
|
# CSV-Datei laden
|
||||||
df = load_data()
|
df = load_data()
|
||||||
@@ -68,10 +112,12 @@ def search():
|
|||||||
telefon = request.args.get('telefon', '').strip()
|
telefon = request.args.get('telefon', '').strip()
|
||||||
query = request.args.get('q', '').strip()
|
query = request.args.get('q', '').strip()
|
||||||
|
|
||||||
# Wenn keine spezifischen Suchkriterien angegeben sind, aber eine allgemeine Suche
|
# Initialisiere die Maske für die Filterung
|
||||||
if not any([name, ort, kundennummer, fachrichtung, telefon]) and query:
|
mask = pd.Series(True, index=df.index)
|
||||||
# Suche in allen relevanten Feldern
|
|
||||||
mask = (
|
# Wenn eine allgemeine Suche angegeben ist
|
||||||
|
if query:
|
||||||
|
query_mask = (
|
||||||
df['Vorname'].str.contains(query, case=False, na=False) |
|
df['Vorname'].str.contains(query, case=False, na=False) |
|
||||||
df['Nachname'].str.contains(query, case=False, na=False) |
|
df['Nachname'].str.contains(query, case=False, na=False) |
|
||||||
df['Ort'].str.contains(query, case=False, na=False) |
|
df['Ort'].str.contains(query, case=False, na=False) |
|
||||||
@@ -79,10 +125,9 @@ def search():
|
|||||||
df['Fachrichtung'].str.contains(query, case=False, na=False) |
|
df['Fachrichtung'].str.contains(query, case=False, na=False) |
|
||||||
df['Tel'].astype(str).str.contains(query, case=False, na=False)
|
df['Tel'].astype(str).str.contains(query, case=False, na=False)
|
||||||
)
|
)
|
||||||
else:
|
mask &= query_mask
|
||||||
# Spezifische Suche
|
|
||||||
mask = pd.Series(True, index=df.index)
|
|
||||||
|
|
||||||
|
# Spezifische Suchkriterien anwenden
|
||||||
if name:
|
if name:
|
||||||
name_mask = (
|
name_mask = (
|
||||||
df['Vorname'].str.contains(name, case=False, na=False) |
|
df['Vorname'].str.contains(name, case=False, na=False) |
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
version: '3.8'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
build: .
|
build: .
|
||||||
|
BIN
static/medisoftware_logo_rb_200.png
Normal file
BIN
static/medisoftware_logo_rb_200.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.4 KiB |
@@ -7,155 +7,15 @@
|
|||||||
<link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}">
|
<link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}">
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">
|
||||||
<style>
|
<link href="{{ url_for('static', filename='css/styles.css') }}" rel="stylesheet">
|
||||||
body {
|
|
||||||
min-height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
.main-content {
|
|
||||||
flex: 1 0 auto;
|
|
||||||
padding: 2rem 0;
|
|
||||||
}
|
|
||||||
.search-container {
|
|
||||||
max-width: 800px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
.result-card {
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
.result-card:hover {
|
|
||||||
transform: translateY(-2px);
|
|
||||||
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
|
||||||
}
|
|
||||||
.loading {
|
|
||||||
display: none;
|
|
||||||
text-align: center;
|
|
||||||
margin: 2rem 0;
|
|
||||||
}
|
|
||||||
.phone-link, .email-link, .address-link, .customer-link {
|
|
||||||
text-decoration: none;
|
|
||||||
color: #0d6efd;
|
|
||||||
}
|
|
||||||
.phone-link:hover, .email-link:hover, .address-link:hover, .customer-link:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
.search-icon, .reset-icon {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
color: #6c757d;
|
|
||||||
cursor: pointer;
|
|
||||||
display: none;
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
.reset-icon {
|
|
||||||
right: 10px;
|
|
||||||
}
|
|
||||||
.search-icon {
|
|
||||||
right: 35px;
|
|
||||||
}
|
|
||||||
.reset-icon.visible {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.search-icon.visible {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.customer-number {
|
|
||||||
color: #6c757d;
|
|
||||||
font-size: 0.9em;
|
|
||||||
}
|
|
||||||
.footer {
|
|
||||||
flex-shrink: 0;
|
|
||||||
text-align: center;
|
|
||||||
padding: 1rem;
|
|
||||||
background-color: #f8f9fa;
|
|
||||||
border-top: 1px solid #dee2e6;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.share-feedback {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 20px;
|
|
||||||
right: 20px;
|
|
||||||
background: #28a745;
|
|
||||||
color: white;
|
|
||||||
padding: 8px 16px;
|
|
||||||
border-radius: 4px;
|
|
||||||
display: none;
|
|
||||||
animation: fadeOut 2s forwards;
|
|
||||||
z-index: 1000;
|
|
||||||
}
|
|
||||||
@keyframes fadeOut {
|
|
||||||
0% { opacity: 1; }
|
|
||||||
70% { opacity: 1; }
|
|
||||||
100% { opacity: 0; }
|
|
||||||
}
|
|
||||||
.card-actions {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
margin-top: 1rem;
|
|
||||||
}
|
|
||||||
.share-button {
|
|
||||||
padding: 5px 10px;
|
|
||||||
border-radius: 15px;
|
|
||||||
font-size: 0.9em;
|
|
||||||
}
|
|
||||||
.search-fields {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
||||||
gap: 1rem;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
.search-field {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.input-group {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.result-counts {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
padding: 0.5rem;
|
|
||||||
background-color: #f8f9fa;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
.result-count {
|
|
||||||
background-color: #e9ecef;
|
|
||||||
padding: 4px 12px;
|
|
||||||
border-radius: 12px;
|
|
||||||
font-size: 0.9em;
|
|
||||||
color: #6c757d;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.result-count.visible {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
.location-pin {
|
|
||||||
color: #dc3545;
|
|
||||||
margin-left: 4px;
|
|
||||||
font-size: 1.2em;
|
|
||||||
}
|
|
||||||
.weather-info {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-left: 10px;
|
|
||||||
font-size: 0.9em;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
.weather-info img {
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
margin-right: 4px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<div class="container search-container">
|
<div class="container">
|
||||||
|
<div class="text-center mb-4">
|
||||||
|
<img src="{{ url_for('static', filename='medisoftware_logo_rb_200.png') }}" alt="medisoftware Logo" class="img-fluid" style="max-width: 200px;">
|
||||||
|
</div>
|
||||||
|
<div class="search-container">
|
||||||
<h1 class="text-center mb-4">medisoftware Kundensuche</h1>
|
<h1 class="text-center mb-4">medisoftware Kundensuche</h1>
|
||||||
|
|
||||||
<div class="input-group mb-4 position-relative">
|
<div class="input-group mb-4 position-relative">
|
||||||
@@ -208,13 +68,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="shareFeedback" class="share-feedback">
|
<div id="shareFeedback" class="share-feedback">
|
||||||
Link kopiert!
|
Link kopiert!
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<p class="mb-0">(c) 2025 <a href="https://medisoftware.de" target="_blank" rel="noopener noreferrer" class="text-decoration-none">medisoftware</a></p>
|
<div class="footer-content">
|
||||||
|
Made with ❤️ and 🍺 by <a href="https://www.medisoftware.de" target="_blank" class="footer-link">medisoftware</a>
|
||||||
|
<div style="font-size: 0.8em;">Version: v1.2.0</div>
|
||||||
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -223,8 +87,14 @@
|
|||||||
|
|
||||||
function createPhoneLink(phone) {
|
function createPhoneLink(phone) {
|
||||||
if (!phone) return 'N/A';
|
if (!phone) return 'N/A';
|
||||||
const cleaned = phone.replace(/\D/g, '');
|
const cleaned = phone.replace(/[^\d+\s]/g, '');
|
||||||
const telLink = '0' + cleaned;
|
const clientIP = '{{ request.headers.get("X-Forwarded-For", request.remote_addr) }}';
|
||||||
|
const allowedIPRanges = '{{ allowed_ip_ranges }}'.split(',');
|
||||||
|
|
||||||
|
// Überprüfen, ob die Client-IP in einem der erlaubten Bereiche liegt
|
||||||
|
const isAllowed = allowedIPRanges.some(range => clientIP.startsWith(range.trim()));
|
||||||
|
|
||||||
|
const telLink = cleaned.startsWith('+') ? cleaned : (isAllowed ? '0' + cleaned.replace(/\s/g, '') : cleaned.replace(/\s/g, ''));
|
||||||
return `<a href="tel:${telLink}" class="phone-link">${phone}</a>`;
|
return `<a href="tel:${telLink}" class="phone-link">${phone}</a>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,23 +103,112 @@
|
|||||||
return `<a href="mailto:${email}" class="email-link">${email}</a>`;
|
return `<a href="mailto:${email}" class="email-link">${email}</a>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function highlightText(text, searchTerms) {
|
||||||
|
// Konvertiere text zu String und prüfe auf null/undefined
|
||||||
|
const textStr = String(text || '');
|
||||||
|
if (!textStr || !searchTerms || searchTerms.length === 0) return textStr;
|
||||||
|
|
||||||
|
// Escapen der Suchbegriffe für reguläre Ausdrücke
|
||||||
|
const escapedTerms = searchTerms.map(term =>
|
||||||
|
String(term || '').replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
||||||
|
).filter(term => term.length > 0);
|
||||||
|
|
||||||
|
if (escapedTerms.length === 0) return textStr;
|
||||||
|
|
||||||
|
// Erstelle einen temporären div-Element
|
||||||
|
const tempDiv = document.createElement('div');
|
||||||
|
tempDiv.innerHTML = textStr;
|
||||||
|
|
||||||
|
// Funktion zum Hervorheben von Text
|
||||||
|
function highlightNode(node) {
|
||||||
|
if (node.nodeType === 3) { // Text node
|
||||||
|
const text = node.textContent;
|
||||||
|
let newText = text;
|
||||||
|
|
||||||
|
escapedTerms.forEach(term => {
|
||||||
|
const regex = new RegExp(`(${term})`, 'gi');
|
||||||
|
newText = newText.replace(regex, '<mark>$1</mark>');
|
||||||
|
});
|
||||||
|
|
||||||
|
if (newText !== text) {
|
||||||
|
const span = document.createElement('span');
|
||||||
|
span.innerHTML = newText;
|
||||||
|
node.parentNode.replaceChild(span, node);
|
||||||
|
}
|
||||||
|
} else if (node.nodeType === 1) { // Element node
|
||||||
|
// Überspringe mark-Tags und Links
|
||||||
|
if (node.tagName !== 'MARK' && node.tagName !== 'A') {
|
||||||
|
Array.from(node.childNodes).forEach(highlightNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
highlightNode(tempDiv);
|
||||||
|
return tempDiv.innerHTML;
|
||||||
|
}
|
||||||
|
|
||||||
function createAddressLink(street, plz, city) {
|
function createAddressLink(street, plz, city) {
|
||||||
if (!street || !plz || !city) return 'N/A';
|
if (!street || !plz || !city) return 'N/A';
|
||||||
const address = `${street}, ${plz} ${city}`;
|
const address = `${street}, ${plz} ${city}`;
|
||||||
const searchQuery = encodeURIComponent(address);
|
const searchQuery = encodeURIComponent(address);
|
||||||
return `${address}
|
const routeQuery = encodeURIComponent(address);
|
||||||
|
const clientIP = '{{ request.headers.get("X-Forwarded-For", request.remote_addr) }}';
|
||||||
|
console.log('Client IP in createAddressLink:', clientIP);
|
||||||
|
return `<span class="address-text">${address}</span>
|
||||||
<a href="https://www.google.com/maps/search/?api=1&query=${searchQuery}"
|
<a href="https://www.google.com/maps/search/?api=1&query=${searchQuery}"
|
||||||
class="address-link" target="_blank" rel="noopener noreferrer">
|
class="address-link" target="_blank" rel="noopener noreferrer">
|
||||||
<i class="fa-solid fa-location-pin location-pin"></i>
|
<i class="fa-solid fa-location-pin location-pin"></i>
|
||||||
|
</a>
|
||||||
|
<a href="https://www.google.com/maps/dir/?api=1&destination=${routeQuery}"
|
||||||
|
class="route-link" target="_blank" rel="noopener noreferrer">
|
||||||
|
<i class="fa-solid fa-car route-pin"></i>
|
||||||
</a>`;
|
</a>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createCustomerLink(customerNumber) {
|
function adjustCustomerNumber(number) {
|
||||||
if (!customerNumber) return 'N/A';
|
return number - 12000;
|
||||||
return `<a href="medisw:openkkbefe/P${customerNumber}?NetGrp=4"
|
}
|
||||||
class="customer-link" target="_blank" rel="noopener noreferrer">
|
|
||||||
${customerNumber}
|
function isIPInSubnet(ip, subnet) {
|
||||||
</a>`;
|
// Teile die IP und das Subnetz in ihre Komponenten
|
||||||
|
const [subnetIP, bits] = subnet.split('/');
|
||||||
|
const ipParts = ip.split('.').map(Number);
|
||||||
|
const subnetParts = subnetIP.split('.').map(Number);
|
||||||
|
|
||||||
|
// Konvertiere IPs in 32-bit Zahlen
|
||||||
|
const ipNum = (ipParts[0] << 24) | (ipParts[1] << 16) | (ipParts[2] << 8) | ipParts[3];
|
||||||
|
const subnetNum = (subnetParts[0] << 24) | (subnetParts[1] << 16) | (subnetParts[2] << 8) | subnetParts[3];
|
||||||
|
|
||||||
|
// Erstelle die Subnetzmaske
|
||||||
|
const mask = ~((1 << (32 - bits)) - 1);
|
||||||
|
|
||||||
|
// Prüfe, ob die IP im Subnetz liegt
|
||||||
|
return (ipNum & mask) === (subnetNum & mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
function createCustomerLink(nummer) {
|
||||||
|
const clientIP = '{{ request.headers.get("X-Forwarded-For", request.remote_addr) }}';
|
||||||
|
const allowedIPRanges = '{{ allowed_ip_ranges }}'.split(',');
|
||||||
|
|
||||||
|
// Debug-Ausgabe für die IP-Bereiche
|
||||||
|
console.log('Client IP in createCustomerLink:', clientIP);
|
||||||
|
console.log('Allowed IP Ranges:', allowedIPRanges);
|
||||||
|
|
||||||
|
// Überprüfe, ob die Client-IP in einem der erlaubten Bereiche liegt
|
||||||
|
const isAllowed = allowedIPRanges.some(range => {
|
||||||
|
const trimmedRange = range.trim();
|
||||||
|
console.log('Checking range:', trimmedRange);
|
||||||
|
return isIPInSubnet(clientIP, trimmedRange);
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('isAllowed in createCustomerLink:', isAllowed);
|
||||||
|
|
||||||
|
const adjustedNumber = adjustCustomerNumber(nummer);
|
||||||
|
if (isAllowed) {
|
||||||
|
return `<a href="medisw:openkkbefe/P${adjustedNumber}?NetGrp=4" class="customer-link">${nummer}</a>`;
|
||||||
|
} else {
|
||||||
|
return nummer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showCopyFeedback() {
|
function showCopyFeedback() {
|
||||||
@@ -283,91 +242,128 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function searchCustomers() {
|
function searchCustomers() {
|
||||||
const name = document.getElementById('nameInput').value;
|
const query = document.getElementById('searchInput').value.trim();
|
||||||
const ort = document.getElementById('ortInput').value;
|
const fachrichtung = document.getElementById('fachrichtungInput').value.trim();
|
||||||
const kundennummer = document.getElementById('kundennummerInput').value;
|
const ort = document.getElementById('ortInput').value.trim();
|
||||||
const fachrichtung = document.getElementById('fachrichtungInput').value;
|
const name = document.getElementById('nameInput').value.trim();
|
||||||
const telefon = document.getElementById('telefonInput').value;
|
const telefon = document.getElementById('telefonInput').value.trim();
|
||||||
const query = document.getElementById('searchInput').value;
|
const kundennummer = document.getElementById('kundennummerInput')?.value.trim() || '';
|
||||||
|
|
||||||
// Prüfe, ob mindestens ein Suchfeld ausgefüllt ist
|
// Sammle alle nicht-leeren Suchbegriffe
|
||||||
if (!name && !ort && !kundennummer && !fachrichtung && !telefon && !query) {
|
const searchTerms = [query, fachrichtung, ort, name, telefon, kundennummer]
|
||||||
document.getElementById('results').innerHTML = '';
|
.filter(term => term && term.length > 0);
|
||||||
lastResults = [];
|
|
||||||
updateResultCounts();
|
// Prüfe, ob alle Suchfelder leer sind
|
||||||
|
if (searchTerms.length === 0) {
|
||||||
|
const resultsDiv = document.getElementById('results');
|
||||||
|
const generalCount = document.getElementById('generalCount');
|
||||||
|
resultsDiv.innerHTML = '';
|
||||||
|
generalCount.textContent = '';
|
||||||
|
generalCount.classList.remove('visible');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lade-Animation anzeigen
|
const resultsDiv = document.getElementById('results');
|
||||||
document.getElementById('loading').style.display = 'block';
|
const loadingDiv = document.getElementById('loading');
|
||||||
document.getElementById('results').innerHTML = '';
|
loadingDiv.style.display = 'block';
|
||||||
|
resultsDiv.innerHTML = '';
|
||||||
|
|
||||||
// URL-Parameter erstellen
|
const searchParams = new URLSearchParams();
|
||||||
const params = new URLSearchParams();
|
if (query) searchParams.append('q', query);
|
||||||
if (name) params.append('name', name);
|
if (fachrichtung) searchParams.append('fachrichtung', fachrichtung);
|
||||||
if (ort) params.append('ort', ort);
|
if (ort) searchParams.append('ort', ort);
|
||||||
if (kundennummer) params.append('kundennummer', kundennummer);
|
if (name) searchParams.append('name', name);
|
||||||
if (fachrichtung) params.append('fachrichtung', fachrichtung);
|
if (telefon) searchParams.append('telefon', telefon);
|
||||||
if (telefon) params.append('telefon', telefon);
|
if (kundennummer) searchParams.append('kundennummer', kundennummer);
|
||||||
if (query) params.append('q', query);
|
|
||||||
|
|
||||||
fetch(`/search?${params.toString()}`)
|
fetch(`/search?${searchParams.toString()}`)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.error) {
|
resultsDiv.innerHTML = '';
|
||||||
showError(data.error);
|
|
||||||
|
// Prüfe, ob data ein Objekt mit results-Array ist
|
||||||
|
if (!data || !data.results || !Array.isArray(data.results)) {
|
||||||
|
console.error('Unerwartetes Datenformat:', data);
|
||||||
|
resultsDiv.innerHTML = '<div class="error">Unerwartetes Datenformat vom Server</div>';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const resultsContainer = document.getElementById('results');
|
const results = data.results;
|
||||||
resultsContainer.innerHTML = '';
|
if (results.length === 0) {
|
||||||
|
resultsDiv.innerHTML = '<div class="no-results">Keine Ergebnisse gefunden</div>';
|
||||||
if (data.results && data.results.length > 0) {
|
} else {
|
||||||
data.results.forEach(customer => {
|
results.forEach(customer => {
|
||||||
const card = document.createElement('div');
|
const card = document.createElement('div');
|
||||||
card.className = 'card mb-3';
|
card.className = 'customer-card';
|
||||||
card.innerHTML = `
|
|
||||||
<div class="card-body">
|
// Debug-Ausgabe für die Kundendaten
|
||||||
<h5 class="card-title">${customer.Vorname} ${customer.Nachname}</h5>
|
console.log('Kundendaten:', customer);
|
||||||
<p class="card-text">
|
console.log('Alle verfügbaren Felder:', Object.keys(customer));
|
||||||
<strong>Kundennummer:</strong> ${customer.Nummer}<br>
|
console.log('Telefon-bezogene Felder:', {
|
||||||
<strong>Fachrichtung:</strong> ${customer.Fachrichtung || 'N/A'}<br>
|
Telefon: customer.Telefon,
|
||||||
<strong>Adresse:</strong> ${createAddressLink(customer.Strasse, customer.PLZ, customer.Ort)}
|
Telefonnummer: customer.Telefonnummer,
|
||||||
${customer.weather ? `
|
telefon: customer.telefon,
|
||||||
<span class="weather-info">
|
telefonnummer: customer.telefonnummer,
|
||||||
<img src="http://openweathermap.org/img/wn/${customer.weather.icon}@2x.png"
|
phone: customer.phone,
|
||||||
alt="${customer.weather.description}"
|
'phone.number': customer.phone?.number
|
||||||
title="${customer.weather.description}">
|
|
||||||
${customer.weather.temperature}°C
|
|
||||||
</span>
|
|
||||||
` : ''}
|
|
||||||
<br>
|
|
||||||
<strong>Telefon:</strong> ${createPhoneLink(customer.Tel)}<br>
|
|
||||||
<strong>E-Mail:</strong> ${createEmailLink(customer.mail)}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
resultsContainer.appendChild(card);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Zeige die Anzahl der Treffer an
|
// Erstelle die Adresse mit Hervorhebung
|
||||||
const totalResults = document.getElementById('total-results');
|
const address = `${customer.Strasse || ''}, ${customer.PLZ || ''} ${customer.Ort || ''}`;
|
||||||
if (totalResults) {
|
const addressLink = createAddressLink(customer.Strasse, customer.PLZ, customer.Ort);
|
||||||
totalResults.textContent = `${data.total} Treffer gefunden`;
|
const highlightedAddress = highlightText(addressLink, searchTerms);
|
||||||
|
|
||||||
|
// Erstelle die Kundennummer mit Hervorhebung
|
||||||
|
const highlightedNumber = highlightText(customer.Nummer, searchTerms);
|
||||||
|
const customerLink = createCustomerLink(customer.Nummer);
|
||||||
|
|
||||||
|
// Erstelle die Telefonnummern mit Hervorhebung
|
||||||
|
let phoneNumber = '';
|
||||||
|
let companyPhone = '';
|
||||||
|
let mobilePhone = '';
|
||||||
|
|
||||||
|
if (typeof customer === 'object') {
|
||||||
|
phoneNumber = customer.Tel || '';
|
||||||
|
companyPhone = customer['Tele Firma'] || '';
|
||||||
|
mobilePhone = customer.Handy || '';
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
resultsContainer.innerHTML = '<div class="alert alert-info">Keine Ergebnisse gefunden.</div>';
|
const phoneLink = createPhoneLink(phoneNumber);
|
||||||
|
const companyPhoneLink = createPhoneLink(companyPhone);
|
||||||
|
const mobilePhoneLink = createPhoneLink(mobilePhone);
|
||||||
|
|
||||||
|
const highlightedPhone = highlightText(phoneLink, searchTerms);
|
||||||
|
const highlightedCompanyPhone = highlightText(companyPhoneLink, searchTerms);
|
||||||
|
const highlightedMobilePhone = highlightText(mobilePhoneLink, searchTerms);
|
||||||
|
|
||||||
|
card.innerHTML = `
|
||||||
|
<div class="customer-info">
|
||||||
|
<strong>Kundennummer:</strong> ${customerLink}<br>
|
||||||
|
<strong>Name:</strong> ${highlightText(`${customer.Vorname || ''} ${customer.Nachname || ''}`, searchTerms)}<br>
|
||||||
|
<strong>Fachrichtung:</strong> ${highlightText(customer.Fachrichtung || '', searchTerms)}<br>
|
||||||
|
<strong>Adresse:</strong> ${highlightedAddress}<br>
|
||||||
|
<strong>Telefon:</strong> ${highlightedPhone}<br>
|
||||||
|
<strong>Firma:</strong> ${highlightedCompanyPhone}<br>
|
||||||
|
<strong>Mobil:</strong> ${highlightedMobilePhone}
|
||||||
|
</div>
|
||||||
|
<button class="share-button" onclick="copyCustomerLink('${adjustCustomerNumber(customer.Nummer)}')">
|
||||||
|
<i class="fas fa-share-alt"></i> Teilen
|
||||||
|
</button>
|
||||||
|
`;
|
||||||
|
resultsDiv.appendChild(card);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
// Aktualisiere die Anzahl der Treffer
|
||||||
|
const generalCount = document.getElementById('generalCount');
|
||||||
|
generalCount.textContent = results.length > 0 ? `${results.length} Treffer gefunden` : '';
|
||||||
|
generalCount.classList.toggle('visible', results.length > 0);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error('Fehler:', error);
|
console.error('Fehler bei der Suche:', error);
|
||||||
document.getElementById('results').innerHTML =
|
resultsDiv.innerHTML = '<div class="error">Ein Fehler ist aufgetreten</div>';
|
||||||
`<div class="alert alert-danger">${error.message}</div>`;
|
|
||||||
lastResults = [];
|
|
||||||
updateResultCounts();
|
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
document.getElementById('loading').style.display = 'none';
|
loadingDiv.style.display = 'none';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
60
templates/login.html
Normal file
60
templates/login.html
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>medisoftware Kundensuche</title>
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.main-content {
|
||||||
|
flex: 1 0 auto;
|
||||||
|
padding: 2rem 0;
|
||||||
|
margin-bottom: 4rem; /* Platz für die fixierte Fußzeile */
|
||||||
|
}
|
||||||
|
.footer {
|
||||||
|
flex-shrink: 0;
|
||||||
|
text-align: center;
|
||||||
|
padding: 1rem;
|
||||||
|
background-color: #f8f9fa;
|
||||||
|
border-top: 1px solid #dee2e6;
|
||||||
|
width: 100%;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container mt-5">
|
||||||
|
<div class="text-center mb-4">
|
||||||
|
<img src="{{ url_for('static', filename='medisoftware_logo_rb_200.png') }}" alt="medisoftware Logo" class="img-fluid" style="max-width: 200px;">
|
||||||
|
</div>
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<h2 class="text-center">Login</h2>
|
||||||
|
<form method="POST" action="/login">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="password" class="form-label">Passwort</label>
|
||||||
|
<input type="password" class="form-control" id="password" name="password" required>
|
||||||
|
</div>
|
||||||
|
<button type="submit" class="btn btn-primary w-100">Einloggen</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<footer class="footer">
|
||||||
|
<div class="footer-content">
|
||||||
|
Made with ❤️ and 🍺 by <a href="https://www.medisoftware.de" target="_blank" class="footer-link">medisoftware</a>
|
||||||
|
<div style="font-size: 0.8em;">Version: v1.2.0</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
Reference in New Issue
Block a user