mirror of
https://github.com/Direct-Dev-Ru/go-lcg.git
synced 2025-11-16 01:29:55 +00:00
Исправления в ветке auth-feature
This commit is contained in:
@@ -79,6 +79,14 @@ var ExecutePageCSSTemplate = template.Must(template.New("execute_css").Parse(`
|
||||
opacity: 0.9;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.config-info {
|
||||
margin: 5px 0 0 0 !important;
|
||||
opacity: 0.7 !important;
|
||||
font-size: 0.9em !important;
|
||||
font-style: italic;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
.content {
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ var ExecutePageTemplate = template.Must(template.New("execute").Parse(`<!DOCTYPE
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{.Title}} - Linux Command GPT</title>
|
||||
<title>{{.Title}} - {{.AppName}}</title>
|
||||
<style>
|
||||
{{template "execute_css" .}}
|
||||
</style>
|
||||
@@ -17,16 +17,19 @@ var ExecutePageTemplate = template.Must(template.New("execute").Parse(`<!DOCTYPE
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>{{.Header}}</h1>
|
||||
<p>Выполнение запросов к Linux Command GPT через веб-интерфейс</p>
|
||||
<p>Выполнение запросов к {{.AppName}} через веб-интерфейс</p>
|
||||
<p class="config-info">({{.ProviderType}} • {{.Model}} • {{.Host}})</p>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="nav-buttons">
|
||||
<a href="/" class="nav-btn">🏠 Главная</a>
|
||||
<a href="/history" class="nav-btn">📝 История</a>
|
||||
<a href="/prompts" class="nav-btn">⚙️ Промпты</a>
|
||||
<a href="{{.BasePath}}/" class="nav-btn">🏠 Главная</a>
|
||||
<a href="{{.BasePath}}/history" class="nav-btn">📝 История</a>
|
||||
<a href="{{.BasePath}}/prompts" class="nav-btn">⚙️ Промпты</a>
|
||||
</div>
|
||||
|
||||
<form method="POST" id="executeForm">
|
||||
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
|
||||
|
||||
<div class="form-section">
|
||||
<div class="form-group">
|
||||
<label for="system_id">🤖 Системный промпт:</label>
|
||||
|
||||
@@ -89,6 +89,7 @@ var ExecutePageScriptsTemplate = template.Must(template.New("execute_scripts").P
|
||||
function saveResult() {
|
||||
const resultDataField = document.getElementById('resultData');
|
||||
const prompt = document.getElementById('prompt').value;
|
||||
const csrfToken = document.querySelector('input[name="csrf_token"]').value;
|
||||
|
||||
if (!resultDataField.value || !prompt.trim()) {
|
||||
alert('Нет данных для сохранения');
|
||||
@@ -104,10 +105,11 @@ var ExecutePageScriptsTemplate = template.Must(template.New("execute_scripts").P
|
||||
model: resultData.model || 'Unknown'
|
||||
};
|
||||
|
||||
fetch('/api/save-result', {
|
||||
fetch('{{.BasePath}}/api/save-result', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-Token': csrfToken,
|
||||
},
|
||||
body: JSON.stringify(requestData)
|
||||
})
|
||||
@@ -134,6 +136,7 @@ var ExecutePageScriptsTemplate = template.Must(template.New("execute_scripts").P
|
||||
const resultDataField = document.getElementById('resultData');
|
||||
const prompt = document.getElementById('prompt').value;
|
||||
const systemId = document.getElementById('system_id').value;
|
||||
const csrfToken = document.querySelector('input[name="csrf_token"]').value;
|
||||
|
||||
if (!resultDataField.value || !prompt.trim()) {
|
||||
alert('Нет данных для сохранения в историю');
|
||||
@@ -152,10 +155,11 @@ var ExecutePageScriptsTemplate = template.Must(template.New("execute_scripts").P
|
||||
system: systemName
|
||||
};
|
||||
|
||||
fetch('/api/add-to-history', {
|
||||
fetch('{{.BasePath}}/api/add-to-history', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-Token': csrfToken,
|
||||
},
|
||||
body: JSON.stringify(requestData)
|
||||
})
|
||||
|
||||
@@ -155,13 +155,13 @@ const HistoryPageTemplate = `
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>📝 История запросов</h1>
|
||||
<p>Управление историей запросов Linux Command GPT</p>
|
||||
<p>Управление историей запросов {{.AppName}}</p>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="nav-buttons">
|
||||
<a href="/" class="nav-btn">🏠 Главная</a>
|
||||
<a href="/run" class="nav-btn">🚀 Выполнение</a>
|
||||
<a href="/prompts" class="nav-btn">⚙️ Промпты</a>
|
||||
<a href="{{.BasePath}}/" class="nav-btn">🏠 Главная</a>
|
||||
<a href="{{.BasePath}}/run" class="nav-btn">🚀 Выполнение</a>
|
||||
<a href="{{.BasePath}}/prompts" class="nav-btn">⚙️ Промпты</a>
|
||||
<button class="nav-btn clear-btn" onclick="clearHistory()">🗑️ Очистить всю историю</button>
|
||||
</div>
|
||||
|
||||
@@ -197,12 +197,12 @@ const HistoryPageTemplate = `
|
||||
|
||||
<script>
|
||||
function viewHistoryEntry(index) {
|
||||
window.location.href = '/history/view/' + index;
|
||||
window.location.href = '{{.BasePath}}/history/view/' + index;
|
||||
}
|
||||
|
||||
function deleteHistoryEntry(index) {
|
||||
if (confirm('Вы уверены, что хотите удалить запись #' + index + '?')) {
|
||||
fetch('/history/delete/' + index, {
|
||||
fetch('{{.BasePath}}/history/delete/' + index, {
|
||||
method: 'DELETE'
|
||||
})
|
||||
.then(response => {
|
||||
@@ -221,7 +221,7 @@ const HistoryPageTemplate = `
|
||||
|
||||
function clearHistory() {
|
||||
if (confirm('Вы уверены, что хотите очистить всю историю?\\n\\nЭто действие нельзя отменить.')) {
|
||||
fetch('/history/clear', {
|
||||
fetch('{{.BasePath}}/history/clear', {
|
||||
method: 'DELETE'
|
||||
})
|
||||
.then(response => {
|
||||
|
||||
@@ -224,7 +224,7 @@ const HistoryViewTemplate = `
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>📝 Запись #{{.Index}}</h1>
|
||||
<a href="/history" class="back-btn">← Назад к истории</a>
|
||||
<a href="{{.BasePath}}/history" class="back-btn">← Назад к истории</a>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="history-meta">
|
||||
@@ -249,7 +249,7 @@ const HistoryViewTemplate = `
|
||||
{{.ExplanationHTML}}
|
||||
|
||||
<div class="actions">
|
||||
<a href="/history" class="action-btn">📝 К истории</a>
|
||||
<a href="{{.BasePath}}/history" class="action-btn">📝 К истории</a>
|
||||
<button class="action-btn delete-btn" onclick="deleteHistoryEntry({{.Index}})">🗑️ Удалить запись</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -258,12 +258,12 @@ const HistoryViewTemplate = `
|
||||
<script>
|
||||
function deleteHistoryEntry(index) {
|
||||
if (confirm('Вы уверены, что хотите удалить запись #' + index + '?')) {
|
||||
fetch('/history/delete/' + index, {
|
||||
fetch('{{.BasePath}}/history/delete/' + index, {
|
||||
method: 'DELETE'
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
window.location.href = '/history';
|
||||
window.location.href = '{{.BasePath}}/history';
|
||||
} else {
|
||||
alert('Ошибка при удалении записи');
|
||||
}
|
||||
|
||||
323
serve/templates/login.go
Normal file
323
serve/templates/login.go
Normal file
@@ -0,0 +1,323 @@
|
||||
package templates
|
||||
|
||||
// LoginPageTemplate шаблон страницы авторизации
|
||||
const LoginPageTemplate = `
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{.Title}}</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c, #4facfe, #00f2fe);
|
||||
background-size: 400% 400%;
|
||||
animation: gradientShift 15s ease infinite;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@keyframes gradientShift {
|
||||
0% { background-position: 0% 50%; }
|
||||
50% { background-position: 100% 50%; }
|
||||
100% { background-position: 0% 50%; }
|
||||
}
|
||||
|
||||
/* Плавающие элементы */
|
||||
.floating-elements {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.floating-element {
|
||||
position: absolute;
|
||||
opacity: 0.1;
|
||||
animation: float 20s infinite linear;
|
||||
}
|
||||
|
||||
.floating-element:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 25s; }
|
||||
.floating-element:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 30s; }
|
||||
.floating-element:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 20s; }
|
||||
.floating-element:nth-child(4) { left: 40%; animation-delay: 6s; animation-duration: 35s; }
|
||||
.floating-element:nth-child(5) { left: 50%; animation-delay: 8s; animation-duration: 28s; }
|
||||
.floating-element:nth-child(6) { left: 60%; animation-delay: 10s; animation-duration: 22s; }
|
||||
.floating-element:nth-child(7) { left: 70%; animation-delay: 12s; animation-duration: 32s; }
|
||||
.floating-element:nth-child(8) { left: 80%; animation-delay: 14s; animation-duration: 26s; }
|
||||
.floating-element:nth-child(9) { left: 90%; animation-delay: 16s; animation-duration: 24s; }
|
||||
|
||||
@keyframes float {
|
||||
0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
|
||||
10% { opacity: 0.1; }
|
||||
90% { opacity: 0.1; }
|
||||
100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
|
||||
}
|
||||
|
||||
.lock-icon {
|
||||
font-size: 2rem;
|
||||
color: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.key-icon {
|
||||
font-size: 1.5rem;
|
||||
color: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.shield-icon {
|
||||
font-size: 1.8rem;
|
||||
color: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.star-icon {
|
||||
font-size: 1.2rem;
|
||||
color: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.login-container {
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
backdrop-filter: blur(10px);
|
||||
padding: 2rem;
|
||||
border-radius: 20px;
|
||||
box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.login-header {
|
||||
text-align: center;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.login-header h1 {
|
||||
color: #333;
|
||||
font-size: 1.8rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.login-header p {
|
||||
color: #666;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.form-group input {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
border: 2px solid #e1e5e9;
|
||||
border-radius: 10px;
|
||||
font-size: 1rem;
|
||||
transition: all 0.3s ease;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.form-group input:focus {
|
||||
outline: none;
|
||||
border-color: #667eea;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
|
||||
background: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
.login-button {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
font-size: 1rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.login-button::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
||||
transition: left 0.5s;
|
||||
}
|
||||
|
||||
.login-button:hover {
|
||||
transform: translateY(-3px);
|
||||
box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
|
||||
}
|
||||
|
||||
.login-button:hover::before {
|
||||
left: 100%;
|
||||
}
|
||||
|
||||
.login-button:active {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.message {
|
||||
margin-top: 1rem;
|
||||
padding: 0.75rem;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.message.success {
|
||||
background-color: #d4edda;
|
||||
color: #155724;
|
||||
border: 1px solid #c3e6cb;
|
||||
}
|
||||
|
||||
.message.error {
|
||||
background-color: #f8d7da;
|
||||
color: #721c24;
|
||||
border: 1px solid #f5c6cb;
|
||||
}
|
||||
|
||||
.loading {
|
||||
display: none;
|
||||
text-align: center;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
border: 2px solid #f3f3f3;
|
||||
border-top: 2px solid #667eea;
|
||||
border-radius: 50%;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
animation: spin 1s linear infinite;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Плавающие элементы фона -->
|
||||
<div class="floating-elements">
|
||||
<div class="floating-element lock-icon">🔒</div>
|
||||
<div class="floating-element key-icon">🔑</div>
|
||||
<div class="floating-element shield-icon">🛡️</div>
|
||||
<div class="floating-element star-icon">⭐</div>
|
||||
<div class="floating-element lock-icon">🔐</div>
|
||||
<div class="floating-element key-icon">🗝️</div>
|
||||
<div class="floating-element shield-icon">🔒</div>
|
||||
<div class="floating-element star-icon">✨</div>
|
||||
<div class="floating-element lock-icon">🔒</div>
|
||||
</div>
|
||||
|
||||
<div class="login-container">
|
||||
<div class="login-header">
|
||||
<h1>🔐 Авторизация</h1>
|
||||
<p>Войдите в систему для доступа к LCG</p>
|
||||
</div>
|
||||
|
||||
<form id="loginForm">
|
||||
<input type="hidden" id="csrf_token" name="csrf_token" value="{{.CSRFToken}}">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="username">Имя пользователя:</label>
|
||||
<input type="text" id="username" name="username" required placeholder="Введите имя пользователя">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password">Пароль:</label>
|
||||
<input type="password" id="password" name="password" required placeholder="Введите пароль">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="login-button">Войти</button>
|
||||
</form>
|
||||
|
||||
<div class="loading" id="loading">
|
||||
<div class="spinner"></div>
|
||||
<p>Проверка авторизации...</p>
|
||||
</div>
|
||||
|
||||
<div id="message"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById('loginForm').addEventListener('submit', async function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const form = e.target;
|
||||
const formData = new FormData(form);
|
||||
const username = formData.get('username');
|
||||
const password = formData.get('password');
|
||||
|
||||
// Показываем загрузку
|
||||
document.getElementById('loading').style.display = 'block';
|
||||
document.getElementById('message').innerHTML = '';
|
||||
|
||||
try {
|
||||
const csrfToken = document.getElementById('csrf_token').value;
|
||||
const response = await fetch('/api/login', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-Token': csrfToken
|
||||
},
|
||||
body: JSON.stringify({
|
||||
username: username,
|
||||
password: password,
|
||||
csrf_token: csrfToken
|
||||
})
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
if (data.success) {
|
||||
// Успешная авторизация, перенаправляем на главную страницу
|
||||
window.location.href = '/';
|
||||
} else {
|
||||
// Ошибка авторизации
|
||||
showMessage(data.error || 'Ошибка авторизации', 'error');
|
||||
}
|
||||
} catch (error) {
|
||||
showMessage('Ошибка соединения с сервером', 'error');
|
||||
} finally {
|
||||
document.getElementById('loading').style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
function showMessage(text, type) {
|
||||
const messageDiv = document.getElementById('message');
|
||||
messageDiv.innerHTML = '<div class="message ' + type + '">' + text + '</div>';
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>`
|
||||
@@ -235,13 +235,13 @@ const PromptsPageTemplate = `
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>⚙️ Системные промпты</h1>
|
||||
<p>Управление системными промптами Linux Command GPT</p>
|
||||
<p>Управление системными промптами {{.AppName}}</p>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="nav-buttons">
|
||||
<a href="/" class="nav-btn">🏠 Главная</a>
|
||||
<a href="/run" class="nav-btn">🚀 Выполнение</a>
|
||||
<a href="/history" class="nav-btn">📝 История</a>
|
||||
<a href="{{.BasePath}}/" class="nav-btn">🏠 Главная</a>
|
||||
<a href="{{.BasePath}}/run" class="nav-btn">🚀 Выполнение</a>
|
||||
<a href="{{.BasePath}}/history" class="nav-btn">📝 История</a>
|
||||
<button class="nav-btn add-btn" onclick="showAddForm()">➕ Добавить промпт</button>
|
||||
<div class="lang-switcher">
|
||||
<button class="lang-btn {{if eq .Lang "ru"}}active{{end}}" onclick="switchLang('ru')">🇷🇺 RU</button>
|
||||
@@ -391,7 +391,7 @@ const PromptsPageTemplate = `
|
||||
|
||||
function saveCurrentPrompts(lang) {
|
||||
// Отправляем запрос для сохранения текущих промптов с новым языком
|
||||
fetch('/prompts/save-lang', {
|
||||
fetch('{{.BasePath}}/prompts/save-lang', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -417,7 +417,7 @@ const PromptsPageTemplate = `
|
||||
|
||||
function deletePrompt(id) {
|
||||
if (confirm('Вы уверены, что хотите удалить промпт #' + id + '?')) {
|
||||
fetch('/prompts/delete/' + id, {
|
||||
fetch('{{.BasePath}}/prompts/delete/' + id, {
|
||||
method: 'DELETE'
|
||||
})
|
||||
.then(response => {
|
||||
@@ -467,10 +467,10 @@ const PromptsPageTemplate = `
|
||||
|
||||
let url, method;
|
||||
if (isVerbosePrompt) {
|
||||
url = '/prompts/edit-verbose/' + id;
|
||||
url = '{{.BasePath}}/prompts/edit-verbose/' + id;
|
||||
method = 'PUT';
|
||||
} else {
|
||||
url = id ? '/prompts/edit/' + id : '/prompts/add';
|
||||
url = id ? '{{.BasePath}}/prompts/edit/' + id : '{{.BasePath}}/prompts/add';
|
||||
method = id ? 'PUT' : 'POST';
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ const PromptsPageTemplate = `
|
||||
// Функция восстановления системного промпта
|
||||
function restorePrompt(id) {
|
||||
if (confirm('Восстановить промпт к значению по умолчанию?')) {
|
||||
fetch('/prompts/restore/' + id, {
|
||||
fetch('{{.BasePath}}/prompts/restore/' + id, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -526,7 +526,7 @@ const PromptsPageTemplate = `
|
||||
// Функция восстановления verbose промпта
|
||||
function restoreVerbosePrompt(mode) {
|
||||
if (confirm('Восстановить промпт к значению по умолчанию?')) {
|
||||
fetch('/prompts/restore-verbose/' + mode, {
|
||||
fetch('{{.BasePath}}/prompts/restore-verbose/' + mode, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -7,7 +7,7 @@ const ResultsPageTemplate = `
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LCG Results - Linux Command GPT</title>
|
||||
<title>{{.AppAbbreviation}} Результаты - {{.AppName}}</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
@@ -182,15 +182,15 @@ const ResultsPageTemplate = `
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>🚀 LCG Results</h1>
|
||||
<p>Просмотр сохраненных результатов Linux Command GPT</p>
|
||||
<h1>🚀 {{.AppAbbreviation}} - {{.AppName}}</h1>
|
||||
<p>Просмотр сохраненных результатов {{.AppName}}</p>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="nav-buttons">
|
||||
<button class="nav-btn" onclick="location.reload()">🔄 Обновить</button>
|
||||
<a href="/run" class="nav-btn">🚀 Выполнение</a>
|
||||
<a href="/history" class="nav-btn">📝 История</a>
|
||||
<a href="/prompts" class="nav-btn">⚙️ Промпты</a>
|
||||
<a href="{{.BasePath}}/run" class="nav-btn">🚀 Выполнение</a>
|
||||
<a href="{{.BasePath}}/history" class="nav-btn">📝 История</a>
|
||||
<a href="{{.BasePath}}/prompts" class="nav-btn">⚙️ Промпты</a>
|
||||
</div>
|
||||
|
||||
<!-- Поиск -->
|
||||
@@ -218,7 +218,7 @@ const ResultsPageTemplate = `
|
||||
<div class="file-actions">
|
||||
<button class="delete-btn" onclick="deleteFile('{{.Name}}')" title="Удалить файл">🗑️</button>
|
||||
</div>
|
||||
<div class="file-card-content" onclick="window.location.href='/file/{{.Name}}'">
|
||||
<div class="file-card-content" onclick="window.location.href='{{$.BasePath}}/file/{{.Name}}'">
|
||||
<div class="file-name">{{.Name}}</div>
|
||||
<div class="file-info">
|
||||
📅 {{.ModTime}} | 📏 {{.Size}}
|
||||
@@ -240,7 +240,7 @@ const ResultsPageTemplate = `
|
||||
<script>
|
||||
function deleteFile(filename) {
|
||||
if (confirm('Вы уверены, что хотите удалить файл "' + filename + '"?\\n\\nЭто действие нельзя отменить.')) {
|
||||
fetch('/delete/' + encodeURIComponent(filename), {
|
||||
fetch('{{.BasePath}}/delete/' + encodeURIComponent(filename), {
|
||||
method: 'DELETE'
|
||||
})
|
||||
.then(response => {
|
||||
|
||||
Reference in New Issue
Block a user