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
6c6c3a50
Commit
6c6c3a50
authored
Jan 14, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(plugins): more work on how plugins expose directives
parent
d420cb38
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
80 additions
and
57 deletions
+80
-57
docs/sources/reference/keyboard_shortcuts.md
+1
-1
public/app/core/services/dynamic_directive_srv.ts
+18
-8
public/app/features/all.js
+1
-1
public/app/features/annotations/annotations_srv.js
+2
-1
public/app/features/annotations/editor_ctrl.js
+0
-0
public/app/features/annotations/partials/editor.html
+2
-4
public/app/features/annotations/query_editor.ts
+26
-0
public/app/features/apps/all.ts
+1
-1
public/app/features/dashboard/keybindings.js
+1
-1
public/app/features/panel/panel_directive.js
+0
-14
public/app/partials/help_modal.html
+4
-4
public/app/plugins/datasource/cloudwatch/module.js
+4
-3
public/app/plugins/datasource/elasticsearch/module.js
+12
-13
public/app/plugins/datasource/graphite/module.js
+6
-4
public/app/plugins/datasource/graphite/partials/annotations.editor.html
+2
-2
No files found.
docs/sources/reference/keyboard_shortcuts.md
View file @
6c6c3a50
...
...
@@ -18,10 +18,10 @@ Press `Shift`+`?` to open the keyboard shortcut dialog from anywhere within the
|---|---|
|
`Esc`
|Exit fullscreen edit/view mode, close search or any editor view|
|
`F`
|Open dashboard search view (also contains import/playlist controls)|
|
`R`
|Refresh (Fetches new data and rerenders panels)|
|
`CTRL`
+
`S`
|Save dashboard|
|
`CTRL`
+
`H`
|Hide row controls|
|
`CTRL`
+
`Z`
|Zoom out|
|
`CTRL`
+
`R`
|Refresh (Fetches new data and rerenders panels)|
|
`CTRL`
+
`O`
|Enable/Disable shared graph crosshair|
...
...
public/app/core/services/dynamic_directive_srv.ts
View file @
6c6c3a50
...
...
@@ -6,7 +6,7 @@ import coreModule from '../core_module';
class
DynamicDirectiveSrv
{
/** @ngInject */
constructor
(
private
$compile
,
private
$parse
)
{}
constructor
(
private
$compile
,
private
$parse
,
private
$rootScope
)
{}
addDirective
(
element
,
name
,
scope
)
{
var
child
=
angular
.
element
(
document
.
createElement
(
name
));
...
...
@@ -16,13 +16,10 @@ class DynamicDirectiveSrv {
element
.
append
(
child
);
}
create
(
options
)
{
let
directiveDef
=
{
restrict
:
'E'
,
scope
:
options
.
scope
,
link
:
(
scope
,
elem
,
attrs
)
=>
{
link
(
scope
,
elem
,
attrs
,
options
)
{
options
.
directive
(
scope
).
then
(
directiveInfo
=>
{
if
(
!
directiveInfo
||
!
directiveInfo
.
fn
)
{
elem
.
empty
();
return
;
}
...
...
@@ -32,10 +29,23 @@ class DynamicDirectiveSrv {
}
this
.
addDirective
(
elem
,
directiveInfo
.
name
,
scope
);
}).
catch
(
function
(
err
)
{
console
.
log
(
'Dynamic directive load error: '
,
err
);
}).
catch
(
err
=>
{
console
.
log
(
'Plugin load:'
,
err
);
this
.
$rootScope
.
appEvent
(
'alert-error'
,
[
'Plugin error'
,
err
.
toString
()]);
});
}
create
(
options
)
{
let
directiveDef
=
{
restrict
:
'E'
,
scope
:
options
.
scope
,
link
:
(
scope
,
elem
,
attrs
)
=>
{
if
(
options
.
watch
)
{
scope
.
$watch
(
options
.
watch
,()
=>
this
.
link
(
scope
,
elem
,
attrs
,
options
));
}
else
{
this
.
link
(
scope
,
elem
,
attrs
,
options
);
}
}
};
return
directiveDef
;
...
...
public/app/features/all.js
View file @
6c6c3a50
define
([
'./panellinks/module'
,
'./dashlinks/module'
,
'./annotations/annotations
S
rv'
,
'./annotations/annotations
_s
rv'
,
'./templating/templateSrv'
,
'./dashboard/all'
,
'./playlist/all'
,
...
...
public/app/features/annotations/annotations
S
rv.js
→
public/app/features/annotations/annotations
_s
rv.js
View file @
6c6c3a50
define
([
'angular'
,
'lodash'
,
'./editorCtrl'
'./editor_ctrl'
,
'./query_editor'
],
function
(
angular
,
_
)
{
'use strict'
;
...
...
public/app/features/annotations/editor
C
trl.js
→
public/app/features/annotations/editor
_c
trl.js
View file @
6c6c3a50
File moved
public/app/features/annotations/partials/editor.html
View file @
6c6c3a50
...
...
@@ -91,10 +91,8 @@
</div>
</div>
<annnotations-ds-query-editor
datasource=
"currentAnnotation.datasource"
current-annotation=
"currentAnnotation"
></annotations-ds-query-editor>
<datasource-editor-view
datasource=
"currentAnnotation.datasource"
name=
"annotations-query-editor"
></datasource-editor-view>
<annotations-query-editor
datasource=
"currentDatasource"
annotation=
"currentAnnotation"
>
</annotations-query-editor>
<br>
<button
ng-show=
"mode === 'new'"
type=
"button"
class=
"btn btn-success"
ng-click=
"add()"
>
Add
</button>
...
...
public/app/features/annotations/query_editor.ts
0 → 100644
View file @
6c6c3a50
///<reference path="../../headers/common.d.ts" />
import
angular
from
'angular'
;
/** @ngInject */
function
annotationsQueryEditor
(
dynamicDirectiveSrv
)
{
return
dynamicDirectiveSrv
.
create
({
scope
:
{
annotation
:
"="
,
datasource
:
"="
},
watch
:
"datasource.type"
,
directive
:
scope
=>
{
console
.
log
(
scope
.
datasource
);
return
System
.
import
(
scope
.
datasource
.
meta
.
module
).
then
(
function
(
dsModule
)
{
return
{
name
:
'annotation-query-editor-'
+
scope
.
datasource
.
meta
.
id
,
fn
:
dsModule
.
annotationsQueryEditor
,
};
});
},
});
}
angular
.
module
(
'grafana.directives'
).
directive
(
'annotationsQueryEditor'
,
annotationsQueryEditor
);
public/app/features/apps/all.ts
View file @
6c6c3a50
import
'./edit_ctrl'
;
import
'./list_ctrl'
;
import
'./config_
loader
'
;
import
'./config_
view
'
;
public/app/features/dashboard/keybindings.js
View file @
6c6c3a50
...
...
@@ -52,7 +52,7 @@ function(angular, $) {
scope
.
appEvent
(
'save-dashboard'
,
evt
);
},
{
inputDisabled
:
true
});
keyboardManager
.
bind
(
'
ctrl+
r'
,
function
()
{
keyboardManager
.
bind
(
'r'
,
function
()
{
scope
.
broadcastRefresh
();
},
{
inputDisabled
:
true
});
...
...
public/app/features/panel/panel_directive.js
View file @
6c6c3a50
...
...
@@ -43,20 +43,6 @@ function (angular, $, config) {
};
});
module
.
directive
(
'datasourceEditorView'
,
function
(
dynamicDirectiveSrv
)
{
return
{
restrict
:
'E'
,
link
:
function
(
scope
,
elem
,
attrs
)
{
dynamicDirectiveSrv
.
define
({
datasourceProperty
:
attrs
.
datasource
,
name
:
attrs
.
name
,
scope
:
scope
,
parentElem
:
elem
,
});
}
};
});
module
.
directive
(
'queryEditorLoader'
,
function
(
$compile
,
$parse
,
datasourceSrv
)
{
return
{
restrict
:
'E'
,
...
...
public/app/partials/help_modal.html
View file @
6c6c3a50
...
...
@@ -25,6 +25,10 @@
<td>
Open dashboard search view (also contains import/playlist controls)
</td>
</tr>
<tr>
<td><span
class=
"label label-info"
>
R
</span></td>
<td>
Refresh (Fetches new data and rerenders panels)
</td>
</tr>
<tr>
<td><span
class=
"label label-info"
>
CTRL+S
</span></td>
<td>
Save dashboard
</td>
</tr>
...
...
@@ -37,10 +41,6 @@
<td>
Zoom out
</td>
</tr>
<tr>
<td><span
class=
"label label-info"
>
CTRL+R
</span></td>
<td>
Refresh (Fetches new data and rerenders panels)
</td>
</tr>
<tr>
<td><span
class=
"label label-info"
>
CTRL+O
</span></td>
<td>
Enable/Disable shared graph crosshair
</td>
</tr>
...
...
public/app/plugins/datasource/cloudwatch/module.js
View file @
6c6c3a50
...
...
@@ -29,11 +29,12 @@ function (angular, CloudWatchDatasource) {
};
});
module
.
directive
(
'datasourceCustomSettingsViewCloudwatch'
,
function
()
{
function
configView
()
{
return
{
templateUrl
:
'app/plugins/datasource/cloudwatch/partials/edit_view.html'
};
}
);
}
return
{
Datasource
:
CloudWatchDatasource
Datasource
:
CloudWatchDatasource
,
configView
:
configView
,
};
});
public/app/plugins/datasource/elasticsearch/module.js
View file @
6c6c3a50
...
...
@@ -10,18 +10,6 @@ function (angular, ElasticDatasource, editView) {
var
module
=
angular
.
module
(
'grafana.directives'
);
module
.
directive
(
'metricQueryEditorElasticsearch'
,
function
()
{
return
{
controller
:
'ElasticQueryCtrl'
,
templateUrl
:
'app/plugins/datasource/elasticsearch/partials/query.editor.html'
};
});
module
.
directive
(
'metricQueryOptionsElasticsearch'
,
function
()
{
return
{
templateUrl
:
'app/plugins/datasource/elasticsearch/partials/query.options.html'
};
});
module
.
directive
(
'annotationsQueryEditorElasticsearch'
,
function
()
{
return
{
templateUrl
:
'app/plugins/datasource/elasticsearch/partials/annotations.editor.html'
};
});
module
.
directive
(
'elasticMetricAgg'
,
function
()
{
return
{
templateUrl
:
'app/plugins/datasource/elasticsearch/partials/metric_agg.html'
,
...
...
@@ -51,11 +39,22 @@ function (angular, ElasticDatasource, editView) {
};
});
module
.
directive
(
'datasourceCustomSettingsViewElasticsearch'
,
editView
.
default
);
module
.
directive
(
'metricQueryEditorElasticsearch'
,
function
()
{
return
{
controller
:
'ElasticQueryCtrl'
,
templateUrl
:
'app/plugins/datasource/elasticsearch/partials/query.editor.html'
};
});
module
.
directive
(
'metricQueryOptionsElasticsearch'
,
function
()
{
return
{
templateUrl
:
'app/plugins/datasource/elasticsearch/partials/query.options.html'
};
});
function
annotationsQueryEditor
()
{
return
{
templateUrl
:
'app/plugins/datasource/elasticsearch/partials/annotations.editor.html'
};
}
return
{
Datasource
:
ElasticDatasource
,
configView
:
editView
.
default
,
annotationsQueryEditor
:
annotationsQueryEditor
,
};
});
public/app/plugins/datasource/graphite/module.js
View file @
6c6c3a50
...
...
@@ -15,15 +15,17 @@ function (angular, GraphiteDatasource) {
return
{
templateUrl
:
'app/plugins/datasource/graphite/partials/query.options.html'
};
});
module
.
directive
(
'annotationsQueryEditorGraphite'
,
function
()
{
function
annotationsQueryEditor
()
{
return
{
templateUrl
:
'app/plugins/datasource/graphite/partials/annotations.editor.html'
};
}
);
}
module
.
directive
(
'datasourceCustomSettingsViewGraphite'
,
function
()
{
function
configView
()
{
return
{
templateUrl
:
'app/plugins/datasource/graphite/partials/config.html'
};
}
);
}
return
{
Datasource
:
GraphiteDatasource
,
configView
:
configView
,
annotationsQueryEditor
:
annotationsQueryEditor
,
};
});
public/app/plugins/datasource/graphite/partials/annotations.editor.html
View file @
6c6c3a50
<div
class=
"editor-row"
>
<div
class=
"editor-option"
>
<label
class=
"small"
>
Graphite target expression
</label>
<input
type=
"text"
class=
"span10"
ng-model=
'
currentA
nnotation.target'
placeholder=
""
></input>
<input
type=
"text"
class=
"span10"
ng-model=
'
a
nnotation.target'
placeholder=
""
></input>
</div>
</div>
<div
class=
"editor-row"
>
<div
class=
"editor-option"
>
<label
class=
"small"
>
Graphite event tags
</label>
<input
type=
"text"
ng-model=
'
currentA
nnotation.tags'
placeholder=
""
></input>
<input
type=
"text"
ng-model=
'
a
nnotation.tags'
placeholder=
""
></input>
</div>
</div>
...
...
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