if .This.Namespaces, ui draws dropdown for namespaces
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<body class="fullscreen tb_fullscreen lr_fullscreen" style="position: absolute">
|
<body class="fullscreen tb_fullscreen lr_fullscreen" style="position: absolute">
|
||||||
<div class="rows" style="height: inherit;">
|
<div class="rows" style="height: inherit;">
|
||||||
{{ template "_searchbar" }}
|
{{ template "_topbar" . }}
|
||||||
<div class="columns thic_flex tb_buffer" style="height: calc(100% - 4rem);">
|
<div class="columns thic_flex tb_buffer" style="height: calc(100% - 4rem);">
|
||||||
{{ template "_filetree" . }}
|
{{ template "_filetree" . }}
|
||||||
<div class="thic_flex lr_fullscreen" style="margin-left: 1em; width: 5px;">
|
<div class="thic_flex lr_fullscreen" style="margin-left: 1em; width: 5px;">
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
data := map[string]interface{}{
|
data := map[string]interface{}{
|
||||||
"This": map[string]interface{}{
|
"This": map[string]interface{}{
|
||||||
|
"Namespaces": []string{"datastore", "dp-orchestration"},
|
||||||
"ID": "id00/id11",
|
"ID": "id00/id11",
|
||||||
"Title": "title id11",
|
"Title": "title id11",
|
||||||
"ReadOnly": false,
|
"ReadOnly": false,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<body class="fullscreen tb_fullscreen lr_fullscreen" style="position: absolute">
|
<body class="fullscreen tb_fullscreen lr_fullscreen" style="position: absolute">
|
||||||
<div class="rows" style="height: inherit;">
|
<div class="rows" style="height: inherit;">
|
||||||
{{ template "_searchbar" }}
|
{{ template "_topbar" . }}
|
||||||
<div class="columns thic_flex tb_buffer" style="height: calc(100% - 4rem);">
|
<div class="columns thic_flex tb_buffer" style="height: calc(100% - 4rem);">
|
||||||
{{ template "_filetree" . }}
|
{{ template "_filetree" . }}
|
||||||
<div class="thic_flex lr_fullscreen" style="margin-left: 1em; width: 5px;">
|
<div class="thic_flex lr_fullscreen" style="margin-left: 1em; width: 5px;">
|
||||||
|
|||||||
15
server/public/ui/templates/_namespace.ctmpl
Normal file
15
server/public/ui/templates/_namespace.ctmpl
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{{ define "_namespace" }}
|
||||||
|
<script>
|
||||||
|
function setNamespace() {
|
||||||
|
document.getElementById("namespace").disabled = true
|
||||||
|
window.location.href = `${window.location.protocol}`+"//"+`${window.location.host}/ui/files/${document.getElementById("namespace").value}`
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{{ if .This.Namespaces }}
|
||||||
|
<select id="namespace" onchange="setNamespace()" style="max-width: 7rem;">
|
||||||
|
{{ range .This.Namespaces }}
|
||||||
|
<option>{{ . }}</option>
|
||||||
|
{{ end }}
|
||||||
|
</select>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{{ define "_searchbar" }}
|
{{ define "_searchbar" }}
|
||||||
<form class="columns" action="/ui/search" method="GET">
|
<form class="columns thic_flex" action="/ui/search" method="GET">
|
||||||
<input class="thic_flex" type="text" name="q" placeholder="space delimited search regexp"/>
|
<input class="thic_flex" type="text" name="q" placeholder="space delimited search regexp"/>
|
||||||
<input class="info lil_btn" type="submit" value="search"/>
|
<input class="info lil_btn" type="submit" value="search"/>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
6
server/public/ui/templates/_topbar.ctmpl
Normal file
6
server/public/ui/templates/_topbar.ctmpl
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{{ define "_topbar" }}
|
||||||
|
<div class="columns lr_fullscreen">
|
||||||
|
{{ template "_namespace" . }}
|
||||||
|
{{ template "_searchbar" . }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
Reference in New Issue
Block a user