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