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
d420cb38
Commit
d420cb38
authored
Jan 14, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(plugins): work on plugin directives loading
parent
b55f8215
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
34 deletions
+34
-34
public/app/core/services/dynamic_directive_srv.ts
+1
-1
public/app/features/apps/config_view.ts
+2
-2
public/app/features/apps/partials/edit.html
+3
-3
public/app/features/datasources/all.js
+1
-0
public/app/features/datasources/config_view.ts
+25
-0
public/app/features/datasources/partials/edit.html
+1
-1
public/app/features/panel/panel_directive.js
+0
-27
public/app/plugins/datasource/elasticsearch/module.js
+1
-0
No files found.
public/app/core/services/dynamic_directive_srv.ts
View file @
d420cb38
...
...
@@ -22,7 +22,7 @@ class DynamicDirectiveSrv {
scope
:
options
.
scope
,
link
:
(
scope
,
elem
,
attrs
)
=>
{
options
.
directive
(
scope
).
then
(
directiveInfo
=>
{
if
(
!
directiveInfo
)
{
if
(
!
directiveInfo
||
!
directiveInfo
.
fn
)
{
return
;
}
...
...
public/app/features/apps/config_
loader
.ts
→
public/app/features/apps/config_
view
.ts
View file @
d420cb38
...
...
@@ -3,7 +3,7 @@
import
angular
from
'angular'
;
/** @ngInject */
function
appConfig
Loader
(
dynamicDirectiveSrv
)
{
function
appConfig
View
(
dynamicDirectiveSrv
)
{
return
dynamicDirectiveSrv
.
create
({
scope
:
{
appModel
:
"="
...
...
@@ -20,4 +20,4 @@ function appConfigLoader(dynamicDirectiveSrv) {
}
angular
.
module
(
'grafana.directives'
).
directive
(
'appConfig
Loader'
,
appConfigLoader
);
angular
.
module
(
'grafana.directives'
).
directive
(
'appConfig
View'
,
appConfigView
);
public/app/features/apps/partials/edit.html
View file @
d420cb38
...
...
@@ -93,12 +93,12 @@
<section
class=
"simple-box"
>
<h3
class=
"simple-box-header"
>
Configuration:
</h3>
<div
class=
"simple-box-body"
>
<div
ng-if=
"ctrl.appModel.appId"
>
<app-config-view
app-model=
"ctrl.appModel"
></app-config-view>
</div>
</div>
</section>
<div
ng-if=
"ctrl.appModel.appId"
>
<app-config-loader
app-model=
"ctrl.appModel"
></app-config-loader>
</div>
</div>
</div>
public/app/features/datasources/all.js
View file @
d420cb38
define
([
'./list_ctrl'
,
'./edit_ctrl'
,
'./config_view'
,
],
function
()
{});
public/app/features/datasources/config_view.ts
0 → 100644
View file @
d420cb38
///<reference path="../../headers/common.d.ts" />
import
angular
from
'angular'
;
/** @ngInject */
function
dsConfigView
(
dynamicDirectiveSrv
)
{
return
dynamicDirectiveSrv
.
create
({
scope
:
{
dsMeta
:
"="
,
current
:
"="
},
watch
:
"dsMeta.module"
,
directive
:
scope
=>
{
return
System
.
import
(
scope
.
dsMeta
.
module
).
then
(
function
(
dsModule
)
{
return
{
name
:
'ds-config-'
+
scope
.
dsMeta
.
id
,
fn
:
dsModule
.
configView
,
};
});
},
});
}
angular
.
module
(
'grafana.directives'
).
directive
(
'dsConfigView'
,
dsConfigView
);
public/app/features/datasources/partials/edit.html
View file @
d420cb38
...
...
@@ -42,7 +42,7 @@
<div
class=
"clearfix"
></div>
</div>
<d
atasource-custom-settings-view
ds-meta=
"datasourceMeta"
current=
"current"
></datasource-custom-settings
-view>
<d
s-config-view
ng-if=
"datasourceMeta.id"
ds-meta=
"datasourceMeta"
current=
"current"
></ds-config
-view>
<div
ng-if=
"testing"
style=
"margin-top: 25px"
>
<h5
ng-show=
"!testing.done"
>
Testing....
<i
class=
"fa fa-spiner fa-spin"
></i></h5>
...
...
public/app/features/panel/panel_directive.js
View file @
d420cb38
...
...
@@ -43,33 +43,6 @@ function (angular, $, config) {
};
});
module
.
directive
(
'datasourceCustomSettingsView'
,
function
(
$compile
)
{
return
{
restrict
:
'E'
,
scope
:
{
dsMeta
:
"="
,
current
:
"="
,
},
link
:
function
(
scope
,
elem
)
{
scope
.
$watch
(
"dsMeta.module"
,
function
()
{
if
(
!
scope
.
dsMeta
)
{
return
;
}
System
.
import
(
scope
.
dsMeta
.
module
).
then
(
function
()
{
elem
.
empty
();
var
panelEl
=
angular
.
element
(
document
.
createElement
(
'datasource-custom-settings-view-'
+
scope
.
dsMeta
.
id
));
elem
.
append
(
panelEl
);
$compile
(
panelEl
)(
scope
);
}).
catch
(
function
(
err
)
{
console
.
log
(
'Failed to load plugin:'
,
err
);
scope
.
appEvent
(
'alert-error'
,
[
'Plugin Load Error'
,
'Failed to load plugin '
+
scope
.
dsMeta
.
id
+
', '
+
err
]);
});
});
}
};
});
module
.
directive
(
'datasourceEditorView'
,
function
(
dynamicDirectiveSrv
)
{
return
{
restrict
:
'E'
,
...
...
public/app/plugins/datasource/elasticsearch/module.js
View file @
d420cb38
...
...
@@ -55,6 +55,7 @@ function (angular, ElasticDatasource, editView) {
return
{
Datasource
:
ElasticDatasource
,
configView
:
editView
.
default
,
};
});
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