mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2026-11-05 22:29:32 +09:00
Rename configuration parameter prefix from dbadmin to snapadmin (#19)
This commit is contained in:
commit
b55afbd2d6
37 files changed
+177
-152
No files matched your search
@@ -65,26 +65,26 @@ Otherwise, go ahead and add these to your `application.properties` file:
|
||||
|
||||
```properties
|
||||
## The first-level part of the URL path: http://localhost:8080/${baseUrl}/
|
||||
dbadmin.baseUrl=admin
|
||||
snapadmin.baseUrl=admin
|
||||
|
||||
## The package(s) that contain your @Entity classes
|
||||
## accepts multiple comma separated values
|
||||
dbadmin.modelsPackage=your.models.package,your.second.models.package
|
||||
snapadmin.modelsPackage=your.models.package,your.second.models.package
|
||||
|
||||
## At the moment, it's required to have open-in-view set to true.
|
||||
# spring.jpa.open-in-view=true
|
||||
|
||||
## OPTIONAL PARAMETERS
|
||||
## Whether to enable SnapAdmin
|
||||
# dbadmin.enabled=true
|
||||
# snapadmin.enabled=true
|
||||
#
|
||||
#
|
||||
## Set to true if you need to run the tests, as it will customize
|
||||
## the database configuration for the internal DataSource
|
||||
# dbadmin.testMode=false
|
||||
# snapadmin.testMode=false
|
||||
#
|
||||
## SQL console enable/disable (true by default)
|
||||
# dbadmin.sqlConsoleEnabled=false
|
||||
# snapadmin.sqlConsoleEnabled=false
|
||||
```
|
||||
|
||||
**IMPORTANT**: The configuration prefix `dbadmin.` will change to `snapadmin.` starting from version 0.2.0, as part of the project being renamed. Remember to update your configuration files accordingly.
|
||||
@@ -97,7 +97,7 @@ Now annotate your `@SpringBootApplication` class containing the `main` method wi
|
||||
|
||||
This will autoconfigure SnapAdmin when your application starts. You are good to go!
|
||||
|
||||
3. At this point, when you run your application, you should be able to visit `http://localhost:${port}/${dbadmin.baseUrl}` and see the web interface.
|
||||
3. At this point, when you run your application, you should be able to visit `http://localhost:${port}/${snapadmin.baseUrl}` and see the web interface.
|
||||
|
||||
## Documentation
|
||||
|
||||
|
||||
@@ -41,3 +41,13 @@ p.text {
|
||||
a {
|
||||
color: #7223D1;
|
||||
}
|
||||
|
||||
|
||||
.testimonials-img {
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.testimonials-img img {
|
||||
border-radius: 50%;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
@@ -96,25 +96,25 @@
|
||||
|
||||
<pre>
|
||||
<code class="language-properties">## The first-level part of the URL path: http://localhost:8080/${baseUrl}/
|
||||
dbadmin.baseUrl=admin
|
||||
snapadmin.baseUrl=admin
|
||||
|
||||
## The package(s) that contain your @Entity classes
|
||||
## accepts multiple comma separated values
|
||||
dbadmin.modelsPackage=your.models.package,your.second.models.package
|
||||
snapadmin.modelsPackage=your.models.package,your.second.models.package
|
||||
|
||||
## At the moment, it's required to have open-in-view set to true.
|
||||
# spring.jpa.open-in-view=true
|
||||
|
||||
## OPTIONAL PARAMETERS
|
||||
## Whether to enable SnapAdmin
|
||||
# dbadmin.enabled=true
|
||||
# snapadmin.enabled=true
|
||||
#
|
||||
## Set to true if you need to run the tests, as it will customize
|
||||
## the database configuration for the internal DataSource
|
||||
# dbadmin.testMode=false
|
||||
# snapadmin.testMode=false
|
||||
#
|
||||
## SQL console enable/disable (true by default)
|
||||
# dbadmin.sqlConsoleEnabled=false
|
||||
# snapadmin.sqlConsoleEnabled=false
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
@@ -344,11 +344,11 @@ public class Payment { ... }</code>
|
||||
<div class="separator"></div>
|
||||
|
||||
<h3 id="settings-panel">3.2 The Settings panel</h3>
|
||||
<p>As mentioned earlier, the Settings panel primarily provides options to customize the branding/appearance of the web interface. These settings are persistent across restarts and are stored in an embedded H2 database (file named <code>dbadmin_internal</code>), along with other data required by SnapAdmin.</p>
|
||||
<p>As mentioned earlier, the Settings panel primarily provides options to customize the branding/appearance of the web interface. These settings are persistent across restarts and are stored in an embedded H2 database (file named <code>snapadmin_internal</code>), along with other data required by SnapAdmin.</p>
|
||||
|
||||
<h2 id="security">4. Security</h2>
|
||||
<p>SnapAdmin does not implement authentication and/or authorization mechanisms. However, you can use a standard Spring security configuration in order to limit access to the web UI or specific parts of it.</p>
|
||||
<p>All SnapAdmin routes start with the value of <code>dbadmin.baseUrl</code> property, and all write operations (edit, create, delete) are implemented as <code>POST</code> calls. The following code provides an example security configuration (assuming SnapAdmin runs at <code>/admin</code>):</p>
|
||||
<p>All SnapAdmin routes start with the value of <code>snapadmin.baseUrl</code> property, and all write operations (edit, create, delete) are implemented as <code>POST</code> calls. The following code provides an example security configuration (assuming SnapAdmin runs at <code>/admin</code>):</p>
|
||||
|
||||
|
||||
<pre>
|
||||
|
||||
+32
-8
@@ -58,7 +58,7 @@
|
||||
<section id="features" class="py-5">
|
||||
<div class="container">
|
||||
<h2 class="text-center mb-4 fw-bold">Features</h2>
|
||||
<p class="text mb-4 mt-3">SnapAdmin scans your existing code base and automatically builds everything at runtime: you won't have to modify your existing code.</p>
|
||||
<p class="text mb-4 mt-3">SnapAdmin saves you time by providing a full-fledged database management interface so you can focus on what matters. It won't be necessary to modify your codebase: SnapAdmin scans your code and builds everything at runtime.</p>
|
||||
<div class="row pt-3">
|
||||
<div class="col-md-4">
|
||||
<h4 class="fw-bold">First-class CRUD</h4>
|
||||
@@ -110,10 +110,10 @@
|
||||
<p>Add the minimum required properties to your <code>application.properties</code> file.</p>
|
||||
<pre>
|
||||
<code class="language-properties"># the root path of all SnapAdmin routes
|
||||
dbadmin.baseUrl=admin
|
||||
snapadmin.baseUrl=admin
|
||||
|
||||
# comma-separated list of packages to scan for @Entity classes
|
||||
dbadmin.modelsPackage=your.models.package
|
||||
snapadmin.modelsPackage=your.models.package
|
||||
</code>
|
||||
</pre>
|
||||
</div>
|
||||
@@ -132,26 +132,48 @@ dbadmin.modelsPackage=your.models.package
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Testimonials -->
|
||||
<section id="testimonials" class="py-5">
|
||||
<div class="container">
|
||||
<h2 class="text-center mb-4 fw-bold">Who is using SnapAdmin</h2>
|
||||
<p class="text mb-4 mt-3">Here's what some of our users say about SnapAdmin. You can <a href="https://github.com/aileftech/snap-admin/issues/17">leave your comment, too</a>!</p>
|
||||
<div class="row pt-3" id="testimonials-row">
|
||||
<div class="col-md-6 d-flex">
|
||||
<div class="d-flex align-items-center testimonials-img">
|
||||
<img class="w-100" src="https://avatars.githubusercontent.com/u/3874760?v=4">
|
||||
</div>
|
||||
<div class="ps-3">
|
||||
<p><b>fabienfleureau</b></p>
|
||||
<p>Hello,
|
||||
Thanks for you project.
|
||||
I use it an hidden admin page, mostly as if it is a direct connection to database.
|
||||
It would be nice to able to run custom queries.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="footer text-white text-center text-lg-start" style="background-color: #130623;">
|
||||
<div class="container p-4">
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-4 footer-card">
|
||||
<div class="row mb-0 mb-md-4">
|
||||
<div class="col-md-4 footer-card mb-md-0 mb-4">
|
||||
<h6>Github</h6>
|
||||
<ul>
|
||||
<li><a href="https://github.com/aileftech/snap-admin/issues">Issues</a></li>
|
||||
<li><a href="https://github.com/aileftech/snap-admin/releases">Releases</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4 footer-card">
|
||||
<div class="col-md-4 footer-card mb-md-0 mb-4">
|
||||
<h6>Documentation</h6>
|
||||
<ul>
|
||||
<li><a href="https://javadoc.io/doc/tech.ailef/snap-admin/latest/index.html">Javadoc</a></li>
|
||||
<li><a href="docs/">Reference Guide</a></li>
|
||||
<li><a href="https://javadoc.io/doc/tech.ailef/snap-admin/latest/index.html">Javadoc</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4 footer-card">
|
||||
<div class="col-md-4 footer-card mb-md-0 mb-4">
|
||||
<h6>Social</h6>
|
||||
<ul>
|
||||
<li><a href="https://twitter.com/aileftech">Twitter</a></li>
|
||||
@@ -164,6 +186,8 @@ dbadmin.modelsPackage=your.models.package
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
<script>hljs.highlightAll();</script>
|
||||
</body>
|
||||
</html>
|
||||
+2
-2
@@ -46,7 +46,7 @@ import tech.ailef.snapadmin.internal.InternalDbAdminConfiguration;
|
||||
* H2 database which is used by SnapAdmin to store user
|
||||
* settings and other information like operations history.
|
||||
*/
|
||||
@ConditionalOnProperty(name = "dbadmin.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "snapadmin.enabled", matchIfMissing = true)
|
||||
@ComponentScan
|
||||
@EnableConfigurationProperties(SnapAdminProperties.class)
|
||||
@Configuration
|
||||
@@ -72,7 +72,7 @@ public class SnapAdminAutoConfiguration {
|
||||
if (props.isTestMode()) {
|
||||
dataSourceBuilder.url("jdbc:h2:mem:test");
|
||||
} else {
|
||||
dataSourceBuilder.url("jdbc:h2:file:./dbadmin_internal");
|
||||
dataSourceBuilder.url("jdbc:h2:file:./snapadmin_internal");
|
||||
}
|
||||
|
||||
dataSourceBuilder.username("sa");
|
||||
|
||||
@@ -22,10 +22,10 @@ package tech.ailef.snapadmin.external;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* The 'dbadmin.*' properties that can be set in the properties file
|
||||
* The 'snapadmin.*' properties that can be set in the properties file
|
||||
* to configure the behaviour of Spring Boot Admin Panel.
|
||||
*/
|
||||
@ConfigurationProperties("dbadmin")
|
||||
@ConfigurationProperties("snapadmin")
|
||||
public class SnapAdminProperties {
|
||||
/**
|
||||
* Whether SnapAdmin is enabled.
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ import tech.ailef.snapadmin.internal.model.ConsoleQuery;
|
||||
import tech.ailef.snapadmin.internal.repository.ConsoleQueryRepository;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = { "/${dbadmin.baseUrl}/", "/${dbadmin.baseUrl}" })
|
||||
@RequestMapping(value = { "/${snapadmin.baseUrl}/", "/${snapadmin.baseUrl}" })
|
||||
public class DataExportController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(DataExportFormat.class);
|
||||
|
||||
|
||||
+3
-3
@@ -83,7 +83,7 @@ import tech.ailef.snapadmin.internal.service.UserSettingsService;
|
||||
* The main DbAdmin controller that register most of the routes of the web interface.
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value= {"/${dbadmin.baseUrl}", "/${dbadmin.baseUrl}/"})
|
||||
@RequestMapping(value= {"/${snapadmin.baseUrl}", "/${snapadmin.baseUrl}/"})
|
||||
public class DefaultDbAdminController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultDbAdminController.class);
|
||||
|
||||
@@ -439,10 +439,10 @@ public class DefaultDbAdminController {
|
||||
}
|
||||
}
|
||||
|
||||
String c = params.get("__dbadmin_create");
|
||||
String c = params.get("__snapadmin_create");
|
||||
if (c == null) {
|
||||
throw new ResponseStatusException(
|
||||
HttpStatus.BAD_REQUEST, "Missing required param __dbadmin_create"
|
||||
HttpStatus.BAD_REQUEST, "Missing required param __snapadmin_create"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ import tech.ailef.snapadmin.external.exceptions.DbAdminException;
|
||||
* Controller to serve file or images (`@DisplayImage`)
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = {"/${dbadmin.baseUrl}/download", "/${dbadmin.baseUrl}/download/"})
|
||||
@RequestMapping(value = {"/${snapadmin.baseUrl}/download", "/${snapadmin.baseUrl}/download/"})
|
||||
public class FileDownloadController {
|
||||
@Autowired
|
||||
private DbAdminRepository repository;
|
||||
|
||||
+14
-14
@@ -56,10 +56,10 @@ public class GlobalController {
|
||||
model.addAttribute("status", "");
|
||||
model.addAttribute("error", "Error");
|
||||
model.addAttribute("message", e.getMessage());
|
||||
model.addAttribute("dbadmin_userConf", userConf);
|
||||
model.addAttribute("dbadmin_baseUrl", getBaseUrl());
|
||||
model.addAttribute("dbadmin_version", dbAdmin.getVersion());
|
||||
model.addAttribute("dbadmin_properties", props);
|
||||
model.addAttribute("snapadmin_userConf", userConf);
|
||||
model.addAttribute("snapadmin_baseUrl", getBaseUrl());
|
||||
model.addAttribute("snapadmin_version", dbAdmin.getVersion());
|
||||
model.addAttribute("snapadmin_properties", props);
|
||||
return "other/error";
|
||||
}
|
||||
|
||||
@@ -68,15 +68,15 @@ public class GlobalController {
|
||||
model.addAttribute("status", "404");
|
||||
model.addAttribute("error", "Error");
|
||||
model.addAttribute("message", e.getMessage());
|
||||
model.addAttribute("dbadmin_userConf", userConf);
|
||||
model.addAttribute("dbadmin_baseUrl", getBaseUrl());
|
||||
model.addAttribute("dbadmin_version", dbAdmin.getVersion());
|
||||
model.addAttribute("dbadmin_properties", props);
|
||||
model.addAttribute("snapadmin_userConf", userConf);
|
||||
model.addAttribute("snapadmin_baseUrl", getBaseUrl());
|
||||
model.addAttribute("snapadmin_version", dbAdmin.getVersion());
|
||||
model.addAttribute("snapadmin_properties", props);
|
||||
response.setStatus(404);
|
||||
return "other/error";
|
||||
}
|
||||
|
||||
@ModelAttribute("dbadmin_version")
|
||||
@ModelAttribute("snapadmin_version")
|
||||
public String getVersion() {
|
||||
return dbAdmin.getVersion();
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public class GlobalController {
|
||||
* @param request the incoming request
|
||||
* @return multi valued map of request parameters
|
||||
*/
|
||||
@ModelAttribute("dbadmin_queryParams")
|
||||
@ModelAttribute("snapadmin_queryParams")
|
||||
public Map<String, String[]> getQueryParams(HttpServletRequest request) {
|
||||
return request.getParameterMap();
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class GlobalController {
|
||||
* The baseUrl as specified in the properties file by the user
|
||||
* @return
|
||||
*/
|
||||
@ModelAttribute("dbadmin_baseUrl")
|
||||
@ModelAttribute("snapadmin_baseUrl")
|
||||
public String getBaseUrl() {
|
||||
return props.getBaseUrl();
|
||||
}
|
||||
@@ -106,7 +106,7 @@ public class GlobalController {
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@ModelAttribute("dbadmin_requestUrl")
|
||||
@ModelAttribute("snapadmin_requestUrl")
|
||||
public String getRequestUrl(HttpServletRequest request) {
|
||||
return request.getRequestURI();
|
||||
}
|
||||
@@ -116,12 +116,12 @@ public class GlobalController {
|
||||
* in the settings table.
|
||||
* @return
|
||||
*/
|
||||
@ModelAttribute("dbadmin_userConf")
|
||||
@ModelAttribute("snapadmin_userConf")
|
||||
public UserConfiguration getUserConf() {
|
||||
return userConf;
|
||||
}
|
||||
|
||||
@ModelAttribute("dbadmin_properties")
|
||||
@ModelAttribute("snapadmin_properties")
|
||||
public SnapAdminProperties getProps() {
|
||||
return props;
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ import tech.ailef.snapadmin.external.dto.AutocompleteSearchResult;
|
||||
* API controller for autocomplete results
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value= {"/${dbadmin.baseUrl}/api/autocomplete", "/${dbadmin.baseUrl}/api/autocomplete/"})
|
||||
@RequestMapping(value= {"/${snapadmin.baseUrl}/api/autocomplete", "/${snapadmin.baseUrl}/api/autocomplete/"})
|
||||
public class AutocompleteController {
|
||||
@Autowired
|
||||
private SnapAdmin dbAdmin;
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
* Configuration class for the "internal" data source. This is place in the root "internal"
|
||||
* package, so as to allow component scanning and detection of models and repositories.
|
||||
*/
|
||||
@ConditionalOnProperty(name = "dbadmin.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "snapadmin.enabled", matchIfMissing = true)
|
||||
@ComponentScan
|
||||
@Configuration
|
||||
public class InternalDbAdminConfiguration {
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#spring.jpa.hibernate.ddl-auto=create
|
||||
|
||||
#spring.datasource.dbadmin.url=jdbc:h2:file:./database
|
||||
#spring.datasource.dbadmin.username=sa
|
||||
#spring.datasource.dbadmin.password=password
|
||||
#spring.h2.console.enabled=true
|
||||
|
||||
#spring.jpa.show-sql=true
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -6,7 +6,7 @@
|
||||
<!-- Modal -->
|
||||
<div class="modal modal-lg fade" id="csvQueryExportModal" tabindex="-1" aria-labelledby="csvQueryExportModalLabel" aria-hidden="true"
|
||||
th:if="${results != null}">
|
||||
<form th:action="|/${dbadmin_baseUrl}/console/export/${activeQuery.getId()}|" method="GET">
|
||||
<form th:action="|/${snapadmin_baseUrl}/console/export/${activeQuery.getId()}|" method="GET">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@@ -66,7 +66,7 @@
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<div class="w-100 d-flex inner-navigation">
|
||||
<a th:each="query : ${tabs}" th:href="|/${dbadmin_baseUrl}/console/run/${query.getId()}|"
|
||||
<a th:each="query : ${tabs}" th:href="|/${snapadmin_baseUrl}/console/run/${query.getId()}|"
|
||||
class="d-inline-block query-tab"
|
||||
th:classAppend="${query.getId() == activeQuery.getId() ? 'active' : ''}">
|
||||
<div class="ui-tab ps-5 pe-5 p-3">
|
||||
@@ -76,14 +76,14 @@
|
||||
</a>
|
||||
<div class="inner-navigation-border flex-grow-1 align-items-center d-flex">
|
||||
<h3 class="ms-3 mt-0 mb-0">
|
||||
<a th:href="|/${dbadmin_baseUrl}/console/new|">
|
||||
<a th:href="|/${snapadmin_baseUrl}/console/new|">
|
||||
<i class="bi bi-plus-square-fill align-middle"></i>
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box with-navigation">
|
||||
<form th:action="|/${dbadmin_baseUrl}/console/run/${activeQuery.getId()}|" method="GET">
|
||||
<form th:action="|/${snapadmin_baseUrl}/console/run/${activeQuery.getId()}|" method="GET">
|
||||
<span class="text-muted fw-bold mb-1 d-inline-block">Query title</span>
|
||||
<input type="text" class="form-control mb-3"
|
||||
name="queryTitle" th:value="${activeQuery.getTitle()}">
|
||||
@@ -94,7 +94,7 @@
|
||||
<a href="#" class="ms-4 ui-btn btn btn-danger mt-3" id="console-delete-btn">Delete</a>
|
||||
</form>
|
||||
<div class="d-flex justify-content-end">
|
||||
<form th:action="|/${dbadmin_baseUrl}/console/delete/${activeQuery.getId()}|" method="POST"
|
||||
<form th:action="|/${snapadmin_baseUrl}/console/delete/${activeQuery.getId()}|" method="POST"
|
||||
id="console-delete-form">
|
||||
</form>
|
||||
</div>
|
||||
@@ -110,7 +110,7 @@
|
||||
<ul class="pagination me-3">
|
||||
<li class="page-item" th:if="${pagination.getCurrentPage() != 1}">
|
||||
<a class="page-link"
|
||||
th:href="@{|${dbadmin_requestUrl}${pagination.getLink(pagination.getCurrentPage() - 1)}|}"
|
||||
th:href="@{|${snapadmin_requestUrl}${pagination.getLink(pagination.getCurrentPage() - 1)}|}"
|
||||
aria-label="Previous">
|
||||
<span aria-hidden="true">«</span>
|
||||
<span class="sr-only">Previous</span>
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
<li class="page-item" th:each="p : ${pagination.getBeforePages()}">
|
||||
<a class="page-link"
|
||||
th:href="@{|${dbadmin_requestUrl}${pagination.getLink(p)}|}" th:text="${p}"></a>
|
||||
th:href="@{|${snapadmin_requestUrl}${pagination.getLink(p)}|}" th:text="${p}"></a>
|
||||
</li>
|
||||
|
||||
<li class="page-item active">
|
||||
@@ -128,13 +128,13 @@
|
||||
|
||||
<li class="page-item" th:each="p : ${pagination.getAfterPages()}">
|
||||
<a class="page-link"
|
||||
th:href="@{|${dbadmin_requestUrl}${pagination.getLink(p)}|}"
|
||||
th:href="@{|${snapadmin_requestUrl}${pagination.getLink(p)}|}"
|
||||
th:text="${p}"></a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link"
|
||||
th:if="${!pagination.isLastPage()}"
|
||||
th:href="@{|${dbadmin_requestUrl}${pagination.getLink(pagination.getCurrentPage() + 1)}|}"
|
||||
th:href="@{|${snapadmin_requestUrl}${pagination.getLink(pagination.getCurrentPage() + 1)}|}"
|
||||
aria-label="Next">
|
||||
<span class="sr-only">Next</span>
|
||||
<span aria-hidden="true">»</span>
|
||||
@@ -179,7 +179,7 @@
|
||||
<ul class="pagination me-3">
|
||||
<li class="page-item" th:if="${pagination.getCurrentPage() != 1}">
|
||||
<a class="page-link"
|
||||
th:href="@{|${dbadmin_requestUrl}${pagination.getLink(pagination.getCurrentPage() - 1)}|}"
|
||||
th:href="@{|${snapadmin_requestUrl}${pagination.getLink(pagination.getCurrentPage() - 1)}|}"
|
||||
aria-label="Previous">
|
||||
<span aria-hidden="true">«</span>
|
||||
<span class="sr-only">Previous</span>
|
||||
@@ -188,7 +188,7 @@
|
||||
|
||||
<li class="page-item" th:each="p : ${pagination.getBeforePages()}">
|
||||
<a class="page-link"
|
||||
th:href="@{|${dbadmin_requestUrl}${pagination.getLink(p)}|}" th:text="${p}"></a>
|
||||
th:href="@{|${snapadmin_requestUrl}${pagination.getLink(p)}|}" th:text="${p}"></a>
|
||||
</li>
|
||||
|
||||
<li class="page-item active">
|
||||
@@ -197,13 +197,13 @@
|
||||
|
||||
<li class="page-item" th:each="p : ${pagination.getAfterPages()}">
|
||||
<a class="page-link"
|
||||
th:href="@{|${dbadmin_requestUrl}${pagination.getLink(p)}|}"
|
||||
th:href="@{|${snapadmin_requestUrl}${pagination.getLink(p)}|}"
|
||||
th:text="${p}"></a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link"
|
||||
th:if="${!pagination.isLastPage()}"
|
||||
th:href="@{|${dbadmin_requestUrl}${pagination.getLink(pagination.getCurrentPage() + 1)}|}"
|
||||
th:href="@{|${snapadmin_requestUrl}${pagination.getLink(pagination.getCurrentPage() + 1)}|}"
|
||||
aria-label="Next">
|
||||
<span class="sr-only">Next</span>
|
||||
<span aria-hidden="true">»</span>
|
||||
@@ -239,6 +239,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" th:src="|/${dbadmin_baseUrl}/js/console.js|"></script>
|
||||
<script type="text/javascript" th:src="|/${snapadmin_baseUrl}/js/console.js|"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -11,10 +11,10 @@
|
||||
<td class="text-center row-icons">
|
||||
<a class="ps-1"
|
||||
th:classAppend="|${!schema.isEditEnabled() ? 'disable' : ''}|"
|
||||
th:href="|/${dbadmin_baseUrl}/model/${schema.getJavaClass().getName()}/edit/${row.getPrimaryKeyValue()}|">
|
||||
th:href="|/${snapadmin_baseUrl}/model/${schema.getJavaClass().getName()}/edit/${row.getPrimaryKeyValue()}|">
|
||||
<i class="bi bi-pencil-square"></i></a>
|
||||
<form class="delete-form" method="POST"
|
||||
th:action="|/${dbadmin_baseUrl}/model/${schema.getJavaClass().getName()}/delete/${row.getPrimaryKeyValue()}|">
|
||||
th:action="|/${snapadmin_baseUrl}/model/${schema.getJavaClass().getName()}/delete/${row.getPrimaryKeyValue()}|">
|
||||
<button th:class="|${!schema.isDeleteEnabled() ? 'disable' : ''}|"><i class="bi bi-trash"></i></button>
|
||||
</form>
|
||||
</td>
|
||||
@@ -37,7 +37,7 @@
|
||||
<!-- data-row-field fragment -->
|
||||
<th:block th:fragment="data_row_field(field, object)">
|
||||
<th:block th:if="${field.getConnectedType() != null && object.traverse(field) != null}">
|
||||
<a th:href="|/${dbadmin_baseUrl}/model/${field.getConnectedType().getName()}/show/${object.traverse(field).getPrimaryKeyValue()}|">
|
||||
<a th:href="|/${snapadmin_baseUrl}/model/${field.getConnectedType().getName()}/show/${object.traverse(field).getPrimaryKeyValue()}|">
|
||||
<span th:text="${object.has(field) ? object.traverse(field).getPrimaryKeyValue() : 'NULL'}"></span>
|
||||
</a>
|
||||
<p class="p-0 m-0"
|
||||
@@ -45,7 +45,7 @@
|
||||
</th:block>
|
||||
<th:block th:if="${field.getConnectedType() == null}">
|
||||
<th:block th:if="${field.isPrimaryKey()}">
|
||||
<a th:href="|/${dbadmin_baseUrl}/model/${schema.getClassName()}/show/${object.get(field).getValue()}|">
|
||||
<a th:href="|/${snapadmin_baseUrl}/model/${schema.getClassName()}/show/${object.get(field).getValue()}|">
|
||||
<span th:text="${object.get(field).getFormattedValue()}">
|
||||
</span>
|
||||
</a>
|
||||
@@ -66,11 +66,11 @@
|
||||
<th:block th:if="${object.get(field).getValue()}">
|
||||
<div th:if="${field.isImage()}" class="mb-2">
|
||||
<img class="thumb-image"
|
||||
th:src="|/${dbadmin_baseUrl}/download/${schema.getClassName()}/${field.getJavaName()}/${object.getPrimaryKeyValue()}/image|">
|
||||
th:src="|/${snapadmin_baseUrl}/download/${schema.getClassName()}/${field.getJavaName()}/${object.getPrimaryKeyValue()}/image|">
|
||||
</div>
|
||||
|
||||
<a class="text-decoration-none null-label"
|
||||
th:href="|/${dbadmin_baseUrl}/download/${schema.getClassName()}/${field.getJavaName()}/${object.getPrimaryKeyValue()}|">
|
||||
th:href="|/${snapadmin_baseUrl}/download/${schema.getClassName()}/${field.getJavaName()}/${object.getPrimaryKeyValue()}|">
|
||||
<i class="align-middle bi bi-box-arrow-down"></i><span class="align-middle"> Download
|
||||
<!--/*--> <span class="text-muted">([[ ${object.get(field).getValue().length} ]] bytes)</span> <!--*/-->
|
||||
</span>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<span th:if="${object.get(field) != null}">
|
||||
<th:block th:if="${field.isForeignKey()}">
|
||||
<a th:href="|/${dbadmin_baseUrl}/model/${field.getConnectedType().getName()}/show/${object.get(field)}|">
|
||||
<a th:href="|/${snapadmin_baseUrl}/model/${field.getConnectedType().getName()}/show/${object.get(field)}|">
|
||||
<span th:text="${object.get(field)}"></span>
|
||||
</a>
|
||||
</th:block>
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
<div th:if="${field.isImage()}" class="mb-2">
|
||||
<img class="thumb-image"
|
||||
th:id="|__thumb_${name}|"
|
||||
th:src="|/${dbadmin_baseUrl}/download/${schema.getClassName()}/${field.getJavaName()}/${object.getPrimaryKeyValue()}/image|">
|
||||
th:src="|/${snapadmin_baseUrl}/download/${schema.getClassName()}/${field.getJavaName()}/${object.getPrimaryKeyValue()}/image|">
|
||||
</div>
|
||||
</div>
|
||||
<!--/*--> File input <!--*/-->
|
||||
|
||||
@@ -3,21 +3,21 @@
|
||||
<head th:fragment="head">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.2/font/bootstrap-icons.css" integrity="sha384-b6lVK+yci+bfDmaY1u0zE8YYJt0TZxLEAFyYSLHId4xoVvsrQu3INevFKo+Xir8e" crossorigin="anonymous">
|
||||
<link rel="stylesheet" th:href="|/${dbadmin_baseUrl}/css/dbadmin.css|">
|
||||
<link rel="stylesheet" th:href="|/${dbadmin_baseUrl}/css/style.css|">
|
||||
<link rel="stylesheet" th:href="|/${snapadmin_baseUrl}/snapadmin/css/snapadmin.css|">
|
||||
<link rel="stylesheet" th:href="|/${snapadmin_baseUrl}/snapadmin/css/style.css|">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/js/bootstrap.min.js" integrity="sha512-1/RvZTcCDEUjY/CypiMz+iqqtaoQfAITmNSJY17Myp4Ms5mdxPS5UV7iOfdZoxcGhzFbOm6sntTKJppjvuhg4g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script type="text/javascript" th:src="|/${dbadmin_baseUrl}/js/table.js|"></script>
|
||||
<script type="text/javascript" th:src="|/${dbadmin_baseUrl}/js/autocomplete.js|"></script>
|
||||
<script type="text/javascript" th:src="|/${dbadmin_baseUrl}/js/autocomplete-multi.js|"></script>
|
||||
<script type="text/javascript" th:src="|/${dbadmin_baseUrl}/js/filters.js|"></script>
|
||||
<script type="text/javascript" th:src="|/${dbadmin_baseUrl}/js/logs.js|"></script>
|
||||
<script type="text/javascript" th:src="|/${dbadmin_baseUrl}/js/create.js|"></script>
|
||||
<script type="text/javascript" th:src="|/${snapadmin_baseUrl}/snapadmin/js/table.js|"></script>
|
||||
<script type="text/javascript" th:src="|/${snapadmin_baseUrl}/snapadmin/js/autocomplete.js|"></script>
|
||||
<script type="text/javascript" th:src="|/${snapadmin_baseUrl}/snapadmin/js/autocomplete-multi.js|"></script>
|
||||
<script type="text/javascript" th:src="|/${snapadmin_baseUrl}/snapadmin/js/filters.js|"></script>
|
||||
<script type="text/javascript" th:src="|/${snapadmin_baseUrl}/snapadmin/js/logs.js|"></script>
|
||||
<script type="text/javascript" th:src="|/${snapadmin_baseUrl}/snapadmin/js/create.js|"></script>
|
||||
<title th:text="${title != null ? title + ' | Spring Boot DB Admin Panel' : 'Spring Boot DB Admin Panel'}"></title>
|
||||
<script th:inline="javascript">
|
||||
let baseUrl = [[ ${dbadmin_baseUrl} ]];
|
||||
let baseUrl = [[ ${snapadmin_baseUrl} ]];
|
||||
</script>
|
||||
<style type="text/css" th:if="${dbadmin_userConf != null}">
|
||||
[( ${dbadmin_userConf.get('additionalCss')} )]
|
||||
<style type="text/css" th:if="${snapadmin_userConf != null}">
|
||||
[( ${snapadmin_userConf.get('additionalCss')} )]
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
|
||||
<nav class="navbar fixed-top navbar-expand-lg bg-accent color-white" th:fragment="navbar">
|
||||
<div class="container-fluid">
|
||||
<a class=" fw-bold navbar-brand" th:href="|/${dbadmin_baseUrl}|"><i class="bi bi-hexagon-fill"></i>
|
||||
[[ ${dbadmin_userConf.get('brandName')} ]]
|
||||
<a class=" fw-bold navbar-brand" th:href="|/${snapadmin_baseUrl}|"><i class="bi bi-hexagon-fill"></i>
|
||||
[[ ${snapadmin_userConf.get('brandName')} ]]
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
@@ -47,7 +47,7 @@
|
||||
<h6 class="fw-bold pt-2 ms-3 menu-subheading d-none d-md-block">MENU</h6>
|
||||
<ul class="sidebar-menu pb-0 mb-0 ">
|
||||
<li th:class="${#strings.equals(activePage, 'entities') ? 'active' : ''}">
|
||||
<a th:href="|/${dbadmin_baseUrl}|">
|
||||
<a th:href="|/${snapadmin_baseUrl}|">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="menu-icon">
|
||||
<i class="bi bi-database"></i>
|
||||
@@ -59,7 +59,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li th:class="${#strings.equals(activePage, 'logs') ? 'active' : ''}">
|
||||
<a th:href="|/${dbadmin_baseUrl}/logs|">
|
||||
<a th:href="|/${snapadmin_baseUrl}/logs|">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="menu-icon">
|
||||
<i class="bi bi-file-text"></i>
|
||||
@@ -70,9 +70,9 @@
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li th:if="${dbadmin_properties.isSqlConsoleEnabled()}"
|
||||
<li th:if="${snapadmin_properties.isSqlConsoleEnabled()}"
|
||||
th:class="${#strings.equals(activePage, 'console') ? 'active' : ''}">
|
||||
<a th:href="|/${dbadmin_baseUrl}/console|">
|
||||
<a th:href="|/${snapadmin_baseUrl}/console|">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="menu-icon">
|
||||
<i class="bi bi-terminal"></i>
|
||||
@@ -84,7 +84,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li th:class="${#strings.equals(activePage, 'settings') ? 'active' : ''}">
|
||||
<a th:href="|/${dbadmin_baseUrl}/settings|">
|
||||
<a th:href="|/${snapadmin_baseUrl}/settings|">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="menu-icon">
|
||||
<i class="bi bi-gear"></i>
|
||||
@@ -115,7 +115,7 @@
|
||||
<div class="separator"></div>
|
||||
<ul class="sidebar-menu mb-0 pb-0">
|
||||
<li th:class="${#strings.equals(page, 'help') ? 'active' : ''}">
|
||||
<a th:href="|/${dbadmin_baseUrl}/help|">
|
||||
<a th:href="|/${snapadmin_baseUrl}/help|">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="menu-icon">
|
||||
<i class="bi bi-question-circle"></i>
|
||||
@@ -123,7 +123,7 @@
|
||||
<div class="menu-entry-text d-none d-md-block">
|
||||
Help
|
||||
</div>
|
||||
<div th:text="|v${dbadmin_version}|" class="text-muted ms-5"></div>
|
||||
<div th:text="|v${snapadmin_version}|" class="text-muted ms-5"></div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
@@ -139,7 +139,7 @@
|
||||
<ul class="pagination me-3">
|
||||
<li class="page-item" th:if="${page.getPagination().getCurrentPage() != 1}">
|
||||
<a class="page-link"
|
||||
th:href="@{|${dbadmin_requestUrl}${page.getPagination().getLink(page.getPagination.getCurrentPage() - 1)}|}"
|
||||
th:href="@{|${snapadmin_requestUrl}${page.getPagination().getLink(page.getPagination.getCurrentPage() - 1)}|}"
|
||||
aria-label="Previous">
|
||||
<span aria-hidden="true">«</span>
|
||||
<span class="sr-only">Previous</span>
|
||||
@@ -148,7 +148,7 @@
|
||||
|
||||
<li class="page-item" th:each="p : ${page.getPagination().getBeforePages()}">
|
||||
<a class="page-link"
|
||||
th:href="@{|${dbadmin_requestUrl}${page.getPagination().getLink(p)}|}" th:text="${p}"></a>
|
||||
th:href="@{|${snapadmin_requestUrl}${page.getPagination().getLink(p)}|}" th:text="${p}"></a>
|
||||
</li>
|
||||
|
||||
<li class="page-item active">
|
||||
@@ -157,13 +157,13 @@
|
||||
|
||||
<li class="page-item" th:each="p : ${page.getPagination().getAfterPages()}">
|
||||
<a class="page-link"
|
||||
th:href="@{|${dbadmin_requestUrl}${page.getPagination().getLink(p)}|}"
|
||||
th:href="@{|${snapadmin_requestUrl}${page.getPagination().getLink(p)}|}"
|
||||
th:text="${p}"></a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link"
|
||||
th:if="${!page.getPagination().isLastPage()}"
|
||||
th:href="@{|${dbadmin_requestUrl}${page.getPagination().getLink(page.getPagination.getCurrentPage() + 1)}|}"
|
||||
th:href="@{|${snapadmin_requestUrl}${page.getPagination().getLink(page.getPagination.getCurrentPage() + 1)}|}"
|
||||
aria-label="Next">
|
||||
<span class="sr-only">Next</span>
|
||||
<span aria-hidden="true">»</span>
|
||||
@@ -171,12 +171,12 @@
|
||||
</li>
|
||||
</ul>
|
||||
<div class="me-3">
|
||||
<form method="GET" th:action="@{|${dbadmin_requestUrl}|}">
|
||||
<form method="GET" th:action="@{|${snapadmin_requestUrl}|}">
|
||||
<input type="hidden" th:value="${page.getPagination().getCurrentPage()}" th:name="page">
|
||||
<input type="hidden" th:value="${query}" th:name="query">
|
||||
<input type="hidden" name="pageSize">
|
||||
<th:block th:each="p : ${dbadmin_queryParams.keySet()}">
|
||||
<input th:each="v : ${dbadmin_queryParams.get(p)}"
|
||||
<th:block th:each="p : ${snapadmin_queryParams.keySet()}">
|
||||
<input th:each="v : ${snapadmin_queryParams.get(p)}"
|
||||
th:name="${p}" th:value="${v}" type="hidden"
|
||||
th:if="${p.startsWith('filter_')}">
|
||||
</th:block>
|
||||
@@ -199,7 +199,7 @@
|
||||
|
||||
<div class="d-flex align-items-center" th:if="${page.getPagination().getMaxPage() == 1}">
|
||||
<div class="me-3">
|
||||
<form method="GET" th:action="@{|${dbadmin_requestUrl}|}">
|
||||
<form method="GET" th:action="@{|${snapadmin_requestUrl}|}">
|
||||
<input type="hidden" th:value="${page.getPagination().getCurrentPage()}" th:name="page">
|
||||
<input type="hidden" th:value="${query}" th:name="query">
|
||||
<input type="hidden" name="pageSize">
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
<body>
|
||||
<th:block th:fragment="sort_arrow(sortKey, sortOrder, fieldName)">
|
||||
<th:block th:if="${sortKey != fieldName}" >
|
||||
<a th:href="@{|${dbadmin_requestUrl}${page.getPagination().getSortedPageLink(fieldName, 'DESC')}|}">
|
||||
<a th:href="@{|${snapadmin_requestUrl}${page.getPagination().getSortedPageLink(fieldName, 'DESC')}|}">
|
||||
<i title="Sort" class="bi bi-caret-up"></i>
|
||||
</a>
|
||||
</th:block>
|
||||
<th:block th:unless="${sortKey != fieldName}">
|
||||
<a th:if="${sortOrder == 'DESC'}"
|
||||
th:href="@{|${dbadmin_requestUrl}${page.getPagination().getSortedPageLink(fieldName, 'ASC')}|}">
|
||||
th:href="@{|${snapadmin_requestUrl}${page.getPagination().getSortedPageLink(fieldName, 'ASC')}|}">
|
||||
<i title="Sort" class="bi bi-caret-down-fill"></i>
|
||||
</a>
|
||||
<a th:if="${sortOrder == 'ASC'}"
|
||||
th:href="@{|${dbadmin_requestUrl}${page.getPagination().getSortedPageLink(fieldName, 'DESC')}|}">
|
||||
th:href="@{|${snapadmin_requestUrl}${page.getPagination().getSortedPageLink(fieldName, 'DESC')}|}">
|
||||
<i title="Sort" class="bi bi-caret-up-fill"></i>
|
||||
</a>
|
||||
</th:block>
|
||||
@@ -26,7 +26,7 @@
|
||||
<p>This table contains no data.</p>
|
||||
</div>
|
||||
<div th:if="${results.size() > 0}">
|
||||
<form id="multi-delete-form" th:action="|/${dbadmin_baseUrl}/model/${schema.getClassName()}/delete|" method="POST">
|
||||
<form id="multi-delete-form" th:action="|/${snapadmin_baseUrl}/model/${schema.getClassName()}/delete|" method="POST">
|
||||
</form>
|
||||
<nav th:replace="~{fragments/resources :: pagination(${page})}">
|
||||
</nav>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div th:replace="~{fragments/resources :: sidebar('entities')}"></div>
|
||||
<div class="main-content bg-lighter">
|
||||
<h1 class="fw-bold mb-4"><i class="align-middle bi bi-database"></i><span class="align-middle"> Entities</span></h1>
|
||||
<form th:action="|/${dbadmin_baseUrl}|" method="GET">
|
||||
<form th:action="|/${snapadmin_baseUrl}|" method="GET">
|
||||
<div class="input-group">
|
||||
<input type="text" th:value="${query}"
|
||||
placeholder="Type a class or a table name and press ENTER to search"
|
||||
@@ -37,12 +37,12 @@
|
||||
<td class="warning-col">
|
||||
<a th:if="${!schema.getErrors().isEmpty()}"
|
||||
title="Some errors or warnings were raised while processing this table."
|
||||
th:href="|/${dbadmin_baseUrl}/model/${schema.getClassName()}/schema|">
|
||||
th:href="|/${snapadmin_baseUrl}/model/${schema.getClassName()}/schema|">
|
||||
<i class="bi bi-exclamation-triangle"></i></a>
|
||||
</td>
|
||||
<td>
|
||||
<a th:text="${schema.getTableName()}"
|
||||
th:href="|/${dbadmin_baseUrl}/model/${schema.getClassName()}|"></a>
|
||||
th:href="|/${snapadmin_baseUrl}/model/${schema.getClassName()}|"></a>
|
||||
</td>
|
||||
<td>
|
||||
<span th:text="${counts.get(schema.getClassName())}"></span>
|
||||
@@ -51,10 +51,10 @@
|
||||
<span th:text="${schema.getClassName()}"></span>
|
||||
</td>
|
||||
<td class="text-end row-icons">
|
||||
<a title="List all" th:href="|/${dbadmin_baseUrl}/model/${schema.getClassName()}|"><i class="bi bi-list"></i></i></a>
|
||||
<a title="List all" th:href="|/${snapadmin_baseUrl}/model/${schema.getClassName()}|"><i class="bi bi-list"></i></i></a>
|
||||
<a th:title="|${!schema.isCreateEnabled() ? 'CREATE disabled for this type' : 'Create new item'}|"
|
||||
th:class="|${!schema.isCreateEnabled() ? 'disable' : ''}|"
|
||||
th:href="|/${dbadmin_baseUrl}/model/${schema.getClassName()}/create|"><i class="bi bi-plus-square"></i>
|
||||
th:href="|/${snapadmin_baseUrl}/model/${schema.getClassName()}/create|"><i class="bi bi-plus-square"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="box">
|
||||
<h3 class="fw-bold">Logs</h3>
|
||||
<div class="w-75">
|
||||
<form th:action="|/${dbadmin_baseUrl}/logs|" class="mt-3" id="log-filter-form" method="GET">
|
||||
<form th:action="|/${snapadmin_baseUrl}/logs|" class="mt-3" id="log-filter-form" method="GET">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">Action type</span>
|
||||
<select name="actionType" class="form-select">
|
||||
@@ -111,7 +111,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<th:block th:if="${entry.getActionType() != 'DELETE'}">
|
||||
<a th:href="|/${dbadmin_baseUrl}/model/${entry.getJavaClass()}/show/${entry.getPrimaryKey()}|"
|
||||
<a th:href="|/${snapadmin_baseUrl}/model/${entry.getJavaClass()}/show/${entry.getPrimaryKey()}|"
|
||||
th:text="${entry.getPrimaryKey()}"></a>
|
||||
</th:block>
|
||||
<th:block th:if="${entry.getActionType() == 'DELETE'}">
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
|
||||
<h1 class="fw-bold mb-4">
|
||||
<i class="align-middle bi bi-database"></i>
|
||||
<span class="align-middle"><a th:href="|/${dbadmin_baseUrl}|">Entities </a></span>
|
||||
<span class="align-middle"><a th:href="|/${snapadmin_baseUrl}|">Entities </a></span>
|
||||
<i class="align-middle bi bi-chevron-double-right"></i>
|
||||
<a class="align-middle" th:href="|/${dbadmin_baseUrl}/model/${schema.getJavaClass().getName()}|">
|
||||
<a class="align-middle" th:href="|/${snapadmin_baseUrl}/model/${schema.getJavaClass().getName()}|">
|
||||
[[ ${schema.getJavaClass().getSimpleName()} ]] </a>
|
||||
<i class="align-middle bi bi-chevron-double-right"></i>
|
||||
<span class="align-middle" th:text="${create ? 'Create' : 'Edit'}"></span>
|
||||
@@ -28,8 +28,8 @@
|
||||
<div class="col">
|
||||
<div class="box">
|
||||
<h3 class="fw-bold mb-4" th:text="${create ? schema.getJavaClass().getSimpleName() : object.getDisplayName()}"></h3>
|
||||
<form class="form" enctype="multipart/form-data" method="post" th:action="|/${dbadmin_baseUrl}/model/${className}/create|">
|
||||
<input type="hidden" name="__dbadmin_create" th:value="${create}">
|
||||
<form class="form" enctype="multipart/form-data" method="post" th:action="|/${snapadmin_baseUrl}/model/${className}/create|">
|
||||
<input type="hidden" name="__snapadmin_create" th:value="${create}">
|
||||
<div th:each="field : ${schema.getSortedFields(false)}" class="mt-2"
|
||||
th:if="${!field.isGeneratedValue() || !create}"
|
||||
th:classAppend="|${validationErrors != null && validationErrors.hasErrors(field.getJavaName()) ? 'invalid' : ''}|">
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
|
||||
<div class="d-flex mt-4 justify-content-between">
|
||||
<a th:href="|/${dbadmin_baseUrl}/model/${schema.getClassName()}|" class="ui-btn btn btn-secondary">Cancel</a>
|
||||
<a th:href="|/${snapadmin_baseUrl}/model/${schema.getClassName()}|" class="ui-btn btn btn-secondary">Cancel</a>
|
||||
<input type="submit" class="ui-btn btn btn-primary" th:value="${object != null ? 'Save' : 'Create'}">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<body>
|
||||
<!-- Modal -->
|
||||
<div class="modal modal-lg fade" id="csvExportModal" tabindex="-1" aria-labelledby="csvExportModalLabel" aria-hidden="true">
|
||||
<form th:action="|/${dbadmin_baseUrl}/export/${schema.getClassName()}|" method="GET">
|
||||
<form th:action="|/${snapadmin_baseUrl}/export/${schema.getClassName()}|" method="GET">
|
||||
<input type="hidden" name="query" th:value="${query}">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
@@ -102,19 +102,19 @@
|
||||
<div class="main-content bg-lighter">
|
||||
<th:block th:replace="~{fragments/resources :: alerts}"></th:block>
|
||||
<h1 class="fw-bold mb-4"><i class="align-middle bi bi-database"></i>
|
||||
<span class="align-middle"><a th:href="|/${dbadmin_baseUrl}|">Entities</a></span>
|
||||
<span class="align-middle"><a th:href="|/${snapadmin_baseUrl}|">Entities</a></span>
|
||||
<i class="align-middle bi bi-chevron-double-right"></i>
|
||||
<span class="align-middle"> [[ ${schema.getJavaClass().getSimpleName()} ]] </span>
|
||||
</h1>
|
||||
<div class="row mt-4">
|
||||
<div th:class="${schema.getFilterableFields().isEmpty() ? 'col' : 'col-9'}">
|
||||
<div class="w-100 d-flex inner-navigation">
|
||||
<a th:href="|/${dbadmin_baseUrl}/model/${className}|" class="active">
|
||||
<a th:href="|/${snapadmin_baseUrl}/model/${className}|" class="active">
|
||||
<div class="ui-tab ps-5 pe-5 p-3">
|
||||
<i class="bi bi-database pe-2"></i> DATA
|
||||
</div>
|
||||
</a>
|
||||
<a th:href="|/${dbadmin_baseUrl}/model/${className}/schema|">
|
||||
<a th:href="|/${snapadmin_baseUrl}/model/${className}/schema|">
|
||||
<div class="ui-tab ps-5 pe-5 p-3">
|
||||
<i class="bi bi-table pe-2"></i> SCHEMA
|
||||
</div>
|
||||
@@ -123,7 +123,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="box with-navigation">
|
||||
<form th:action="|/${dbadmin_baseUrl}/model/${className}|" method="GET" class="mb-3">
|
||||
<form th:action="|/${snapadmin_baseUrl}/model/${className}|" method="GET" class="mb-3">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="bi bi-search"></i></span>
|
||||
<input type="text" th:value="${query}"
|
||||
@@ -131,8 +131,8 @@
|
||||
class="ui-text-input form-control" name="query" autofocus>
|
||||
<button class="ui-btn btn btn-primary">Search</button>
|
||||
</div>
|
||||
<th:block th:each="queryParam : ${dbadmin_queryParams.keySet()}">
|
||||
<input th:each="paramValue : ${dbadmin_queryParams.get(queryParam)}"
|
||||
<th:block th:each="queryParam : ${snapadmin_queryParams.keySet()}">
|
||||
<input th:each="paramValue : ${snapadmin_queryParams.get(queryParam)}"
|
||||
th:if="${queryParam.startsWith('filter_')}"
|
||||
th:name="${queryParam}" th:value="${paramValue}" type="hidden">
|
||||
</th:block>
|
||||
@@ -160,7 +160,7 @@
|
||||
<h3 class="create-button">
|
||||
<a th:title="|${!schema.isCreateEnabled() ? 'CREATE disabled for this type' : 'Create new item'}|"
|
||||
th:class="|${!schema.isCreateEnabled() ? 'disable' : ''}|"
|
||||
th:href="|/${dbadmin_baseUrl}/model/${schema.getClassName()}/create|"><i class="bi bi-plus-square"></i></a>
|
||||
th:href="|/${snapadmin_baseUrl}/model/${schema.getClassName()}/create|"><i class="bi bi-plus-square"></i></a>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
@@ -184,8 +184,8 @@
|
||||
[[ ${filter}]] <i class="bi bi-x-circle"></i>
|
||||
</span>
|
||||
<form action="" th:id="${filter.toString()}" method="GET">
|
||||
<th:block th:each="p : ${dbadmin_queryParams.keySet()}">
|
||||
<input th:each="v : ${dbadmin_queryParams.get(p)}" th:name="${p}" th:value="${v}" type="hidden">
|
||||
<th:block th:each="p : ${snapadmin_queryParams.keySet()}">
|
||||
<input th:each="v : ${snapadmin_queryParams.get(p)}" th:name="${p}" th:value="${v}" type="hidden">
|
||||
</th:block>
|
||||
<input type="hidden" name="remove_field" th:value="${filter.getField().getJavaName()}">
|
||||
<input type="hidden" name="remove_op" th:value="${filter.getOp()}">
|
||||
|
||||
@@ -10,20 +10,20 @@
|
||||
<div th:replace="~{fragments/resources :: sidebar('entities')}"></div>
|
||||
<div class="main-content bg-lighter">
|
||||
<h1 class="fw-bold mb-4"><i class="bi bi-database"></i>
|
||||
<a class="align-middle" th:href="|/${dbadmin_baseUrl}|">Entities</a>
|
||||
<a class="align-middle" th:href="|/${snapadmin_baseUrl}|">Entities</a>
|
||||
<i class="align-middle bi bi-chevron-double-right"></i>
|
||||
<a class="align-middle" th:href="|/${dbadmin_baseUrl}/model/${schema.getJavaClass().getName()}|"> [[ ${schema.getJavaClass().getSimpleName()} ]]</a>
|
||||
<a class="align-middle" th:href="|/${snapadmin_baseUrl}/model/${schema.getJavaClass().getName()}|"> [[ ${schema.getJavaClass().getSimpleName()} ]]</a>
|
||||
<i class="align-middle bi bi-chevron-double-right"></i><span class="align-middle"> Schema</span>
|
||||
</h1>
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<div class="w-100 d-flex inner-navigation">
|
||||
<a th:href="|/${dbadmin_baseUrl}/model/${schema.getJavaClass().getName()}|">
|
||||
<a th:href="|/${snapadmin_baseUrl}/model/${schema.getJavaClass().getName()}|">
|
||||
<div class="ui-tab ps-5 pe-5 p-3">
|
||||
<i class="bi bi-database pe-2"></i> DATA
|
||||
</div>
|
||||
</a>
|
||||
<a th:href="|/${dbadmin_baseUrl}/model/${schema.getJavaClass().getName()}/schema|" class="active">
|
||||
<a th:href="|/${snapadmin_baseUrl}/model/${schema.getJavaClass().getName()}/schema|" class="active">
|
||||
<div class="ui-tab ps-5 pe-5 p-3">
|
||||
<i class="bi bi-table pe-2"></i> SCHEMA
|
||||
</div>
|
||||
@@ -40,7 +40,7 @@
|
||||
</span>
|
||||
</h3>
|
||||
<h3 class="create-button"><a th:title="|${!schema.isCreateEnabled() ? 'CREATE disabled for this type' : 'Create new item'}|"
|
||||
th:href="|/${dbadmin_baseUrl}/model/${schema.getClassName()}/create|"
|
||||
th:href="|/${snapadmin_baseUrl}/model/${schema.getClassName()}/create|"
|
||||
th:class="|${!schema.isCreateEnabled() ? 'disable' : ''}|"><i class="bi bi-plus-square"></i></a></h3>
|
||||
</div>
|
||||
<div class="mb-4 operations-badges">
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
<div th:replace="~{fragments/resources :: sidebar('entities')}"></div>
|
||||
<div class="main-content bg-lighter">
|
||||
<h1 class="fw-bold mb-4"><i class="align-middle bi bi-database"></i>
|
||||
<a class="align-middle" th:href="|/${dbadmin_baseUrl}|">Entities</a>
|
||||
<a class="align-middle" th:href="|/${snapadmin_baseUrl}|">Entities</a>
|
||||
<i class="align-middle bi bi-chevron-double-right"></i>
|
||||
<a class="align-middle" th:href="|/${dbadmin_baseUrl}/model/${schema.getJavaClass().getName()}|">
|
||||
<a class="align-middle" th:href="|/${snapadmin_baseUrl}/model/${schema.getJavaClass().getName()}|">
|
||||
[[ ${schema.getJavaClass().getSimpleName()} ]]</a>
|
||||
<i class="align-middle bi bi-chevron-double-right"></i>
|
||||
<span class="align-middle"> [[ ${object.getDisplayName()} ]]</span>
|
||||
@@ -24,17 +24,17 @@
|
||||
<h3 class="mb-3 fw-bold" th:text="${object.getDisplayName()}"></h3>
|
||||
<h3><a
|
||||
th:class="|${!schema.isEditEnabled() ? 'disable' : ''} me-2|"
|
||||
th:href="|/${dbadmin_baseUrl}/model/${schema.getClassName()}/edit/${object.getPrimaryKeyValue()}|">
|
||||
th:href="|/${snapadmin_baseUrl}/model/${schema.getClassName()}/edit/${object.getPrimaryKeyValue()}|">
|
||||
<i class="bi bi-pencil"></i></a>
|
||||
|
||||
<form class="delete-form me-2" method="POST"
|
||||
th:action="|/${dbadmin_baseUrl}/model/${schema.getJavaClass().getName()}/delete/${object.getPrimaryKeyValue()}|">
|
||||
th:action="|/${snapadmin_baseUrl}/model/${schema.getJavaClass().getName()}/delete/${object.getPrimaryKeyValue()}|">
|
||||
<button th:class="|${!schema.isDeleteEnabled() ? 'disable' : ''}|"><i class="bi bi-trash"></i></button>
|
||||
</form>
|
||||
|
||||
<a th:title="|${!schema.isCreateEnabled() ? 'CREATE disabled for this type' : 'Create new item'}|"
|
||||
th:class="|${!schema.isCreateEnabled() ? 'disable' : ''}|"
|
||||
th:href="|/${dbadmin_baseUrl}/model/${schema.getClassName()}/create|"><i class="bi bi-plus-square"></i></a>
|
||||
th:href="|/${snapadmin_baseUrl}/model/${schema.getClassName()}/create|"><i class="bi bi-plus-square"></i></a>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -10,17 +10,17 @@
|
||||
<div class="main-content bg-lighter">
|
||||
<th:block th:replace="~{fragments/resources :: alerts}"></th:block>
|
||||
<h1 class="fw-bold mb-4"><i class="align-middle bi bi-gear"></i>
|
||||
<span class="align-middle"><a th:href="|/${dbadmin_baseUrl}|">Settings</a></span>
|
||||
<span class="align-middle"><a th:href="|/${snapadmin_baseUrl}|">Settings</a></span>
|
||||
</h1>
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<div class="w-100 d-flex inner-navigation">
|
||||
<a th:href="|/${dbadmin_baseUrl}/settings|">
|
||||
<a th:href="|/${snapadmin_baseUrl}/settings|">
|
||||
<div class="ui-tab ps-5 pe-5 p-3">
|
||||
<i class="bi bi-database pe-2"></i> GENERAL
|
||||
</div>
|
||||
</a>
|
||||
<a th:href="|/${dbadmin_baseUrl}/settings/appearance|" class="active">
|
||||
<a th:href="|/${snapadmin_baseUrl}/settings/appearance|" class="active">
|
||||
<div class="ui-tab ps-5 pe-5 p-3">
|
||||
<i class="bi bi-table pe-2"></i> APPEARANCE
|
||||
</div>
|
||||
@@ -30,13 +30,13 @@
|
||||
</div>
|
||||
<div class="box with-navigation">
|
||||
<h3 class="fw-bold">Appearance</h3>
|
||||
<form th:action="|/${dbadmin_baseUrl}/settings|" method="POST">
|
||||
<form th:action="|/${snapadmin_baseUrl}/settings|" method="POST">
|
||||
<input type="hidden" name="next" value="settings/appearance">
|
||||
<label for="additionalCss">Additional CSS</label>
|
||||
<span class="m-0 p-0 text-muted">Additional CSS code that is added automatically to all pages</span>
|
||||
<textarea class="form-control mt-2"
|
||||
id="additionalCss" name="additionalCss" rows="8"
|
||||
th:text="${dbadmin_userConf.get('additionalCss')}"></textarea>
|
||||
th:text="${snapadmin_userConf.get('additionalCss')}"></textarea>
|
||||
<button class="ui-btn btn btn-primary mt-3">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -10,17 +10,17 @@
|
||||
<div class="main-content bg-lighter">
|
||||
<th:block th:replace="~{fragments/resources :: alerts}"></th:block>
|
||||
<h1 class="fw-bold mb-4"><i class="align-middle bi bi-gear"></i>
|
||||
<span class="align-middle"><a th:href="|/${dbadmin_baseUrl}|">Settings</a></span>
|
||||
<span class="align-middle"><a th:href="|/${snapadmin_baseUrl}|">Settings</a></span>
|
||||
</h1>
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<div class="w-100 d-flex inner-navigation">
|
||||
<a th:href="|/${dbadmin_baseUrl}/settings|" class="active">
|
||||
<a th:href="|/${snapadmin_baseUrl}/settings|" class="active">
|
||||
<div class="ui-tab ps-5 pe-5 p-3">
|
||||
<i class="bi bi-database pe-2"></i> GENERAL
|
||||
</div>
|
||||
</a>
|
||||
<a th:href="|/${dbadmin_baseUrl}/settings/appearance|">
|
||||
<a th:href="|/${snapadmin_baseUrl}/settings/appearance|">
|
||||
<div class="ui-tab ps-5 pe-5 p-3">
|
||||
<i class="bi bi-table pe-2"></i> APPEARANCE
|
||||
</div>
|
||||
@@ -30,12 +30,12 @@
|
||||
</div>
|
||||
<div class="box with-navigation">
|
||||
<h3 class="fw-bold">General</h3>
|
||||
<form th:action="|/${dbadmin_baseUrl}/settings|" method="POST">
|
||||
<form th:action="|/${snapadmin_baseUrl}/settings|" method="POST">
|
||||
<label for="brandName">Brand name</label>
|
||||
<span class="m-0 p-0 text-muted">What appears in the top bar</span>
|
||||
<input class="form-control mt-2" type="text"
|
||||
id="brandName" name="brandName"
|
||||
th:value="${dbadmin_userConf.get('brandName')}">
|
||||
th:value="${snapadmin_userConf.get('brandName')}">
|
||||
<button class="ui-btn btn btn-primary mt-3">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
|
||||
package tech.ailef.dbadmin;
|
||||
package tech.ailef.snapadmin;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
Reference in new issue
Block a user