mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-14 17:35:50 +01:00
Database viewer (replacement of H2 console)
This commit is contained in:
@@ -152,6 +152,10 @@ trait SystemSettingsControllerBase extends AccountManagementControllerBase {
|
|||||||
)(EditGroupForm.apply)
|
)(EditGroupForm.apply)
|
||||||
|
|
||||||
|
|
||||||
|
get("/admin/dbviewer")(adminOnly {
|
||||||
|
html.dbviewer()
|
||||||
|
})
|
||||||
|
|
||||||
get("/admin/system")(adminOnly {
|
get("/admin/system")(adminOnly {
|
||||||
html.system(flash.get("info"))
|
html.system(flash.get("info"))
|
||||||
})
|
})
|
||||||
|
|||||||
15
src/main/twirl/gitbucket/core/admin/dbviewer.scala.html
Normal file
15
src/main/twirl/gitbucket/core/admin/dbviewer.scala.html
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
@()(implicit context: gitbucket.core.controller.Context)
|
||||||
|
@gitbucket.core.html.main("Database viewer") {
|
||||||
|
@gitbucket.core.admin.html.menu("dbviewer") {
|
||||||
|
<div id="editor" style="width: 100%; height: 300px;"></div>
|
||||||
|
<div id="result"></div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<script src="@gitbucket.core.view.helpers.assets("/vendors/ace/ace.js")" type="text/javascript" charset="utf-8"></script>
|
||||||
|
<script>
|
||||||
|
$(function(){
|
||||||
|
$('#editor').text($('#initial').val());
|
||||||
|
var editor = ace.edit("editor");
|
||||||
|
editor.setTheme("ace/theme/monokai");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -25,10 +25,10 @@
|
|||||||
<span>Data export / import</span>
|
<span>Data export / import</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="menu-item-hover">
|
<li class="menu-item-hover @if(active=="dbviewer"){active}">
|
||||||
<a href="@context.path/console/login.jsp" target="_blank">
|
<a href="@context.path/admin/dbviewer">
|
||||||
<i class="menu-icon octicon octicon-database"></i>
|
<i class="menu-icon octicon octicon-database"></i>
|
||||||
<span>H2 console</span>
|
<span>Database viewer</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@gitbucket.core.plugin.PluginRegistry().getSystemSettingMenus.map { menu =>
|
@gitbucket.core.plugin.PluginRegistry().getSystemSettingMenus.map { menu =>
|
||||||
|
|||||||
Reference in New Issue
Block a user