Обновить query.cfm

This commit is contained in:
naeel 2026-02-17 08:47:56 +03:00
parent 9c7e4efdd9
commit 8002a5dc2f

View File

@ -1,55 +1,43 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="ru">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Nubes Lucee CRUD</title> <title>Nubes | Личный кабинет (Демо)</title>
<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: #f0f2f5; color: #1c1e21; } body { font-family: 'Segoe UI', Tahoma, sans-serif; margin: 0; padding: 40px; background: #f4f6f9; }
.box { background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); max-width: 900px; margin: auto; } .box { background: #fff; padding: 30px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); max-width: 850px; margin: auto; }
.header { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid #005bff; padding-bottom: 15px; margin-bottom: 25px; } .header { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid #005bff; padding-bottom: 20px; margin-bottom: 30px; }
.logo { height: 40px; } .logo { height: 45px; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; } table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ebedf0; } th, td { padding: 15px; text-align: left; border-bottom: 1px solid #edf0f2; }
th { background: #f8f9fa; color: #606770; font-size: 0.9em; text-transform: uppercase; } th { background: #fafbfc; color: #7f8c8d; font-size: 0.85em; text-transform: uppercase; }
.btn { cursor: pointer; padding: 7px 14px; border: none; border-radius: 6px; color: #fff; font-weight: 600; transition: opacity 0.2s; } .btn { cursor: pointer; padding: 8px 16px; border: none; border-radius: 6px; color: #fff; font-weight: 500; }
.btn:hover { opacity: 0.8; }
.btn-add { background: #005bff; } .btn-add { background: #005bff; }
.btn-upd { background: #28a745; } .btn-upd { background: #27ae60; }
.btn-del { background: #dc3545; } .btn-del { background: #e74c3c; }
.input-text { padding: 10px; border: 1px solid #ddd; border-radius: 6px; width: 300px; } .input-main { padding: 12px; border: 1px solid #d1d9e0; border-radius: 6px; width: 100%; box-sizing: border-box; }
.input-inline { padding: 5px; border: 1px solid #eee; border-radius: 4px; width: 90%; font-family: inherit; } .input-inline { padding: 8px; border: 1px solid #eee; border-radius: 4px; width: 85%; }
.err { background: #fff1f0; border: 1px solid #ffa39e; padding: 10px; border-radius: 6px; color: #cf1322; margin-bottom: 20px; }
</style> </style>
</head> </head>
<body> <body>
<div class="box"> <div class="box">
<div class="header"> <div class="header">
<img src="https://nubes.ru/themes/custom/nubes_2025/logo.svg" alt="Nubes Logo" class="logo"> <img src="https://nubes.ru/themes/custom/nubes_2025/logo.svg" alt="Nubes Logo" class="logo">
<h2 style="margin:0; color: #005bff;">Lucee CRUD Demo</h2> <h2 style="margin:0; color: #005bff;">Демонстрация CRUD</h2>
</div> </div>
<cfif structKeyExists(request, "db_error")> <form method="post" style="display: flex; gap: 10px; margin-bottom: 40px;">
<div class="err"><strong>Ошибка базы данных:</strong><br><cfoutput>#request.db_error#</cfoutput></div>
</cfif>
<form method="post" style="display: flex; gap: 10px; margin-bottom: 30px;">
<input type="hidden" name="crud_action" value="insert"> <input type="hidden" name="crud_action" value="insert">
<input type="text" name="txt_content" placeholder="Введите данные для записи в БД..." required class="input-text" style="flex-grow: 1;"> <input type="text" name="txt_content" placeholder="Введите текст для сохранения в PostgreSQL..." required class="input-main">
<button type="submit" class="btn btn-add">Добавить запись</button> <button type="submit" class="btn btn-add" style="white-space: nowrap;">Создать запись</button>
</form> </form>
<cfquery name="qGet" datasource="#request.DS#"> <cfquery name="qGet" datasource="#request.DS#">SELECT * FROM nubes_test_table ORDER BY id DESC LIMIT 10</cfquery>
SELECT * FROM nubes_test_table ORDER BY id DESC LIMIT 15
</cfquery>
<table> <table>
<thead> <thead>
<tr> <tr><th>ID</th><th>Данные</th><th>Управление</th></tr>
<th style="width: 50px;">ID</th>
<th>Данные в PostgreSQL</th>
<th style="width: 120px;">Действия</th>
</tr>
</thead> </thead>
<tbody> <tbody>
<cfoutput query="qGet"> <cfoutput query="qGet">
@ -57,17 +45,14 @@
<td>#id#</td> <td>#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="crud_action" value="update"><input type="hidden" name="id" value="#id#">
<input type="hidden" name="id" value="#id#">
<input type="text" name="txt_content" value="#HTMLEditFormat(test_data)#" class="input-inline"> <input type="text" name="txt_content" value="#HTMLEditFormat(test_data)#" class="input-inline">
</form> </form>
</td> </td>
<td style="display: flex; gap: 5px;"> <td style="display: flex; gap: 8px;">
<button type="submit" form="upd_#id#" class="btn btn-upd" title="Сохранить изменения">💾</button> <button type="submit" form="upd_#id#" class="btn btn-upd" 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">
<input type="hidden" name="id" value="#id#">
<button type="submit" class="btn btn-del" title="Удалить">🗑</button> <button type="submit" class="btn btn-del" title="Удалить">🗑</button>
</form> </form>
</td> </td>
@ -75,12 +60,6 @@
</cfoutput> </cfoutput>
</tbody> </tbody>
</table> </table>
<div style="margin-top: 30px; padding-top: 15px; border-top: 1px solid #eee; font-size: 0.8em; color: #999; display: flex; justify-content: space-between;">
<span>DS: <strong><cfoutput>#request.DS#</cfoutput></strong></span>
<span>Pod: <cfoutput>$(kubectl get pods -l app=nifiregistry-sample -o name | head -1)</cfoutput></span>
</div>
</div> </div>
</body> </body>
</html> </html>