/
list.html
94 lines (88 loc) · 3.3 KB
/
list.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
{{- $ctl := .control -}} {{- $showLocation := .loc -}} {{- $share := .share -}}
<!doctype html>
<html>
<head>
<title>{{ .title }}</title>
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="stylesheet" href="/css/list.css" />
<script src="/js/clipboard.min.js"></script>
</head>
<body>
<div class="table ver3 m-b-110">
<div class="table-head">
<table>
<thead>
<tr class="row100 head">
<th class="cell100 column1">Container ID</th>
<th class="cell100 column2">Image</th>
<th class="cell100 column3">Command</th>
<th class="cell100 column4">Name</th>
<th class="cell100 column5">IP</th>
{{- if $showLocation }}
<th class="cell100 column6">Location</th>
{{- end }}
<th class="cell100 column7">Status</th>
{{- if $ctl.Enable }}
<th class="cell100 column8">Actions</th>
{{- end -}}
</tr>
</thead>
</table>
</div>
<div class="table-body">
<table>
<tbody>
{{ range .containers }}
<tr class="row100 body">
<td class="cell100 column1" title="exec into container">
<a href="/exec/{{ printf "%.12s" .ID }}" target="_blank">{{ printf "%.12s" .ID }}</a>
</td>
{{- if $share -}}
<td class="cell100 column2" title="{{ .Image }} | share tty">
<a href="#" class="copy" data-clipboard-text="/share/{{ printf "%.12s" .ID }}">{{ printf .Image }}</a>
</td>
{{- else -}}
<td class="cell100 column2" title="{{ .Image }}">
{{ printf .Image }}
</td>
{{- end -}}
<td class="cell100 column3" title="{{ .Command }}">{{ printf .Command }}</td>
<td class="cell100 column4" title="{{ .Name }}">
<a href="/logs/{{ printf "%.12s" .ID }}?follow=1&tail=10" target="_blank" title="get logs">{{ printf .Name }}</a>
</td>
<td class="cell100 column5" title="{{ .IPs }}">{{ index .IPs 0 }}</td>
{{- if $showLocation -}}
<td class="cell100 column6" title="{{ .LocServer }}">{{ printf .LocServer }}</td>
{{- end -}}
<td class="cell100 column7" title="{{ .Status }}">{{ .State }}</td>
{{ if $ctl.Enable -}}
<td class="cell100 column8">
{{ if or $ctl.Start $ctl.All }}
<button title="start">Start</button>{{ end }} {{ if or $ctl.Stop $ctl.All }}
<button title="stop">Stop</button>{{ end }} {{ if or $ctl.Restart $ctl.All}}
<button title="restart">Restart</button>{{ end }}
</td>
{{ end -}}
</tr>
{{ end }}
</tbody>
</table>
</div>
</div>
<script src="/js/control.js"></script>
<script>
var clipboard = new ClipboardJS('.copy', {
text: function (trigger) {
return trigger.baseURI.replace('/#','') + trigger.getAttribute('data-clipboard-text');
}
});
clipboard.on('success', function (e) {
console.info('Action:', e.action);
console.info('Text:', e.text);
console.info('Trigger:', e.trigger);
e.clearSelection();
alert("share link ("+e.text+") copied!");
});
</script>
</body>
</html>