diff --git a/src/app.js b/src/app.js index 2c33b5b..979bcba 100644 --- a/src/app.js +++ b/src/app.js @@ -39,7 +39,11 @@ angularAPP.config(function ($routeProvider) { templateUrl: 'src/kafka-topics/new/new-topic.html', controller: 'HeaderCtrl' }) - .when('/topic/:topicName', { + .when('/topic/:topicCategoryUrl/:topicName/', { + templateUrl: 'src/kafka-topics/view/view.html', + controller: 'ViewTopicCtrl' + }) + .when('/topic/:topicCategoryUrl/:topicName/:selectedTabIndex', { templateUrl: 'src/kafka-topics/view/view.html', controller: 'ViewTopicCtrl' }).otherwise({ @@ -48,6 +52,20 @@ angularAPP.config(function ($routeProvider) { // $locationProvider.html5Mode(true); }); +angularAPP.run(['$route', '$rootScope', '$location', function ($route, $rootScope, $location) { + var original = $location.path; + $location.path = function (path, reload) { + if (reload === false) { + var lastRoute = $route.current; + var un = $rootScope.$on('$locationChangeSuccess', function () { + $route.current = lastRoute; + un(); + }); + } + return original.apply($location, [path]); + }; +}]) + // ng-show="x | isEmpty" angularAPP.filter('isEmpty', function () { var bar; diff --git a/src/assets/css/styles.css b/src/assets/css/styles.css index 682f6d0..c781d6c 100644 --- a/src/assets/css/styles.css +++ b/src/assets/css/styles.css @@ -63,7 +63,18 @@ a:link, header.a:visited, header.a:hover, header.a:active { border: 1px solid #ddd; z-index: 2; } +.normalcontent.ng-scope { + overflow:initial} +} + +.leftlistPagination .pagination { + margin:0; +} +.toggleconfig { + float: right; + color: #448AFF; +} .example1:after { content: "Register a Complex Schema"; } diff --git a/src/factories/dirPagination.js b/src/factories/dirPagination.js index 87152b8..712a33f 100644 --- a/src/factories/dirPagination.js +++ b/src/factories/dirPagination.js @@ -225,7 +225,7 @@ function dirPaginationControlsTemplateInstaller($templateCache) { var strVar=""; - strVar += "
<\/ng-md-icon> <\/md-button> <\/ng-md-icon> <\/md-button> {{pageNumber}}<\/md-button> <\/ng-md-icon> <\/md-button> <\/ng-md-icon> <\/md-button><\/section>"; + strVar += "
<\/ng-md-icon> <\/md-button> <\/ng-md-icon> <\/md-button> {{pageNumber}}<\/md-button> <\/ng-md-icon> <\/md-button> <\/ng-md-icon> <\/md-button><\/section>"; $templateCache.put('angularUtils.directives.dirPagination.template', strVar); } diff --git a/src/factories/kafka-rest-proxy-factory.js b/src/factories/kafka-rest-proxy-factory.js index 3b0a842..f57a23a 100644 --- a/src/factories/kafka-rest-proxy-factory.js +++ b/src/factories/kafka-rest-proxy-factory.js @@ -24,6 +24,7 @@ angularAPP.factory('KafkaRestProxyFactory', function ($rootScope, $http, $log, $ function success(response) { $log.debug(" curl -X GET " + url + " in [ " + (new Date().getTime() - start) + " ] msec"); var topicNames = response.data; + deferred.resolve(topicNames); }, function failure(response) { diff --git a/src/kafka-topics/list/control-topics-list.html b/src/kafka-topics/list/control-topics-list.html index 0b55159..50c59f4 100644 --- a/src/kafka-topics/list/control-topics-list.html +++ b/src/kafka-topics/list/control-topics-list.html @@ -12,13 +12,14 @@
- + current-page="controlTopicPage" + ng-class="{ 'selectedListItem': topic == topicName }" + >
@@ -40,8 +41,8 @@

{{shortenControlCenterName(topic)}}

-
- +
+
diff --git a/src/kafka-topics/list/left-list.html b/src/kafka-topics/list/left-list.html index f6e2fae..60771e7 100644 --- a/src/kafka-topics/list/left-list.html +++ b/src/kafka-topics/list/left-list.html @@ -1,29 +1,18 @@ - - +

- {{topics.length}} Topics + {{topics.length}} Topics + {{controlTopics.length}} Topics

- - -
System Topics
-
System Topics
-
-
-
- -
-

- {{controlTopics.length}} Topics -

System Topics
-
System Topics
+
System Topics
+
diff --git a/src/kafka-topics/list/topics-list.controller.js b/src/kafka-topics/list/topics-list.controller.js index 90d64e8..19c679a 100644 --- a/src/kafka-topics/list/topics-list.controller.js +++ b/src/kafka-topics/list/topics-list.controller.js @@ -2,7 +2,14 @@ angularAPP.controller('KafkaTopicsListCtrl', function ($scope, $rootScope, $loca $log.info("Starting kafka-topics controller : list (getting topic info)"); toastFactory.hideToast(); - $scope.displayingControlTopics = false; + + $rootScope.$watch('topicCategoryUrl' ,function(){ + $scope.displayingControlTopics = false; + if ($rootScope.topicCategoryUrl =='c') { + $scope.displayingControlTopics = true; + } + },true); + KafkaRestProxyFactory.loadSchemas(); /** @@ -28,6 +35,20 @@ angularAPP.controller('KafkaTopicsListCtrl', function ($scope, $rootScope, $loca $log.error('Failed: ' + reason); }); + $scope.topicsPerPage = 7; + + $scope.controlTopicIndex = $scope.controlTopics.indexOf($rootScope.topicName ); + $scope.controlTopicPage = Math.ceil($scope.controlTopicIndex / $scope.topicsPerPage); + if ($scope.controlTopicPage < 1) { + $scope.controlTopicPage = 1 + } + + $scope.normalTopicIndex = $scope.topics.indexOf($rootScope.topicName ); + $scope.normalTopicPage = Math.ceil($scope.normalTopicIndex / $scope.topicsPerPage); + if ($scope.normalTopicPage < 1) { + $scope.normalTopicPage = 1 + } + }, function (reason) { $log.error('Failed: ' + reason); toastFactory.showSimpleToast("No connectivity. Could not get topic names"); @@ -47,6 +68,8 @@ angularAPP.controller('KafkaTopicsListCtrl', function ($scope, $rootScope, $loca return KafkaRestProxyFactory.isNormalTopic(topicName); }; + $scope.displayingControlTopics = $scope.isNormalTopic; + $scope.hasExtraConfig = function (topicName) { return KafkaRestProxyFactory.hasExtraConfig(topicName); }; @@ -60,7 +83,12 @@ angularAPP.controller('KafkaTopicsListCtrl', function ($scope, $rootScope, $loca } $scope.listClick = function (topicName) { - $location.url("topic/" + topicName); + if (KafkaRestProxyFactory.isNormalTopic(topicName) == false) { + $scope.CategoryTopicUrls = 'c'; + } else { + $scope.CategoryTopicUrls = 'n'; + } + $location.path("topic/" + $scope.CategoryTopicUrls + "/" + topicName); } function doCountsForTopic(topicName) { diff --git a/src/kafka-topics/list/topics-list.html b/src/kafka-topics/list/topics-list.html index ea5dcb5..b1bb0fa 100644 --- a/src/kafka-topics/list/topics-list.html +++ b/src/kafka-topics/list/topics-list.html @@ -13,9 +13,10 @@
-
@@ -39,8 +40,8 @@

{{topic}}

-
- +
+
diff --git a/src/kafka-topics/view/templates/flat_table.html b/src/kafka-topics/view/templates/flat_table.html index d7b8859..21ad089 100644 --- a/src/kafka-topics/view/templates/flat_table.html +++ b/src/kafka-topics/view/templates/flat_table.html @@ -1,6 +1,4 @@ - - Table @@ -10,11 +8,11 @@ - + - + @@ -22,7 +20,7 @@ - @@ -30,9 +28,8 @@
partition key keyvaluevalue
{{c3}}{{c}}{{c}}
{{column}}
+ {{row[column]}}
- +
-
-
+ \ No newline at end of file diff --git a/src/kafka-topics/view/templates/normal.html b/src/kafka-topics/view/templates/normal.html index cf88248..3087b52 100644 --- a/src/kafka-topics/view/templates/normal.html +++ b/src/kafka-topics/view/templates/normal.html @@ -1,8 +1,7 @@ - - Topic + - + @@ -31,9 +30,8 @@
- +
-
diff --git a/src/kafka-topics/view/templates/raw_data.html b/src/kafka-topics/view/templates/raw_data.html index 6b6770a..77b1275 100644 --- a/src/kafka-topics/view/templates/raw_data.html +++ b/src/kafka-topics/view/templates/raw_data.html @@ -1,5 +1,4 @@ -
-
diff --git a/src/kafka-topics/view/templates/withConfiguration.html b/src/kafka-topics/view/templates/withConfiguration.html index f519fe5..37f1f12 100644 --- a/src/kafka-topics/view/templates/withConfiguration.html +++ b/src/kafka-topics/view/templates/withConfiguration.html @@ -1,49 +1,45 @@ - - - Configuration - - - - - - - - - - - + + + + + + + + + + - - -
- - {{key}} - - - is - - - {{value}} - - - instead of - -

- {{getDefautConfigValue(key)}} -

-
-
-

- {{getConfigDescription(key)}} -

-
+ + + + + + + +
ComfigurationValueDefault ValueDescription
+ {{key}} + + {{value}} + + {{getDefautConfigValue(key)}} + + {{ getConfigDescription(key) | limitTo:100 }}... + {{ getConfigDescription(key)}} + + + + +
+
+
+
+ This topic retains the default configuration +
+
+
-
diff --git a/src/kafka-topics/view/view.controller.js b/src/kafka-topics/view/view.controller.js index 48d81d6..629de20 100644 --- a/src/kafka-topics/view/view.controller.js +++ b/src/kafka-topics/view/view.controller.js @@ -1,9 +1,33 @@ -angularAPP.controller('ViewTopicCtrl', function ($scope, $rootScope, $filter, $routeParams, $log, $mdToast, $mdDialog, $http, KafkaRestProxyFactory, UtilsFactory) { +angularAPP.controller('ViewTopicCtrl', function ($scope, $rootScope, $filter, $routeParams, $log, $mdToast, $location, $mdDialog, $http, KafkaRestProxyFactory, UtilsFactory) { $log.info("Starting kafka-topics controller : view ( topic = " + $routeParams.topicName + " )"); $scope.topicName = $routeParams.topicName; $rootScope.topicName = $routeParams.topicName; + $scope.topicCategoryUrl = $routeParams.topicCategoryUrl; + $rootScope.topicCategoryUrl = $routeParams.topicCategoryUrl; + + if ($routeParams.selectedTabIndex == "topic") { + $scope.selectedTabNnumber=0; + } + else if ($routeParams.selectedTabIndex == "table") { + $scope.selectedTabNnumber=1; + } + else if ($routeParams.selectedTabIndex == "rawdata") { + $scope.selectedTabNnumber=2; + } + else if ($routeParams.selectedTabIndex == "config") { + $scope.selectedTabNnumber=3; + } + else { + $scope.selectedTabNnumber=0; + } + + $scope.onTabChanges = function(currentTabIndex){ + $location.path ("topic/" + $scope.topicCategoryUrl + "/" + $scope.topicName + "/" + currentTabIndex, false); + $log.info ('selected Tab Index ' + $scope.selectedTabIndex); + }; + $scope.showSpinner = true; $scope.KAFKA_TOPIC_DELETE_COMMAND = KAFKA_TOPIC_DELETE_COMMAND; @@ -120,6 +144,10 @@ angularAPP.controller('ViewTopicCtrl', function ($scope, $rootScope, $filter, $r return configDescription; }; + $rootScope.showMoreDesc = false; + $rootScope.ToggleMoreDesc = function () { + $rootScope.showMoreDesc = !$rootScope.showMoreDesc; + }; $scope.streamInRealTime = function () { $log.info("Streaming in real time"); @@ -527,7 +555,6 @@ angularAPP.controller('ViewTopicCtrl', function ($scope, $rootScope, $filter, $r }); - //3. reorder the columns for the iteration var newRow = { "offset" : rowWithMoreColumns.offset, @@ -540,7 +567,6 @@ angularAPP.controller('ViewTopicCtrl', function ($scope, $rootScope, $filter, $r $scope.cols3 = Object.keys(flattenObject(newRow.key)); //only the value cols, TODO same for keys? $scope.extraColsNumValues = extraColumnsNumberValue; $scope.extraColsNumKeys = extraColumnsNumberKey; - $log.info ($scope.cols3.length) //PAGINATION STUFF $scope.paginationItems = 10; @@ -558,6 +584,4 @@ angularAPP.controller('ViewTopicCtrl', function ($scope, $rootScope, $filter, $r } } - - }); diff --git a/src/kafka-topics/view/view.html b/src/kafka-topics/view/view.html index d4a16fe..1fbec2f 100644 --- a/src/kafka-topics/view/view.html +++ b/src/kafka-topics/view/view.html @@ -34,20 +34,29 @@

- + + - + +
+
-
-
-
-
+ +
+
+ + +
+
+ + +
+