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
4d1102db
Commit
4d1102db
authored
Aug 13, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Panel edit state is working pretty good now, #672
parent
4987a215
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
61 deletions
+17
-61
src/app/controllers/dashLoader.js
+0
-4
src/app/directives/grafanaGraph.js
+4
-1
src/app/services/dashboard/dashboardKeyBindings.js
+1
-11
src/app/services/dashboard/dashboardSrv.js
+1
-1
src/app/services/dashboard/dashboardViewStateSrv.js
+9
-2
src/app/services/panelSrv.js
+2
-42
No files found.
src/app/controllers/dashLoader.js
View file @
4d1102db
...
@@ -24,10 +24,6 @@ function (angular, _, moment, config) {
...
@@ -24,10 +24,6 @@ function (angular, _, moment, config) {
});
});
};
};
$scope
.
exitFullscreen
=
function
()
{
$scope
.
emitAppEvent
(
'panel-fullscreen-exit'
);
};
$scope
.
set_default
=
function
()
{
$scope
.
set_default
=
function
()
{
window
.
localStorage
.
grafanaDashboardDefault
=
$location
.
path
();
window
.
localStorage
.
grafanaDashboardDefault
=
$location
.
path
();
alertSrv
.
set
(
'Home Set'
,
'This page has been set as your default dashboard'
,
'success'
,
5000
);
alertSrv
.
set
(
'Home Set'
,
'This page has been set as your default dashboard'
,
'success'
,
5000
);
...
...
src/app/directives/grafanaGraph.js
View file @
4d1102db
...
@@ -21,7 +21,6 @@ function (angular, $, kbn, moment, _) {
...
@@ -21,7 +21,6 @@ function (angular, $, kbn, moment, _) {
var
legendSideLastValue
=
null
;
var
legendSideLastValue
=
null
;
scope
.
$on
(
'refresh'
,
function
()
{
scope
.
$on
(
'refresh'
,
function
()
{
if
(
scope
.
otherPanelInFullscreenMode
())
{
return
;
}
scope
.
get_data
();
scope
.
get_data
();
});
});
...
@@ -39,6 +38,10 @@ function (angular, $, kbn, moment, _) {
...
@@ -39,6 +38,10 @@ function (angular, $, kbn, moment, _) {
// Receive render events
// Receive render events
scope
.
$on
(
'render'
,
function
(
event
,
renderData
)
{
scope
.
$on
(
'render'
,
function
(
event
,
renderData
)
{
data
=
renderData
||
data
;
data
=
renderData
||
data
;
if
(
!
data
)
{
scope
.
get_data
();
return
;
}
annotations
=
data
.
annotations
||
annotations
;
annotations
=
data
.
annotations
||
annotations
;
render_panel
();
render_panel
();
});
});
...
...
src/app/services/dashboard/dashboardKeyBindings.js
View file @
4d1102db
...
@@ -12,16 +12,6 @@ function(angular, $) {
...
@@ -12,16 +12,6 @@ function(angular, $) {
this
.
shortcuts
=
function
(
scope
)
{
this
.
shortcuts
=
function
(
scope
)
{
scope
.
onAppEvent
(
'panel-fullscreen-exit'
,
function
()
{
scope
.
dashboardViewState
.
update
({
fullscreen
:
false
});
});
scope
.
onAppEvent
(
'dashboard-saved'
,
function
()
{
if
(
scope
.
dashboardViewState
.
fullscreen
)
{
scope
.
emitAppEvent
(
'panel-fullscreen-exit'
);
}
});
scope
.
$on
(
'$destroy'
,
function
()
{
scope
.
$on
(
'$destroy'
,
function
()
{
keyboardManager
.
unbind
(
'ctrl+f'
);
keyboardManager
.
unbind
(
'ctrl+f'
);
keyboardManager
.
unbind
(
'ctrl+h'
);
keyboardManager
.
unbind
(
'ctrl+h'
);
...
@@ -63,7 +53,7 @@ function(angular, $) {
...
@@ -63,7 +53,7 @@ function(angular, $) {
modalData
.
$scope
.
dismiss
();
modalData
.
$scope
.
dismiss
();
}
}
scope
.
e
mitAppEvent
(
'panel-fullscreen-exit'
);
scope
.
e
xitFullscreen
(
);
},
{
inputDisabled
:
true
});
},
{
inputDisabled
:
true
});
};
};
});
});
...
...
src/app/services/dashboard/dashboardSrv.js
View file @
4d1102db
...
@@ -10,7 +10,7 @@ function (angular, $, kbn, _) {
...
@@ -10,7 +10,7 @@ function (angular, $, kbn, _) {
var
module
=
angular
.
module
(
'grafana.services'
);
var
module
=
angular
.
module
(
'grafana.services'
);
module
.
factory
(
'dashboardSrv'
,
function
(
timer
,
$rootScope
,
$timeout
,
$location
)
{
module
.
factory
(
'dashboardSrv'
,
function
(
timer
,
$rootScope
,
$timeout
)
{
function
DashboardModel
(
data
)
{
function
DashboardModel
(
data
)
{
...
...
src/app/services/dashboard/dashboardViewStateSrv.js
View file @
4d1102db
...
@@ -15,6 +15,14 @@ function (angular, _, $) {
...
@@ -15,6 +15,14 @@ function (angular, _, $) {
function
DashboardViewState
(
$scope
)
{
function
DashboardViewState
(
$scope
)
{
var
self
=
this
;
var
self
=
this
;
$scope
.
exitFullscreen
=
function
()
{
self
.
update
({
fullscreen
:
false
});
};
$scope
.
onAppEvent
(
'dashboard-saved'
,
function
()
{
self
.
update
({
fullscreen
:
false
});
});
$scope
.
onAppEvent
(
'$routeUpdate'
,
function
()
{
$scope
.
onAppEvent
(
'$routeUpdate'
,
function
()
{
var
urlState
=
self
.
getQueryStringState
();
var
urlState
=
self
.
getQueryStringState
();
if
(
self
.
needsSync
(
urlState
))
{
if
(
self
.
needsSync
(
urlState
))
{
...
@@ -45,9 +53,8 @@ function (angular, _, $) {
...
@@ -45,9 +53,8 @@ function (angular, _, $) {
};
};
DashboardViewState
.
prototype
.
update
=
function
(
state
,
skipUrlSync
)
{
DashboardViewState
.
prototype
.
update
=
function
(
state
,
skipUrlSync
)
{
console
.
log
(
'viewstate update: '
,
state
);
_
.
extend
(
this
,
state
);
_
.
extend
(
this
,
state
);
if
(
!
this
.
fullscreen
)
{
if
(
!
this
.
fullscreen
)
{
this
.
panelId
=
null
;
this
.
panelId
=
null
;
this
.
edit
=
false
;
this
.
edit
=
false
;
...
...
src/app/services/panelSrv.js
View file @
4d1102db
define
([
define
([
'angular'
,
'angular'
,
'lodash'
,
'lodash'
,
'jquery'
,
],
],
function
(
angular
,
_
,
$
)
{
function
(
angular
,
_
)
{
'use strict'
;
'use strict'
;
var
module
=
angular
.
module
(
'grafana.services'
);
var
module
=
angular
.
module
(
'grafana.services'
);
...
@@ -71,46 +70,6 @@ function (angular, _, $) {
...
@@ -71,46 +70,6 @@ function (angular, _, $) {
});
});
};
};
$scope
.
enterFullscreenMode
=
function
(
options
)
{
var
docHeight
=
$
(
window
).
height
();
var
editHeight
=
Math
.
floor
(
docHeight
*
0.3
);
var
fullscreenHeight
=
Math
.
floor
(
docHeight
*
0.7
);
var
oldTimeRange
=
$scope
.
range
;
$scope
.
height
=
options
.
edit
?
editHeight
:
fullscreenHeight
;
$scope
.
editMode
=
options
.
edit
;
if
(
!
$scope
.
fullscreen
)
{
var
closeEditMode
=
$rootScope
.
$on
(
'panel-fullscreen-exit'
,
function
()
{
$scope
.
editMode
=
false
;
$scope
.
fullscreen
=
false
;
delete
$scope
.
height
;
closeEditMode
();
$timeout
(
function
()
{
if
(
oldTimeRange
!==
$scope
.
range
)
{
$scope
.
dashboard
.
emit_refresh
();
}
else
{
$scope
.
$emit
(
'render'
);
}
});
});
}
$
(
window
).
scrollTop
(
0
);
$scope
.
dashboardViewState
.
update
({
fullscreen
:
true
,
edit
:
$scope
.
editMode
,
panelId
:
$scope
.
panel
.
id
});
$scope
.
fullscreen
=
true
;
$timeout
(
function
()
{
$scope
.
$emit
(
'render'
);
});
};
$scope
.
addDataQuery
=
function
()
{
$scope
.
addDataQuery
=
function
()
{
$scope
.
panel
.
targets
.
push
({
target
:
''
});
$scope
.
panel
.
targets
.
push
({
target
:
''
});
};
};
...
@@ -165,6 +124,7 @@ function (angular, _, $) {
...
@@ -165,6 +124,7 @@ function (angular, _, $) {
panel_get_data
();
panel_get_data
();
};
};
if
(
!
$scope
.
skipDataOnInit
)
{
if
(
!
$scope
.
skipDataOnInit
)
{
$scope
.
get_data
();
$scope
.
get_data
();
}
}
...
...
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