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
7d6e04ac
Commit
7d6e04ac
authored
Aug 27, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fixes to dasheditor and firefox fixes for search
parent
6502cff8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
17 deletions
+40
-17
src/app/controllers/search.js
+8
-3
src/app/directives/dashEditLink.js
+14
-0
src/app/directives/grafanaVersionCheck.js
+2
-3
src/app/partials/dasheditor.html
+7
-7
src/css/less/grafana.less
+9
-4
No files found.
src/app/controllers/search.js
View file @
7d6e04ac
...
@@ -28,7 +28,7 @@ function (angular, _, config, $) {
...
@@ -28,7 +28,7 @@ function (angular, _, config, $) {
$scope
.
keyDown
=
function
(
evt
)
{
$scope
.
keyDown
=
function
(
evt
)
{
if
(
evt
.
keyCode
===
27
)
{
if
(
evt
.
keyCode
===
27
)
{
$
element
.
find
(
'.dropdown-toggle'
).
dropdown
(
'toggle
'
);
$
scope
.
emitAppEvent
(
'hide-dash-editor
'
);
}
}
if
(
evt
.
keyCode
===
40
)
{
if
(
evt
.
keyCode
===
40
)
{
$scope
.
selectedIndex
++
;
$scope
.
selectedIndex
++
;
...
@@ -134,13 +134,18 @@ function (angular, _, config, $) {
...
@@ -134,13 +134,18 @@ function (angular, _, config, $) {
module
.
directive
(
'xngFocus'
,
function
()
{
module
.
directive
(
'xngFocus'
,
function
()
{
return
function
(
scope
,
element
,
attrs
)
{
return
function
(
scope
,
element
,
attrs
)
{
$
(
element
)
.
click
(
function
(
e
)
{
element
.
click
(
function
(
e
)
{
e
.
stopPropagation
();
e
.
stopPropagation
();
});
});
scope
.
$watch
(
attrs
.
xngFocus
,
function
(
newValue
)
{
scope
.
$watch
(
attrs
.
xngFocus
,
function
(
newValue
)
{
if
(
!
newValue
)
{
return
;
}
setTimeout
(
function
()
{
setTimeout
(
function
()
{
newValue
&&
element
.
focus
();
element
.
focus
();
var
pos
=
element
.
val
().
length
*
2
;
element
[
0
].
setSelectionRange
(
pos
,
pos
);
},
200
);
},
200
);
},
true
);
},
true
);
};
};
...
...
src/app/directives/dashEditLink.js
View file @
7d6e04ac
...
@@ -31,6 +31,16 @@ function (angular, $) {
...
@@ -31,6 +31,16 @@ function (angular, $) {
var
editorScope
;
var
editorScope
;
var
lastEditor
;
var
lastEditor
;
function
hideScrollbars
(
value
)
{
if
(
value
)
{
document
.
documentElement
.
style
.
overflow
=
'hidden'
;
// firefox, chrome
document
.
body
.
scroll
=
"no"
;
// ie only
}
else
{
document
.
documentElement
.
style
.
overflow
=
'auto'
;
document
.
body
.
scroll
=
"yes"
;
}
}
scope
.
onAppEvent
(
'hide-dash-editor'
,
function
()
{
scope
.
onAppEvent
(
'hide-dash-editor'
,
function
()
{
if
(
editorScope
)
{
if
(
editorScope
)
{
editorScope
.
dismiss
();
editorScope
.
dismiss
();
...
@@ -56,8 +66,12 @@ function (angular, $) {
...
@@ -56,8 +66,12 @@ function (angular, $) {
elem
.
empty
();
elem
.
empty
();
lastEditor
=
null
;
lastEditor
=
null
;
editorScope
=
null
;
editorScope
=
null
;
hideScrollbars
(
false
);
};
};
// hide page scrollbars while edit pane is visible
hideScrollbars
(
true
);
var
src
=
"'"
+
payload
.
src
+
"'"
;
var
src
=
"'"
+
payload
.
src
+
"'"
;
var
view
=
$
(
'<div class="dashboard-edit-view" ng-include="'
+
src
+
'"></div>'
);
var
view
=
$
(
'<div class="dashboard-edit-view" ng-include="'
+
src
+
'"></div>'
);
elem
.
append
(
view
);
elem
.
append
(
view
);
...
...
src/app/directives/grafanaVersionCheck.js
View file @
7d6e04ac
...
@@ -11,7 +11,7 @@ function (angular) {
...
@@ -11,7 +11,7 @@ function (angular) {
restrict
:
'A'
,
restrict
:
'A'
,
link
:
function
(
scope
,
elem
)
{
link
:
function
(
scope
,
elem
)
{
if
(
grafanaVersion
[
0
]
===
'@'
)
{
if
(
grafanaVersion
[
0
]
===
'@'
)
{
return
;
//
return;
}
}
$http
({
method
:
'GET'
,
url
:
'https://grafanarel.s3.amazonaws.com/latest.json'
})
$http
({
method
:
'GET'
,
url
:
'https://grafanarel.s3.amazonaws.com/latest.json'
})
...
@@ -30,4 +30,4 @@ function (angular) {
...
@@ -30,4 +30,4 @@ function (angular) {
}
}
};
};
});
});
});
});
\ No newline at end of file
src/app/partials/dasheditor.html
View file @
7d6e04ac
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
</div>
</div>
<div
ng-model=
"editor.index"
bs-tabs
style=
"text-transform:capitalize;"
>
<div
ng-model=
"editor.index"
bs-tabs
style=
"text-transform:capitalize;"
>
<div
ng-repeat=
"tab in ['General', 'Rows', '
Control
s', 'Import']"
data-title=
"{{tab}}"
>
<div
ng-repeat=
"tab in ['General', 'Rows', '
Feature
s', 'Import']"
data-title=
"{{tab}}"
>
</div>
</div>
<div
ng-repeat=
"tab in dashboard.nav"
data-title=
"{{tab.type}}"
>
<div
ng-repeat=
"tab in dashboard.nav"
data-title=
"{{tab.type}}"
>
</div>
</div>
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
</bootstrap-tagsinput>
</bootstrap-tagsinput>
<tip>
Press enter to a add tag
</tip>
<tip>
Press enter to a add tag
</tip>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -91,13 +92,12 @@
...
@@ -91,13 +92,12 @@
</div>
</div>
<div
class=
"dashboard-editor-footer"
>
<div
class=
"dashboard-editor-footer"
>
<div
class=
"pull-left"
ng-if=
"editor.index == 0"
>
<div
class=
"grafana-version-info"
ng-show=
"editor.index === 0"
>
<span
class=
"editor-option small"
style=
"line-height: 20px;"
>
<span
class=
"editor-option small"
>
Grafana version: {{grafanaVersion}}
Grafana version: {{grafanaVersion}}
</span>
<span
grafana-version-check
>
</span>
</span>
<span>
|
<a
ng-click=
"toggleConsole()"
ng-show=
"!consoleEnabled"
>
enable console
</a>
<a
ng-click=
"toggleConsole()"
ng-show=
"consoleEnabled"
>
disable console
</a></span>
<div
class=
"small"
grafana-version-check
>
</div>
</div>
</div>
<button
type=
"button"
class=
"btn btn-success pull-right"
ng-click=
"editor.index=0;dismiss();reset_panel();dashboard.emit_refresh()"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-success pull-right"
ng-click=
"editor.index=0;dismiss();reset_panel();dashboard.emit_refresh()"
>
Close
</button>
...
...
src/css/less/grafana.less
View file @
7d6e04ac
...
@@ -32,10 +32,6 @@
...
@@ -32,10 +32,6 @@
}
}
}
}
body {
overflow-y: hidden;
}
// Search
// Search
.grafana-search-panel {
.grafana-search-panel {
.search-field-wrapper {
.search-field-wrapper {
...
@@ -518,6 +514,7 @@ select.grafana-target-segment-input {
...
@@ -518,6 +514,7 @@ select.grafana-target-segment-input {
.dashboard-edit-view {
.dashboard-edit-view {
padding: 20px;
padding: 20px;
background-color: @grafanaPanelBackground;
background-color: @grafanaPanelBackground;
position: relative;
}
}
.dashboard-editor-body {
.dashboard-editor-body {
...
@@ -554,3 +551,11 @@ select.grafana-target-segment-input {
...
@@ -554,3 +551,11 @@ select.grafana-target-segment-input {
}
}
}
}
.grafana-version-info {
position: absolute;
bottom: 2px;
left: 3px;
font-size: 80%;
color: darken(@gray, 25%);
a { color: darken(@gray, 25%); }
}
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