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
3b5c813b
Commit
3b5c813b
authored
Jan 29, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
worked on user frontend state, state like favorites, etc
parent
9d0982f2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
21 deletions
+38
-21
src/app/controllers/grafanaCtrl.js
+6
-14
src/app/features/grafanaDatasource/datasource.js
+6
-6
src/app/partials/dasheditor.html
+1
-1
src/app/services/all.js
+1
-0
src/app/services/userSrv.js
+24
-0
No files found.
src/app/controllers/grafanaCtrl.js
View file @
3b5c813b
...
...
@@ -10,17 +10,17 @@ function (angular, config, _, $, store) {
var
module
=
angular
.
module
(
'grafana.controllers'
);
module
.
controller
(
'GrafanaCtrl'
,
function
(
$scope
,
alertSrv
,
utilSrv
,
grafanaVersion
,
$rootScope
,
$controller
)
{
$scope
.
grafanaVersion
=
grafanaVersion
[
0
]
===
'@'
?
'master'
:
grafanaVersion
;
module
.
controller
(
'GrafanaCtrl'
,
function
(
$scope
,
alertSrv
,
utilSrv
,
grafanaVersion
,
$rootScope
,
$controller
,
userSrv
)
{
$scope
.
init
=
function
()
{
$scope
.
grafana
=
{};
$scope
.
grafana
.
version
=
grafanaVersion
;
$scope
.
_
=
_
;
$rootScope
.
profilingEnabled
=
store
.
getBool
(
'profilingEnabled'
);
$rootScope
.
performance
=
{
loadStart
:
new
Date
().
getTime
()
};
$rootScope
.
appSubUrl
=
config
.
appSubUrl
;
$scope
.
init
=
function
()
{
$scope
.
_
=
_
;
if
(
$rootScope
.
profilingEnabled
)
{
$scope
.
initProfiling
();
}
alertSrv
.
init
();
...
...
@@ -28,16 +28,8 @@ function (angular, config, _, $, store) {
$scope
.
dashAlerts
=
alertSrv
;
$scope
.
grafana
.
style
=
'dark'
;
$scope
.
grafana
.
user
=
{};
if
(
window
.
grafanaBackend
)
{
$scope
.
initBackendFeatures
();
}
};
$scope
.
initBackendFeatures
=
function
()
{
$scope
.
grafana
.
user
=
userSrv
.
getSignedInUser
();
$scope
.
grafana
.
sidemenu
=
store
.
getBool
(
'grafana.sidemenu'
);
$scope
.
grafana
.
user
=
window
.
grafanaBootData
.
user
;
$scope
.
onAppEvent
(
'logged-out'
,
function
()
{
$scope
.
grafana
.
sidemenu
=
false
;
...
...
src/app/features/grafanaDatasource/datasource.js
View file @
3b5c813b
...
...
@@ -18,17 +18,17 @@ function (angular, _, kbn) {
this
.
editorSrc
=
'app/features/grafanaDatasource/partials/query.editor.html'
;
}
GrafanaDatasource
.
prototype
.
getDashboard
=
function
(
id
,
isTemp
)
{
var
url
=
'/dashboard/'
+
id
;
GrafanaDatasource
.
prototype
.
getDashboard
=
function
(
slug
,
isTemp
)
{
var
url
=
'/dashboard/'
+
slug
;
if
(
isTemp
)
{
url
=
'/temp/'
+
id
;
url
=
'/temp/'
+
slug
;
}
return
backendSrv
.
get
(
'/api/dashboard/'
+
id
)
return
backendSrv
.
get
(
'/api/dashboard/'
+
slug
)
.
then
(
function
(
data
)
{
if
(
data
)
{
return
angular
.
fromJson
(
data
)
;
if
(
data
&&
data
.
dashboard
)
{
return
data
.
dashboard
;
}
else
{
return
false
;
}
...
...
src/app/partials/dasheditor.html
View file @
3b5c813b
...
...
@@ -96,7 +96,7 @@
<div
class=
"dashboard-editor-footer"
>
<div
class=
"grafana-version-info"
ng-show=
"editor.index === 0"
>
<span
class=
"editor-option small"
>
Grafana version: {{grafana
V
ersion}}
Grafana version: {{grafana
.v
ersion}}
</span>
<span
grafana-version-check
>
</span>
...
...
src/app/services/all.js
View file @
3b5c813b
...
...
@@ -2,6 +2,7 @@ define([
'./alertSrv'
,
'./utilSrv'
,
'./datasourceSrv'
,
'./userSrv'
,
'./timer'
,
'./keyboardManager'
,
'./popoverSrv'
,
...
...
src/app/services/userSrv.js
0 → 100644
View file @
3b5c813b
define
([
'angular'
,
'lodash'
,
],
function
(
angular
,
_
)
{
'use strict'
;
var
module
=
angular
.
module
(
'grafana.services'
);
module
.
service
(
'userSrv'
,
function
()
{
function
User
()
{
if
(
window
.
grafanaBootData
.
user
)
{
_
.
extend
(
this
,
window
.
grafanaBootData
.
user
);
}
}
this
.
getSignedInUser
=
function
()
{
return
new
User
();
};
});
});
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