Обновить query.cfm
This commit is contained in:
parent
4136c71dcc
commit
96e29df985
118
query.cfm
118
query.cfm
@ -1,88 +1,64 @@
|
|||||||
<style>
|
<style>
|
||||||
body { font-family: 'Segoe UI', sans-serif; margin: 25px; background: #f4f7f6; color: #333; }
|
body { font-family: sans-serif; margin: 30px; line-height: 1.5; }
|
||||||
.card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); margin-bottom: 25px; }
|
table { border-collapse: collapse; width: 80%; margin-top: 20px; }
|
||||||
.header { background: #2c3e50; color: white; padding: 15px; border-radius: 8px 8px 0 0; margin: -20px -20px 20px -20px; }
|
th, td { border: 1px solid #ccc; padding: 10px; text-align: left; }
|
||||||
h2 { color: #2c3e50; border-bottom: 2px solid #e1e8ed; padding-bottom: 8px; margin-top: 0; }
|
th { background: #eee; }
|
||||||
.status-ok { background: #2ecc71; color: white; padding: 5px 15px; border-radius: 20px; font-weight: bold; font-size: 0.9em; }
|
.success { color: #27ae60; font-weight: bold; }
|
||||||
table { width: 100%; border-collapse: collapse; margin: 10px 0; }
|
.env-box { background: #f9f9f9; padding: 10px; border: 1px dashed #999; margin-top: 30px; font-size: 0.8em; }
|
||||||
th, td { text-align: left; padding: 10px; border: 1px solid #eee; }
|
|
||||||
th { background: #f8f9fa; width: 30%; }
|
|
||||||
.tf-var { color: #d35400; font-family: monospace; font-weight: bold; }
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="card">
|
<h2>🛠 Тест базы данных: Запись и Чтение</h2>
|
||||||
<div class="header">
|
|
||||||
<h1 style="margin:0; font-size: 1.5em;">🚀 Lucee Connection Dashboard</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2>1. Request Information</h2>
|
<cftry>
|
||||||
<cfdump var="#request#" label="Full Request Scope" expand="false" />
|
<cfquery name="qCreate">
|
||||||
|
CREATE TABLE IF NOT EXISTS nubes_test_table (
|
||||||
|
id SERIAL PRIMARY KEY,
|
||||||
|
test_data TEXT,
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
</cfquery>
|
||||||
|
|
||||||
<h2>2. Application Context (this)</h2>
|
<cfquery name="qInsert">
|
||||||
<cfdump var="#this#" label="Application.cfc Settings" expand="false" />
|
INSERT INTO nubes_test_table (test_data)
|
||||||
|
VALUES ('Проверка записи через Lucee: ' || CURRENT_TIMESTAMP);
|
||||||
|
</cfquery>
|
||||||
|
|
||||||
<h2>3. Database Test (PostgreSQL)</h2>
|
<cfquery name="qSelect">
|
||||||
<cftry>
|
SELECT * FROM nubes_test_table ORDER BY id DESC LIMIT 10;
|
||||||
<cfquery name="qTest" result="res">
|
</cfquery>
|
||||||
SELECT
|
|
||||||
CURRENT_TIMESTAMP as db_time,
|
|
||||||
current_database() as db_name,
|
|
||||||
current_user as db_user;
|
|
||||||
</cfquery>
|
|
||||||
|
|
||||||
<table>
|
<p class="success">✅ Соединение активно! Данные успешно записаны в PostgreSQL.</p>
|
||||||
<tr>
|
|
||||||
<th>Connection Status</th>
|
|
||||||
<td><span class="status-ok">✅ ACTIVE</span></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>Current Database</th>
|
|
||||||
<td><strong><cfoutput>#qTest.db_name#</cfoutput></strong></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>DB User</th>
|
|
||||||
<td><cfoutput>#qTest.db_user#</cfoutput></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>DB Server Time</th>
|
|
||||||
<td><cfoutput>#qTest.db_time#</cfoutput></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>Execution Time</th>
|
|
||||||
<td><cfoutput>#res.executiontime# ms</cfoutput></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<cfcatch>
|
|
||||||
<div style="background: #e74c3c; color: white; padding: 15px; border-radius: 5px;">
|
|
||||||
<strong>❌ DATABASE ERROR:</strong><br>
|
|
||||||
<cfoutput>#cfcatch.message#</cfoutput>
|
|
||||||
</div>
|
|
||||||
</cfcatch>
|
|
||||||
</cftry>
|
|
||||||
|
|
||||||
<h2>4. Terraform Environment Variables (🟥➡️)</h2>
|
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Variable Key</th>
|
<th>ID</th>
|
||||||
<th>Value from Terraform</th>
|
<th>Сообщение из базы</th>
|
||||||
|
<th>Дата и время в БД</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<cfset env = createObject("java", "java.lang.System").getEnv()>
|
<cfoutput query="qSelect">
|
||||||
<cfloop collection="#env#" item="key">
|
<tr>
|
||||||
<cfif findNoCase("testds_", key) OR findNoCase("PG", key)>
|
<td>#id#</td>
|
||||||
<tr>
|
<td>#test_data#</td>
|
||||||
<td class="tf-var"><cfoutput>#key#</cfoutput></td>
|
<td>#created_at#</td>
|
||||||
<td><cfoutput>#env[key]#</cfoutput></td>
|
</tr>
|
||||||
</tr>
|
</cfoutput>
|
||||||
</cfif>
|
|
||||||
</cfloop>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
|
||||||
|
|
||||||
<p style="text-align: center; color: #95a5a6; font-size: 0.8em;">
|
<cfcatch>
|
||||||
Managed by Terraform | Dashboard Generated: <cfoutput>#dateTimeFormat(now(), "yyyy-mm-dd HH:nn:ss")#</cfoutput>
|
<div style="color:red; border: 1px solid red; padding: 10px;">
|
||||||
</p>
|
<strong>❌ Ошибка:</strong><br>
|
||||||
|
<cfoutput>#cfcatch.message#</cfoutput>
|
||||||
|
</div>
|
||||||
|
</cfcatch>
|
||||||
|
</cftry>
|
||||||
|
|
||||||
|
<div class="env-box">
|
||||||
|
<details>
|
||||||
|
<summary style="cursor:pointer;">Показать переменные окружения (Terraform)</summary>
|
||||||
|
<cfdump var="#createObject('java', 'java.lang.System').getEnv()#" label="System Env" expand="false">
|
||||||
|
</details>
|
||||||
|
</div>
|
||||||
Loading…
Reference in New Issue
Block a user