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
689e366f
Commit
689e366f
authored
Jun 06, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring: updated api url routes so they do not conflict with slug route
parent
e2061312
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
pkg/api/api.go
+6
-6
public/app/features/dashboard/history/history_srv.ts
+3
-3
No files found.
pkg/api/api.go
View file @
689e366f
...
...
@@ -224,12 +224,12 @@ func (hs *HttpServer) registerRoutes() {
r
.
Group
(
"/dashboards"
,
func
()
{
r
.
Combo
(
"/db/:slug"
)
.
Get
(
GetDashboard
)
.
Delete
(
DeleteDashboard
)
r
.
Get
(
"/
db
/:dashboardId/versions"
,
wrap
(
GetDashboardVersions
))
r
.
Get
(
"/
db
/:dashboardId/versions/:id"
,
wrap
(
GetDashboardVersion
))
r
.
Get
(
"/
db
/:dashboardId/compare/:versions"
,
wrap
(
CompareDashboardVersions
))
r
.
Get
(
"/
db
/:dashboardId/compare/:versions/html"
,
wrap
(
CompareDashboardVersionsJSON
))
r
.
Get
(
"/
db
/:dashboardId/compare/:versions/basic"
,
wrap
(
CompareDashboardVersionsBasic
))
r
.
Post
(
"/
db
/:dashboardId/restore"
,
reqEditorRole
,
bind
(
dtos
.
RestoreDashboardVersionCommand
{}),
wrap
(
RestoreDashboardVersion
))
r
.
Get
(
"/
id
/:dashboardId/versions"
,
wrap
(
GetDashboardVersions
))
r
.
Get
(
"/
id
/:dashboardId/versions/:id"
,
wrap
(
GetDashboardVersion
))
r
.
Get
(
"/
id
/:dashboardId/compare/:versions"
,
wrap
(
CompareDashboardVersions
))
r
.
Get
(
"/
id
/:dashboardId/compare/:versions/html"
,
wrap
(
CompareDashboardVersionsJSON
))
r
.
Get
(
"/
id
/:dashboardId/compare/:versions/basic"
,
wrap
(
CompareDashboardVersionsBasic
))
r
.
Post
(
"/
id
/:dashboardId/restore"
,
reqEditorRole
,
bind
(
dtos
.
RestoreDashboardVersionCommand
{}),
wrap
(
RestoreDashboardVersion
))
r
.
Post
(
"/db"
,
reqEditorRole
,
bind
(
m
.
SaveDashboardCommand
{}),
wrap
(
PostDashboard
))
r
.
Get
(
"/file/:file"
,
GetDashboardFromJsonFile
)
...
...
public/app/features/dashboard/history/history_srv.ts
View file @
689e366f
...
...
@@ -11,18 +11,18 @@ export class HistorySrv {
getHistoryList
(
dashboard
:
DashboardModel
,
options
:
HistoryListOpts
)
{
const
id
=
dashboard
&&
dashboard
.
id
?
dashboard
.
id
:
void
0
;
return
id
?
this
.
backendSrv
.
get
(
`api/dashboards/
db
/
${
id
}
/versions`
,
options
)
:
this
.
$q
.
when
([]);
return
id
?
this
.
backendSrv
.
get
(
`api/dashboards/
id
/
${
id
}
/versions`
,
options
)
:
this
.
$q
.
when
([]);
}
compareVersions
(
dashboard
:
DashboardModel
,
compare
:
{
new
:
number
,
original
:
number
},
view
=
'html'
)
{
const
id
=
dashboard
&&
dashboard
.
id
?
dashboard
.
id
:
void
0
;
const
url
=
`api/dashboards/
db
/
${
id
}
/compare/
${
compare
.
original
}
...
${
compare
.
new
}
/
${
view
}
`
;
const
url
=
`api/dashboards/
id
/
${
id
}
/compare/
${
compare
.
original
}
...
${
compare
.
new
}
/
${
view
}
`
;
return
id
?
this
.
backendSrv
.
get
(
url
)
:
this
.
$q
.
when
({});
}
restoreDashboard
(
dashboard
:
DashboardModel
,
version
:
number
)
{
const
id
=
dashboard
&&
dashboard
.
id
?
dashboard
.
id
:
void
0
;
const
url
=
`api/dashboards/
db
/
${
id
}
/restore`
;
const
url
=
`api/dashboards/
id
/
${
id
}
/restore`
;
return
id
&&
_
.
isNumber
(
version
)
?
this
.
backendSrv
.
post
(
url
,
{
version
})
:
this
.
$q
.
when
({});
}
}
...
...
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