mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-06-09 05:48:20 +00:00
WIP
This commit is contained in:
parent
49a9d58421
commit
d714b8c0a6
@ -35,13 +35,17 @@ import tech.ailef.dbadmin.internal.InternalDbAdminConfiguration;
|
||||
@Import(InternalDbAdminConfiguration.class)
|
||||
public class DbAdminAutoConfiguration {
|
||||
@Autowired
|
||||
Environment env;
|
||||
private DbAdminProperties props;
|
||||
|
||||
@Bean
|
||||
public DataSource internalDataSource() {
|
||||
DataSourceBuilder<?> dataSourceBuilder = DataSourceBuilder.create();
|
||||
dataSourceBuilder.driverClassName("org.h2.Driver");
|
||||
dataSourceBuilder.url("jdbc:h2:file:./dbadmin_internal");
|
||||
if (props.isTestMode())
|
||||
dataSourceBuilder.url("jdbc:h2:mem:test");
|
||||
else
|
||||
dataSourceBuilder.url("jdbc:h2:file:./dbadmin_internal");
|
||||
|
||||
dataSourceBuilder.username("sa");
|
||||
dataSourceBuilder.password("password");
|
||||
return dataSourceBuilder.build();
|
||||
|
@ -26,6 +26,8 @@ public class DbAdminProperties {
|
||||
*/
|
||||
private String modelsPackage;
|
||||
|
||||
private boolean testMode = false;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
@ -50,11 +52,20 @@ public class DbAdminProperties {
|
||||
this.modelsPackage = modelsPackage;
|
||||
}
|
||||
|
||||
public boolean isTestMode() {
|
||||
return testMode;
|
||||
}
|
||||
|
||||
public void setTestMode(boolean testMode) {
|
||||
this.testMode = testMode;
|
||||
}
|
||||
|
||||
public Map<String, String> toMap() {
|
||||
Map<String, String> conf = new HashMap<>();
|
||||
conf.put("enabled", enabled + "");
|
||||
conf.put("baseUrl", baseUrl);
|
||||
conf.put("modelsPackage", modelsPackage);
|
||||
conf.put("testMode", testMode + "");
|
||||
return conf;
|
||||
}
|
||||
|
||||
|
@ -37,13 +37,14 @@
|
||||
<option value="Any">Any</option>
|
||||
<option th:each="schema : ${schemas}"
|
||||
th:value="${schema.getTableName()}"
|
||||
th:text="${schema.getJavaClass().getSimpleName()}"
|
||||
th:text="${schema.getTableName()}"
|
||||
th:selected="${schema.getTableName().equals(searchRequest.getTable())}">
|
||||
</option>
|
||||
</select>
|
||||
<span class="input-group-text ms-3">Item ID</span>
|
||||
<input type="text" class="form-control" name="itemId"
|
||||
th:value="${searchRequest.getItemId()}">
|
||||
<button class="ui-btn btn btn-primary ms-3">Filter</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user