Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
984ece64
Commit
984ece64
authored
Jan 16, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get access denied when trying to save from collaboration role viewer
parent
9637efd5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
18 deletions
+31
-18
src/app/features/account/accountCtrl.js
+0
-1
src/app/features/grafanaDatasource/datasource.js
+4
-0
src/app/services/backendSrv.js
+27
-17
No files found.
src/app/features/account/accountCtrl.js
View file @
984ece64
...
@@ -9,7 +9,6 @@ function (angular) {
...
@@ -9,7 +9,6 @@ function (angular) {
module
.
controller
(
'AccountCtrl'
,
function
(
$scope
,
$http
,
backendSrv
)
{
module
.
controller
(
'AccountCtrl'
,
function
(
$scope
,
$http
,
backendSrv
)
{
$scope
.
collaborator
=
{};
$scope
.
collaborator
=
{};
$scope
.
showTokens
=
false
;
$scope
.
init
=
function
()
{
$scope
.
init
=
function
()
{
$scope
.
getAccount
();
$scope
.
getAccount
();
...
...
src/app/features/grafanaDatasource/datasource.js
View file @
984ece64
...
@@ -52,6 +52,10 @@ function (angular, _, kbn) {
...
@@ -52,6 +52,10 @@ function (angular, _, kbn) {
return
backendSrv
.
post
(
'/api/dashboard/'
,
{
dashboard
:
dashboard
})
return
backendSrv
.
post
(
'/api/dashboard/'
,
{
dashboard
:
dashboard
})
.
then
(
function
(
data
)
{
.
then
(
function
(
data
)
{
return
{
title
:
dashboard
.
title
,
url
:
'/dashboard/db/'
+
data
.
slug
};
return
{
title
:
dashboard
.
title
,
url
:
'/dashboard/db/'
+
data
.
slug
};
},
function
(
err
)
{
err
.
isHandled
=
true
;
err
.
data
=
err
.
data
||
{};
throw
err
.
data
.
message
||
"Unknown error"
;
});
});
};
};
...
...
src/app/services/backendSrv.js
View file @
984ece64
...
@@ -8,7 +8,8 @@ function (angular, _, config) {
...
@@ -8,7 +8,8 @@ function (angular, _, config) {
var
module
=
angular
.
module
(
'grafana.services'
);
var
module
=
angular
.
module
(
'grafana.services'
);
module
.
service
(
'backendSrv'
,
function
(
$http
,
alertSrv
)
{
module
.
service
(
'backendSrv'
,
function
(
$http
,
alertSrv
,
$timeout
)
{
var
self
=
this
;
this
.
get
=
function
(
url
,
params
)
{
this
.
get
=
function
(
url
,
params
)
{
return
this
.
request
({
method
:
'GET'
,
url
:
url
,
params
:
params
});
return
this
.
request
({
method
:
'GET'
,
url
:
url
,
params
:
params
});
...
@@ -26,22 +27,7 @@ function (angular, _, config) {
...
@@ -26,22 +27,7 @@ function (angular, _, config) {
return
this
.
request
({
method
:
'PUT'
,
url
:
url
,
data
:
data
});
return
this
.
request
({
method
:
'PUT'
,
url
:
url
,
data
:
data
});
};
};
this
.
request
=
function
(
options
)
{
this
.
_handleError
=
function
(
err
)
{
var
httpOptions
=
{
url
:
config
.
appSubUrl
+
options
.
url
,
method
:
options
.
method
,
data
:
options
.
data
,
params
:
options
.
params
,
};
return
$http
(
httpOptions
).
then
(
function
(
results
)
{
if
(
options
.
method
!==
'GET'
)
{
if
(
results
&&
results
.
data
.
message
)
{
alertSrv
.
set
(
results
.
data
.
message
,
''
,
'success'
,
3000
);
}
}
return
results
.
data
;
},
function
(
err
)
{
if
(
err
.
status
===
422
)
{
if
(
err
.
status
===
422
)
{
alertSrv
.
set
(
"Validation failed"
,
""
,
"warning"
,
4000
);
alertSrv
.
set
(
"Validation failed"
,
""
,
"warning"
,
4000
);
throw
err
.
data
;
throw
err
.
data
;
...
@@ -64,6 +50,30 @@ function (angular, _, config) {
...
@@ -64,6 +50,30 @@ function (angular, _, config) {
}
}
throw
data
;
throw
data
;
};
this
.
request
=
function
(
options
)
{
var
httpOptions
=
{
url
:
config
.
appSubUrl
+
options
.
url
,
method
:
options
.
method
,
data
:
options
.
data
,
params
:
options
.
params
,
};
return
$http
(
httpOptions
).
then
(
function
(
results
)
{
if
(
options
.
method
!==
'GET'
)
{
if
(
results
&&
results
.
data
.
message
)
{
alertSrv
.
set
(
results
.
data
.
message
,
''
,
'success'
,
3000
);
}
}
return
results
.
data
;
},
function
(
err
)
{
$timeout
(
function
()
{
if
(
err
.
isHandled
)
{
return
;
}
self
.
_handleError
(
err
);
},
50
);
throw
err
;
});
});
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment