diff --git a/src/app/controllers/dashLoader.js b/src/app/controllers/dashLoader.js index 303e889b2c1..87f9aa4454e 100644 --- a/src/app/controllers/dashLoader.js +++ b/src/app/controllers/dashLoader.js @@ -97,28 +97,6 @@ function (angular, _, moment) { window.saveAs(blob, $scope.dashboard.title + '-' + new Date().getTime()); }; - $scope.save_gist = function() { - $scope.dashboard.save_gist($scope.gist.title).then(function(link) { - if (!_.isUndefined(link)) { - $scope.gist.last = link; - alertSrv.set('Gist saved','You will be able to access your exported dashboard file at '+ - ''+link+' in a moment','success'); - } else { - alertSrv.set('Save failed','Gist could not be saved','error',5000); - } - }); - }; - - $scope.gist_dblist = function(id) { - $scope.dashboard.gist_list(id).then(function(files) { - if (files && files.length > 0) { - $scope.gist.files = files; - } else { - alertSrv.set('Gist Failed','Could not retrieve dashboard list from gist','error',5000); - } - }); - }; - // function $scope.zoom // factor :: Zoom factor, so 0.5 = cuts timespan in half, 2 doubles timespan $scope.zoom = function(factor) { diff --git a/src/app/partials/search.html b/src/app/partials/search.html index 0acd7fdd7ef..55eeb8e211a 100644 --- a/src/app/partials/search.html +++ b/src/app/partials/search.html @@ -104,20 +104,5 @@ - -
-
Gist Enter a gist number or url
-
-
- -
Dashboards in gist:{{gist.url | gistid}} click to load
-
No gist dashboards found
- - - - -
{{file.title}}
-
-
diff --git a/src/app/services/dashboard/dashboardModel.js b/src/app/services/dashboard/dashboardModel.js index b4cedb779c4..767ba61a7d1 100644 --- a/src/app/services/dashboard/dashboardModel.js +++ b/src/app/services/dashboard/dashboardModel.js @@ -95,63 +95,5 @@ function (angular, $, kbn, _) { } }; - /* - var gist_pattern = /(^\d{5,}$)|(^[a-z0-9]{10,}$)|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/; - - this.gist_id = function(string) { - if(self.is_gist(string)) { - return string.match(gist_pattern)[0].replace(/.*\//, ''); - } - }; - - this.is_gist = function(string) { - if(!_.isUndefined(string) && string !== '' && !_.isNull(string.match(gist_pattern))) { - return string.match(gist_pattern).length > 0 ? true : false; - } else { - return false; - } - }; - - this.save_gist = function(title,dashboard) { - var save = _.clone(dashboard || self.current); - save.title = title || self.current.title; - return $http({ - url: "https://api.github.com/gists", - method: "POST", - data: { - "description": save.title, - "public": false, - "files": { - "kibana-dashboard.json": { - "content": angular.toJson(save,true) - } - } - } - }).then(function(data) { - return data.data.html_url; - }, function() { - return false; - }); - }; - - this.gist_list = function(id) { - return $http.jsonp("https://api.github.com/gists/"+id+"?callback=JSON_CALLBACK" - ).then(function(response) { - var files = []; - _.each(response.data.data.files,function(v) { - try { - var file = JSON.parse(v.content); - files.push(file); - } catch(e) { - return false; - } - }); - return files; - }, function() { - return false; - }); - }; - */ - }); });