mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-02 03:48:26 +00:00
Configurable home disk percentage, translations
This commit is contained in:
parent
58f1191f2d
commit
a2df691c7d
@ -93,6 +93,7 @@
|
|||||||
"Major Upgrade": "Major Upgrade",
|
"Major Upgrade": "Major Upgrade",
|
||||||
"Maximum Age": "Maximum Age",
|
"Maximum Age": "Maximum Age",
|
||||||
"Metadata Only": "Metadata Only",
|
"Metadata Only": "Metadata Only",
|
||||||
|
"Minimum Free Disk Space": "Minimum Free Disk Space",
|
||||||
"Move to top of queue": "Move to top of queue",
|
"Move to top of queue": "Move to top of queue",
|
||||||
"Multi level wildcard (matches multiple directory levels)": "Multi level wildcard (matches multiple directory levels)",
|
"Multi level wildcard (matches multiple directory levels)": "Multi level wildcard (matches multiple directory levels)",
|
||||||
"Never": "Never",
|
"Never": "Never",
|
||||||
@ -120,6 +121,7 @@
|
|||||||
"RAM Utilization": "RAM Utilization",
|
"RAM Utilization": "RAM Utilization",
|
||||||
"Random": "Random",
|
"Random": "Random",
|
||||||
"Release Notes": "Release Notes",
|
"Release Notes": "Release Notes",
|
||||||
|
"Remove": "Remove",
|
||||||
"Rescan": "Rescan",
|
"Rescan": "Rescan",
|
||||||
"Rescan All": "Rescan All",
|
"Rescan All": "Rescan All",
|
||||||
"Rescan Interval": "Rescan Interval",
|
"Rescan Interval": "Rescan Interval",
|
||||||
@ -176,6 +178,7 @@
|
|||||||
"The following items could not be synchronized.": "The following items could not be synchronized.",
|
"The following items could not be synchronized.": "The following items could not be synchronized.",
|
||||||
"The maximum age must be a number and cannot be blank.": "The maximum age must be a number and cannot be blank.",
|
"The maximum age must be a number and cannot be blank.": "The maximum age must be a number and cannot be blank.",
|
||||||
"The maximum time to keep a version (in days, set to 0 to keep versions forever).": "The maximum time to keep a version (in days, set to 0 to keep versions forever).",
|
"The maximum time to keep a version (in days, set to 0 to keep versions forever).": "The maximum time to keep a version (in days, set to 0 to keep versions forever).",
|
||||||
|
"The minimum free disk space percentage must be a non-negative number between 0 and 100 (inclusive).": "The minimum free disk space percentage must be a non-negative number between 0 and 100 (inclusive).",
|
||||||
"The number of days must be a number and cannot be blank.": "The number of days must be a number and cannot be blank.",
|
"The number of days must be a number and cannot be blank.": "The number of days must be a number and cannot be blank.",
|
||||||
"The number of days to keep files in the trash can. Zero means forever.": "The number of days to keep files in the trash can. Zero means forever.",
|
"The number of days to keep files in the trash can. Zero means forever.": "The number of days to keep files in the trash can. Zero means forever.",
|
||||||
"The number of old versions to keep, per file.": "The number of old versions to keep, per file.",
|
"The number of old versions to keep, per file.": "The number of old versions to keep, per file.",
|
||||||
|
@ -38,10 +38,10 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group" ng-class="{'has-error': folderEditor.minDiskFreePct.$invalid && folderEditor.minDiskFreePct.$dirty}">
|
<div class="form-group" ng-class="{'has-error': folderEditor.minDiskFreePct.$invalid && folderEditor.minDiskFreePct.$dirty}">
|
||||||
<label for="minDiskFreePct"><span translate>Minimum disk free percentage</span> (0-100)</label>
|
<label for="minDiskFreePct"><span translate>Minimum Free Disk Space</span> (0-100%)</label>
|
||||||
<input name="minDiskFreePct" id="minDiskFreePct" class="form-control" type="number" ng-model="currentFolder.minDiskFreePct" required min="0" max="100"></input>
|
<input name="minDiskFreePct" id="minDiskFreePct" class="form-control" type="number" ng-model="currentFolder.minDiskFreePct" required min="0" max="100"></input>
|
||||||
<p class="help-block">
|
<p class="help-block">
|
||||||
<span translate ng-if="!folderEditor.minDiskFreePct.$valid && folderEditor.minDiskFreePct.$dirty">The minimum disk free percentage must be a non-negative number between 0 and 100 (inclusive).</span>
|
<span translate ng-if="!folderEditor.minDiskFreePct.$valid && folderEditor.minDiskFreePct.$dirty">The minimum free disk space percentage must be a non-negative number between 0 and 100 (inclusive).</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
File diff suppressed because one or more lines are too long
@ -238,6 +238,7 @@ type OptionsConfiguration struct {
|
|||||||
DatabaseBlockCacheMiB int `xml:"databaseBlockCacheMiB" json:"databaseBlockCacheMiB" default:"0"`
|
DatabaseBlockCacheMiB int `xml:"databaseBlockCacheMiB" json:"databaseBlockCacheMiB" default:"0"`
|
||||||
PingTimeoutS int `xml:"pingTimeoutS" json:"pingTimeoutS" default:"30"`
|
PingTimeoutS int `xml:"pingTimeoutS" json:"pingTimeoutS" default:"30"`
|
||||||
PingIdleTimeS int `xml:"pingIdleTimeS" json:"pingIdleTimeS" default:"60"`
|
PingIdleTimeS int `xml:"pingIdleTimeS" json:"pingIdleTimeS" default:"60"`
|
||||||
|
MinHomeDiskFreePct int `xml:"minHomeDiskFreePct" json:"minHomeDiskFreePct" default:"1"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (orig OptionsConfiguration) Copy() OptionsConfiguration {
|
func (orig OptionsConfiguration) Copy() OptionsConfiguration {
|
||||||
|
@ -45,7 +45,6 @@ const (
|
|||||||
indexBatchSize = 1000 // Either way, don't include more files than this
|
indexBatchSize = 1000 // Either way, don't include more files than this
|
||||||
reqValidationTime = time.Hour // How long to cache validation entries for Request messages
|
reqValidationTime = time.Hour // How long to cache validation entries for Request messages
|
||||||
reqValidationCacheSize = 1000 // How many entries to aim for in the validation cache size
|
reqValidationCacheSize = 1000 // How many entries to aim for in the validation cache size
|
||||||
minHomeDiskFreePct = 1.0 // Stop when less space than this is available on the home (config & db) disk
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type service interface {
|
type service interface {
|
||||||
@ -1663,8 +1662,10 @@ func (m *Model) BringToFront(folder, file string) {
|
|||||||
// CheckFolderHealth checks the folder for common errors and returns the
|
// CheckFolderHealth checks the folder for common errors and returns the
|
||||||
// current folder error, or nil if the folder is healthy.
|
// current folder error, or nil if the folder is healthy.
|
||||||
func (m *Model) CheckFolderHealth(id string) error {
|
func (m *Model) CheckFolderHealth(id string) error {
|
||||||
if free, err := osutil.DiskFreePercentage(m.cfg.ConfigPath()); err == nil && free < minHomeDiskFreePct {
|
if minFree := float64(m.cfg.Options().MinHomeDiskFreePct); minFree > 0 {
|
||||||
return errors.New("out of disk space")
|
if free, err := osutil.DiskFreePercentage(m.cfg.ConfigPath()); err == nil && free < minFree {
|
||||||
|
return errors.New("home disk is out of space")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
folder, ok := m.cfg.Folders()[id]
|
folder, ok := m.cfg.Folders()[id]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user