Files
SQS-service/app/ui/info.html
T

237 lines
9.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>shared-sqs — очередь Nubes (SQS API)</title>
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
<style>
:root {
--brand-primary: #2563eb;
--brand-primary-dark: #1d4ed8;
--brand-gray: #d1d5db;
--brand-grey-light: #f3f4f6;
--text-primary: #1a1a1a;
--text-muted: #6b7280;
--success: #16a34a;
--warning: #d97706;
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: system-ui, "Segoe UI", Roboto, sans-serif;
font-size: 14px;
color: var(--text-primary);
background: #fafafa;
line-height: 1.5;
}
/* Топбар — как в deck: белый, border-bottom */
.topbar {
height: 56px;
display: flex;
align-items: center;
gap: 8px;
padding: 0 16px;
background: #fff;
border-bottom: 1px solid var(--brand-gray);
position: sticky;
top: 0;
}
.topbar .brand { font-weight: 600; color: var(--text-primary); }
.topbar .muted { color: var(--text-muted); }
.topbar .spacer { flex: 1; }
.chip {
font-family: ui-monospace, monospace;
font-size: 12px;
color: var(--brand-primary);
background: #eff6ff;
border: 1px solid #bfdbfe;
border-radius: 999px;
padding: 2px 10px;
}
.container { max-width: 880px; margin: 0 auto; padding: 24px 16px 48px; }
/* Hero */
.hero { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.hero h1 { font-size: 24px; margin: 0; letter-spacing: -0.3px; }
.hero .sub { color: var(--text-muted); margin: 4px 0 0; }
.badge {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 12px;
font-weight: 600;
color: var(--warning);
background: #fffbeb;
border: 1px solid #fde68a;
border-radius: 999px;
padding: 2px 10px;
margin-left: 8px;
}
/* Карточки — как в design-system */
.card {
background: #fff;
border: 1px solid var(--brand-gray);
border-radius: 12px;
box-shadow: 0 1px 2px rgba(0,0,0,0.05);
margin-bottom: 20px;
overflow: hidden;
}
.card-header {
background: var(--brand-grey-light);
padding: 12px;
font-weight: 600;
font-size: 14px;
}
.card-body { padding: 12px; }
.card-body > p:first-child { margin-top: 0; }
.card-body > p:last-child { margin-bottom: 0; }
/* Сетка «подключение» */
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; }
.kv .k { color: var(--text-muted); }
.kv .v { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }
a { color: var(--brand-primary); text-decoration: none; }
a:hover { color: var(--brand-primary-dark); text-decoration: underline; }
/* Таблицы — как в design-system */
.tbl-wrap { border: 1px solid var(--brand-gray); border-radius: 8px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
background: var(--brand-grey-light);
text-align: left;
text-transform: uppercase;
font-size: 12px;
letter-spacing: 0.3px;
padding: 4px 8px;
border-right: 1px solid var(--brand-gray);
color: var(--text-muted);
font-weight: 600;
}
td { padding: 4px 8px; border-right: 1px solid var(--brand-gray); border-bottom: 1px solid var(--brand-gray); }
tr:last-child td { border-bottom: none; }
td:last-child, th:last-child { border-right: none; }
tr:hover td { background: rgba(243,244,246,0.5); }
td code, .v code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
/* Код-блоки */
pre {
background: var(--brand-grey-light);
border: 1px solid var(--brand-gray);
border-radius: 8px;
padding: 12px;
overflow-x: auto;
font-family: ui-monospace, Menlo, Consolas, monospace;
font-size: 12.5px;
line-height: 1.6;
margin: 8px 0 0;
}
pre code { background: none; border: none; padding: 0; }
.cmd-label { font-size: 12px; color: var(--text-muted); margin: 12px 0 0; font-weight: 600; }
.cmd-label:first-child { margin-top: 0; }
.status-ok { color: var(--success); font-weight: 600; }
.footer { color: var(--text-muted); font-size: 12px; text-align: center; margin-top: 32px; }
</style>
</head>
<body>
<div class="topbar">
<img src="/static/logo.svg" height="18" alt="nubes">
<span class="brand">Nubes</span>
<span class="muted">· очередь</span>
<span class="spacer"></span>
<span class="chip">{{VERSION}}</span>
</div>
<div class="container">
<div class="hero">
<img src="/static/logo.svg" height="28" alt="nubes">
<div>
<h1>shared-sqs <span class="badge">тестирование</span></h1>
<p class="sub">Multi-tenant очередь, совместимая с AWS SQS API. Каждый тенант получает изолированное пространство очередей.</p>
</div>
</div>
<div class="card">
<div class="card-header">Подключение</div>
<div class="card-body kv">
<div class="k">Endpoint</div>
<div class="v">https://sqs.containerk8s.dev.nubes.ru</div>
<div class="k">Протокол</div>
<div class="v">AWS SQS Query / JSON, подпись <code>AWS Signature V4</code></div>
<div class="k">Регион</div>
<div class="v">us-east-1</div>
<div class="k">Аутентификация</div>
<div class="v">Access Key / Secret Key тенанта (выдаются в консоли <a href="/ui">/ui</a>)</div>
<div class="k">Консоль</div>
<div class="v"><a href="/ui">/ui</a> — веб-интерфейс (вход по токену Nubes)</div>
<div class="k">Health</div>
<div class="v"><a href="/health">GET /health</a> <span class="status-ok">● ok</span></div>
<div class="k">Метрики</div>
<div class="v"><a href="/metrics">GET /metrics</a> — Prometheus</div>
<div class="k">Persistence</div>
<div class="v">Managed Redis (realm <code>iot-naeel</code>)</div>
</div>
</div>
<div class="card">
<div class="card-header">Команды SQS API</div>
<div class="card-body">
<p>Все команды отправляются на корень <code>POST https://sqs.containerk8s.dev.nubes.ru/</code> с параметром <code>Action</code>.</p>
<div class="tbl-wrap">
<table>
<thead>
<tr><th>Action</th><th>Описание</th></tr>
</thead>
<tbody>
<tr><td><code>CreateQueue</code></td><td>Создать очередь</td></tr>
<tr><td><code>ListQueues</code></td><td>Список очередей тенанта</td></tr>
<tr><td><code>GetQueueUrl</code></td><td>URL очереди по имени</td></tr>
<tr><td><code>GetQueueAttributes</code></td><td>Атрибуты очереди</td></tr>
<tr><td><code>SetQueueAttributes</code></td><td>Изменить атрибуты очереди</td></tr>
<tr><td><code>SendMessage</code></td><td>Отправить сообщение</td></tr>
<tr><td><code>SendMessageBatch</code></td><td>Отправить до 10 сообщений разом</td></tr>
<tr><td><code>ReceiveMessage</code></td><td>Получить сообщения (long polling до 20с)</td></tr>
<tr><td><code>DeleteMessage</code></td><td>Удалить сообщение</td></tr>
<tr><td><code>DeleteMessageBatch</code></td><td>Удалить до 10 сообщений разом</td></tr>
<tr><td><code>ChangeMessageVisibility</code></td><td>Изменить таймаут видимости сообщения</td></tr>
<tr><td><code>ChangeMessageVisibilityBatch</code></td><td>Пакетно изменить таймаут видимости</td></tr>
<tr><td><code>PurgeQueue</code></td><td>Очистить очередь</td></tr>
<tr><td><code>DeleteQueue</code></td><td>Удалить очередь</td></tr>
<tr><td><code>TagQueue</code></td><td>Назначить теги очереди</td></tr>
<tr><td><code>UntagQueue</code></td><td>Снять теги с очереди</td></tr>
<tr><td><code>ListQueueTags</code></td><td>Список тегов очереди</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="card">
<div class="card-header">Примеры (AWS CLI)</div>
<div class="card-body">
<div class="cmd-label">Ключи тенанта</div>
<pre><code>export AWS_ACCESS_KEY_ID=&lt;Access Key из /ui&gt;
export AWS_SECRET_ACCESS_KEY=&lt;Secret Key из /ui&gt;</code></pre>
<div class="cmd-label">Создать очередь</div>
<pre><code>aws sqs create-queue --queue-name demo \
--endpoint-url https://sqs.containerk8s.dev.nubes.ru \
--region us-east-1</code></pre>
<div class="cmd-label">Отправить сообщение (QueueUrl — из ответа create-queue)</div>
<pre><code>aws sqs send-message --queue-url &lt;QueueUrl&gt; \
--message-body "hello nubes" \
--endpoint-url https://sqs.containerk8s.dev.nubes.ru \
--region us-east-1</code></pre>
<div class="cmd-label">Получить и удалить сообщение</div>
<pre><code>aws sqs receive-message --queue-url &lt;QueueUrl&gt; \
--endpoint-url https://sqs.containerk8s.dev.nubes.ru --region us-east-1
aws sqs delete-message --queue-url &lt;QueueUrl&gt; \
--receipt-handle &lt;ReceiptHandle&gt; \
--endpoint-url https://sqs.containerk8s.dev.nubes.ru --region us-east-1</code></pre>
</div>
</div>
<div class="footer">shared-sqs · realm iot-naeel · версия {{VERSION}} · <a href="/metrics">метрики</a> · <a href="/health">health</a></div>
</div>
</body>
</html>