WIP SQL console

This commit is contained in:
Francesco
2023-10-20 16:57:44 +02:00
parent ec7eac3c12
commit 198f7166f2
3 changed files with 43 additions and 2 deletions

View File

@@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.http.HttpStatus;
import org.springframework.jdbc.UncategorizedSQLException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.TransactionSystemException;
import org.springframework.ui.Model;
@@ -87,6 +88,8 @@ public class DefaultDbAdminController {
@Autowired
private UserActionService userActionService;
@Autowired
private JdbcTemplate jdbTemplate;
@Autowired
private UserSettingsRepository userSettingsRepo;
@@ -535,6 +538,17 @@ public class DefaultDbAdminController {
return "help";
}
@GetMapping("/console")
public String console(Model model, @RequestParam(required=false) String query) {
model.addAttribute("activePage", "console");
if (query != null) {
jdbTemplate.execute(query);
}
return "console";
}
@GetMapping("/settings/appearance")
public String settingsAppearance(Model model) {
model.addAttribute("activePage", "settings");