Просмотр исходного кода

Fixed gist loading, saving will require registration of your domain

Rashid Khan 13 лет назад
Родитель
Сommit
30f036ad3e
1 измененных файлов с 4 добавлено и 6 удалено
  1. 4 6
      panels/dashcontrol/module.js

+ 4 - 6
panels/dashcontrol/module.js

@@ -5,7 +5,7 @@ angular.module('kibana.dashcontrol', [])
   var _d = {
   var _d = {
     group   : "default",
     group   : "default",
     save : {
     save : {
-      gist: true,
+      gist: false,
       elasticsearch: true,
       elasticsearch: true,
       local: true,
       local: true,
       'default': true
       'default': true
@@ -209,12 +209,10 @@ angular.module('kibana.dashcontrol', [])
   }
   }
 
 
   $scope.gist_dblist = function(id) {
   $scope.gist_dblist = function(id) {
-    $http({
-    url: "https://api.github.com/gists/"+id,
-    method: "GET"
-    }).success(function(data, status, headers, config) {
+    $http.jsonp("https://api.github.com/gists/"+id+"?callback=JSON_CALLBACK"
+    ).success(function(response) {
       $scope.gist.files = []
       $scope.gist.files = []
-      _.each(data.files,function(v,k) {
+      _.each(response.data.files,function(v,k) {
         try {
         try {
           var file = JSON.parse(v.content)
           var file = JSON.parse(v.content)
           $scope.gist.files.push(file)
           $scope.gist.files.push(file)