Skip to content

Commit 5b87d94

Browse files
authored
Merge pull request #56 from Landoop/plugins-for-0.11-and-above
Plugins for 0.11 and above Fixes #54
2 parents 02e7534 + 6e51a0e commit 5b87d94

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/kafka-connect/select-type/sink-or-source.controller.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,22 @@ angularAPP.controller('SelectNewConnectorCtrl', function ($scope, $http, $log, $
2222

2323
if (supportedConnectorsFactory.getAllClassFromTemplate().indexOf(plugin.class) == -1) {
2424
$scope.hasUnsupportedConnectors = true;
25-
var type="Unknown";
26-
var a = plugin.class.split('.');
27-
if (a[a.length-1].toLowerCase().indexOf('sink') > 0) {
28-
type="Sink"
29-
} else if (a[a.length-1].toLowerCase().indexOf('source') > 0) {
30-
type="Source"
31-
}
25+
var splitClass = plugin.class.split('.');
26+
var calcName = splitClass[splitClass.length - 1];
27+
3228
var o = {
33-
name: a[a.length-1],
29+
name: calcName,
3430
class: plugin.class,
3531
icon: "connector.jpg",
3632
isUndefined: true,
37-
type: type
33+
34+
}
35+
if(!plugin.type) {
36+
o.type = calcName.toLowerCase().indexOf('sink') > 0 ? 'Sink' : 'Source'
37+
} else {
38+
o.type = plugin.type.toLowerCase().indexOf('sink') > 0 ? 'Sink' : 'Source'
3839
}
39-
if (type == "Source")
40+
if (o.type == "Source")
4041
$scope.sources.push(o);
4142
else
4243
$scope.sinks.push(o);

src/kafka-connect/select-type/sink-or-source.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h4>
2424

2525
<md-list class="dense" flex ng-if="sources.length > 0">
2626
<md-subheader class="md-no-sticky">Sources</md-subheader>
27-
<md-list-item ng-repeat="source in sources | filter : search2"
27+
<md-list-item ng-repeat="source in sources | filter : search2 track by $index"
2828
class="md-2-line createConnectorList"
2929
ng-if="isClassInClasspath(source.class)">
3030
<a ng-href="#/cluster/{{ cluster }}/create-connector/{{ source.class }}"><img ng-src="src/assets/icons/{{source.icon}}" class="md-avatar" style="height: initial;"/></a>
@@ -40,7 +40,7 @@ <h3><b><a ng-href="#/cluster/{{ cluster }}/create-connector/{{ source.class }}">
4040

4141
<md-list class="dense" flex ng-if="sinks.length > 0" >
4242
<md-subheader class="md-no-sticky">Sinks</md-subheader>
43-
<md-list-item ng-repeat="sink in sinks | filter : search2"
43+
<md-list-item ng-repeat="sink in sinks | filter : search2 track by $index"
4444
class="md-2-line createConnectorList"
4545
ng-if="isClassInClasspath(sink.class)">
4646
<a ng-href="#/cluster/{{ cluster }}/create-connector/{{ sink.class }}"><img ng-src="src/assets/icons/{{sink.icon}}" class="md-avatar" style="width:40px;height:40px;" /></a>

0 commit comments

Comments
 (0)