Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui: Add detailed file versioning information to folder info (ref #963) #8348

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions gui/default/assets/lang/lang-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
22 changes: 16 additions & 6 deletions gui/default/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -522,12 +522,22 @@ <h4 class="panel-title">
</td>
</tr>
<tr ng-if="folder.versioning.type">
<th><span class="far fa-fw fa-copy"></span>&nbsp;<span translate>File Versioning</span></th>
<td class="text-right" ng-switch="folder.versioning.type">
<span ng-switch-when="trashcan" translate>Trash Can File Versioning</span>
<span ng-switch-when="staggered" translate>Staggered File Versioning</span>
<span ng-switch-when="simple" translate>Simple File Versioning</span>
<span ng-switch-when="external" translate>External File Versioning</span>
<th><span class="fa fa-fw fa-file"></span>&nbsp;<span translate>File Versioning</span></th>
<td class="text-right">
<span ng-switch="folder.versioning.type">
<span ng-switch-when="trashcan" translate>Trash Can</span>
<span ng-switch-when="simple" translate>Simple</span>
<span ng-switch-when="staggered" translate>Staggered</span>
<span ng-switch-when="external" tooltip data-original-title="<span class='text-monospace'>{{folder.versioning.params.command}}</span>" translate>External</span>
</span>
<span ng-if="folder.versioning.type != 'external'">
<span ng-if="(folder.versioning.type == 'trashcan' || folder.versioning.type == 'simple') && folder.versioning.params.cleanoutDays != versioningDefaults.trashcanClean" tooltip data-original-title="{{'Clean out after' | translate}}">&ensp;<span class="fa fa-calendar"></span>&nbsp;{{folder.versioning.params.cleanoutDays * 86400 | duration:"d"}}</span>
<span ng-if="folder.versioning.type == 'simple' && folder.versioning.params.keep != versioningDefaults.simpleKeep" tooltip data-original-title="{{'Keep Versions' | translate}}">&ensp;<span class="fa fa-file-archive-o"></span>&nbsp;{{folder.versioning.params.keep}}</span>
<span ng-if="folder.versioning.type == 'staggered' && folder.versioning.params.maxAge != versioningDefaults.staggeredMaxAge" tooltip data-original-title="{{'Maximum Age' | translate}}">&ensp;<span class="fa fa-calendar"></span>&nbsp;{{folder.versioning.params.maxAge | duration}}</span>
<span ng-if="folder.versioning.cleanupIntervalS != versioningDefaults.cleanupIntervalS" tooltip data-original-title="{{'Cleanup Interval' | translate}}">&ensp;<span class="fa fa-recycle"></span>&nbsp;<span ng-if="folder.versioning.cleanupIntervalS == 0" translate>Disabled</span><span ng-if="folder.versioning.cleanupIntervalS > 0">{{folder.versioning.cleanupIntervalS | duration}}</span></span>
<!-- Keep the path last, so that it truncates without pushing other information out of the screen. -->
<span ng-if="folder.versioning.fsPath != ''" tooltip data-original-title="{{folder.versioning.fsPath}}">&ensp;<span class="fa fa-folder-open-o"></span>&nbsp;{{folder.versioning.fsPath}}</span>
tomasz1986 marked this conversation as resolved.
Show resolved Hide resolved
</span>
</td>
</tr>
<tr>
Expand Down
6 changes: 5 additions & 1 deletion gui/default/syncthing/core/durationFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ angular.module('syncthing.core')
var t = (input / SECONDS_IN[k] | 0); // Math.floor

if (t > 0) {
result += " " + t + k;
tomasz1986 marked this conversation as resolved.
Show resolved Hide resolved
if (!result) {
result = t + k;
} else {
result += " " + t + k;
}
}

if (precision == k) {
Expand Down