-
Notifications
You must be signed in to change notification settings - Fork 0
/
keysindex.html
101 lines (100 loc) · 5.51 KB
/
keysindex.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>KBDBWeb</title>
<!-- https://getbootstrap.com/ -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<!-- https://htmx.org/docs/#via-a-cdn-e-g-unpkg-com -->
<script src="https://unpkg.com/htmx.org@1.9.9" integrity="sha384-QFjmbokDn2DjBjq+fM+8LUIVrAgqcNW2s0PjAxHETgRn9l4fvX31ZxDxvwQnyMOX" crossorigin="anonymous"></script>
<style >
#id-input
{
border-width:0px;
border:none;
font-weight: bold;
text-align:center;
}
</style>
</head>
<body class="container">{{$Api := .Api}}{{$Namespace := .Namespace}}
<div class="row mt-4 g-4">
<div class="col-12">
<h1 class="mb-4">KVDB Namespace {{ $Namespace }}</h1>
<table class="table" id="kv-list">
<thead>
<tr>
<th scope="col" style="text-align:center;">#</th>
<th scope="col">Key</th>
<th scope="col">Value</th>
<th scope="col">
<form action="/{{ $Api }}//" method="get">
<input type="submit" class="btn btn-success btn-block" name="input" id="return" value="Return" /></th>
</form></th>
<th scope="col">
<form action="/{{ $Api }}/{{ $Namespace }}/" method="get">
<input type="submit" class="btn btn-primary btn-block" name="input" id="refresh" value="Refresh" /></th>
</form>
<th scope="col">
<form action="/{{ $Api }}/{{ $Namespace }}/" method="post" >
<input type="hidden" name="namespace" value="{{ $Namespace }}" />
<input type="submit" class="btn btn-danger btn-block" name="input" id="delete" value="Delete" onclick="return confirm('Are you sure?')" {{if .System }}disabled{{ else }}{{end}}/>
</form>
</th>
</tr>
</thead>
<tbody>
{{ range .Items }}
<form action="/{{ $Api }}/{{ $Namespace }}/" method="post">
<tr>
<th scope="row">
<input type="text" name="id" id="id-input" class="form-control no-border" value="{{ .Id }}" maxlength="2" size="2" readonly/>
</th>
<td>
<input type="text" name="key" id="key-input" class="form-control" value="{{ .Key }}" maxlength="32" size="42" {{if .ReadOnly }}readonly{{ else }}{{end}}/>
</td>
<td>
<textarea type="text" name="value" id="value-input" rows="{{ .Lines }}" cols="100" maxlength="21800" class="form-control" style="text-align:left" {{if .ReadOnly }}readonly{{ else }}{{end}}>{{ .Value }}</textarea>
</td>
<td>
<input type="submit" class="btn btn-success btn-block" name="input" id="update" value="Update" {{if .ReadOnly }}disabled{{ else }}{{end}}/>
</td>
<td>
<input type="submit" class="btn btn-primary btn-block" name="input" id="roll" value="Roll" {{if .ReadOnly }}disabled{{ else }}{{end}}/>
</td>
<td>
<input type="submit" class="btn btn-danger btn-block" name="input" id="delete" value="Delete" onclick="return confirm('Are you sure?')" {{if .ReadOnly }}disabled{{ else }}{{end}}/>
</td>
</tr>
</form>
{{ end }}
</tbody>
<tbody>
<form action="/{{ $Api }}/{{ $Namespace }}/" method="post">
<tr>
<th scope="row">
<input type="text" name="id" id="id-input" class="form-control no-border" value="+" maxlength="2" size="2" readonly/>
</th>
<td>
<input type="text" name="key" id="key-input" maxlength="32" size="42" class="form-control"/>
</td>
<td>
<textarea type="text" name="value" id="value-input" rows="1" cols="50" maxlength="21800" class="form-control" style="text-align:left"></textarea>
</td>
<td>
<input type="submit" class="btn btn-success btn-block" name="input" id="create" value="Create" />
</td>
<td>
<input type="submit" class="btn btn-primary btn-block" name="input" id="generate" value="Generate" />
</td>
<td>
</td>
</tr>
</form>
</tbody>
</table>
</div>
</div>
</body>
</html>