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
c283f099
Commit
c283f099
authored
Feb 28, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed solo panel view (used for png rendering)
parent
232f980c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
12 deletions
+13
-12
src/app/features/panel/soloPanelCtrl.js
+4
-7
src/app/routes/backend/all.js
+3
-3
src/app/routes/backend/dashboard.js
+2
-2
src/app/services/backendSrv.js
+4
-0
No files found.
src/app/features/panel/soloPanelCtrl.js
View file @
c283f099
...
...
@@ -7,15 +7,14 @@ function (angular, $) {
var
module
=
angular
.
module
(
'grafana.routes'
);
module
.
controller
(
'SoloPanelCtrl'
,
function
(
$scope
,
$rootScope
,
datasourceSrv
,
$routeParams
,
dashboardSrv
,
timeSrv
,
$location
)
{
module
.
controller
(
'SoloPanelCtrl'
,
function
(
$scope
,
backendSrv
,
$routeParams
,
dashboardSrv
,
timeSrv
,
$location
,
templateValuesSrv
)
{
var
panelId
;
$scope
.
init
=
function
()
{
var
db
=
datasourceSrv
.
getGrafanaDB
();
var
params
=
$location
.
search
();
panelId
=
parseInt
(
params
.
panelId
);
db
.
getDashboard
(
$routeParams
.
id
,
false
)
backendSrv
.
getDashboard
(
$routeParams
.
slug
)
.
then
(
function
(
dashboard
)
{
$scope
.
initPanelScope
(
dashboard
);
}).
then
(
null
,
function
(
error
)
{
...
...
@@ -41,12 +40,10 @@ function (angular, $) {
}
$scope
.
panel
.
span
=
12
;
$scope
.
dashboardViewState
=
{
registerPanel
:
function
()
{
}
};
$scope
.
dashboardViewState
=
{
registerPanel
:
function
()
{
},
state
:
{}};
timeSrv
.
init
(
$scope
.
dashboard
);
templateValuesSrv
.
init
(
$scope
.
dashboard
,
$scope
.
dashboardViewState
);
};
$scope
.
getPanelById
=
function
(
id
)
{
...
...
src/app/routes/backend/all.js
View file @
c283f099
...
...
@@ -15,12 +15,12 @@ define([
controller
:
'DashFromDBProvider'
,
reloadOnSearch
:
false
,
})
.
when
(
'/dashboard/db/:
id
'
,
{
.
when
(
'/dashboard/db/:
slug
'
,
{
templateUrl
:
'app/partials/dashboard.html'
,
controller
:
'DashFromDBProvider'
,
reloadOnSearch
:
false
,
})
.
when
(
'/dashboard/import/:
id
'
,
{
.
when
(
'/dashboard/import/:
file
'
,
{
templateUrl
:
'app/partials/dashboard.html'
,
controller
:
'DashFromImportCtrl'
,
reloadOnSearch
:
false
,
...
...
@@ -93,7 +93,7 @@ define([
templateUrl
:
'app/partials/login.html'
,
controller
:
'LoginCtrl'
,
})
.
when
(
'/dashboard/solo/:
id
/'
,
{
.
when
(
'/dashboard/solo/:
slug
/'
,
{
templateUrl
:
'app/features/panel/partials/soloPanel.html'
,
controller
:
'SoloPanelCtrl'
,
})
...
...
src/app/routes/backend/dashboard.js
View file @
c283f099
...
...
@@ -9,7 +9,7 @@ function (angular) {
module
.
controller
(
'DashFromDBProvider'
,
function
(
$scope
,
$routeParams
,
backendSrv
)
{
if
(
!
$routeParams
.
id
)
{
if
(
!
$routeParams
.
slug
)
{
backendSrv
.
get
(
'/api/dashboards/home'
).
then
(
function
(
result
)
{
$scope
.
initDashboard
(
result
,
$scope
);
},
function
()
{
...
...
@@ -20,7 +20,7 @@ function (angular) {
return
;
}
return
backendSrv
.
get
(
'/api/dashboards/db/'
+
$routeParams
.
id
).
then
(
function
(
result
)
{
return
backendSrv
.
get
Dashboard
(
$routeParams
.
slug
).
then
(
function
(
result
)
{
$scope
.
initDashboard
(
result
,
$scope
);
},
function
()
{
$scope
.
initDashboard
({
...
...
src/app/services/backendSrv.js
View file @
c283f099
...
...
@@ -81,6 +81,10 @@ function (angular, _, config) {
return
this
.
get
(
'/api/search'
,
query
);
};
this
.
getDashboard
=
function
(
slug
)
{
return
this
.
get
(
'/api/dashboards/db/'
+
slug
);
};
this
.
saveDashboard
=
function
(
dash
)
{
return
this
.
post
(
'/api/dashboards/db/'
,
{
dashboard
:
dash
});
};
...
...
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