diff --git a/client/Pages/EventTypeDetails/Help.elm b/client/Pages/EventTypeDetails/Help.elm index c6c5234..d8cbdab 100644 --- a/client/Pages/EventTypeDetails/Help.elm +++ b/client/Pages/EventTypeDetails/Help.elm @@ -1,4 +1,4 @@ -module Pages.EventTypeDetails.Help exposing (audience, authorization, category, cleanupPolicy, cleanupPolicyCompact, compatibilityMode, consumers, createdAt, defaultStatistic, enrichmentStrategies, envelope, eventType, options, orderingKeyFields, owningApplication, partitionCompactionKeyField, partitionKeyFields, partitionStrategy, partitions, publishers, schema, subscription, updatedAt) +module Pages.EventTypeDetails.Help exposing (audience, authorization, category, cleanupPolicy, cleanupPolicyCompact, compatibilityMode, consumers, consumingQueries, createdAt, defaultStatistic, enrichmentStrategies, envelope, eventType, options, orderingKeyFields, owningApplication, partitionCompactionKeyField, partitionKeyFields, partitionStrategy, partitions, publishers, schema, subscription, updatedAt) import Config exposing (appPreffix) import Helpers.UI exposing (..) @@ -354,6 +354,11 @@ publishers = ] +consumingQueries : List (Html msg) +consumingQueries = + [ text "The list of nakadi-sql queries consuming this Event Type." ] + + consumers : List (Html msg) consumers = [ text "The list of low-level consumers for this Event Type." diff --git a/client/Pages/EventTypeDetails/Update.elm b/client/Pages/EventTypeDetails/Update.elm index 575922c..79bac1d 100644 --- a/client/Pages/EventTypeDetails/Update.elm +++ b/client/Pages/EventTypeDetails/Update.elm @@ -91,7 +91,10 @@ update settings message model = dispatch LoadPublishers ConsumerTab -> - dispatch LoadConsumers + Cmd.batch + [ dispatch LoadConsumers + , dispatch LoadConsumingQueries + ] PublishTab -> Cmd.none diff --git a/client/Pages/EventTypeDetails/View.elm b/client/Pages/EventTypeDetails/View.elm index 92991e8..eb098e4 100644 --- a/client/Pages/EventTypeDetails/View.elm +++ b/client/Pages/EventTypeDetails/View.elm @@ -247,6 +247,7 @@ detailsLayout typeName eventType model = eventType pageState.consumersStore model.subscriptionStore + pageState.consumingQueriesStore appsInfoUrl usersInfoUrl ) @@ -619,11 +620,19 @@ renderPublishers name appsInfoUrl usersInfoUrl item = ] -consumersTab : EventType -> Stores.Consumer.Model -> Stores.Subscription.Model -> String -> String -> Html Msg -consumersTab eventType consumersStore subscriptionsStore appsInfoUrl usersInfoUrl = +consumersTab : + EventType + -> Stores.Consumer.Model + -> Stores.Subscription.Model + -> Stores.ConsumingQuery.Model + -> String + -> String + -> Html Msg +consumersTab eventType consumersStore subscriptionsStore queryStore appsInfoUrl usersInfoUrl = div [ class "dc-card" ] - [ consumersPanel eventType consumersStore appsInfoUrl usersInfoUrl - , subscriptionsPanel eventType subscriptionsStore appsInfoUrl + [ subscriptionsPanel eventType subscriptionsStore appsInfoUrl + , consumingQueriesPanel queryStore + , consumersPanel eventType consumersStore appsInfoUrl usersInfoUrl ] @@ -715,6 +724,32 @@ renderSubscription name appsInfoUrl item = ] +consumingQueriesPanel : Stores.ConsumingQuery.Model -> Html Msg +consumingQueriesPanel queryStore = + let + sqlQueriesList = + Store.items queryStore + + count = + List.length sqlQueriesList + + countStr = + pluralCount count "consuming nakadi-sql queries" + in + div [] + [ span [] + [ text countStr + , helpIcon "Consuming queries" Help.consumingQueries BottomRight + , refreshButton LoadConsumingQueries + ] + , div [ class "consumer-tab__list" ] + [ Helpers.Panel.loadingStatus queryStore <| + grid [ "Consuming nakadi-sql queries" ] + (sqlQueriesList |> List.map renderSqlQueries) + ] + ] + + renderSqlQueries : ConsumingQuery -> Html Msg renderSqlQueries query = tr [ class "dc-table__tr" ]