Sfoglia il codice sorgente

Add Rescan button to repositories

Jakob Borg 11 anni fa
parent
commit
50f0097843
4 ha cambiato i file con 7 aggiunte e 5 eliminazioni
  1. 0 0
      auto/gui.files.go
  2. 5 5
      gui/app.js
  3. 1 0
      gui/index.html
  4. 1 0
      gui/lang-en.json

File diff suppressed because it is too large
+ 0 - 0
auto/gui.files.go


+ 5 - 5
gui/app.js

@@ -755,8 +755,6 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate, $loca
         cfg.APIKey = randomString(30, 32);
     };
 
-
-
     $scope.acceptUR = function () {
         $scope.config.Options.URAccepted = 1000; // Larger than the largest existing report version
         $scope.saveConfig();
@@ -794,9 +792,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate, $loca
     };
 
     $scope.override = function (repo) {
-        $http.post(urlbase + "/model/override?repo=" + encodeURIComponent(repo)).success(function () {
-            $scope.refresh();
-        });
+        $http.post(urlbase + "/model/override?repo=" + encodeURIComponent(repo));
     };
 
     $scope.about = function () {
@@ -807,6 +803,10 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate, $loca
         $scope.reportPreview = true;
     };
 
+    $scope.rescanRepo = function (repo) {
+        $http.post(urlbase + "/scan?repo=" + encodeURIComponent(repo));
+    };
+
     $scope.init();
     setInterval($scope.refresh, 10000);
 });

+ 1 - 0
gui/index.html

@@ -230,6 +230,7 @@
                   </table>
                 </div>
                 <span class="pull-right">
+                  <a class="btn btn-sm btn-default" href="" ng-show="repoStatus(repo.ID) == 'idle'" ng-click="rescanRepo(repo.ID)"><span class="glyphicon glyphicon-refresh"></span>&emsp;<span translate>Rescan</span></a>
                   <a class="btn btn-sm btn-primary" href="" ng-click="editRepo(repo)"><span class="glyphicon glyphicon-pencil"></span>&emsp;<span translate>Edit</span></a>
                   <a class="btn btn-sm btn-danger" ng-if="repo.ReadOnly && model[repo.ID].needFiles > 0" ng-click="override(repo.ID)" href=""><span class="glyphicon glyphicon-upload"></span>&emsp;<span translate>Override Changes</span></a>
                 </span>

+ 1 - 0
gui/lang-en.json

@@ -64,6 +64,7 @@
    "Repository ID": "Repository ID",
    "Repository Master": "Repository Master",
    "Repository Path": "Repository Path",
+   "Rescan": "Rescan",
    "Rescan Interval (s)": "Rescan Interval (s)",
    "Restart": "Restart",
    "Restart Needed": "Restart Needed",

Some files were not shown because too many files changed in this diff