浏览代码

/rest/errors should return an object (fixes #695)

Jakob Borg 11 年之前
父节点
当前提交
37a473e7d6
共有 3 个文件被更改,包括 2 次插入2 次删除
  1. 0 0
      auto/gui.files.go
  2. 1 1
      cmd/syncthing/gui.go
  3. 1 1
      gui/app.js

文件差异内容过多而无法显示
+ 0 - 0
auto/gui.files.go


+ 1 - 1
cmd/syncthing/gui.go

@@ -430,7 +430,7 @@ func restGetSystem(w http.ResponseWriter, r *http.Request) {
 func restGetErrors(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Content-Type", "application/json; charset=utf-8")
 	guiErrorsMut.Lock()
-	json.NewEncoder(w).Encode(guiErrors)
+	json.NewEncoder(w).Encode(map[string][]guiError{"errors": guiErrors})
 	guiErrorsMut.Unlock()
 }
 

+ 1 - 1
gui/app.js

@@ -356,7 +356,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate, $loca
 
     function refreshErrors() {
         $http.get(urlbase + '/errors').success(function (data) {
-            $scope.errors = data;
+            $scope.errors = data.errors;
             console.log("refreshErrors", data);
         });
     }

部分文件因为文件数量过多而无法显示