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
20ebb614
Commit
20ebb614
authored
Feb 21, 2018
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboards: cleanup
Move api calls to backend_srv
parent
b7cf6f97
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
public/app/core/services/backend_srv.ts
+2
-2
public/app/features/panel/solo_panel_ctrl.ts
+1
-1
public/app/routes/dashboard_loaders.ts
+1
-1
No files found.
public/app/core/services/backend_srv.ts
View file @
20ebb614
...
...
@@ -221,8 +221,8 @@ export class BackendSrv {
return
this
.
get
(
'/api/search'
,
query
);
}
getDashboard
(
type
,
slug
)
{
return
this
.
get
(
'/api/dashboards/'
+
type
+
'/'
+
slug
);
getDashboard
BySlug
(
slug
)
{
return
this
.
get
(
`/api/dashboards/db/
${
slug
}
`
);
}
getDashboardByUid
(
uid
:
string
)
{
...
...
public/app/features/panel/solo_panel_ctrl.ts
View file @
20ebb614
...
...
@@ -18,7 +18,7 @@ export class SoloPanelCtrl {
// if no uid, redirect to new route based on slug
if
(
!
(
$routeParams
.
type
===
'script'
||
$routeParams
.
type
===
'snapshot'
)
&&
!
$routeParams
.
uid
)
{
backendSrv
.
get
(
`/api/dashboards/db/
${
$routeParams
.
slug
}
`
).
then
(
res
=>
{
backendSrv
.
get
DashboardBySlug
(
$routeParams
.
slug
).
then
(
res
=>
{
if
(
res
)
{
const
url
=
locationUtil
.
stripBaseFromUrl
(
res
.
meta
.
url
.
replace
(
'/d/'
,
'/d-solo/'
));
$location
.
path
(
url
).
replace
();
...
...
public/app/routes/dashboard_loaders.ts
View file @
20ebb614
...
...
@@ -21,7 +21,7 @@ export class LoadDashboardCtrl {
// if no uid, redirect to new route based on slug
if
(
!
(
$routeParams
.
type
===
'script'
||
$routeParams
.
type
===
'snapshot'
)
&&
!
$routeParams
.
uid
)
{
backendSrv
.
get
(
`/api/dashboards/db/
${
$routeParams
.
slug
}
`
).
then
(
res
=>
{
backendSrv
.
get
DashboardBySlug
(
$routeParams
.
slug
).
then
(
res
=>
{
if
(
res
)
{
$location
.
path
(
locationUtil
.
stripBaseFromUrl
(
res
.
meta
.
url
)).
replace
();
}
...
...
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