history snaphost time interval is now configurable in settings

This commit is contained in:
azivner
2017-09-24 20:50:14 -04:00
parent 08064b181d
commit c12161feba
4 changed files with 39 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ function displaySettings() {
type: 'GET',
success: function (result) {
$("#encryptionTimeoutInSeconds").val(result['encryption_session_timeout']);
$("#historySnapshotTimeIntervalInSeconds").val(result['history_snapshot_time_interval']);
},
error: () => alert("Error getting settings.")
});
@@ -78,5 +79,25 @@ $("#encryptionTimeoutForm").submit(() => {
error: () => alert("Error occurred during changing encryption timeout.")
});
return false;
});
$("#historySnapshotTimeIntervalForm").submit(() => {
const historySnapshotTimeInterval = $("#historySnapshotTimeIntervalInSeconds").val();
$.ajax({
url: baseUrl + 'settings',
type: 'POST',
data: JSON.stringify({
name: 'history_snapshot_time_interval',
value: historySnapshotTimeInterval
}),
contentType: "application/json",
success: function () {
alert("History snapshot time interval has been changed.");
},
error: () => alert("Error occurred during changing history snapshot time interval.")
});
return false;
});