From de2d7c33a3cac59e9061fe655cb7d60cc8218131 Mon Sep 17 00:00:00 2001 From: tomasz1986 Date: Sat, 28 May 2022 13:46:15 +0200 Subject: [PATCH] gui: Add detailed file versioning information to folder info (ref #963) (#8348) --- gui/default/assets/lang/lang-en.json | 4 +++ gui/default/index.html | 32 ++++++++++++++++---- gui/default/syncthing/core/durationFilter.js | 6 +++- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/gui/default/assets/lang/lang-en.json b/gui/default/assets/lang/lang-en.json index d213d3cf0..431218b1a 100644 --- a/gui/default/assets/lang/lang-en.json +++ b/gui/default/assets/lang/lang-en.json @@ -130,6 +130,7 @@ "Enter ignore patterns, one per line.": "Enter ignore patterns, one per line.", "Enter up to three octal digits.": "Enter up to three octal digits.", "Error": "Error", + "External": "External", "External File Versioning": "External File Versioning", "Failed Items": "Failed Items", "Failed to load file versions.": "Failed to load file versions.", @@ -318,6 +319,7 @@ "Shown instead of Device ID in the cluster status. Will be updated to the name the device advertises if left empty.": "Shown instead of Device ID in the cluster status. Will be updated to the name the device advertises if left empty.", "Shutdown": "Shutdown", "Shutdown Complete": "Shutdown Complete", + "Simple": "Simple", "Simple File Versioning": "Simple File Versioning", "Single level wildcard (matches within a directory only)": "Single level wildcard (matches within a directory only)", "Size": "Size", @@ -329,6 +331,7 @@ "Stable releases and release candidates": "Stable releases and release candidates", "Stable releases are delayed by about two weeks. During this time they go through testing as release candidates.": "Stable releases are delayed by about two weeks. During this time they go through testing as release candidates.", "Stable releases only": "Stable releases only", + "Staggered": "Staggered", "Staggered File Versioning": "Staggered File Versioning", "Start Browser": "Start Browser", "Statistics": "Statistics", @@ -395,6 +398,7 @@ "Time": "Time", "Time the item was last modified": "Time the item was last modified", "Today": "Today", + "Trash Can": "Trash Can", "Trash Can File Versioning": "Trash Can File Versioning", "Twitter": "Twitter", "Type": "Type", diff --git a/gui/default/index.html b/gui/default/index.html index 6178f75aa..a9fd9ee6d 100644 --- a/gui/default/index.html +++ b/gui/default/index.html @@ -522,12 +522,32 @@ -  File Versioning - - Trash Can File Versioning - Staggered File Versioning - Simple File Versioning - External File Versioning +  File Versioning + + + Trash Can + Simple + Staggered + External + + + +   {{folder.versioning.params.cleanoutDays * 86400 | duration:"d"}} + + +   {{folder.versioning.params.keep}} + + +   {{folder.versioning.params.maxAge | duration}} + + +   Disabled{{folder.versioning.cleanupIntervalS | duration}} + + + +   {{folder.versioning.fsPath}} + + diff --git a/gui/default/syncthing/core/durationFilter.js b/gui/default/syncthing/core/durationFilter.js index bd72f4c3e..dc73d3b58 100644 --- a/gui/default/syncthing/core/durationFilter.js +++ b/gui/default/syncthing/core/durationFilter.js @@ -21,7 +21,11 @@ angular.module('syncthing.core') var t = (input / SECONDS_IN[k] | 0); // Math.floor if (t > 0) { - result += " " + t + k; + if (!result) { + result = t + k; + } else { + result += " " + t + k; + } } if (precision == k) {