mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fixed snapshot sharing issue
This commit is contained in:
parent
7be7aeb70a
commit
d3db49ae3e
@ -15,7 +15,7 @@ import (
|
|||||||
func CreateDashboardSnapshot(c *middleware.Context, cmd m.CreateDashboardSnapshotCommand) {
|
func CreateDashboardSnapshot(c *middleware.Context, cmd m.CreateDashboardSnapshotCommand) {
|
||||||
if cmd.External {
|
if cmd.External {
|
||||||
// external snapshot ref requires key and delete key
|
// external snapshot ref requires key and delete key
|
||||||
if cmd.Key != "" && cmd.DeleteKey != "" {
|
if cmd.Key == "" || cmd.DeleteKey == "" {
|
||||||
c.JsonApiErr(400, "Missing key and delete key for external snapshot", nil)
|
c.JsonApiErr(400, "Missing key and delete key for external snapshot", nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ function (angular, _) {
|
|||||||
// save external in local instance as well
|
// save external in local instance as well
|
||||||
cmdData.external = true;
|
cmdData.external = true;
|
||||||
cmdData.key = results.key;
|
cmdData.key = results.key;
|
||||||
cmdData.delete_key = results.delete_key;
|
cmdData.deleteKey = results.deleteKey;
|
||||||
backendSrv.post('/api/snapshots/', cmdData);
|
backendSrv.post('/api/snapshots/', cmdData);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -54,12 +54,16 @@ function (angular, _, config) {
|
|||||||
|
|
||||||
this.request = function(options) {
|
this.request = function(options) {
|
||||||
var httpOptions = {
|
var httpOptions = {
|
||||||
url: config.appSubUrl + options.url,
|
url: options.url,
|
||||||
method: options.method,
|
method: options.method,
|
||||||
data: options.data,
|
data: options.data,
|
||||||
params: options.params,
|
params: options.params,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (httpOptions.url.indexOf('/') === 0) {
|
||||||
|
httpOptions.url = config.appSubUrl + httpOptions.url;
|
||||||
|
}
|
||||||
|
|
||||||
return $http(httpOptions).then(function(results) {
|
return $http(httpOptions).then(function(results) {
|
||||||
if (options.method !== 'GET') {
|
if (options.method !== 'GET') {
|
||||||
if (results && results.data.message) {
|
if (results && results.data.message) {
|
||||||
|
Loading…
Reference in New Issue
Block a user