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
25316cbe
Commit
25316cbe
authored
Jan 28, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed broken feature: new dashboard button
parent
a7a8ea30
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
11 deletions
+27
-11
src/app/controllers/search.js
+2
-1
src/app/routes/backend/all.js
+4
-4
src/app/routes/backend/dashboard.js
+7
-3
src/app/routes/standalone/fromFile.js
+14
-3
No files found.
src/app/controllers/search.js
View file @
25316cbe
...
...
@@ -154,7 +154,8 @@ function (angular, _, config, $) {
};
$scope
.
newDashboard
=
function
()
{
$location
.
url
(
'/dashboard/file/empty.json'
);
//$location.path('/dashboard/file/empty.json');
$location
.
url
(
'dashboard/new'
);
};
});
...
...
src/app/routes/backend/all.js
View file @
25316cbe
...
...
@@ -20,14 +20,14 @@ define([
controller
:
'DashFromDBProvider'
,
reloadOnSearch
:
false
,
})
.
when
(
'/dashboard/
temp
/:id'
,
{
.
when
(
'/dashboard/
import
/:id'
,
{
templateUrl
:
'app/partials/dashboard.html'
,
controller
:
'DashFrom
DBProvider
'
,
controller
:
'DashFrom
ImportCtrl
'
,
reloadOnSearch
:
false
,
})
.
when
(
'/dashboard/
import/:id
'
,
{
.
when
(
'/dashboard/
new
'
,
{
templateUrl
:
'app/partials/dashboard.html'
,
controller
:
'
DashFromImport
Ctrl'
,
controller
:
'
NewDashboard
Ctrl'
,
reloadOnSearch
:
false
,
})
.
when
(
'/account'
,
{
...
...
src/app/routes/backend/dashboard.js
View file @
25316cbe
...
...
@@ -48,18 +48,22 @@ function (angular, store) {
}).
then
(
null
,
function
()
{
$scope
.
initDashboard
({},
$scope
);
});
});
module
.
controller
(
'DashFromImportCtrl'
,
function
(
$scope
,
$location
,
alertSrv
)
{
if
(
!
window
.
grafanaImportDashboard
)
{
alertSrv
.
set
(
'Not found'
,
'Cannot reload page with unsaved imported dashboard'
,
'warning'
,
7000
);
$location
.
path
(
''
);
return
;
}
$scope
.
initDashboard
(
window
.
grafanaImportDashboard
,
$scope
);
});
module
.
controller
(
'NewDashboardCtrl'
,
function
(
$scope
)
{
$scope
.
initDashboard
({
title
:
"New dashboard"
,
rows
:
[{
height
:
'250px'
,
panels
:[]
}]
},
$scope
);
});
});
src/app/routes/standalone/fromFile.js
View file @
25316cbe
...
...
@@ -15,10 +15,16 @@ function (angular, $, config, _) {
templateUrl
:
'app/partials/dashboard.html'
,
controller
:
'DashFromFileProvider'
,
reloadOnSearch
:
false
,
})
.
when
(
'/dashboard/new'
,
{
templateUrl
:
'app/partials/dashboard.html'
,
controller
:
'DashFromFileProvider'
,
reloadOnSearch
:
false
,
newDashboard
:
true
,
});
});
module
.
controller
(
'DashFromFileProvider'
,
function
(
$scope
,
$rootScope
,
$http
,
$routeParams
,
alertSrv
)
{
module
.
controller
(
'DashFromFileProvider'
,
function
(
$scope
,
$rootScope
,
$http
,
$routeParams
,
$route
)
{
var
renderTemplate
=
function
(
json
,
params
)
{
var
_r
;
...
...
@@ -46,12 +52,17 @@ function (angular, $, config, _) {
}
return
result
.
data
;
},
function
()
{
alertSrv
.
set
(
'Error'
,
"Could not load <i>dashboards/"
+
file
+
"</i>. Please make sure it exists"
,
'error'
);
$scope
.
appEvent
(
'alert-error'
,
[
"Dashboard load failed"
,
"Could not load <i>dashboards/"
+
file
+
"</i>. Please make sure it exists"
]
);
return
false
;
});
};
file_load
(
$routeParams
.
jsonFile
).
then
(
function
(
result
)
{
var
fileToLoad
=
$routeParams
.
jsonFile
;
if
(
$route
.
current
.
newDashboard
)
{
fileToLoad
=
'empty.json'
;
}
file_load
(
fileToLoad
).
then
(
function
(
result
)
{
$scope
.
initDashboard
(
result
,
$scope
);
});
...
...
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