-
Notifications
You must be signed in to change notification settings - Fork 35
/
dashboard.tmpl
138 lines (131 loc) · 6.84 KB
/
dashboard.tmpl
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
{{ define "title" }}{{i18n "AdminDashboardTitle"}}{{ end }}
{{ define "content" }}
<h1
class="text-3xl tracking-tight font-black text-black mt-2 mb-0"
>{{i18n "AdminDashboardTitle"}}</h1>
<div class="flex flex-col-reverse sm:flex-row justify-start items-stretch ">
<div class="sm:mr-4 mt-6 py-6 px-4 border-gray-200 border-2 rounded-3xl flex flex-col justify-start items-start">
<div class="grid grid-rows-2 grid-flow-col gap-x-4 gap-y-0">
{{if gt .OnlineCount 0}}
<div class="row-span-2 w-14 h-14 bg-green-50 rounded flex flex-col justify-center items-center">
<div class="w-3 h-3 bg-green-500 rounded-full relative">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-green-500 opacity-75"></span>
</div>
</div>
{{else}}
<div class="row-span-2 w-14 h-14 bg-gray-100 rounded flex flex-col justify-center items-center">
<div class="w-2 h-2 bg-gray-400 rounded-full"></div>
</div>
{{end}}
<div
id="online-count"
class="col-span-2 font-black text-black text-xl"
>{{.OnlineCount}}</div>
<div class="col-span-2 text-gray-500">Online</div>
</div>
</div>
<div class="sm:mr-4 mt-6 py-6 px-4 border-gray-200 border-2 rounded-3xl flex flex-col justify-start items-start">
<div class="grid grid-rows-2 grid-flow-col gap-x-4 gap-y-0">
<div class="row-span-2 w-14 h-14 bg-purple-50 rounded flex flex-col justify-center items-center">
<svg class="text-purple-600 w-8 h-8" viewBox="0 0 24 24">
<path fill="currentColor" d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,6A2,2 0 0,0 10,8A2,2 0 0,0 12,10A2,2 0 0,0 14,8A2,2 0 0,0 12,6M12,13C14.67,13 20,14.33 20,17V20H4V17C4,14.33 9.33,13 12,13M12,14.9C9.03,14.9 5.9,16.36 5.9,17V18.1H18.1V17C18.1,16.36 14.97,14.9 12,14.9Z" />
</svg>
</div>
<div
id="member-count"
class="col-span-2 font-black text-black text-xl"
>{{.MemberCount}}</div>
<div class="col-span-2 text-gray-500">{{i18n "AdminMembersTitle"}}</div>
</div>
</div>
<div class="sm:mr-4 mt-6 py-6 px-4 border-gray-200 border-2 rounded-3xl flex flex-col justify-start items-start">
<div class="grid grid-rows-2 grid-flow-col gap-x-4 gap-y-0">
<div class="row-span-2 w-14 h-14 bg-purple-50 rounded flex flex-col justify-center items-center">
<svg class="text-purple-600 w-8 h-8" viewBox="0 0 24 24">
<path fill="currentColor" d="M15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4M15,5.9C16.16,5.9 17.1,6.84 17.1,8C17.1,9.16 16.16,10.1 15,10.1A2.1,2.1 0 0,1 12.9,8A2.1,2.1 0 0,1 15,5.9M4,7V10H1V12H4V15H6V12H9V10H6V7H4M15,13C12.33,13 7,14.33 7,17V20H23V17C23,14.33 17.67,13 15,13M15,14.9C17.97,14.9 21.1,16.36 21.1,17V18.1H8.9V17C8.9,16.36 12,14.9 15,14.9Z" />
</svg>
</div>
<div
id="invite-count"
class="col-span-2 font-black text-black text-xl"
>{{.InviteCount}}</div>
<div class="col-span-2 text-gray-500">{{i18n "AdminInvitesTitle"}}</div>
</div>
</div>
<div class="sm:mr-4 mt-6 py-6 px-4 border-gray-200 border-2 rounded-3xl flex flex-col justify-start items-start">
<div class="grid grid-rows-2 grid-flow-col gap-x-4 gap-y-0">
<div class="row-span-2 w-14 h-14 bg-red-50 rounded flex flex-col justify-center items-center">
<svg class="text-red-600 w-6 h-6" viewBox="0 0 24 24">
<path fill="currentColor" d="M12,0A12,12 0 0,1 24,12A12,12 0 0,1 12,24A12,12 0 0,1 0,12A12,12 0 0,1 12,0M12,2A10,10 0 0,0 2,12C2,14.4 2.85,16.6 4.26,18.33L18.33,4.26C16.6,2.85 14.4,2 12,2M12,22A10,10 0 0,0 22,12C22,9.6 21.15,7.4 19.74,5.67L5.67,19.74C7.4,21.15 9.6,22 12,22Z" />
</svg>
</div>
<div
id="denied-count"
class="col-span-2 font-black text-black text-xl"
>{{.DeniedCount}}</div>
<div class="col-span-2 text-gray-500">{{i18n "AdminDeniedKeysTitle"}}</div>
</div>
</div>
</div>
<div class="mb-8">
{{if gt .OnlineCount 0}}
<div class="ml-11 h-8 w-0.5 bg-gray-200"></div>
{{end}}
{{range .OnlineRefs}}
<div class="ml-11 h-8 w-0.5 bg-gray-200"></div>
<div class="ml-11 relative h-3">
<div class="absolute inline-flex w-3 h-3 bg-green-500 rounded-full -left-1 -ml-px"></div>
<div class="absolute w-44 sm:w-auto -top-1.5 ml-5 pl-1 font-mono truncate flex-auto text-gray-700">{{.}}</div>
</div>
{{end}}
</div>
<div class="max-w-lg">
<h2 class="text-xl tracking-tight font-bold text-black mt-2 mb-2">{{i18n "PrivacyModesTitle"}}</h2>
<p class="mb-4">
{{ i18n "ExplanationPrivacyModes" }}
<a class="text-pink-600 underline" href="https://ssb-ngi-pointer.github.io/rooms2/#privacy-modes">{{ i18n "RoomsSpecification" }}</a>.
</p>
<h3 class="text-gray-400 text-sm font-bold mb-2">{{ i18n "SetPrivacyModeTitle" }}</h3>
<details class="mb-8 self-start w-96" id="change-privacy">
<summary class="px-3 py-1 w-96 rounded shadow bg-white ring-1 ring-gray-300 hover:bg-gray-100 cursor-pointer">
{{ i18n .CurrentMode.String }}
</summary>
<div class="absolute w-96 z-10 bg-white mt-2 shadow-xl ring-1 ring-gray-200 rounded divide-y flex flex-col items-stretch overflow-hidden">
{{ range .PrivacyModes }}
{{ if ne . $.CurrentMode }}
<form
action="{{urlTo "admin:dashboard:set-privacy" }}"
method="POST"
>
{{$.csrfField}}
<input type="hidden" name="privacy_mode" value="{{.}}">
<input
type="submit"
value="{{ i18n .String }}"
class="pl-10 pr-3 py-2 w-full text-left bg-white text-gray-700 hover:text-gray-900 hover:bg-gray-50 cursor-pointer"
/>
</form>
{{ else }}
<div class="pr-3 py-2 text-gray-600 flex flex-row items-center cursor-default">
<div class="w-10 flex flex-row items-center justify-center">
<svg class="w-4 h-4" viewBox="0 0 24 24">
<path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" />
</svg>
</div>
<span>{{ i18n .String }}</span>
</div>
{{end}}
{{end}}
</div>
</details>
<div class="grid max-w-lg grid-cols-3 gap-y-2 mb-8">
<div class="text-xl text-gray-500 font-bold">Open</div>
<div class="text-md col-span-2 italic">{{ i18n "ExplanationOpen" }}</div>
<div class="text-xl text-gray-500 font-bold">Community</div>
<div class="text-md col-span-2 italic">{{ i18n "ExplanationCommunity" }}</div>
<div class="text-xl text-gray-500 font-bold">Restricted</div>
<div class="text-md col-span-2 italic">{{ i18n "ExplanationRestricted" }}</div>
</div>
</div>
</div>
{{end}}