Selaa lähdekoodia

WebClient: add support for more languages to the editor

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
Nicola Murino 1 vuosi sitten
vanhempi
commit
59bdd4bc4e

+ 1 - 1
internal/httpd/httpd.go

@@ -184,7 +184,7 @@ const (
 	MaxRestoreSize       = 20 * 1048576 // 20 MB
 	maxRequestSize       = 1048576      // 1MB
 	maxLoginBodySize     = 262144       // 256 KB
-	httpdMaxEditFileSize = 1048576      // 1 MB
+	httpdMaxEditFileSize = 2 * 1048576  // 2 MB
 	maxMultipartMem      = 10 * 1048576 // 10 MB
 	osWindows            = "windows"
 	otpHeaderCode        = "X-SFTPGO-OTP"

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
static/vendor/codemirror/cm6.bundle.min.js


+ 4 - 1
templates/webclient/editfile.html

@@ -150,8 +150,11 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
     //{{- end}}
 
     KTUtil.onDOMContentLoaded(function () {
+        let filename = "{{.Name}}";
+        let extension = filename.slice((filename.lastIndexOf(".") - 1 >>> 0) + 2).toLowerCase();
         let options = {
-            oneDark: KTThemeMode.getMode() == "dark"
+            oneDark: KTThemeMode.getMode() == "dark",
+            fileExt: extension
         };
         //{{- if .ReadOnly}}
         options.readOnly = true;

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä