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
7dc4484f
Commit
7dc4484f
authored
Jun 12, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed dashboard service to dashboardModel, fixed saving default dashboard feature
parent
257ea391
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
27 deletions
+17
-27
src/app/controllers/dash.js
+0
-7
src/app/controllers/dashLoader.js
+3
-10
src/app/partials/dashLoader.html
+1
-1
src/app/routes/dashboard-from-file.js
+10
-0
src/app/services/all.js
+3
-1
src/app/services/dashboard/all.js
+0
-4
src/app/services/dashboard/dashboardModel.js
+0
-4
No files found.
src/app/controllers/dash.js
View file @
7dc4484f
...
...
@@ -23,7 +23,6 @@ define([
'config'
,
'underscore'
,
'services/all'
,
'services/dashboard/all'
],
function
(
angular
,
$
,
config
,
_
)
{
"use strict"
;
...
...
@@ -119,12 +118,6 @@ function (angular, $, config, _) {
return
$scope
.
editorTabs
;
};
// This is whoafully incomplete, but will do for now
$scope
.
parse_error
=
function
(
data
)
{
var
_error
=
data
.
match
(
"nested: (.*?);"
);
return
_
.
isNull
(
_error
)
?
data
:
_error
[
1
];
};
$scope
.
colors
=
[
"#7EB26D"
,
"#EAB839"
,
"#6ED0E0"
,
"#EF843C"
,
"#E24D42"
,
"#1F78C1"
,
"#BA43A9"
,
"#705DA0"
,
//1
"#508642"
,
"#CCA300"
,
"#447EBC"
,
"#C15C17"
,
"#890F02"
,
"#0A437C"
,
"#6D1F62"
,
"#584477"
,
//2
...
...
src/app/controllers/dashLoader.js
View file @
7dc4484f
...
...
@@ -48,20 +48,13 @@ function (angular, _, moment) {
};
$scope
.
set_default
=
function
()
{
if
(
$scope
.
dashboard
.
set_default
(
$location
.
path
()))
{
window
.
localStorage
.
grafanaDashboardDefault
=
$location
.
path
();
alertSrv
.
set
(
'Home Set'
,
'This page has been set as your default dashboard'
,
'success'
,
5000
);
}
else
{
alertSrv
.
set
(
'Incompatible Browser'
,
'Sorry, your browser is too old for this feature'
,
'error'
,
5000
);
}
};
$scope
.
purge_default
=
function
()
{
if
(
$scope
.
dashboard
.
purge_default
())
{
alertSrv
.
set
(
'Local Default Clear'
,
'Your default dashboard has been reset to the default'
,
'success'
,
5000
);
}
else
{
alertSrv
.
set
(
'Incompatible Browser'
,
'Sorry, your browser is too old for this feature'
,
'error'
,
5000
);
}
delete
window
.
localStorage
.
grafanaDashboardDefault
;
alertSrv
.
set
(
'Local Default Clear'
,
'Your default dashboard has been reset to the default'
,
'success'
,
5000
);
};
$scope
.
saveForSharing
=
function
()
{
...
...
src/app/partials/dashLoader.html
View file @
7dc4484f
...
...
@@ -66,7 +66,7 @@
</li>
<li
class=
"grafana-menu-home"
><a
bs-tooltip=
"'Goto saved default'"
data-placement=
"bottom"
href=
'#/
dashboard
'
><i
class=
'icon-home'
></i></a></li>
<li
class=
"grafana-menu-home"
><a
bs-tooltip=
"'Goto saved default'"
data-placement=
"bottom"
href=
'#/'
><i
class=
'icon-home'
></i></a></li>
<li
class=
"grafana-menu-edit"
ng-show=
"dashboard.editable"
bs-tooltip=
"'Configure dashboard'"
data-placement=
"bottom"
><a
class=
"link"
config-modal=
"app/partials/dasheditor.html"
><i
class=
'icon-cog pointer'
></i></a></li>
...
...
src/app/routes/dashboard-from-file.js
View file @
7dc4484f
...
...
@@ -14,6 +14,16 @@ function (angular, $, config, _) {
.
when
(
'/dashboard/file/:jsonFile'
,
{
templateUrl
:
'app/partials/dashboard.html'
,
controller
:
'DashFromFileProvider'
,
})
.
when
(
'/'
,
{
redirectTo
:
function
()
{
if
(
window
.
localStorage
&&
window
.
localStorage
.
grafanaDashboardDefault
)
{
return
window
.
localStorage
.
grafanaDashboardDefault
;
}
else
{
return
config
.
default_route
;
}
}
});
});
...
...
src/app/services/all.js
View file @
7dc4484f
define
([
'./alertSrv'
,
'./dashboard'
,
'./datasourceSrv'
,
'./filterSrv'
,
'./timer'
,
...
...
@@ -10,5 +9,7 @@ define([
'./playlistSrv'
,
'./unsavedChangesSrv'
,
'./elasticsearch/es-client'
,
'./dashboard/dashboardKeyBindings'
,
'./dashboard/dashboardModel'
,
],
function
()
{});
\ No newline at end of file
src/app/services/dashboard/all.js
deleted
100644 → 0
View file @
257ea391
define
([
'./dashboardKeyBindings'
,
],
function
()
{});
src/app/services/dashboard.js
→
src/app/services/dashboard
/dashboardModel
.js
View file @
7dc4484f
...
...
@@ -90,10 +90,6 @@ function (angular, $, kbn, _) {
}
};
// An elasticJS client to use
/*var ejs = ejsResource(config.elasticsearch, config.elasticsearchBasicAuth);
var gist_pattern = /(^\d{5,}$)|(^[a-z0-9]{10,}$)|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/;
*/
return
{
create
:
function
(
dashboard
)
{
return
new
DashboardModel
(
dashboard
);
...
...
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