Runway 1.1.0
This commit is contained in:
1 parent
ce217fc952
commit
07d5bd7e9a
223 files changed
+21147
-255
No files matched your search
@@ -0,0 +1,12 @@
|
||||
<!-- Site dashboard card: whether this site keeps data in the database, its size, and the last database restore.
|
||||
Bare fragment; binding in dashboard.th.xml. -->
|
||||
<div class="card" id="dbd">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title mb-2" id="dbd-title">Database</h3>
|
||||
<p class="mb-1" id="dbd-has"><span id="dbd-has-text">This site keeps plugin data in the database.</span>
|
||||
<span class="text-secondary" id="dbd-size">0.0 MiB</span></p>
|
||||
<p class="text-secondary mb-1" id="dbd-none">This site keeps no data in the database.</p>
|
||||
<p class="small mb-0" id="dbd-restore"><span id="dbd-l-restore">Last database restore</span>:
|
||||
<span id="dbd-restore-text">text</span></p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Site dashboard card logic. Values from ${@databaseScreens.site(tenantSiteId)}, read once at the root. -->
|
||||
<thlogic>
|
||||
<attr sel="#dbd" th:with="dl=${@databaseScreens.site(tenantSiteId)}"/>
|
||||
<attr sel="#dbd-title" th:text="#{database.dashboard.title}"/>
|
||||
<attr sel="#dbd-has" th:if="${dl.hasData()}"/>
|
||||
<attr sel="#dbd-has-text" th:text="#{database.dashboard.has}"/>
|
||||
<attr sel="#dbd-size" th:text="${dl.size()}"/>
|
||||
<attr sel="#dbd-none" th:unless="${dl.hasData()}"
|
||||
th:text="#{database.dashboard.none}"/>
|
||||
<attr sel="#dbd-restore" th:unless="${dl.lastRestore().isEmpty()}"
|
||||
th:classappend="${dl.lastRestoreOk() ? '' : 'text-danger'}"/>
|
||||
<attr sel="#dbd-l-restore" th:text="#{database.dashboard.restore}"/>
|
||||
<attr sel="#dbd-restore-text" th:text="${dl.lastRestore()}"/>
|
||||
</thlogic>
|
||||
@@ -0,0 +1,235 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><title>Database</title></head>
|
||||
<body>
|
||||
<!-- The database screen (@ConsoleScreen, application console). Markup only: every binding is in health.th.xml.
|
||||
Every state change is a POST form carrying the console's CSRF token (.db-csrf). -->
|
||||
<div id="content">
|
||||
<div class="page-header d-print-none mb-3">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<div class="page-pretitle" id="db-pretitle">Application</div>
|
||||
<h2 class="page-title" id="db-heading">Database</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="db-flash" class="alert alert-success" role="status"><span id="db-flash-text">done</span></div>
|
||||
<div id="db-error" class="alert alert-danger" role="alert"><span id="db-error-text">error</span></div>
|
||||
|
||||
<div class="row row-cards">
|
||||
<!-- Status -->
|
||||
<div class="col-lg-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title" id="db-status-title">Status</h3>
|
||||
<div class="card-actions">
|
||||
<span class="badge bg-success-lt" id="db-badge-ok">Available</span>
|
||||
<span class="badge bg-danger-lt" id="db-badge-down">Not available</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="text-secondary" id="db-detail">detail</p>
|
||||
<div class="datagrid">
|
||||
<div class="datagrid-item">
|
||||
<div class="datagrid-title" id="db-l-provider">Provider</div>
|
||||
<div class="datagrid-content" id="db-provider">postgresql</div>
|
||||
</div>
|
||||
<div class="datagrid-item">
|
||||
<div class="datagrid-title" id="db-l-server">Server</div>
|
||||
<div class="datagrid-content" id="db-server">PostgreSQL 17</div>
|
||||
</div>
|
||||
<div class="datagrid-item">
|
||||
<div class="datagrid-title" id="db-l-driver">Driver</div>
|
||||
<div class="datagrid-content" id="db-driver">pgjdbc</div>
|
||||
</div>
|
||||
<div class="datagrid-item">
|
||||
<div class="datagrid-title" id="db-l-target">Database</div>
|
||||
<div class="datagrid-content"><code id="db-target">host/db</code></div>
|
||||
</div>
|
||||
<div class="datagrid-item">
|
||||
<div class="datagrid-title" id="db-l-tls">TLS</div>
|
||||
<div class="datagrid-content" id="db-tls">verify-full</div>
|
||||
</div>
|
||||
<div class="datagrid-item">
|
||||
<div class="datagrid-title" id="db-l-namespace">Namespace</div>
|
||||
<div class="datagrid-content"><code id="db-namespace">rw</code></div>
|
||||
</div>
|
||||
<div class="datagrid-item">
|
||||
<div class="datagrid-title" id="db-l-pool">Connections in use</div>
|
||||
<div class="datagrid-content" id="db-pool">0 / 10</div>
|
||||
</div>
|
||||
<div class="datagrid-item">
|
||||
<div class="datagrid-title" id="db-l-schemas">Sites with data</div>
|
||||
<div class="datagrid-content" id="db-schemas">0</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-danger small mt-3 mb-0" id="db-last-error"><span id="db-l-last-error">Last error</span>:
|
||||
<span id="db-last-error-at">time</span> — <span id="db-last-error-text">text</span></p>
|
||||
<p class="text-danger small mt-2 mb-0" id="db-problem">problem</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Connection tests -->
|
||||
<div class="col-lg-6">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3 class="card-title" id="db-test-title">Connection tests</h3></div>
|
||||
<div class="card-body">
|
||||
<form method="post" action="/__app/database/test-running" class="mb-3">
|
||||
<input class="db-csrf" type="hidden" name="_csrf" value="">
|
||||
<button type="submit" class="btn btn-outline-primary" id="db-test-running">Test running
|
||||
connection</button>
|
||||
</form>
|
||||
<p class="text-secondary small" id="db-test-new-help">Try other settings without saving them.</p>
|
||||
<form method="post" action="/__app/database/test-new" autocomplete="off">
|
||||
<input class="db-csrf" type="hidden" name="_csrf" value="">
|
||||
<div class="row g-2">
|
||||
<div class="col-md-4">
|
||||
<label class="form-label" for="db-f-provider" id="db-fl-provider">Provider</label>
|
||||
<select class="form-select" id="db-f-provider" name="provider">
|
||||
<option value="postgresql">postgresql</option>
|
||||
<option value="mariadb">mariadb</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<label class="form-label" for="db-f-host" id="db-fl-host">Host</label>
|
||||
<input class="form-control" id="db-f-host" name="host" type="text" value="">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label" for="db-f-port" id="db-fl-port">Port</label>
|
||||
<input class="form-control" id="db-f-port" name="port" type="text" value="">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label" for="db-f-database" id="db-fl-database">Database</label>
|
||||
<input class="form-control" id="db-f-database" name="database" type="text" value="">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label" for="db-f-username" id="db-fl-username">Username</label>
|
||||
<input class="form-control" id="db-f-username" name="username" type="text" value="">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label" for="db-f-password" id="db-fl-password">Password</label>
|
||||
<input class="form-control" id="db-f-password" name="password" type="password"
|
||||
value="">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label" for="db-f-tls" id="db-fl-tls">TLS</label>
|
||||
<select class="form-select" id="db-f-tls" name="tls">
|
||||
<option value="verify-full">verify-full</option>
|
||||
<option value="require">require</option>
|
||||
<option value="disable">disable</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<label class="form-label" for="db-f-ca" id="db-fl-ca">CA certificate (PEM)</label>
|
||||
<textarea class="form-control font-monospace" id="db-f-ca" name="caCertificate"
|
||||
rows="2"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-secondary small mt-2" id="db-test-password-note">A blank password reuses the
|
||||
saved one only for the same server, database, account and TLS settings.</p>
|
||||
<button type="submit" class="btn btn-primary" id="db-test-new">Test these settings</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Migration problems -->
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3 class="card-title" id="db-issues-title">Plugin tables needing
|
||||
attention</h3></div>
|
||||
<div class="card-body" id="db-issues-none"><p class="text-secondary mb-0" id="db-issues-none-text">
|
||||
None.</p></div>
|
||||
<div class="table-responsive" id="db-issues">
|
||||
<table class="table table-vcenter card-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th id="db-h-schema">Schema</th>
|
||||
<th id="db-h-plugin">Plugin</th>
|
||||
<th id="db-h-state">Problem</th>
|
||||
<th id="db-h-detail">Detail</th>
|
||||
<th id="db-h-actions">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr id="db-issue-row">
|
||||
<td><code class="db-issue-schema">schema</code></td>
|
||||
<td class="db-issue-plugin">plugin</td>
|
||||
<td><span class="badge bg-warning-lt db-issue-state">FAILED</span></td>
|
||||
<td class="small db-issue-detail">detail</td>
|
||||
<td class="text-nowrap">
|
||||
<form method="post" action="/__app/database/recover" class="d-inline db-form-retry">
|
||||
<input class="db-csrf" type="hidden" name="_csrf" value="">
|
||||
<input type="hidden" name="schema" class="db-issue-schema-in" value="">
|
||||
<input type="hidden" name="plugin" class="db-issue-plugin-in" value="">
|
||||
<input type="hidden" name="action" value="retry">
|
||||
<button type="submit" class="btn btn-sm btn-outline-primary db-retry">Retry</button>
|
||||
</form>
|
||||
<form method="post" action="/__app/database/recover" class="d-inline db-form-applied">
|
||||
<input class="db-csrf" type="hidden" name="_csrf" value="">
|
||||
<input type="hidden" name="schema" class="db-issue-schema-in" value="">
|
||||
<input type="hidden" name="plugin" class="db-issue-plugin-in" value="">
|
||||
<input type="hidden" name="action" value="mark_applied">
|
||||
<button type="submit" class="btn btn-sm btn-outline-secondary db-applied">Mark
|
||||
applied</button>
|
||||
</form>
|
||||
<form method="post" action="/__app/database/recover" class="d-inline db-form-checksum">
|
||||
<input class="db-csrf" type="hidden" name="_csrf" value="">
|
||||
<input type="hidden" name="schema" class="db-issue-schema-in" value="">
|
||||
<input type="hidden" name="plugin" class="db-issue-plugin-in" value="">
|
||||
<input type="hidden" name="action" value="accept_checksum">
|
||||
<button type="submit" class="btn btn-sm btn-outline-warning db-checksum">Accept
|
||||
shipped checksum</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Plugins, nodes, backups -->
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3 class="card-title" id="db-consumers-title">Plugins using it</h3></div>
|
||||
<div class="card-body">
|
||||
<ul class="list-unstyled mb-0" id="db-consumers"><li id="db-consumer-row"><code
|
||||
class="db-consumer">plugin</code></li></ul>
|
||||
<p class="text-secondary mb-0" id="db-consumers-none">None.</p>
|
||||
<p class="text-warning small mt-3 mb-0" id="db-app-warning"><span id="db-app-warning-text">These
|
||||
plugins keep Runway-wide data, which does not move with a change of database:</span>
|
||||
<span id="db-app-plugins">plugin</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3 class="card-title" id="db-nodes-title">Nodes seen recently</h3></div>
|
||||
<div class="card-body">
|
||||
<ul class="list-unstyled mb-0"><li id="db-node-row"><span class="db-node-host">host</span>
|
||||
<span class="text-secondary small db-node-seen">seen</span></li></ul>
|
||||
<p class="text-secondary small mt-2 mb-0" id="db-nodes-help">More than one node is normal in a
|
||||
cluster. Unknown nodes may mean another installation shares this namespace.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3 class="card-title" id="db-backups-title">Backups</h3></div>
|
||||
<div class="card-body">
|
||||
<p class="mb-1"><span id="db-l-largest">Largest site backup</span>:
|
||||
<span id="db-largest">—</span></p>
|
||||
<p class="text-warning small" id="db-budget-warning">Close to the backup budget: raise it, or
|
||||
back the database up with its own tools.</p>
|
||||
<p class="text-danger small mb-0" id="db-restore-failure"><span id="db-l-restore-failure">Last
|
||||
failed restore</span>: <span id="db-restore-failure-text">text</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Decoupled logic of the database screen. `db` is the DatabaseScreens.Health record the controller put in the model;
|
||||
besides it, the template uses only what a console screen may rely on: _csrf and #{..} messages. `//` reaches nested
|
||||
elements of an iterated row. Form actions are constants in the markup.
|
||||
-->
|
||||
<thlogic>
|
||||
<attr sel="#db-pretitle" th:text="#{database.console.pretitle}"/>
|
||||
<attr sel="#db-heading" th:text="#{database.console.heading}"/>
|
||||
|
||||
<attr sel="#db-flash" th:if="${databaseFlash != null}"/>
|
||||
<attr sel="#db-flash-text" th:text="${databaseFlash}"/>
|
||||
<attr sel="#db-error" th:if="${databaseError != null}"/>
|
||||
<attr sel="#db-error-text" th:text="${databaseError}"/>
|
||||
|
||||
<attr sel=".db-csrf"
|
||||
th:attr="name=${_csrf != null ? _csrf.parameterName : '_csrf'},value=${_csrf != null ? _csrf.token : ''}"/>
|
||||
|
||||
<!-- Status -->
|
||||
<attr sel="#db-status-title" th:text="#{database.console.status}"/>
|
||||
<attr sel="#db-badge-ok" th:if="${db.available()}" th:text="#{database.console.available}"/>
|
||||
<attr sel="#db-badge-down" th:unless="${db.available()}" th:text="#{database.console.unavailable}"/>
|
||||
<attr sel="#db-detail" th:text="#{'database.status.' + ${db.runtime().status().name()}(${db.runtime().detail()})}"/>
|
||||
<attr sel="#db-l-provider" th:text="#{database.console.provider}"/>
|
||||
<attr sel="#db-provider" th:text="${db.provider().isEmpty() ? '—' : db.provider()}"/>
|
||||
<attr sel="#db-l-server" th:text="#{database.console.server}"/>
|
||||
<attr sel="#db-server" th:text="${db.runtime().server() == null ? '—' : db.runtime().server()}"/>
|
||||
<attr sel="#db-l-driver" th:text="#{database.console.driver}"/>
|
||||
<attr sel="#db-driver" th:text="${db.runtime().driver() == null ? '—' : db.runtime().driver()}"/>
|
||||
<attr sel="#db-l-target" th:text="#{database.console.target}"/>
|
||||
<attr sel="#db-target" th:text="${db.target().isEmpty() ? '—' : db.target()}"/>
|
||||
<attr sel="#db-l-tls" th:text="#{database.console.tls}"/>
|
||||
<attr sel="#db-tls" th:text="${db.tls().isEmpty() ? '—' : db.tls()}"/>
|
||||
<attr sel="#db-l-namespace" th:text="#{database.console.namespace}"/>
|
||||
<attr sel="#db-namespace" th:text="${db.namespace().isEmpty() ? '—' : db.namespace()}"/>
|
||||
<attr sel="#db-l-pool" th:text="#{database.console.pool}"/>
|
||||
<attr sel="#db-pool" th:text="${db.runtime().poolActive()} + ' / ' + ${db.runtime().poolMax()}"/>
|
||||
<attr sel="#db-l-schemas" th:text="#{database.console.schemas}"/>
|
||||
<attr sel="#db-schemas" th:text="${db.liveSchemas()}"/>
|
||||
<attr sel="#db-last-error" th:if="${db.runtime().lastError() != null}"/>
|
||||
<attr sel="#db-l-last-error" th:text="#{database.console.lastError}"/>
|
||||
<attr sel="#db-last-error-at" th:text="${db.runtime().lastErrorAt()}"/>
|
||||
<attr sel="#db-last-error-text" th:text="${db.runtime().lastError()}"/>
|
||||
<attr sel="#db-problem" th:if="${db.problem() != null}" th:text="${db.problem()}"/>
|
||||
|
||||
<!-- Connection tests -->
|
||||
<attr sel="#db-test-title" th:text="#{database.console.tests}"/>
|
||||
<attr sel="#db-test-running" th:text="#{database.console.testRunning}"/>
|
||||
<attr sel="#db-test-new-help" th:text="#{database.console.testNew.help}"/>
|
||||
<attr sel="#db-fl-provider" th:text="#{database.set.provider}"/>
|
||||
<attr sel="#db-fl-host" th:text="#{database.set.host}"/>
|
||||
<attr sel="#db-fl-port" th:text="#{database.set.port}"/>
|
||||
<attr sel="#db-fl-database" th:text="#{database.set.database}"/>
|
||||
<attr sel="#db-fl-username" th:text="#{database.set.username}"/>
|
||||
<attr sel="#db-fl-password" th:text="#{database.set.password}"/>
|
||||
<attr sel="#db-fl-tls" th:text="#{database.set.tls}"/>
|
||||
<attr sel="#db-fl-ca" th:text="#{database.set.caCertificate}"/>
|
||||
<attr sel="#db-test-password-note" th:text="#{database.console.testNew.password}"/>
|
||||
<attr sel="#db-test-new" th:text="#{database.console.testNew}"/>
|
||||
|
||||
<!-- Migration problems -->
|
||||
<attr sel="#db-issues-title" th:text="#{database.console.issues}"/>
|
||||
<attr sel="#db-issues-none" th:if="${db.issues().isEmpty()}"/>
|
||||
<attr sel="#db-issues-none-text" th:text="#{database.console.none}"/>
|
||||
<attr sel="#db-issues" th:unless="${db.issues().isEmpty()}"/>
|
||||
<attr sel="#db-h-schema" th:text="#{database.console.schema}"/>
|
||||
<attr sel="#db-h-plugin" th:text="#{database.console.plugin}"/>
|
||||
<attr sel="#db-h-state" th:text="#{database.console.problem}"/>
|
||||
<attr sel="#db-h-detail" th:text="#{database.console.detail}"/>
|
||||
<attr sel="#db-h-actions" th:text="#{database.console.actions}"/>
|
||||
<attr sel="#db-issue-row" th:each="i : ${db.issues()}"/>
|
||||
<attr sel="#db-issue-row//.db-issue-schema" th:text="${i.schema()}"/>
|
||||
<attr sel="#db-issue-row//.db-issue-plugin" th:text="${i.pluginId()}"/>
|
||||
<attr sel="#db-issue-row//.db-issue-state" th:text="#{'database.issue.' + ${i.state()}}"/>
|
||||
<attr sel="#db-issue-row//.db-issue-detail" th:text="${i.detail()}"/>
|
||||
<attr sel="#db-issue-row//.db-issue-schema-in" th:value="${i.schema()}"/>
|
||||
<attr sel="#db-issue-row//.db-issue-plugin-in" th:value="${i.pluginId()}"/>
|
||||
<attr sel="#db-issue-row//.db-form-retry" th:if="${i.state() == 'FAILED'}"/>
|
||||
<attr sel="#db-issue-row//.db-form-applied" th:if="${i.state() == 'FAILED'}"/>
|
||||
<attr sel="#db-issue-row//.db-form-checksum" th:if="${i.state() == 'CHECKSUM'}"/>
|
||||
<attr sel="#db-issue-row//.db-retry" th:text="#{database.recover.retry}"/>
|
||||
<attr sel="#db-issue-row//.db-applied" th:text="#{database.recover.markApplied}"/>
|
||||
<attr sel="#db-issue-row//.db-checksum" th:text="#{database.recover.acceptChecksum}"/>
|
||||
|
||||
<!-- Plugins, nodes, backups -->
|
||||
<attr sel="#db-consumers-title" th:text="#{database.console.consumers}"/>
|
||||
<attr sel="#db-consumers" th:unless="${db.consumers().isEmpty()}"/>
|
||||
<attr sel="#db-consumer-row" th:each="p : ${db.consumers()}"/>
|
||||
<attr sel="#db-consumer-row//.db-consumer" th:text="${p}"/>
|
||||
<attr sel="#db-consumers-none" th:if="${db.consumers().isEmpty()}" th:text="#{database.console.none}"/>
|
||||
<attr sel="#db-app-warning" th:unless="${db.appSchemaPlugins().isEmpty()}"/>
|
||||
<attr sel="#db-app-warning-text" th:text="#{database.console.appWarning}"/>
|
||||
<attr sel="#db-app-plugins" th:text="${#strings.listJoin(db.appSchemaPlugins(), ', ')}"/>
|
||||
<attr sel="#db-nodes-title" th:text="#{database.console.nodes}"/>
|
||||
<attr sel="#db-node-row" th:each="n : ${db.nodes()}"/>
|
||||
<attr sel="#db-node-row//.db-node-host" th:text="${n.host()}"/>
|
||||
<attr sel="#db-node-row//.db-node-seen" th:text="${n.seenAt()}"/>
|
||||
<attr sel="#db-nodes-help" th:text="#{database.console.nodes.help}"/>
|
||||
<attr sel="#db-backups-title" th:text="#{database.console.backups}"/>
|
||||
<attr sel="#db-l-largest" th:text="#{database.console.largest}"/>
|
||||
<attr sel="#db-largest" th:text="${db.largestBackup() == null ? '—' : db.largestBackup()}"/>
|
||||
<attr sel="#db-budget-warning" th:if="${db.backupBudgetWarning()}" th:text="#{database.console.budgetWarning}"/>
|
||||
<attr sel="#db-restore-failure" th:if="${db.lastRestoreFailure() != null}"/>
|
||||
<attr sel="#db-l-restore-failure" th:text="#{database.console.restoreFailure}"/>
|
||||
<attr sel="#db-restore-failure-text" th:text="${db.lastRestoreFailure()}"/>
|
||||
</thlogic>
|
||||
Reference in new issue
Block a user