-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Index.cshtml
189 lines (164 loc) · 6.9 KB
/
Index.cshtml
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
@using Bit.Admin.Controllers
@model HomeModel
@{
ViewData["Title"] = "Dashboard";
}
@section Scripts {
<script>
(() => {
let loadedWebLatest = false;
let loadedWebInstalled = false;
fetch('@Url.Action("GetLatestVersion", new { project = @ProjectType.Web })').then((response) => {
return response.json();
}).then((version) => {
document.getElementById('web-latest').innerText = version;
loadedWebLatest = true;
if (loadedWebInstalled) {
checkVersions('web', document.getElementById('web-installed').innerText, version);
}
});
fetch('@Url.Action("GetLatestVersion", new { project = @ProjectType.Core })').then((response) => {
return response.json();
}).then((version) => {
document.getElementById('server-latest').innerText = version;
checkVersions('core', '@Model.CurrentVersion', version);
});
fetch('@Url.Action("GetInstalledWebVersion")').then((response) => {
return response.json();
}).then((version) => {
document.getElementById('web-installed').innerText = version;
loadedWebInstalled = true;
if (loadedWebLatest) {
checkVersions('web', version, document.getElementById('web-latest').innerText);
}
});
function checkVersions(platform, installed, latest) {
if (installed === '-' || latest === '-') {
return;
}
if (installed !== latest) {
document.getElementById(platform + '-warning').classList.remove('d-none');
} else {
document.getElementById(platform + '-success').classList.remove('d-none');
}
}
})();
</script>
}
<h1>Dashboard</h1>
<p>Welcome to the Bitwarden System Administration Portal.</p>
<h2>Version</h2>
<div class="row">
<div class="col-md">
<dl class="row">
<dt class="col-sm-5">Server Installed</dt>
<dd class="col-sm-7">
<span id="server-installed">@Model.CurrentVersion</span>
<i class="fa fa-check text-success d-none" id="core-success" title="You are up to date!"></i>
<i class="fa fa-warning text-warning d-none" id="core-warning"
title="This version is not the latest. You should update."></i>
</dd>
<dt class="col-sm-5">Server Latest</dt>
<dd class="col-sm-7">
<span id="server-latest" title="Checking version..."><i class="fa fa-spinner fa-spin"></i></span>
</dd>
<dt class="col-sm-5">Web Installed</dt>
<dd class="col-sm-7">
<span id="web-installed"><i class="fa fa-spinner fa-spin" title="Checking version..."></i></span>
<i class="fa fa-check text-success d-none" id="web-success" title="You are up to date!"></i>
<i class="fa fa-warning text-warning d-none" id="web-warning"
title="This version is not the latest. You should update."></i>
</dd>
<dt class="col-sm-5">Web Latest</dt>
<dd class="col-sm-7">
<span id="web-latest"><i class="fa fa-spinner fa-spin" title="Checking version..."></i></span>
</dd>
</dl>
</div>
<div class="col-md">
<ul class="list-unstyled">
<li><a href="https://github.com/bitwarden/server/releases" target="_blank" rel="noreferrer">Check for Server
updates</a></li>
<li><a href="https://github.com/bitwarden/clients/releases" target="_blank" rel="noreferrer">Check for Web
updates</a></li>
<li><a href="https://help.bitwarden.com/article/updating-on-premise/" target="_blank" rel="noreferrer">How
do I update?</a></li>
</ul>
</div>
</div>
<h2>Settings</h2>
<h3>SMTP</h3>
@if(!Bit.Core.Utilities.CoreHelpers.SettingHasValue(Model.GlobalSettings.Mail?.Smtp?.Host))
{
<p class="text-body-secondary">Not configured</p>
}
else
{
<dl class="row">
<dt class="col-sm-4 col-lg-3">Host</dt>
<dd class="col-sm-8 col-lg-9">
@(string.IsNullOrWhiteSpace(Model.GlobalSettings.Mail.Smtp.Host) ? "-" : Model.GlobalSettings.Mail.Smtp.Host)
</dd>
<dt class="col-sm-4 col-lg-3">Port</dt>
<dd class="col-sm-8 col-lg-9">@Model.GlobalSettings.Mail.Smtp.Port</dd>
<dt class="col-sm-4 col-lg-3">SSL</dt>
<dd class="col-sm-8 col-lg-9">@(Model.GlobalSettings.Mail.Smtp.Ssl ? "Yes" : "No")</dd>
<dt class="col-sm-4 col-lg-3">StartTLS</dt>
<dd class="col-sm-8 col-lg-9">
@(Model.GlobalSettings.Mail.Smtp.StartTls ? "Yes" : Model.GlobalSettings.Mail.Smtp.Port == 25 ? "No" : "Discover")
</dd>
<dt class="col-sm-4 col-lg-3">Username</dt>
<dd class="col-sm-8 col-lg-9">
@(string.IsNullOrWhiteSpace(Model.GlobalSettings.Mail.Smtp.Username) ? "-" : Model.GlobalSettings.Mail.Smtp.Username)
</dd>
</dl>
}
<h3>Other</h3>
<dl class="row">
<dt class="col-sm-4 col-lg-3">Installation Id</dt>
<dd class="col-sm-8 col-lg-9">
@if(Model.GlobalSettings.Installation?.Id != null)
{
<code>@Model.GlobalSettings.Installation.Id</code>
}
else
{
<text>-</text>
}
</dd>
<dt class="col-sm-4 col-lg-3">User Registration</dt>
<dd class="col-sm-8 col-lg-9">@(Model.GlobalSettings.DisableUserRegistration ? "Disabled" : "Enabled")</dd>
<dt class="col-sm-4 col-lg-3">Push Notifications</dt>
<dd class="col-sm-8 col-lg-9">
@if(Bit.Core.Utilities.CoreHelpers.SettingHasValue(Model.GlobalSettings.PushRelayBaseUri))
{
<span><i class="fa fa-check"></i> Configured</span>
}
else
{
<span class="text-body-secondary">Not configured</span>
}
</dd>
<dt class="col-sm-4 col-lg-3">Yubico 2FA</dt>
<dd class="col-sm-8 col-lg-9">
@if(Bit.Core.Utilities.CoreHelpers.SettingHasValue(Model.GlobalSettings.Yubico?.Key) && Bit.Core.Utilities.CoreHelpers.SettingHasValue(Model.GlobalSettings.Yubico?.ClientId))
{
<span><i class="fa fa-check"></i> Configured</span>
}
else
{
<span class="text-body-secondary">Not configured</span>
}
</dd>
<dt class="col-sm-4 col-lg-3">Duo 2FA</dt>
<dd class="col-sm-8 col-lg-9">
@if(Bit.Core.Utilities.CoreHelpers.SettingHasValue(Model.GlobalSettings.Duo?.AKey))
{
<span><i class="fa fa-check"></i> Configured</span>
}
else
{
<span class="text-body-secondary">Not configured</span>
}
</dd>
</dl>