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, $) {
...
@@ -7,15 +7,14 @@ function (angular, $) {
var
module
=
angular
.
module
(
'grafana.routes'
);
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
;
var
panelId
;
$scope
.
init
=
function
()
{
$scope
.
init
=
function
()
{
var
db
=
datasourceSrv
.
getGrafanaDB
();
var
params
=
$location
.
search
();
var
params
=
$location
.
search
();
panelId
=
parseInt
(
params
.
panelId
);
panelId
=
parseInt
(
params
.
panelId
);
db
.
getDashboard
(
$routeParams
.
id
,
false
)
backendSrv
.
getDashboard
(
$routeParams
.
slug
)
.
then
(
function
(
dashboard
)
{
.
then
(
function
(
dashboard
)
{
$scope
.
initPanelScope
(
dashboard
);
$scope
.
initPanelScope
(
dashboard
);
}).
then
(
null
,
function
(
error
)
{
}).
then
(
null
,
function
(
error
)
{
...
@@ -41,12 +40,10 @@ function (angular, $) {
...
@@ -41,12 +40,10 @@ function (angular, $) {
}
}
$scope
.
panel
.
span
=
12
;
$scope
.
panel
.
span
=
12
;
$scope
.
dashboardViewState
=
{
$scope
.
dashboardViewState
=
{
registerPanel
:
function
()
{
},
state
:
{}};
registerPanel
:
function
()
{
}
};
timeSrv
.
init
(
$scope
.
dashboard
);
timeSrv
.
init
(
$scope
.
dashboard
);
templateValuesSrv
.
init
(
$scope
.
dashboard
,
$scope
.
dashboardViewState
);
};
};
$scope
.
getPanelById
=
function
(
id
)
{
$scope
.
getPanelById
=
function
(
id
)
{
...
...
src/app/routes/backend/all.js
View file @
c283f099
...
@@ -15,12 +15,12 @@ define([
...
@@ -15,12 +15,12 @@ define([
controller
:
'DashFromDBProvider'
,
controller
:
'DashFromDBProvider'
,
reloadOnSearch
:
false
,
reloadOnSearch
:
false
,
})
})
.
when
(
'/dashboard/db/:
id
'
,
{
.
when
(
'/dashboard/db/:
slug
'
,
{
templateUrl
:
'app/partials/dashboard.html'
,
templateUrl
:
'app/partials/dashboard.html'
,
controller
:
'DashFromDBProvider'
,
controller
:
'DashFromDBProvider'
,
reloadOnSearch
:
false
,
reloadOnSearch
:
false
,
})
})
.
when
(
'/dashboard/import/:
id
'
,
{
.
when
(
'/dashboard/import/:
file
'
,
{
templateUrl
:
'app/partials/dashboard.html'
,
templateUrl
:
'app/partials/dashboard.html'
,
controller
:
'DashFromImportCtrl'
,
controller
:
'DashFromImportCtrl'
,
reloadOnSearch
:
false
,
reloadOnSearch
:
false
,
...
@@ -93,7 +93,7 @@ define([
...
@@ -93,7 +93,7 @@ define([
templateUrl
:
'app/partials/login.html'
,
templateUrl
:
'app/partials/login.html'
,
controller
:
'LoginCtrl'
,
controller
:
'LoginCtrl'
,
})
})
.
when
(
'/dashboard/solo/:
id
/'
,
{
.
when
(
'/dashboard/solo/:
slug
/'
,
{
templateUrl
:
'app/features/panel/partials/soloPanel.html'
,
templateUrl
:
'app/features/panel/partials/soloPanel.html'
,
controller
:
'SoloPanelCtrl'
,
controller
:
'SoloPanelCtrl'
,
})
})
...
...
src/app/routes/backend/dashboard.js
View file @
c283f099
...
@@ -9,7 +9,7 @@ function (angular) {
...
@@ -9,7 +9,7 @@ function (angular) {
module
.
controller
(
'DashFromDBProvider'
,
function
(
$scope
,
$routeParams
,
backendSrv
)
{
module
.
controller
(
'DashFromDBProvider'
,
function
(
$scope
,
$routeParams
,
backendSrv
)
{
if
(
!
$routeParams
.
id
)
{
if
(
!
$routeParams
.
slug
)
{
backendSrv
.
get
(
'/api/dashboards/home'
).
then
(
function
(
result
)
{
backendSrv
.
get
(
'/api/dashboards/home'
).
then
(
function
(
result
)
{
$scope
.
initDashboard
(
result
,
$scope
);
$scope
.
initDashboard
(
result
,
$scope
);
},
function
()
{
},
function
()
{
...
@@ -20,7 +20,7 @@ function (angular) {
...
@@ -20,7 +20,7 @@ function (angular) {
return
;
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
);
$scope
.
initDashboard
(
result
,
$scope
);
},
function
()
{
},
function
()
{
$scope
.
initDashboard
({
$scope
.
initDashboard
({
...
...
src/app/services/backendSrv.js
View file @
c283f099
...
@@ -81,6 +81,10 @@ function (angular, _, config) {
...
@@ -81,6 +81,10 @@ function (angular, _, config) {
return
this
.
get
(
'/api/search'
,
query
);
return
this
.
get
(
'/api/search'
,
query
);
};
};
this
.
getDashboard
=
function
(
slug
)
{
return
this
.
get
(
'/api/dashboards/db/'
+
slug
);
};
this
.
saveDashboard
=
function
(
dash
)
{
this
.
saveDashboard
=
function
(
dash
)
{
return
this
.
post
(
'/api/dashboards/db/'
,
{
dashboard
:
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