Обновить query.cfm

This commit is contained in:
naeel 2026-02-17 08:54:49 +03:00
parent 8bd9790d14
commit 9c9c3b1f58

View File

@ -2,58 +2,93 @@
<html lang="ru"> <html lang="ru">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Nubes | Личный кабинет (Демо)</title> <title>Nubes | Управление данными</title>
<link rel="icon" href="https://nubes.ru/themes/custom/nubes/images/nubes-ico.svg" type="image/svg+xml"> <link rel="icon" href="https://nubes.ru/themes/custom/nubes/images/nubes-ico.svg" type="image/svg+xml">
<style> <style>
body { font-family: 'Segoe UI', Tahoma, sans-serif; margin: 0; padding: 40px; background: #f4f6f9; } :root {
.box { background: #fff; padding: 30px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); max-width: 850px; margin: auto; } --nubes-blue: #005BFF;
.header { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid #005bff; padding-bottom: 20px; margin-bottom: 30px; } --nubes-dark: #1A1A1A;
.logo { height: 45px; } --nubes-grey: #F8F9FA;
--nubes-border: #E5E7EB;
}
body { font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 0; background: var(--nubes-grey); color: var(--nubes-dark); }
.header-bg { background: #fff; border-bottom: 1px solid var(--nubes-border); padding: 15px 0; margin-bottom: 40px; }
.container { max-width: 1000px; margin: auto; padding: 0 20px; }
.header-content { display: flex; align-items: center; justify-content: space-between; }
.logo { height: 40px; }
.card { background: #fff; padding: 32px; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.04); }
h1 { font-size: 24px; font-weight: 600; margin-top: 0; color: var(--nubes-dark); }
/* Стили кнопок nubes.ru */
.btn {
display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; padding: 12px 24px; border: none; border-radius: 8px;
font-weight: 600; font-size: 14px; transition: all 0.2s; text-decoration: none;
}
.btn-primary { background: var(--nubes-blue); color: #fff; }
.btn-primary:hover { background: #004ED9; transform: translateY(-1px); }
.btn-action { padding: 8px; background: transparent; border: 1px solid var(--nubes-border); border-radius: 6px; }
.btn-action:hover { background: #f0f2f5; }
.input-group { display: flex; gap: 12px; margin-bottom: 32px; }
input[type="text"] {
flex-grow: 1; padding: 12px 16px; border: 1px solid var(--nubes-border);
border-radius: 8px; font-size: 14px; outline: none; transition: border-color 0.2s;
}
input[type="text"]:focus { border-color: var(--nubes-blue); }
table { width: 100%; border-collapse: collapse; } table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid #edf0f2; } th { text-align: left; padding: 16px; font-size: 12px; text-transform: uppercase; color: #6B7280; border-bottom: 1px solid var(--nubes-border); }
th { background: #fafbfc; color: #7f8c8d; font-size: 0.85em; text-transform: uppercase; } td { padding: 16px; border-bottom: 1px solid var(--nubes-border); }
.btn { cursor: pointer; padding: 8px 16px; border: none; border-radius: 6px; color: #fff; font-weight: 500; }
.btn-add { background: #005bff; } .id-cell { font-family: monospace; color: #9CA3AF; width: 50px; }
.btn-upd { background: #27ae60; } .actions-cell { display: flex; gap: 8px; width: 100px; }
.btn-del { background: #e74c3c; }
.input-main { padding: 12px; border: 1px solid #d1d9e0; border-radius: 6px; width: 100%; box-sizing: border-box; }
.input-inline { padding: 8px; border: 1px solid #eee; border-radius: 4px; width: 85%; }
</style> </style>
</head> </head>
<body> <body>
<div class="box">
<div class="header"> <div class="header-bg">
<img src="https://nubes.ru/themes/custom/nubes_2025/logo.svg" alt="Nubes Logo" class="logo"> <div class="container header-content">
<h2 style="margin:0; color: #005bff;">Демонстрация CRUD</h2> <img src="https://nubes.ru/themes/custom/nubes_2025/logo.svg" alt="Nubes" class="logo">
<div style="font-size: 14px; color: var(--nubes-blue); font-weight: 600;">Lucee + Postgres Demo</div>
</div>
</div> </div>
<form method="post" style="display: flex; gap: 10px; margin-bottom: 40px;"> <div class="container">
<div class="card">
<h1>Управление записями</h1>
<form method="post" class="input-group">
<input type="hidden" name="crud_action" value="insert"> <input type="hidden" name="crud_action" value="insert">
<input type="text" name="txt_content" placeholder="Введите текст для сохранения в PostgreSQL..." required class="input-main"> <input type="text" name="txt_content" placeholder="Введите текст сообщения..." required>
<button type="submit" class="btn btn-add" style="white-space: nowrap;">Создать запись</button> <button type="submit" class="btn btn-primary">Добавить запись</button>
</form> </form>
<cfquery name="qGet" datasource="#request.DS#">SELECT * FROM nubes_test_table ORDER BY id DESC LIMIT 10</cfquery> <cfquery name="qGet" datasource="#request.DS#">SELECT * FROM nubes_test_table ORDER BY id DESC LIMIT 10</cfquery>
<table> <table>
<thead> <thead>
<tr><th>ID</th><th>Данные</th><th>Управление</th></tr> <tr><th>ID</th><th>Содержимое</th><th>Действия</th></tr>
</thead> </thead>
<tbody> <tbody>
<cfoutput query="qGet"> <cfoutput query="qGet">
<tr> <tr>
<td>#id#</td> <td class="id-cell">#id#</td>
<td> <td>
<form method="post" id="upd_#id#" style="margin:0"> <form method="post" id="upd_#id#" style="margin:0">
<input type="hidden" name="crud_action" value="update"><input type="hidden" name="id" value="#id#"> <input type="hidden" name="crud_action" value="update">
<input type="text" name="txt_content" value="#HTMLEditFormat(test_data)#" class="input-inline"> <input type="hidden" name="id" value="#id#">
<input type="text" name="txt_content" value="#HTMLEditFormat(test_data)#" style="width:100%; border:none; padding:4px;">
</form> </form>
</td> </td>
<td style="display: flex; gap: 8px;"> <td class="actions-cell">
<button type="submit" form="upd_#id#" class="btn btn-upd" title="Сохранить">💾</button> <button type="submit" form="upd_#id#" class="btn-action" title="Сохранить">💾</button>
<form method="post" style="margin:0" onsubmit="return confirm('Удалить?')"> <form method="post" style="margin:0" onsubmit="return confirm('Удалить запись?')">
<input type="hidden" name="crud_action" value="delete"><input type="hidden" name="id" value="#id#"> <input type="hidden" name="crud_action" value="delete">
<button type="submit" class="btn btn-del" title="Удалить">🗑</button> <input type="hidden" name="id" value="#id#">
<button type="submit" class="btn-action" title="Удалить">🗑</button>
</form> </form>
</td> </td>
</tr> </tr>
@ -61,5 +96,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
</body> </body>
</html> </html>