Compare commits
22 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 |
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
|
54
CHANGELOG.md
54
CHANGELOG.md
@@ -5,37 +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/),
|
||||
und dieses Projekt adhäriert zu [Semantic Versioning](https://semver.org/lang/de/).
|
||||
|
||||
## [1.0.6] - 2024-03-17
|
||||
### Geändert
|
||||
- Verbesserte Suchfunktion: Kombinierte Suche über mehrere Felder möglich
|
||||
- Dokumentation: Beispiele für kombinierte Suche hinzugefügt
|
||||
## [v1.2.0] - 2024-03-18
|
||||
|
||||
## [1.0.5] - 2024-03-17
|
||||
### Geändert
|
||||
- Verbesserte Suchfunktion: Ergebnisliste wird gelöscht, wenn alle Suchfelder leer sind
|
||||
- IP-Subnetz-Prüfung korrigiert (CIDR-Notation wird jetzt korrekt ausgewertet)
|
||||
- Debug-Logging für IP-Adressen hinzugefügt
|
||||
- Beispiel-Umgebungsvariablen (.env.example) hinzugefügt
|
||||
|
||||
## [1.0.4] - 2024-03-17
|
||||
### Geändert
|
||||
- Verbesserte Adressanzeige: Location-Icon neben der Adresse
|
||||
- Entfernung des Google Maps Links aus dem Adresstext
|
||||
### Hinzugefügt
|
||||
- IP-basierte Zugriffssteuerung für medisoftware-Links
|
||||
- IP-basierte Zugriffssteuerung für Telefonnummern-Links
|
||||
- Google Maps Integration für Adressen
|
||||
- Version im Footer angezeigt
|
||||
|
||||
## [1.0.3] - 2024-03-17
|
||||
### Geändert
|
||||
- Hervorhebung der Suchbegriffe in den Ergebnissen
|
||||
### Verbessert
|
||||
- Verbesserte Fehlerbehandlung bei der IP-Überprüfung
|
||||
- Bessere Dokumentation der Konfigurationsmöglichkeiten
|
||||
|
||||
## [v1.1.0] - 2024-03-17
|
||||
|
||||
### Hinzugefügt
|
||||
- Benutzer-Login für nicht-autorisierte IPs
|
||||
- Verbesserte Darstellung der Telefonnummern
|
||||
- Responsive Design für mobile Geräte
|
||||
|
||||
### Verbessert
|
||||
- Optimierte Suchfunktion
|
||||
- Verbesserte Benutzeroberfläche
|
||||
|
||||
## [1.0.2] - 2024-03-17
|
||||
### Geändert
|
||||
- Entfernung der Wetterinformationen
|
||||
- Optimierung der Suchfunktion
|
||||
## [v1.0.0] - 2024-03-17
|
||||
|
||||
## [1.0.1] - 2024-03-17
|
||||
### Hinzugefügt
|
||||
- Wetterinformationen für Kundensitz
|
||||
- Caching für Wetterdaten
|
||||
|
||||
## [1.0.0] - 2024-03-17
|
||||
### Hinzugefügt
|
||||
- Erste Version der Kundensuche
|
||||
- Grundlegende Suchfunktionen
|
||||
- Responsive Design
|
||||
- Erste Version mit grundlegenden Suchfunktionen
|
||||
- Echtzeit-Suche über Kundendaten
|
||||
- Hervorhebung von Suchbegriffen in den Ergebnissen
|
||||
- Klickbare Links für Telefonnummern, E-Mail-Adressen und Adressen
|
||||
- Docker-Container für einfache Installation und Deployment
|
63
README.md
63
README.md
@@ -1,27 +1,15 @@
|
||||
# medisoftware Kundensuche
|
||||
|
||||
Eine webbasierte Kundensuche für medisoftware mit erweiterten Suchfunktionen.
|
||||
Eine einfache Webanwendung zur Suche nach medisoftware Kunden mit IP-basierter Zugriffssteuerung.
|
||||
|
||||
## Features
|
||||
|
||||
- Schnelle und präzise Kundensuche
|
||||
- Mehrere Suchfelder für gezielte Suche:
|
||||
- Name (Vor- und Nachname)
|
||||
- Ort
|
||||
- Kundennummer
|
||||
- Fachrichtung
|
||||
- Telefon
|
||||
- Allgemeine Suche über alle Felder
|
||||
- Kombinierte Suche über mehrere Felder
|
||||
- Hervorhebung der Suchbegriffe in den Ergebnissen
|
||||
- Direkte Links zu:
|
||||
- medisoftware Kundenkartei (Kundennummer)
|
||||
- Google Maps (Adresse)
|
||||
- Telefon (Klick zum Anrufen)
|
||||
- E-Mail (Klick zum Mailen)
|
||||
- Responsive Design für alle Geräte
|
||||
- Automatische Aktualisierung der Ergebnisse
|
||||
- Leere Ergebnisliste bei leeren Suchfeldern
|
||||
- Kundensuche nach verschiedenen Kriterien (Name, Ort, Kundennummer, etc.)
|
||||
- Direkte Links zu Kundendaten in medisoftware (für autorisierte IPs)
|
||||
- Telefonnummern-Links für autorisierte IPs
|
||||
- Adress-Links mit Google Maps Integration
|
||||
- IP-basierte Zugriffssteuerung
|
||||
- Responsive Design
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -31,20 +19,39 @@ git clone https://gitea.elpatron.me/elpatron/medi-customers.git
|
||||
cd medi-customers
|
||||
```
|
||||
|
||||
2. Docker Container starten:
|
||||
2. Umgebungsvariablen einrichten:
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# Bearbeiten Sie die .env-Datei mit Ihren Einstellungen
|
||||
```
|
||||
|
||||
3. Docker Container starten:
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
3. Die Anwendung ist unter `http://localhost:5001` erreichbar.
|
||||
## Konfiguration
|
||||
|
||||
## Entwicklung
|
||||
Die Anwendung kann über folgende Umgebungsvariablen konfiguriert werden:
|
||||
|
||||
- Python 3.11
|
||||
- Flask
|
||||
- Docker
|
||||
- Bootstrap 5
|
||||
- Font Awesome
|
||||
- `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
|
||||
|
||||
@@ -96,4 +103,4 @@ curl "http://localhost:5001/search?fachrichtung=Zahnarzt&ort=Berlin&name=Schmidt
|
||||
|
||||
## Version
|
||||
|
||||
Aktuelle Version: [1.0.5](CHANGELOG.md#105---2024-03-17)
|
||||
Aktuelle Version: [v1.2.0](CHANGELOG.md#v120---2024-03-17)
|
48
app.py
48
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 os
|
||||
import logging
|
||||
@@ -7,8 +7,10 @@ from datetime import datetime, timedelta
|
||||
from dotenv import load_dotenv
|
||||
import requests
|
||||
from collections import defaultdict
|
||||
import ipaddress
|
||||
|
||||
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)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -21,6 +23,9 @@ CSV_FILE = "data/customers.csv"
|
||||
# Lade Umgebungsvariablen
|
||||
load_dotenv()
|
||||
|
||||
# Statisches Passwort aus der .env Datei
|
||||
STATIC_PASSWORD = os.getenv('LOGIN_PASSWORD', 'changeme')
|
||||
|
||||
def clean_dataframe(df):
|
||||
"""Konvertiert NaN-Werte in None für JSON-Kompatibilität"""
|
||||
return df.replace({np.nan: None})
|
||||
@@ -48,12 +53,51 @@ def load_data():
|
||||
logger.error(f"Fehler beim Laden der CSV-Datei: {str(e)}")
|
||||
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('/')
|
||||
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')
|
||||
def search():
|
||||
if not session.get('logged_in'):
|
||||
return redirect(url_for('login'))
|
||||
try:
|
||||
# CSV-Datei laden
|
||||
df = load_data()
|
||||
|
@@ -1,5 +1,3 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
web:
|
||||
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,170 +7,15 @@
|
||||
<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://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.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 */
|
||||
}
|
||||
.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%;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 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;
|
||||
background-color: #0d6efd;
|
||||
color: white;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
.share-button:hover {
|
||||
background-color: #0b5ed7;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.customer-card {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
|
||||
border-bottom: 1px solid #e9ecef;
|
||||
}
|
||||
.customer-card:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.customer-info {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
<link href="{{ url_for('static', filename='css/styles.css') }}" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<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>
|
||||
|
||||
<div class="input-group mb-4 position-relative">
|
||||
@@ -223,13 +68,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="shareFeedback" class="share-feedback">
|
||||
Link kopiert!
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<script>
|
||||
@@ -239,7 +88,13 @@
|
||||
function createPhoneLink(phone) {
|
||||
if (!phone) return 'N/A';
|
||||
const cleaned = phone.replace(/[^\d+\s]/g, '');
|
||||
const telLink = cleaned.startsWith('+') ? cleaned : '0' + cleaned.replace(/\s/g, '');
|
||||
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>`;
|
||||
}
|
||||
|
||||
@@ -296,16 +151,64 @@
|
||||
if (!street || !plz || !city) return 'N/A';
|
||||
const address = `${street}, ${plz} ${city}`;
|
||||
const searchQuery = encodeURIComponent(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}"
|
||||
class="address-link" target="_blank" rel="noopener noreferrer">
|
||||
<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>`;
|
||||
}
|
||||
|
||||
function createCustomerLink(customerNumber) {
|
||||
if (!customerNumber) return 'N/A';
|
||||
return `<a href="medisw:openkkbefe/P${customerNumber}?NetGrp=4" class="customer-link">${customerNumber}</a>`;
|
||||
function adjustCustomerNumber(number) {
|
||||
return number - 12000;
|
||||
}
|
||||
|
||||
function isIPInSubnet(ip, subnet) {
|
||||
// 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() {
|
||||
@@ -443,7 +346,7 @@
|
||||
<strong>Firma:</strong> ${highlightedCompanyPhone}<br>
|
||||
<strong>Mobil:</strong> ${highlightedMobilePhone}
|
||||
</div>
|
||||
<button class="share-button" onclick="copyCustomerLink('${customer.Nummer}')">
|
||||
<button class="share-button" onclick="copyCustomerLink('${adjustCustomerNumber(customer.Nummer)}')">
|
||||
<i class="fas fa-share-alt"></i> Teilen
|
||||
</button>
|
||||
`;
|
||||
|
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