From 20aa53486a2d5704f90baf8c04d826d01a861382 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sun, 13 May 2018 09:58:00 +0200 Subject: [PATCH] all: Serialize folder types to new names (#4942) It's been a year and a half since we started accepting the new names. It's time we start producing them. --- cmd/syncthing/usage_report.go | 10 +++++++--- gui/default/index.html | 11 +++++------ gui/default/syncthing/core/syncthingController.js | 2 +- gui/default/syncthing/folder/editFolderModalView.html | 6 +++--- lib/config/foldertype.go | 4 ++-- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/cmd/syncthing/usage_report.go b/cmd/syncthing/usage_report.go index f7db1c362..0ff02dcbb 100644 --- a/cmd/syncthing/usage_report.go +++ b/cmd/syncthing/usage_report.go @@ -79,7 +79,8 @@ func reportData(cfg configIntf, m modelIntf, connectionsService connectionsIntf, var rescanIntvs []int folderUses := map[string]int{ - "readonly": 0, + "sendonly": 0, + "sendreceive": 0, "ignorePerms": 0, "ignoreDelete": 0, "autoNormalize": 0, @@ -91,8 +92,11 @@ func reportData(cfg configIntf, m modelIntf, connectionsService connectionsIntf, for _, cfg := range cfg.Folders() { rescanIntvs = append(rescanIntvs, cfg.RescanIntervalS) - if cfg.Type == config.FolderTypeSendOnly { - folderUses["readonly"]++ + switch cfg.Type { + case config.FolderTypeSendOnly: + folderUses["sendonly"]++ + case config.FolderTypeSendReceive: + folderUses["sendreceive"]++ } if cfg.IgnorePerms { folderUses["ignorePerms"]++ diff --git a/gui/default/index.html b/gui/default/index.html index 5af082b9a..7175d34d9 100644 --- a/gui/default/index.html +++ b/gui/default/index.html @@ -274,7 +274,7 @@

@@ -358,11 +358,10 @@ {{model[folder.id].pullErrors | alwaysNumber | localeNumber}} items - +  Folder Type - Send Only - {{ folder.type.charAt(0).toUpperCase() + folder.type.slice(1) }} + Send Only @@ -435,7 +434,7 @@ {{folderStats[folder.id].lastScan | date:'yyyy-MM-dd HH:mm:ss'}} - +  Latest Change @@ -449,7 +448,7 @@
diff --git a/lib/config/foldertype.go b/lib/config/foldertype.go index a68c461ca..1c82bb42d 100644 --- a/lib/config/foldertype.go +++ b/lib/config/foldertype.go @@ -16,9 +16,9 @@ const ( func (t FolderType) String() string { switch t { case FolderTypeSendReceive: - return "readwrite" + return "sendreceive" case FolderTypeSendOnly: - return "readonly" + return "sendonly" default: return "unknown" }