mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-06-08 21:38:21 +00:00
0.0.4
This commit is contained in:
parent
1cfc812414
commit
7434c3d56a
@ -1,5 +1,8 @@
|
||||
package tech.ailef.dbadmin;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
@ -47,5 +50,13 @@ public class DbAdminProperties {
|
||||
this.modelsPackage = modelsPackage;
|
||||
}
|
||||
|
||||
public Map<String, String> toMap() {
|
||||
Map<String, String> conf = new HashMap<>();
|
||||
conf.put("enabled", enabled + "");
|
||||
conf.put("baseUrl", baseUrl);
|
||||
conf.put("modelsPackage", modelsPackage);
|
||||
return conf;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package tech.ailef.dbadmin.controller.rest;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import tech.ailef.dbadmin.DbAdmin;
|
||||
import tech.ailef.dbadmin.DbAdminProperties;
|
||||
import tech.ailef.dbadmin.dbmapping.DbAdminRepository;
|
||||
import tech.ailef.dbadmin.dbmapping.DbObjectSchema;
|
||||
import tech.ailef.dbadmin.dto.PaginatedResult;
|
||||
@ -24,6 +27,9 @@ public class DefaultDbAdminRestController {
|
||||
@Autowired
|
||||
public DbAdmin dbAdmin;
|
||||
|
||||
@Autowired
|
||||
private DbAdminProperties properties;
|
||||
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@ -31,6 +37,11 @@ public class DefaultDbAdminRestController {
|
||||
// @Qualifier("internalJdbc")
|
||||
// private JdbcTemplate internalJdbc;
|
||||
|
||||
// @GetMapping("/configuration")
|
||||
// public ResponseEntity<?> conf() {
|
||||
// return ResponseEntity.ok(properties.toMap());
|
||||
// }
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<?> index(@RequestParam(required = false) String query) {
|
||||
checkInit();
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Request to the autocomplete REST endpoit */
|
||||
async function getSuggestions(className, query) {
|
||||
const response = await fetch(`/dbadmin/api/autocomplete/${className}?query=${query}`);
|
||||
const response = await fetch(`/${baseUrl}/api/autocomplete/${className}?query=${query}`);
|
||||
const suggestions = await response.json();
|
||||
return suggestions;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Request to the autocomplete REST endpoit */
|
||||
async function getSuggestions(className, query) {
|
||||
const response = await fetch(`/dbadmin/api/autocomplete/${className}?query=${query}`);
|
||||
const response = await fetch(`/${baseUrl}/api/autocomplete/${className}?query=${query}`);
|
||||
const suggestions = await response.json();
|
||||
return suggestions;
|
||||
}
|
||||
|
@ -12,6 +12,9 @@
|
||||
<script type="text/javascript" src="/js/filters.js"></script>
|
||||
<script type="text/javascript" src="/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 = [[ ${baseUrl} ]];
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<th:block th:fragment="alerts">
|
||||
|
Loading…
x
Reference in New Issue
Block a user