diff --git a/ui/app/controllers/vault/cluster/clients/index.js b/ui/app/controllers/vault/cluster/clients/index.js index 8cb0262e7f..4b69910b55 100644 --- a/ui/app/controllers/vault/cluster/clients/index.js +++ b/ui/app/controllers/vault/cluster/clients/index.js @@ -1,7 +1,7 @@ import Controller from '@ember/controller'; export default class ClientsController extends Controller { - queryParams = ['tab', 'start', 'end']; + queryParams = ['tab', 'start', 'end']; // ARG TODO remove tab = null; start = null; end = null; diff --git a/ui/app/routes/vault/cluster/clients/index.js b/ui/app/routes/vault/cluster/clients/index.js index 2d51b9c779..03df7936d4 100644 --- a/ui/app/routes/vault/cluster/clients/index.js +++ b/ui/app/routes/vault/cluster/clients/index.js @@ -11,6 +11,7 @@ const getActivityParams = ({ tab, start, end }) => { if (tab === 'current') { params.tab = tab; } else if (tab === 'history') { + // ARG TODO remove if (start) { let startDate = parseDateString(start); if (startDate) { @@ -26,6 +27,8 @@ const getActivityParams = ({ tab, start, end }) => { params.end_time = getTime(endDate) / 1000; } } + } else if (tab === 'dashboard') { + params.tab = tab; } return params; }; diff --git a/ui/app/templates/components/clients/current.hbs b/ui/app/templates/components/clients/current.hbs new file mode 100644 index 0000000000..ba081babca --- /dev/null +++ b/ui/app/templates/components/clients/current.hbs @@ -0,0 +1,70 @@ +
+

+ The below data is for the current month starting from the first day. For historical data, see the monthly history tab. +

+ {{#if (eq @model.config.enabled "Off")}} + + {{#if @model.config.configPath.canUpdate}} + + Go to configuration + + {{/if}} + + {{/if}} + + {{#if @isLoading}} + + {{else}} +
+
+
+
+

+ Total usage +

+

+ These totals are within this namespace and all its children. +

+
+ + Learn more + +
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+ {{/if}} +
\ No newline at end of file diff --git a/ui/app/templates/components/clients/dashboard.hbs b/ui/app/templates/components/clients/dashboard.hbs index 7a6c5272c4..e37af17649 100644 --- a/ui/app/templates/components/clients/dashboard.hbs +++ b/ui/app/templates/components/clients/dashboard.hbs @@ -1,4 +1,4 @@ -{{#if (and (eq @tab "history") (eq @model.config.queriesAvailable false))}} +{{#if (and (eq @tab "dashboard") (eq @model.config.queriesAvailable false))}} {{#if (eq @model.config.enabled "On")}} - {{! ARG TODO change current to Dashboard }} - {{#if (eq @tab "current")}} + {{#if (eq @tab "dashboard")}}

{{! ARG TODO Add link for documentation "here" }} This dashboard will surface Vault client usage over time. Clients represent anything that has authenticated to or @@ -60,42 +59,14 @@ @handleClientActivityQuery={{this.handleClientActivityQuery}} @endTimeDisplay={{this.endTimeDisplay}} /> - {{! ARG TODO more filters for auth and namespace here }} + {{! ARG TODO more filters for namespace here }} {{#if @isLoading}} - {{else if this.hasClientData}} - - - - - + {{else}} + {{! ARG TODO remove once we have this dialed }} + {{/if}} {{else}} - - + + Monthly history @@ -62,7 +62,8 @@ -{{else}} - {{!-- --}} - +{{else if (eq this.tab "current")}} + +{{else if (eq this.tab "dashboard")}} + {{/if}} \ No newline at end of file diff --git a/ui/lib/open-api-explorer/addon/templates/components/swagger-ui.hbs b/ui/lib/open-api-explorer/addon/templates/components/swagger-ui.hbs index f35f61a243..18ee47292f 100644 --- a/ui/lib/open-api-explorer/addon/templates/components/swagger-ui.hbs +++ b/ui/lib/open-api-explorer/addon/templates/components/swagger-ui.hbs @@ -35,4 +35,4 @@ for examples.

- + \ No newline at end of file diff --git a/ui/mirage/handlers/activity.js b/ui/mirage/handlers/activity.js index 57321aca29..086fdb98c1 100644 --- a/ui/mirage/handlers/activity.js +++ b/ui/mirage/handlers/activity.js @@ -1,5 +1,11 @@ export default function (server) { // 1.10 API response + server.get('sys/internal/counters/config', function (db) { + return { + request_id: '00001', + data: db['clients/configs'].first(), + }; + }); server.get('/sys/internal/counters/activity', function () { return { request_id: '26be5ab9-dcac-9237-ec12-269a8ca647d5', diff --git a/ui/mirage/handlers/base.js b/ui/mirage/handlers/base.js index ce38a65865..d8741e4186 100644 --- a/ui/mirage/handlers/base.js +++ b/ui/mirage/handlers/base.js @@ -30,6 +30,7 @@ export default function (server) { }; }); + // ARG TODO eventually remove from base it should all come from activity after 1.10 release. server.get('/sys/internal/counters/activity/monthly', function () { return { data: {