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
a3eb11ca
Commit
a3eb11ca
authored
Jul 24, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #274 from rashidkpc/master
Editor cleanup, support for unlimited ttl on shared dashboards
parents
7a53bcd7
bfe3c376
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
18 deletions
+33
-18
common/css/main.css
+6
-0
js/services.js
+1
-2
panels/dashcontrol/editor.html
+14
-10
panels/dashcontrol/module.js
+7
-1
partials/paneleditor.html
+1
-3
partials/panelgeneral.html
+2
-1
partials/roweditor.html
+2
-1
No files found.
common/css/main.css
View file @
a3eb11ca
...
@@ -13,6 +13,12 @@
...
@@ -13,6 +13,12 @@
text-transform
:
capitalize
;
text-transform
:
capitalize
;
}
}
.editor-title
small
{
opacity
:
0.5
;
font-size
:
0.7em
;
font-weight
:
normal
;
}
.spy
{
.spy
{
position
:
absolute
;
position
:
absolute
;
right
:
0px
;
right
:
0px
;
...
...
js/services.js
View file @
a3eb11ca
...
@@ -716,8 +716,7 @@ angular.module('kibana.services', [])
...
@@ -716,8 +716,7 @@ angular.module('kibana.services', [])
dashboard
:
angular
.
toJson
(
save
)
dashboard
:
angular
.
toJson
(
save
)
});
});
request
=
type
===
'temp'
?
request
.
ttl
(
ttl
)
:
request
;
request
=
type
===
'temp'
&&
ttl
?
request
.
ttl
(
ttl
)
:
request
;
// TOFIX: Implement error handling here
// TOFIX: Implement error handling here
return
request
.
doIndex
(
return
request
.
doIndex
(
...
...
panels/dashcontrol/editor.html
View file @
a3eb11ca
...
@@ -2,28 +2,28 @@
...
@@ -2,28 +2,28 @@
<h5>
Allow saving to
</h5>
<h5>
Allow saving to
</h5>
<div
class=
"row-fluid"
>
<div
class=
"row-fluid"
>
<div
class=
"span2"
>
<div
class=
"span2"
>
<label
class=
"small"
>
Export
</label><input
type=
"checkbox"
ng-model=
"panel.save.local"
ng-checked=
"panel.save.local"
>
<label
class=
"small"
>
Export
</label><input
type=
"checkbox"
ng-model=
"panel.save.local"
ng-checked=
"panel.save.local"
>
</div>
</div>
<div
class=
"span2"
>
<div
class=
"span2"
>
<label
class=
"small"
>
Defaults
</label><input
type=
"checkbox"
ng-model=
"panel.save.default"
ng-checked=
"panel.save.default"
>
<label
class=
"small"
>
Defaults
</label><input
type=
"checkbox"
ng-model=
"panel.save.default"
ng-checked=
"panel.save.default"
>
</div>
</div>
<div
class=
"span2"
>
<div
class=
"span2"
>
<label
class=
"small"
>
Gist
</label><input
type=
"checkbox"
ng-model=
"panel.save.gist"
ng-checked=
"panel.save.gist"
>
<label
class=
"small"
>
Gist
<i
class=
"icon-question-sign"
bs-tooltip=
"'Requires your domain to be OAUTH registered with Github'"
></i>
</label><input
type=
"checkbox"
ng-model=
"panel.save.gist"
ng-checked=
"panel.save.gist"
>
</div>
</div>
<div
class=
"span2"
>
<div
class=
"span2"
>
<label
class=
"small"
>
Elasticsearch
</label><input
type=
"checkbox"
ng-model=
"panel.save.elasticsearch"
ng-checked=
"panel.save.elasticsearch"
>
<label
class=
"small"
>
Elasticsearch
</label><input
type=
"checkbox"
ng-model=
"panel.save.elasticsearch"
ng-checked=
"panel.save.elasticsearch"
>
</div>
</div>
</div>
</div>
<h5>
Allow loading from
</h5>
<h5>
Allow loading from
</h5>
<div
class=
"row-fluid"
>
<div
class=
"row-fluid"
>
<div
class=
"span2"
>
<div
class=
"span2"
>
<label
class=
"small"
>
Local file
</label><input
type=
"checkbox"
ng-model=
"panel.load.local"
ng-checked=
"panel.load.local"
>
<label
class=
"small"
>
Local file
</label><input
type=
"checkbox"
ng-model=
"panel.load.local"
ng-checked=
"panel.load.local"
>
</div>
</div>
<div
class=
"span2"
>
<div
class=
"span2"
>
<label
class=
"small"
>
Gist
</label><input
type=
"checkbox"
ng-model=
"panel.load.gist"
ng-checked=
"panel.load.gist"
>
<label
class=
"small"
>
Gist
</label><input
type=
"checkbox"
ng-model=
"panel.load.gist"
ng-checked=
"panel.load.gist"
>
</div>
</div>
<div
class=
"span2"
>
<div
class=
"span2"
>
<label
class=
"small"
>
Elasticsearch
</label><input
type=
"checkbox"
ng-model=
"panel.load.elasticsearch"
ng-checked=
"panel.load.elasticsearch"
>
<label
class=
"small"
>
Elasticsearch
</label><input
type=
"checkbox"
ng-model=
"panel.load.elasticsearch"
ng-checked=
"panel.load.elasticsearch"
>
</div>
</div>
<div
class=
"span3"
ng-show=
"panel.load.elasticsearch"
>
<div
class=
"span3"
ng-show=
"panel.load.elasticsearch"
>
<label
class=
"small"
>
ES list size
</label><input
class=
"input-mini"
type=
"number"
ng-model=
"panel.elasticsearch_size"
>
<label
class=
"small"
>
ES list size
</label><input
class=
"input-mini"
type=
"number"
ng-model=
"panel.elasticsearch_size"
>
...
@@ -31,11 +31,14 @@
...
@@ -31,11 +31,14 @@
</div>
</div>
<h5>
Sharing
</h5>
<h5>
Sharing
</h5>
<div
class=
"row-fluid"
>
<div
class=
"row-fluid"
>
<div
class=
"span
3
"
>
<div
class=
"span
2
"
>
<label
class=
"small"
>
Allow Sharing
</label><input
type=
"checkbox"
ng-model=
"panel.temp"
ng-checked=
"panel.temp"
>
<label
class=
"small"
>
Allow Sharing
</label><input
type=
"checkbox"
ng-model=
"panel.temp"
ng-checked=
"panel.temp"
>
</div>
</div>
<div
class=
"span8"
ng-show=
"panel.temp"
>
<div
class=
"span2"
ng-show=
"panel.temp"
>
<label
class=
"small"
>
Shared Link TTL (examples: 1m,1d,1w,30d)
</label><input
class=
"input-small"
type=
"text"
ng-model=
"panel.temp_ttl"
>
<label
class=
"small"
>
TTL
</label><input
type=
"checkbox"
ng-model=
"panel.ttl_enable"
ng-checked=
"panel.temp"
>
</div>
<div
class=
"span5"
ng-show=
"panel.temp && panel.ttl_enable"
>
<label
class=
"small"
>
TTL Duration
<i
class=
"icon-question-sign"
bs-tooltip=
"'Elasticsearch date math, eg: 1m,1d,1w,30d'"
></i></label><input
class=
"input-small"
type=
"text"
ng-model=
"panel.temp_ttl"
>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
panels/dashcontrol/module.js
View file @
a3eb11ca
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
* hide_control :: Upon save, hide this panel
* hide_control :: Upon save, hide this panel
* elasticsearch_size :: show this many dashboards under the ES section in the load drop down
* elasticsearch_size :: show this many dashboards under the ES section in the load drop down
* temp :: Allow saving of temp dashboards
* temp :: Allow saving of temp dashboards
* ttl :: Enable setting ttl.
* temp_ttl :: How long should temp dashboards persist
* temp_ttl :: How long should temp dashboards persist
*/
*/
...
@@ -48,6 +49,7 @@ angular.module('kibana.dashcontrol', [])
...
@@ -48,6 +49,7 @@ angular.module('kibana.dashcontrol', [])
hide_control
:
false
,
hide_control
:
false
,
elasticsearch_size
:
20
,
elasticsearch_size
:
20
,
temp
:
true
,
temp
:
true
,
ttl_enable
:
true
,
temp_ttl
:
'30d'
temp_ttl
:
'30d'
};
};
_
.
defaults
(
$scope
.
panel
,
_d
);
_
.
defaults
(
$scope
.
panel
,
_d
);
...
@@ -83,7 +85,11 @@ angular.module('kibana.dashcontrol', [])
...
@@ -83,7 +85,11 @@ angular.module('kibana.dashcontrol', [])
};
};
$scope
.
elasticsearch_save
=
function
(
type
,
ttl
)
{
$scope
.
elasticsearch_save
=
function
(
type
,
ttl
)
{
dashboard
.
elasticsearch_save
(
type
,(
$scope
.
elasticsearch
.
title
||
dashboard
.
current
.
title
),
ttl
).
then
(
dashboard
.
elasticsearch_save
(
type
,
(
$scope
.
elasticsearch
.
title
||
dashboard
.
current
.
title
),
(
$scope
.
panel
.
ttl_enable
?
ttl
:
false
)
).
then
(
function
(
result
)
{
function
(
result
)
{
if
(
!
_
.
isUndefined
(
result
.
_id
))
{
if
(
!
_
.
isUndefined
(
result
.
_id
))
{
$scope
.
alert
(
'Dashboard Saved'
,
'This dashboard has been saved to Elasticsearch as "'
+
$scope
.
alert
(
'Dashboard Saved'
,
'This dashboard has been saved to Elasticsearch as "'
+
...
...
partials/paneleditor.html
View file @
a3eb11ca
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<div
class=
"pull-right editor-title"
>
{{panel.type}} settings
</div>
<div
class=
"pull-right editor-title"
>
<small>
({{panel.status}})
</small>
{{panel.type}} settings
</div>
<div
ng-model=
"editor.index"
bs-tabs
>
<div
ng-model=
"editor.index"
bs-tabs
>
<div
ng-repeat=
"tab in ['General','Panel']"
data-title=
"{{tab}}"
>
<div
ng-repeat=
"tab in ['General','Panel']"
data-title=
"{{tab}}"
>
</div>
</div>
</div>
</div>
<div
ng-show=
"editor.index == 0"
>
<div
ng-show=
"editor.index == 0"
>
<h4>
{{panel.title}} General
<small>
panel settings
</small></h4>
<div
ng-include
src=
"'partials/panelgeneral.html'"
></div>
<div
ng-include
src=
"'partials/panelgeneral.html'"
></div>
</div>
</div>
<div
ng-show=
"editor.index == 1"
>
<div
ng-show=
"editor.index == 1"
>
<h4
style=
"text-transform: capitalize;"
>
{{panel.type}}
<small>
panel settings.
<strong
ng-show=
"!_.isUndefined(panel.status)"
>
({{panel.status}})
</strong></small></h4>
<div
ng-include
src=
"edit_path(panel.type)"
>
No additional settings are available for this type of panel.
</div>
<div
ng-include
src=
"edit_path(panel.type)"
>
No additional settings are available for this type of panel.
</div>
</div>
</div>
...
...
partials/panelgeneral.html
View file @
a3eb11ca
...
@@ -6,6 +6,6 @@
...
@@ -6,6 +6,6 @@
<label
class=
"small"
>
Span
</label>
<select
class=
"input-mini"
ng-model=
"panel.span"
ng-options=
"f for f in [0,1,2,3,4,5,6,7,8,9,10,11,12]"
></select>
<label
class=
"small"
>
Span
</label>
<select
class=
"input-mini"
ng-model=
"panel.span"
ng-options=
"f for f in [0,1,2,3,4,5,6,7,8,9,10,11,12]"
></select>
</div>
</div>
<div
class=
"span1"
>
<div
class=
"span1"
>
<label
class=
"small"
>
Editable
</label><input
type=
"checkbox"
ng-model=
"panel.editable"
ng-checked=
"panel.editable"
>
<label
class=
"small"
>
Editable
</label><input
type=
"checkbox"
ng-model=
"panel.editable"
ng-checked=
"panel.editable"
>
</div>
</div>
</div>
</div>
\ No newline at end of file
partials/roweditor.html
View file @
a3eb11ca
...
@@ -59,5 +59,5 @@
...
@@ -59,5 +59,5 @@
</div>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-success"
ng-click=
"dismiss();reset_panel();close_edit()"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-success"
ng-click=
"
editor.index=0;
dismiss();reset_panel();close_edit()"
>
Close
</button>
</div>
</div>
\ No newline at end of file
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