Runway 1.2.0
This commit is contained in:
1 parent
5fa0c1ef9f
commit
9144c206be
90 files changed
+2737
-554
No files matched your search
@@ -0,0 +1,37 @@
|
||||
<!-- The connection tests, rendered BELOW the generic settings form on /__app/plugins/database/settings (the kernel
|
||||
renders an app-realm plugin's templates/admin-app.html there). Bare fragment; bindings in admin-app.th.xml read
|
||||
the plugin's own beans. The tests take no typed values: a username box followed by a password box is a form the
|
||||
browser fills in with the operator's own console login, which a test would then send to the server it names. -->
|
||||
<div class="card mt-3" id="db-tests">
|
||||
<div class="card-header"><h3 class="card-title" id="db-tests-title">Connection tests</h3></div>
|
||||
<div class="card-body">
|
||||
<p class="text-secondary" id="db-tests-intro">Settings saved here and on a provider's page apply at the next
|
||||
restart. Test them first: the test connects once with the saved values and changes nothing.</p>
|
||||
|
||||
<div class="alert alert-success" id="db-test-ok" role="status"><span id="db-test-ok-text">ok</span></div>
|
||||
<div class="alert alert-danger" id="db-test-error" role="alert"><span id="db-test-error-text">error</span></div>
|
||||
|
||||
<div class="mb-3">
|
||||
<span class="text-secondary" id="db-now-label">Running now:</span>
|
||||
<span class="fw-bold" id="db-now-status">Available</span>
|
||||
<span class="text-secondary" id="db-now-detail">detail</span>
|
||||
</div>
|
||||
|
||||
<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 the running
|
||||
connection</button>
|
||||
</form>
|
||||
|
||||
<p class="text-secondary mb-2" id="db-none">No provider plugin is installed: install database-postgresql or
|
||||
database-mariadb.</p>
|
||||
<div class="db-provider mb-2">
|
||||
<form method="post" action="/__app/database/test-saved" class="d-inline">
|
||||
<input class="db-csrf" type="hidden" name="_csrf" value="">
|
||||
<input class="db-provider-in" type="hidden" name="provider" value="">
|
||||
<button type="submit" class="btn btn-primary db-test-saved">Test the saved settings</button>
|
||||
</form>
|
||||
<a class="ms-2 db-provider-link" href="#">Edit them</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Logic of the connection tests panel. It renders on the KERNEL-owned plugin settings page, which puts nothing of
|
||||
this plugin in the model except the test result (flash attributes databaseTest / databaseTestError, set by the
|
||||
console controller's redirect), so everything else comes from the plugin's beans: the running status from
|
||||
databaseRuntime, the installed providers from databaseConnectionTester. The _csrf token comes from the page.
|
||||
Provider links are built into a local variable: a URL processor may not call a bean.
|
||||
-->
|
||||
<thlogic>
|
||||
<attr sel="#db-tests-title" th:text="#{database.panel.title}"/>
|
||||
<attr sel="#db-tests-intro" th:text="#{database.panel.intro}"/>
|
||||
|
||||
<attr sel="#db-test-ok" th:if="${databaseTest != null}"/>
|
||||
<attr sel="#db-test-ok-text" th:text="${databaseTest}"/>
|
||||
<attr sel="#db-test-error" th:if="${databaseTestError != null}"/>
|
||||
<attr sel="#db-test-error-text" th:text="${databaseTestError}"/>
|
||||
|
||||
<attr sel="#db-now-label" th:text="#{database.panel.now}"/>
|
||||
<!-- th:if is evaluated before th:with, so the condition calls the bean itself. -->
|
||||
<attr sel="#db-now-status" th:with="h=${@databaseRuntime.health()}"
|
||||
th:text="#{'database.status.' + ${h.status().name()}(${h.detail()})}"/>
|
||||
<attr sel="#db-now-detail" th:if="${@databaseRuntime.health().server() != null}"
|
||||
th:text="${@databaseRuntime.health().server()}"/>
|
||||
|
||||
<attr sel=".db-csrf"
|
||||
th:attr="name=${_csrf != null ? _csrf.parameterName : '_csrf'},value=${_csrf != null ? _csrf.token : ''}"/>
|
||||
<attr sel="#db-test-running" th:text="#{database.panel.testRunning}"/>
|
||||
|
||||
<attr sel="#db-none" th:if="${@databaseConnectionTester.testable().isEmpty()}"
|
||||
th:text="#{database.panel.none}"/>
|
||||
<attr sel=".db-provider" th:each="p : ${@databaseConnectionTester.testable()}"
|
||||
th:with="product=${#messages.msg('database.product.' + p)},
|
||||
editUrl=${'/__app/plugins/database-' + p + '/settings'}"/>
|
||||
<attr sel=".db-provider//.db-provider-in" th:value="${p}"/>
|
||||
<attr sel=".db-provider//.db-test-saved" th:text="#{database.panel.testSaved(${product})}"/>
|
||||
<attr sel=".db-provider//.db-provider-link" th:href="${editUrl}"
|
||||
th:text="#{database.panel.edit(${product})}"/>
|
||||
</thlogic>
|
||||
@@ -71,66 +71,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Connection tests -->
|
||||
<!-- Where the settings and the connection tests are (since 2.0.0) -->
|
||||
<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-header"><h3 class="card-title" id="db-settings-title">Settings and 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>
|
||||
<p class="text-secondary" id="db-settings-text">The provider choice and the limits are on the
|
||||
Database plugin's settings page, together with the connection tests. The server, the account
|
||||
and TLS are on the provider plugin's settings page.</p>
|
||||
<a class="btn btn-outline-primary" href="/__app/plugins/database/settings#db-tests"
|
||||
id="db-settings-link">Settings and connection tests</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -43,20 +43,10 @@
|
||||
<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}"/>
|
||||
<!-- Where the settings and the connection tests are -->
|
||||
<attr sel="#db-settings-title" th:text="#{database.console.settings}"/>
|
||||
<attr sel="#db-settings-text" th:text="#{database.console.settings.text}"/>
|
||||
<attr sel="#db-settings-link" th:text="#{database.console.settings.link}"/>
|
||||
|
||||
<!-- Migration problems -->
|
||||
<attr sel="#db-issues-title" th:text="#{database.console.issues}"/>
|
||||
|
||||
Reference in new issue
Block a user