diff --git a/sftpd/sftpd_test.go b/sftpd/sftpd_test.go index 9c656f5a..82ef6f3b 100644 --- a/sftpd/sftpd_test.go +++ b/sftpd/sftpd_test.go @@ -2944,7 +2944,9 @@ func TestBandwidthAndConnections(t *testing.T) { } err = <-c assert.Error(t, err, "connection closed while uploading: the upload must fail") - assert.Eventually(t, func() bool { return len(common.Connections.GetStats()) == 0 }, 1*time.Second, 50*time.Millisecond) + assert.Eventually(t, func() bool { + return len(common.Connections.GetStats()) == 0 + }, 10*time.Second, 200*time.Millisecond) err = os.Remove(testFilePath) assert.NoError(t, err) err = os.Remove(localDownloadPath) diff --git a/templates/connections.html b/templates/connections.html index 2d970ab1..4bc235f9 100644 --- a/templates/connections.html +++ b/templates/connections.html @@ -13,12 +13,12 @@
-{{if .Connections}}
- Status: {{ if .Status.SSH.IsActive}}"Started"{{else}}"Stopped"{{end}}
- {{if .Status.SSH.IsActive}}
-
- {{range .Status.SSH.Bindings}}
-
- Address: "{{.GetAddress}}" {{if .HasProxy}}Proxy: ON{{end}}
-
- {{end}}
- Accepted commands: "{{.Status.SSH.GetSSHCommandsAsString}}"
-
- {{range .Status.SSH.HostKeys}}
-
- Host Key: "{{.Path}}"
-
- Fingerprint: "{{.Fingerprint}}"
-
- {{end}}
- {{end}}
-
- Status: {{ if .Status.FTP.IsActive}}"Started"{{else}}"Stopped"{{end}}
- {{if .Status.FTP.IsActive}}
-
- {{range .Status.FTP.Bindings}}
-
- Address: "{{.GetAddress}}" {{if .HasProxy}}Proxy: ON{{end}}
-
- TLS: "{{.GetTLSDescription}}"
- {{if .ForcePassiveIP}}
-
- PassiveIP: {{.ForcePassiveIP}}
- {{end}}
-
- {{end}}
-
- Passive port range: "{{.Status.FTP.PassivePortRange.Start}}-{{.Status.FTP.PassivePortRange.End}}"
- {{end}}
-
+ Status: {{ if .Status.SSH.IsActive}}"Started"{{else}}"Stopped"{{end}}
+ {{if .Status.SSH.IsActive}}
+
+ {{range .Status.SSH.Bindings}}
+
+ Address: "{{.GetAddress}}" {{if .HasProxy}}Proxy: ON{{end}}
+
+ {{end}}
+ Accepted commands: "{{.Status.SSH.GetSSHCommandsAsString}}"
+
+ {{range .Status.SSH.HostKeys}}
+
+ Host Key: "{{.Path}}"
+
+ Fingerprint: "{{.Fingerprint}}"
+
+ {{end}}
+ {{end}}
+
- Status: {{ if .Status.WebDAV.IsActive}}"Started"{{else}}"Stopped"{{end}}
- {{if .Status.WebDAV.IsActive}}
-
- {{range .Status.WebDAV.Bindings}}
-
- Address: "{{.GetAddress}}"
-
- Protocol: {{if .EnableHTTPS}} HTTPS {{else}} HTTP {{end}}
-
- {{end}}
- {{end}}
-
+ Status: {{ if .Status.FTP.IsActive}}"Started"{{else}}"Stopped"{{end}}
+ {{if .Status.FTP.IsActive}}
+
+ {{range .Status.FTP.Bindings}}
+
+ Address: "{{.GetAddress}}" {{if .HasProxy}}Proxy: ON{{end}}
+
+ TLS: "{{.GetTLSDescription}}"
+ {{if .ForcePassiveIP}}
+
+ PassiveIP: {{.ForcePassiveIP}}
+ {{end}}
+
+ {{end}}
+
+ Passive port range: "{{.Status.FTP.PassivePortRange.Start}}-{{.Status.FTP.PassivePortRange.End}}"
+ {{end}}
+
- Status: {{ if .Status.Defender.IsActive}}"Enabled"{{else}}"Disabled"{{end}} -
-
+ Status: {{ if .Status.WebDAV.IsActive}}"Started"{{else}}"Stopped"{{end}}
+ {{if .Status.WebDAV.IsActive}}
+
+ {{range .Status.WebDAV.Bindings}}
+
+ Address: "{{.GetAddress}}"
+
+ Protocol: {{if .EnableHTTPS}} HTTPS {{else}} HTTP {{end}}
+
+ {{end}}
+ {{end}}
+
+ Status: {{ if .Status.Defender.IsActive}}"Enabled"{{else}}"Disabled"{{end}} +
+
+ Status: {{ if .Status.DataProvider.IsActive}}"OK"{{else}}"{{.Status.DataProvider.Error}}"{{end}}
+
+ Driver: "{{.Status.DataProvider.Driver}}"
+
- Status: {{ if .Status.DataProvider.IsActive}}"OK"{{else}}"{{.Status.DataProvider.Error}}"{{end}}
-
- Driver: "{{.Status.DataProvider.Driver}}"
-