Обновить query.cfm
This commit is contained in:
parent
9c7e4efdd9
commit
8002a5dc2f
73
query.cfm
73
query.cfm
@ -1,55 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<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>
|
||||
body { font-family: 'Segoe UI', Tahoma, sans-serif; margin: 0; padding: 40px; background: #f0f2f5; color: #1c1e21; }
|
||||
.box { background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); max-width: 900px; margin: auto; }
|
||||
.header { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid #005bff; padding-bottom: 15px; margin-bottom: 25px; }
|
||||
.logo { height: 40px; }
|
||||
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
|
||||
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ebedf0; }
|
||||
th { background: #f8f9fa; color: #606770; font-size: 0.9em; text-transform: uppercase; }
|
||||
.btn { cursor: pointer; padding: 7px 14px; border: none; border-radius: 6px; color: #fff; font-weight: 600; transition: opacity 0.2s; }
|
||||
.btn:hover { opacity: 0.8; }
|
||||
body { font-family: 'Segoe UI', Tahoma, sans-serif; margin: 0; padding: 40px; background: #f4f6f9; }
|
||||
.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: 20px; margin-bottom: 30px; }
|
||||
.logo { height: 45px; }
|
||||
table { width: 100%; border-collapse: collapse; }
|
||||
th, td { padding: 15px; text-align: left; border-bottom: 1px solid #edf0f2; }
|
||||
th { background: #fafbfc; color: #7f8c8d; font-size: 0.85em; text-transform: uppercase; }
|
||||
.btn { cursor: pointer; padding: 8px 16px; border: none; border-radius: 6px; color: #fff; font-weight: 500; }
|
||||
.btn-add { background: #005bff; }
|
||||
.btn-upd { background: #28a745; }
|
||||
.btn-del { background: #dc3545; }
|
||||
.input-text { padding: 10px; border: 1px solid #ddd; border-radius: 6px; width: 300px; }
|
||||
.input-inline { padding: 5px; border: 1px solid #eee; border-radius: 4px; width: 90%; font-family: inherit; }
|
||||
.err { background: #fff1f0; border: 1px solid #ffa39e; padding: 10px; border-radius: 6px; color: #cf1322; margin-bottom: 20px; }
|
||||
.btn-upd { background: #27ae60; }
|
||||
.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>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="box">
|
||||
<div class="header">
|
||||
<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>
|
||||
|
||||
<cfif structKeyExists(request, "db_error")>
|
||||
<div class="err"><strong>Ошибка базы данных:</strong><br><cfoutput>#request.db_error#</cfoutput></div>
|
||||
</cfif>
|
||||
|
||||
<form method="post" style="display: flex; gap: 10px; margin-bottom: 30px;">
|
||||
<form method="post" style="display: flex; gap: 10px; margin-bottom: 40px;">
|
||||
<input type="hidden" name="crud_action" value="insert">
|
||||
<input type="text" name="txt_content" placeholder="Введите данные для записи в БД..." required class="input-text" style="flex-grow: 1;">
|
||||
<button type="submit" class="btn btn-add">Добавить запись</button>
|
||||
<input type="text" name="txt_content" placeholder="Введите текст для сохранения в PostgreSQL..." required class="input-main">
|
||||
<button type="submit" class="btn btn-add" style="white-space: nowrap;">Создать запись</button>
|
||||
</form>
|
||||
|
||||
<cfquery name="qGet" datasource="#request.DS#">
|
||||
SELECT * FROM nubes_test_table ORDER BY id DESC LIMIT 15
|
||||
</cfquery>
|
||||
<cfquery name="qGet" datasource="#request.DS#">SELECT * FROM nubes_test_table ORDER BY id DESC LIMIT 10</cfquery>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 50px;">ID</th>
|
||||
<th>Данные в PostgreSQL</th>
|
||||
<th style="width: 120px;">Действия</th>
|
||||
</tr>
|
||||
<tr><th>ID</th><th>Данные</th><th>Управление</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<cfoutput query="qGet">
|
||||
@ -57,17 +45,14 @@
|
||||
<td>#id#</td>
|
||||
<td>
|
||||
<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="hidden" name="id" value="#id#">
|
||||
<input type="text" name="txt_content" value="#HTMLEditFormat(test_data)#" class="input-inline">
|
||||
</form>
|
||||
</td>
|
||||
<td style="display: flex; gap: 5px;">
|
||||
<button type="submit" form="upd_#id#" class="btn btn-upd" title="Сохранить изменения">💾</button>
|
||||
|
||||
<form method="post" style="margin:0" onsubmit="return confirm('Удалить эту запись?')">
|
||||
<input type="hidden" name="crud_action" value="delete">
|
||||
<input type="hidden" name="id" value="#id#">
|
||||
<td style="display: flex; gap: 8px;">
|
||||
<button type="submit" form="upd_#id#" class="btn btn-upd" title="Сохранить">💾</button>
|
||||
<form method="post" style="margin:0" onsubmit="return confirm('Удалить?')">
|
||||
<input type="hidden" name="crud_action" value="delete"><input type="hidden" name="id" value="#id#">
|
||||
<button type="submit" class="btn btn-del" title="Удалить">🗑</button>
|
||||
</form>
|
||||
</td>
|
||||
@ -75,12 +60,6 @@
|
||||
</cfoutput>
|
||||
</tbody>
|
||||
</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>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user