mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
WebClient: make the keep alive interval configurable
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -145,6 +145,7 @@ type filesPage struct {
|
|||||||
Error *util.I18nError
|
Error *util.I18nError
|
||||||
Paths []dirMapping
|
Paths []dirMapping
|
||||||
QuotaUsage *userQuotaUsage
|
QuotaUsage *userQuotaUsage
|
||||||
|
KeepAliveInterval int
|
||||||
}
|
}
|
||||||
|
|
||||||
type shareLoginPage struct {
|
type shareLoginPage struct {
|
||||||
@@ -781,6 +782,7 @@ func (s *httpdServer) renderSharedFilesPage(w http.ResponseWriter, r *http.Reque
|
|||||||
CanCopy: false,
|
CanCopy: false,
|
||||||
Paths: getDirMapping(dirName, currentURL),
|
Paths: getDirMapping(dirName, currentURL),
|
||||||
QuotaUsage: newUserQuotaUsage(&dataprovider.User{}),
|
QuotaUsage: newUserQuotaUsage(&dataprovider.User{}),
|
||||||
|
KeepAliveInterval: int(cookieRefreshThreshold / time.Millisecond),
|
||||||
}
|
}
|
||||||
renderClientTemplate(w, templateClientFiles, data)
|
renderClientTemplate(w, templateClientFiles, data)
|
||||||
}
|
}
|
||||||
@@ -837,6 +839,7 @@ func (s *httpdServer) renderFilesPage(w http.ResponseWriter, r *http.Request, di
|
|||||||
ShareUploadBaseURL: "",
|
ShareUploadBaseURL: "",
|
||||||
Paths: getDirMapping(dirName, webClientFilesPath),
|
Paths: getDirMapping(dirName, webClientFilesPath),
|
||||||
QuotaUsage: newUserQuotaUsage(user),
|
QuotaUsage: newUserQuotaUsage(user),
|
||||||
|
KeepAliveInterval: int(cookieRefreshThreshold / time.Millisecond),
|
||||||
}
|
}
|
||||||
renderClientTemplate(w, templateClientFiles, data)
|
renderClientTemplate(w, templateClientFiles, data)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -263,6 +263,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||||||
"mscgen", "mscin", "msc", "xu", "msgenny", "wat", "wast", "env"];
|
"mscgen", "mscin", "msc", "xu", "msgenny", "wat", "wast", "env"];
|
||||||
const supportedEditFilenames = ["readme", "dockerfile", "pkgbuild"];
|
const supportedEditFilenames = ["readme", "dockerfile", "pkgbuild"];
|
||||||
//{{- end}}
|
//{{- end}}
|
||||||
|
const keepAliveInterval = '{{.KeepAliveInterval}}';
|
||||||
function keepAlive() {
|
function keepAlive() {
|
||||||
//{{- if not .ShareUploadBaseURL}}
|
//{{- if not .ShareUploadBaseURL}}
|
||||||
axios.get('{{.PingURL}}',{
|
axios.get('{{.PingURL}}',{
|
||||||
@@ -1974,7 +1975,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||||||
|
|
||||||
function uploadFiles(files) {
|
function uploadFiles(files) {
|
||||||
keepAlive();
|
keepAlive();
|
||||||
let keepAliveTimer = setInterval(keepAlive, 300000);
|
let keepAliveTimer = setInterval(keepAlive, keepAliveInterval);
|
||||||
|
|
||||||
let has_errors = false;
|
let has_errors = false;
|
||||||
let index = 0;
|
let index = 0;
|
||||||
@@ -2189,7 +2190,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||||||
$("#video_player").get(0).load();
|
$("#video_player").get(0).load();
|
||||||
$('#modal_video_player').modal('show');
|
$('#modal_video_player').modal('show');
|
||||||
keepAlive();
|
keepAlive();
|
||||||
playerKeepAlive = setInterval(keepAlive, 300000);
|
playerKeepAlive = setInterval(keepAlive, keepAliveInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on("i18nshow", function(){
|
$(document).on("i18nshow", function(){
|
||||||
|
|||||||
Reference in New Issue
Block a user