| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <!DOCTYPE html>
- <html lang="el">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Users - WiSearch Panel</title>
- <style>
- body { background-color: #121212; color: #e0e0e0; font-family: 'Segoe UI', Tahoma, sans-serif; margin: 0; padding: 20px; }
-
- /* Κοινό Header με το Admin Dashboard */
- .header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #333; padding-bottom: 15px; margin-bottom: 20px; }
- .title { color: #bb86fc; margin: 0; }
- .title span { color: #e0e0e0; }
- .nav-links a { color: #03dac6; text-decoration: none; margin-left: 15px; font-weight: bold; }
- .nav-links a:hover { text-decoration: underline; }
-
- /* Κεντρικά Κουτιά */
- .content-box { background: #1e1e1e; padding: 20px; border-radius: 8px; border: 1px solid #333; max-width: 1000px; margin: 0 auto 20px auto; }
- h3 { color: #bb86fc; border-bottom: 1px solid #333; padding-bottom: 10px; margin-top: 0; }
-
- /* Φόρμες & Κουμπιά */
- input, select { background: #121212; border: 1px solid #333; color: #e0e0e0; padding: 10px; border-radius: 4px; font-family: monospace; box-sizing: border-box; }
- input:focus, select:focus { border-color: #bb86fc; outline: none; }
- .btn { padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; color: #000; background: #03dac6; transition: 0.2s; }
- .btn:hover { opacity: 0.8; }
- .btn-danger { background: #cf6679; color: #fff; text-decoration: none; padding: 6px 12px; border-radius: 4px; font-size: 12px; transition: 0.2s; }
- .btn-danger:hover { background: #ff4d4d; }
-
- /* Στυλ Πίνακα */
- table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
- th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid #333; }
- th { background-color: #2d2d2d; color: #03dac6; }
-
- /* Ταμπελάκια Ρόλων (Pills) */
- .role-pill { font-size: 11px; padding: 4px 10px; border-radius: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
- .role-admin { background: rgba(187, 134, 252, 0.1); color: #bb86fc; border: 1px solid rgba(187, 134, 252, 0.3); }
- .role-user { background: rgba(3, 218, 198, 0.1); color: #03dac6; border: 1px solid rgba(3, 218, 198, 0.3); }
- /* Μηνύματα Συστήματος */
- .flash { background: #03dac6; color: #000; font-weight: bold; padding: 10px; border-radius: 4px; margin-bottom: 20px; max-width: 1000px; margin-left: auto; margin-right: auto; }
-
- .footer { margin-top: 40px; text-align: center; font-size: 12px; color: #9e9e9e; }
- .footer b { color: #e0e0e0; }
- </style>
- </head>
- <body>
- <div class="header">
- <h1 class="title">WiSearch <span>Panel</span></h1>
- <div class="nav-links">
- <a href="/">🏠 Αναζήτηση</a>
- <a href="/admin">⚙️ Πίνακας Ελέγχου</a>
- <a href="/admin/logs">📜 Logs</a>
- <a href="/logout" style="color: #cf6679;">🚪 Έξοδος ({{ session['username'] }})</a>
- </div>
- </div>
- {% with messages = get_flashed_messages() %}
- {% if messages %}
- {% for msg in messages %}
- <div class="flash">{{ msg }}</div>
- {% endfor %}
- {% endif %}
- {% endwith %}
- <div class="content-box">
- <h3>➕ Προσθήκη Νέου Χρήστη</h3>
- <form action="/admin/users/add" method="POST" style="display: flex; gap: 10px; align-items: center; flex-wrap: wrap;">
- <input type="text" name="username" placeholder="Username" required style="flex: 1; min-width: 200px;">
- <input type="password" name="password" placeholder="Password" required style="flex: 1; min-width: 200px;">
- <select name="role" required style="flex: 1; min-width: 200px;">
- <option value="user">User (Μόνο Sponsored Links)</option>
- <option value="admin">Admin (Πλήρης Πρόσβαση)</option>
- </select>
- <button type="submit" class="btn" style="background: #bb86fc;">Δημιουργία</button>
- </form>
- </div>
- <div class="content-box">
- <h3>👥 Λίστα Χρηστών</h3>
- <table>
- <tr>
- <th>Username</th>
- <th>Ρόλος</th>
- <th>Αλλαγή Password</th>
- <th>Ενέργειες</th>
- </tr>
- {% for u in users %}
- <tr>
- <td style="font-size: 16px; color: #e0e0e0; font-weight: bold;">{{ u.username }}</td>
- <td><span class="role-pill {% if u.role == 'admin' %}role-admin{% else %}role-user{% endif %}">{{ u.role }}</span></td>
- <td>
- <form action="/admin/users/reset/{{ u.id }}" method="POST" style="display: flex; gap: 5px; margin: 0;">
- <input type="text" name="new_password" placeholder="Νέος κωδικός" required style="margin: 0; padding: 6px; font-size: 12px; width: 140px;">
- <button type="submit" class="btn" style="padding: 6px 12px; font-size: 12px;">Αλλαγή</button>
- </form>
- </td>
- <td>
- {% if u.username != session['username'] %}
- <a href="/admin/users/delete/{{ u.id }}" class="btn-danger" onclick="return confirm('Οριστική διαγραφή χρήστη {{ u.username }};')">Διαγραφή</a>
- {% else %}
- <span style="color: #5f6368; font-size: 12px; font-style: italic;">(Τρέχων χρήστης)</span>
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </table>
- </div>
- <div class="footer">
- ⚡ Powered by <b>#6610 Maiden</b>
- </div>
- </body>
- </html>
|