multi user ready
This commit is contained in:
+31
-2
@@ -13,6 +13,12 @@
|
||||
}
|
||||
.container { max-width: 1400px; margin: 0 auto; }
|
||||
h1 { color: #333; margin-bottom: 20px; }
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.controls {
|
||||
background: white;
|
||||
padding: 20px;
|
||||
@@ -36,6 +42,8 @@
|
||||
.btn:disabled { background: #ccc; cursor: not-allowed; }
|
||||
.btn-bitrix { background: #00aeef; }
|
||||
.btn-bitrix:hover { background: #008cc7; }
|
||||
.btn-settings { background: #6c757d; }
|
||||
.btn-settings:hover { background: #545b62; }
|
||||
table {
|
||||
width: 100%;
|
||||
background: white;
|
||||
@@ -83,14 +91,35 @@
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.setup-notice {
|
||||
background: #fff3e0;
|
||||
border-left: 4px solid #f57c00;
|
||||
padding: 16px;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 0 8px 8px 0;
|
||||
}
|
||||
.setup-notice a { color: #e65100; font-weight: 600; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>🔗 Bitmine — Агрегатор задач</h1>
|
||||
<div class="header">
|
||||
<h1>🔗 Bitmine — Агрегатор задач</h1>
|
||||
<a href="/settings" class="btn btn-settings">⚙️ Настройки</a>
|
||||
</div>
|
||||
|
||||
{% if !has_settings %}
|
||||
<div class="setup-notice">
|
||||
⚠️ <strong>Требуется настройка!</strong>
|
||||
Сначала укажите данные для подключения к Redmine в разделе
|
||||
<a href="/settings">Настройки</a>.
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="controls">
|
||||
<a href="/api/redmine/tasks" class="btn">📋 Получить задачи из Redmine</a>
|
||||
<a href="/api/redmine/tasks" class="btn {% if !has_settings %}btn-disabled{% endif %}">
|
||||
📋 Получить задачи из Redmine
|
||||
</a>
|
||||
<button class="btn btn-bitrix" disabled>📌 Получить задачи из Bitrix24</button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Настройки — Bitmine</title>
|
||||
<style>
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
background: #f5f5f5;
|
||||
padding: 20px;
|
||||
}
|
||||
.container { max-width: 600px; margin: 0 auto; }
|
||||
h1 { color: #333; margin-bottom: 20px; }
|
||||
.card {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
||||
padding: 24px;
|
||||
}
|
||||
.form-group { margin-bottom: 20px; }
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
input[type="text"],
|
||||
input[type="password"],
|
||||
input[type="number"] {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
}
|
||||
input:focus {
|
||||
outline: none;
|
||||
border-color: #007bff;
|
||||
box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
|
||||
}
|
||||
.help-text {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.btn {
|
||||
background: #007bff;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 12px 24px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.btn:hover { background: #0056b3; }
|
||||
.btn-secondary {
|
||||
background: #6c757d;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.btn-secondary:hover { background: #545b62; }
|
||||
.error {
|
||||
background: #ffebee;
|
||||
color: #c62828;
|
||||
padding: 16px;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.success {
|
||||
background: #e8f5e9;
|
||||
color: #388e3c;
|
||||
padding: 16px;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.back-link {
|
||||
display: inline-block;
|
||||
margin-bottom: 20px;
|
||||
color: #007bff;
|
||||
text-decoration: none;
|
||||
}
|
||||
.back-link:hover { text-decoration: underline; }
|
||||
.security-note {
|
||||
background: #fff3e0;
|
||||
border-left: 4px solid #f57c00;
|
||||
padding: 12px;
|
||||
margin-top: 20px;
|
||||
font-size: 13px;
|
||||
color: #e65100;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<a href="/" class="back-link">← Назад к списку задач</a>
|
||||
|
||||
<h1>⚙️ Настройки подключения</h1>
|
||||
|
||||
<div class="card">
|
||||
{% if error.is_some() %}
|
||||
<div class="error">{{ error.as_ref().unwrap() }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if success.is_some() %}
|
||||
<div class="success">{{ success.as_ref().unwrap() }}</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="POST" action="/settings">
|
||||
<div class="form-group">
|
||||
<label for="redmine_url">Redmine URL</label>
|
||||
<input
|
||||
type="text"
|
||||
id="redmine_url"
|
||||
name="redmine_url"
|
||||
value="{{ redmine_url }}"
|
||||
placeholder="https://redmine.example.com"
|
||||
required
|
||||
>
|
||||
<div class="help-text">Полный URL вашего Redmine, например: https://redmine.company.com</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="redmine_api_key">API Key</label>
|
||||
<input
|
||||
type="password"
|
||||
id="redmine_api_key"
|
||||
name="redmine_api_key"
|
||||
value=""
|
||||
placeholder="Ваш API ключ из настроек Redmine"
|
||||
required
|
||||
>
|
||||
<div class="help-text">Ключ можно получить в Настройки → Мой аккаунт → API access key</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="redmine_user_id">User ID</label>
|
||||
<input
|
||||
type="number"
|
||||
id="redmine_user_id"
|
||||
name="redmine_user_id"
|
||||
value="{{ redmine_user_id }}"
|
||||
placeholder="7"
|
||||
required
|
||||
>
|
||||
<div class="help-text">Ваш ID пользователя в Redmine (видно в профиле или URL)</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn">💾 Сохранить настройки</button>
|
||||
<a href="/" class="btn btn-secondary">Отмена</a>
|
||||
</form>
|
||||
|
||||
<div class="security-note">
|
||||
🔒 <strong>Безопасность:</strong> Ваши учётные данные хранятся только в сессии браузера и не сохраняются на сервере.
|
||||
При закрытии браузера сессия истекает и данные удаляются.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user