mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-28 04:10:44 -04:00
Co-authored-by: Eren Tantekin <eren.tantekin@hashicorp.com>
This commit is contained in:
parent
3ce68d9623
commit
1515ea76fe
106 changed files with 118 additions and 2066 deletions
12
ui/README.md
12
ui/README.md
|
|
@ -165,6 +165,18 @@ Hello and thank you for contributing to the Vault UI! Below is a list of pattern
|
|||
- [css](docs/css.md)
|
||||
- [ember engines](docs/engines.md)
|
||||
|
||||
### Updating @hashicorp-internal/vault-reporting
|
||||
|
||||
Code regarding vault-reporting module lives in the [shared-secure-ui](https://github.com/hashicorp/shared-secure-ui) repo, and it is being used as a tarball in this repo.
|
||||
|
||||
We use the script [update-vault-reporting-addon.sh](scripts/update-vault-reporting-addon.sh) to fetch the latest tarball from artifactory and update `package.json` accordingly. To run the script, you'll need to have [Doormat CLI](https://docs.prod.secops.hashicorp.services/doormat/cli/) and [jq](https://formulae.brew.sh/formula/jq) installed locally.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
./scripts/update-vault-reporting-addon.sh
|
||||
```
|
||||
|
||||
## Further Reading / Useful Links
|
||||
|
||||
- [ember.js](https://emberjs.com/)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,10 @@ import { service } from '@ember/service';
|
|||
|
||||
import type FlagsService from 'vault/services/flags';
|
||||
import type ApiService from 'vault/services/api';
|
||||
import type { getUsageDataFunction, UsageDashboardData } from '@hashicorp/vault-reporting/types/index';
|
||||
import type {
|
||||
getUsageDataFunction,
|
||||
UsageDashboardData,
|
||||
} from '@hashicorp-internal/vault-reporting/types/index';
|
||||
import type { UtilizationReport } from 'vault/usage';
|
||||
|
||||
/**
|
||||
|
|
@ -65,6 +68,7 @@ export default class UsagePage extends Component {
|
|||
totalRoles: pki?.total_roles || 0,
|
||||
},
|
||||
secretSync: {
|
||||
destinations: secret_sync?.destinations || {},
|
||||
totalDestinations: secret_sync?.total_destinations || 0,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ const appConfig = {
|
|||
'./node_modules/@hashicorp/design-system-tokens/dist/products/css',
|
||||
'./node_modules/ember-basic-dropdown/',
|
||||
'./node_modules/ember-power-select/',
|
||||
'./node_modules/@hashicorp/vault-reporting/dist/styles',
|
||||
'./node_modules/@hashicorp-internal/vault-reporting/dist/styles',
|
||||
],
|
||||
},
|
||||
minifyCSS: {
|
||||
|
|
|
|||
|
|
@ -214,9 +214,9 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "7.26.10",
|
||||
"@hashicorp-internal/vault-reporting": "file:vault-reporting/0.5.1.tgz",
|
||||
"@hashicorp/design-system-components": "4.20.1",
|
||||
"@hashicorp/vault-client-typescript": "hashicorp/vault-client-typescript",
|
||||
"@hashicorp/vault-reporting": "portal:./vault-reporting",
|
||||
"ember-auto-import": "2.10.0",
|
||||
"handlebars": "4.7.8",
|
||||
"highlight.js": "10.7.3",
|
||||
|
|
|
|||
51
ui/scripts/update-vault-reporting-addon.sh
Executable file
51
ui/scripts/update-vault-reporting-addon.sh
Executable file
|
|
@ -0,0 +1,51 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright (c) HashiCorp, Inc.
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
ARTIFACTORY_NPM_URL="https://artifactory.hashicorp.engineering/artifactory/npm/"
|
||||
|
||||
# Show error if doormat CLI or jq doesn't exist
|
||||
|
||||
if ! command -v doormat &> /dev/null; then
|
||||
echo "Error: doormat CLI is not installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v jq &> /dev/null; then
|
||||
echo "Error: jq is not installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
doormat login
|
||||
# Get artifactory token from doormat
|
||||
AF_TOKEN=$(doormat artifactory create-token | jq -r .access_token)
|
||||
|
||||
# Get package info from artifactory API
|
||||
PACKAGE_INFO=$(curl -s -L -H "Authorization: Bearer $AF_TOKEN" "https://artifactory.hashicorp.engineering/artifactory/api/npm/npm/@hashicorp-internal/vault-reporting")
|
||||
|
||||
# Extract the latest version and tarball URL
|
||||
LATEST_VERSION=$(echo "$PACKAGE_INFO" | jq -r '."dist-tags".latest')
|
||||
TARBALL_URL=$(echo "$PACKAGE_INFO" | jq -r --arg version "$LATEST_VERSION" '.versions[$version].dist.tarball')
|
||||
|
||||
echo "LATEST_VERSION: $LATEST_VERSION"
|
||||
echo "TARBALL_URL: $TARBALL_URL"
|
||||
|
||||
# Download the tarball
|
||||
echo "Downloading vault-reporting v$LATEST_VERSION..."
|
||||
curl -L -H "Authorization: Bearer $AF_TOKEN" -o "vault-reporting/$LATEST_VERSION.tgz" "$TARBALL_URL"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ Successfully downloaded vault-reporting-$LATEST_VERSION.tgz"
|
||||
echo "📦 File size: $(ls -lh vault-reporting-$LATEST_VERSION.tgz | awk '{print $5}')"
|
||||
else
|
||||
echo "❌ Failed to download tarball"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Delete all but the latest version
|
||||
find vault-reporting -name "*.tgz" ! -name "$LATEST_VERSION.tgz" -delete
|
||||
|
||||
# Update package.json to point to file:vault-reporting/$LATEST_VERSION.tgz
|
||||
FILENAME="$LATEST_VERSION.tgz"
|
||||
jq --arg version "$LATEST_VERSION" --arg filename "$FILENAME" '.dependencies["@hashicorp-internal/vault-reporting"] = "file:vault-reporting/" + $filename' package.json > tmp.json && mv tmp.json package.json
|
||||
# Install dependencies
|
||||
yarn install
|
||||
|
|
@ -56,7 +56,7 @@ module('Acceptance | enterprise vault-reporting', function (hooks) {
|
|||
.dom('[data-test-vault-reporting-dashboard-counters]')
|
||||
.exists('renders the counters dashboard block');
|
||||
|
||||
const expectedCounters = ['Child namespaces', 'KV secrets', 'Secrets sync', 'PKI roles'];
|
||||
const expectedCounters = ['Child namespaces', 'KV secrets', 'PKI roles'];
|
||||
|
||||
expectedCounters.forEach((counterLabel) => {
|
||||
assert
|
||||
|
|
@ -166,6 +166,34 @@ module('Acceptance | enterprise vault-reporting', function (hooks) {
|
|||
.hasText('210K / 420K', 'lease count is correct');
|
||||
});
|
||||
|
||||
test('dashboard card: Secrets sync', async function (assert) {
|
||||
this.server.get('sys/utilization-report', () => mockedResponseWithData);
|
||||
await visit('/vault/usage-reporting');
|
||||
await waitFor('[data-test-vault-reporting-dashboard-secrets-sync]');
|
||||
|
||||
assert.dom('[data-test-vault-reporting-dashboard-secrets-sync]').exists('renders Secrets sync card');
|
||||
assert
|
||||
.dom(
|
||||
'[data-test-vault-reporting-dashboard-secrets-sync] [data-test-vault-reporting-dashboard-card-title]'
|
||||
)
|
||||
.hasText('Secrets sync', 'title is correct');
|
||||
|
||||
assert
|
||||
.dom(
|
||||
'[data-test-vault-reporting-dashboard-secrets-sync] [data-test-vault-reporting-dashboard-card-description]'
|
||||
)
|
||||
.hasText(
|
||||
'Total number of destinations (e.g. third-party integrations) synced with secrets',
|
||||
'description is correct'
|
||||
);
|
||||
assert
|
||||
.dom('[data-test-vault-reporting-secrets-sync-destinations-row]')
|
||||
.includesText('Destination', 'Destinations header is present');
|
||||
assert
|
||||
.dom('[data-test-vault-reporting-secrets-sync-destinations-row]')
|
||||
.includesText('aws: 1', 'aws destination is present');
|
||||
});
|
||||
|
||||
test('dashboard card: Cluster replication status', async function (assert) {
|
||||
this.server.get('sys/utilization-report', () => mockedResponseWithData);
|
||||
await visit('/vault/usage-reporting');
|
||||
|
|
|
|||
|
|
@ -32,5 +32,6 @@ export const mockedResponseWithData = {
|
|||
pr_state: 'enabled',
|
||||
},
|
||||
secret_engines: { cubbyhole: 45, nomad: 46, aws: 47 },
|
||||
secret_sync: { total_destinations: 1, destinations: { aws: 1 } },
|
||||
},
|
||||
};
|
||||
|
|
|
|||
3
ui/types/vault/usage.d.ts
vendored
3
ui/types/vault/usage.d.ts
vendored
|
|
@ -7,7 +7,7 @@ import type { GenerateUtilizationReportResponse } from '@hashicorp/vault-client-
|
|||
import type {
|
||||
REPLICATION_ENABLED_STATE,
|
||||
REPLICATION_DISABLED_STATE,
|
||||
} from '@hashicorp/vault-reporting/types/index';
|
||||
} from '@hashicorp-internal/vault-reporting/types/index';
|
||||
|
||||
export type GlobalLeaseCountQuota = {
|
||||
capacity: number;
|
||||
|
|
@ -22,6 +22,7 @@ export type LeaseCountQuotas = {
|
|||
|
||||
export type SecretSync = {
|
||||
total_destinations: number;
|
||||
destinations: Record<string, number>;
|
||||
};
|
||||
|
||||
export type Pki = {
|
||||
|
|
|
|||
BIN
ui/vault-reporting/0.5.1.tgz
Normal file
BIN
ui/vault-reporting/0.5.1.tgz
Normal file
Binary file not shown.
|
|
@ -1,92 +0,0 @@
|
|||
License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.
|
||||
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
||||
|
||||
Parameters
|
||||
|
||||
Licensor: HashiCorp, Inc.
|
||||
Licensed Work: Vault Version 1.15.0 or later. The Licensed Work is (c) 2024
|
||||
HashiCorp, Inc.
|
||||
Additional Use Grant: You may make production use of the Licensed Work, provided
|
||||
Your use does not include offering the Licensed Work to third
|
||||
parties on a hosted or embedded basis in order to compete with
|
||||
HashiCorp's paid version(s) of the Licensed Work. For purposes
|
||||
of this license:
|
||||
|
||||
A "competitive offering" is a Product that is offered to third
|
||||
parties on a paid basis, including through paid support
|
||||
arrangements, that significantly overlaps with the capabilities
|
||||
of HashiCorp's paid version(s) of the Licensed Work. If Your
|
||||
Product is not a competitive offering when You first make it
|
||||
generally available, it will not become a competitive offering
|
||||
later due to HashiCorp releasing a new version of the Licensed
|
||||
Work with additional capabilities. In addition, Products that
|
||||
are not provided on a paid basis are not competitive.
|
||||
|
||||
"Product" means software that is offered to end users to manage
|
||||
in their own environments or offered as a service on a hosted
|
||||
basis.
|
||||
|
||||
"Embedded" means including the source code or executable code
|
||||
from the Licensed Work in a competitive offering. "Embedded"
|
||||
also means packaging the competitive offering in such a way
|
||||
that the Licensed Work must be accessed or downloaded for the
|
||||
competitive offering to operate.
|
||||
|
||||
Hosting or using the Licensed Work(s) for internal purposes
|
||||
within an organization is not considered a competitive
|
||||
offering. HashiCorp considers your organization to include all
|
||||
of your affiliates under common control.
|
||||
|
||||
For binding interpretive guidance on using HashiCorp products
|
||||
under the Business Source License, please visit our FAQ.
|
||||
(https://www.hashicorp.com/license-faq)
|
||||
Change Date: Four years from the date the Licensed Work is published.
|
||||
Change License: MPL 2.0
|
||||
|
||||
For information about alternative licensing arrangements for the Licensed Work,
|
||||
please contact licensing@hashicorp.com.
|
||||
|
||||
Notice
|
||||
|
||||
Business Source License 1.1
|
||||
|
||||
Terms
|
||||
|
||||
The Licensor hereby grants you the right to copy, modify, create derivative
|
||||
works, redistribute, and make non-production use of the Licensed Work. The
|
||||
Licensor may make an Additional Use Grant, above, permitting limited production use.
|
||||
|
||||
Effective on the Change Date, or the fourth anniversary of the first publicly
|
||||
available distribution of a specific version of the Licensed Work under this
|
||||
License, whichever comes first, the Licensor hereby grants you rights under
|
||||
the terms of the Change License, and the rights granted in the paragraph
|
||||
above terminate.
|
||||
|
||||
If your use of the Licensed Work does not comply with the requirements
|
||||
currently in effect as described in this License, you must purchase a
|
||||
commercial license from the Licensor, its affiliated entities, or authorized
|
||||
resellers, or you must refrain from using the Licensed Work.
|
||||
|
||||
All copies of the original and modified Licensed Work, and derivative works
|
||||
of the Licensed Work, are subject to this License. This License applies
|
||||
separately for each version of the Licensed Work and the Change Date may vary
|
||||
for each version of the Licensed Work released by Licensor.
|
||||
|
||||
You must conspicuously display this License on each original or modified copy
|
||||
of the Licensed Work. If you receive the Licensed Work in original or
|
||||
modified form from a third party, the terms and conditions set forth in this
|
||||
License apply to your use of that work.
|
||||
|
||||
Any use of the Licensed Work in violation of this License will automatically
|
||||
terminate your rights under this License for the current and all other
|
||||
versions of the Licensed Work.
|
||||
|
||||
This License does not grant you any right in any trademark or logo of
|
||||
Licensor or its affiliates (provided that you may use a trademark or logo of
|
||||
Licensor as expressly required by this License).
|
||||
|
||||
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
||||
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
||||
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
||||
TITLE.
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
# Vault Reporting
|
||||
|
||||
This repo contains shared UI components for Vault Enterprise and Cloud reporting views.
|
||||
|
||||
## Publishing
|
||||
|
||||
At this time this packages is not published to the NPM registry. Since this repo is private and all enterprise features are built into the public open source vault repo we need a way to "publish" updates to vault. There are a couple of utilities to help with tihs.
|
||||
|
||||
### Github workflow
|
||||
|
||||
When your changes are ready and you want to consume them in vault you can trigger a github action to automatically open a PR with the updates in the vault repo.
|
||||
|
||||
1. Visit the [publish-reporting-to-vault](https://github.com/hashicorp/shared-secure-ui/actions/workflows/publish-reporting-to-vault.yml) workflow for `shared-secure-ui` repo.
|
||||
2. Click the "Run workflow" button in the top right
|
||||
3. Enter the branch in vault you want the PR to go into, by default it will be main
|
||||
4. Submit the form
|
||||
|
||||
This should trigger the workflow and after a short amount of time you should be a new draft PR in the vault repo with the `vault-reporting` updates.
|
||||
|
||||
### Publishing locally
|
||||
|
||||
You will need to have this repo and the vault repo checked out locally.
|
||||
|
||||
1. Build the addon `npm run build`
|
||||
2. Export an environment variable called `VAULT_UI_PATH` with the path to your vault/ui directory (if unset it will try to find it at `~/projects/vault/ui/`)
|
||||
3. Run the sync script `npm run sync-to-vault --workspace @hashicorp/vault-reporting`
|
||||
|
||||
You should see the updated dist files in the vault-reporting directory inside of vault.
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const { addonV1Shim } = require('@embroider/addon-shim');
|
||||
module.exports = addonV1Shim(__dirname);
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
*/
|
||||
|
||||
import Component from '@glimmer/component';
|
||||
interface SankeyDiagramArgs {
|
||||
data: {
|
||||
nodes: {
|
||||
name: string;
|
||||
}[];
|
||||
links: {
|
||||
source: number;
|
||||
target: number;
|
||||
value: number;
|
||||
}[];
|
||||
};
|
||||
}
|
||||
export default class SankeyDiagramComponent extends Component<SankeyDiagramArgs> {
|
||||
renderSankey(element: HTMLElement): void;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=sankey-diagram.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"sankey-diagram.d.ts","sourceRoot":"","sources":["../../src/components/sankey-diagram.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAK3C,UAAU,iBAAiB;IACzB,IAAI,EAAE;QACJ,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAC1B,KAAK,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KAC5D,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAE9E,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;CAyDzC"}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"title-row.d.ts","sourceRoot":"","sources":["../../../../src/components/vault-reporting/base/title-row.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAGL,iBAAiB,EAClB,MAAM,gDAAgD,CAAC;AACxD,OAAO,kBAAkB,CAAC;AAI1B,OAAO,KAAK,yBAAyB,MAAM,uCAAuC,CAAC;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE;QACJ,qCAAqC;QACrC,KAAK,EAAE,MAAM,CAAC;QACd,6DAA6D;QAC7D,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;QAClC,wDAAwD;QACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,gEAAgE;QAChE,QAAQ,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACrC,gEAAgE;QAChE,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,gDAAgD;QAChD,UAAU,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;KACjC,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAChE,SAA0B,kBAAkB,EAAE,yBAAyB,CAAC;IAExE,IAAI,OAAO,uBAEV;IAED,IAAI,QAAQ,WAEX;IAED,IAAI,OAAO,WAEV;IAED,IAAI,QAAQ,urTAEX;IAED,IAAI,UAAU,uBAEb;IAED,eAAe,aAMb;CAsDH"}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"cluster-replication.d.ts","sourceRoot":"","sources":["../../../src/components/vault-reporting/cluster-replication.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAO3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAIjE,OAAO,4BAA4B,CAAC;AAEpC,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE;QACJ,qBAAqB,EAAE,yBAAyB,GAAG,UAAU,CAAC;QAC9D,gBAAgB,EAAE,yBAAyB,GAAG,UAAU,CAAC;QACzD,gBAAgB,EAAE,OAAO,CAAC;KAC3B,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,SAAS,CAAC,2BAA2B,CAAC;IACpF,QAAQ,WAAW,yBAAyB,GAAG,UAAU,4CAEvD;IAEF,IAAI,OAAO,YAKV;IAED,IAAI,WAAW,sGAQd;IAED,OAAO,WAAW,yBAAyB,GAAG,UAAU,osTAQtD;IAEF,QAAQ,WAAW,yBAAyB,GAAG,UAAU,oGAQvD;IAEF,IAAI,OAAO,8BAMV;CAuDF"}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../../src/components/vault-reporting/counter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAO3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,gBAAgB,CAAC;AAExB,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,IAAI,CAAC,EAAE,QAAQ,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AACD,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,SAAS,CAAC,4BAA4B,CAAC;IACtF,IAAI,oBAAoB,+BAEvB;IAED,IAAI,KAAK,gCAUR;IAED,IAAI,IAAI,urTAEP;IAED,IAAI,IAAI,uBAKP;CAuEF"}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import Component from '@glimmer/component';
|
||||
import type { UsageDashboardData } from '../../../types';
|
||||
import type ReportingAnalyticsService from '../../../services/reporting-analytics';
|
||||
export interface DashboardExportSignature {
|
||||
Args: {
|
||||
data?: UsageDashboardData;
|
||||
};
|
||||
Blocks: {
|
||||
default: [];
|
||||
};
|
||||
Element: HTMLElement;
|
||||
}
|
||||
export default class DashboardExport extends Component<DashboardExportSignature> {
|
||||
#private;
|
||||
readonly reportingAnalytics: ReportingAnalyticsService;
|
||||
handleTrackExportToggle: () => void;
|
||||
handleTrackExportOption: (option: string) => void;
|
||||
get dataAsDownloadableJSONString(): string;
|
||||
get dataAsDownloadableCSVString(): string;
|
||||
}
|
||||
//# sourceMappingURL=export.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../../src/components/vault-reporting/dashboard/export.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAK3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,yBAAyB,MAAM,uCAAuC,CAAC;AAGnF,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE;QACJ,IAAI,CAAC,EAAE,kBAAkB,CAAC;KAC3B,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IACF,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,SAAS,CAAC,wBAAwB,CAAC;;IAC9E,SAA0B,kBAAkB,EAAE,yBAAyB,CAAC;IAQxE,uBAAuB,aAErB;IAEF,uBAAuB,WAAY,MAAM,UAEvC;IAEF,IAAI,4BAA4B,WAM/B;IAED,IAAI,2BAA2B,WA2D9B;CA8CF"}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import './donut-chart.scss';
|
||||
import Component from '@glimmer/component';
|
||||
export interface SSUReportingDonutChartSignature {
|
||||
Args: {
|
||||
data: {
|
||||
value: number;
|
||||
label: string;
|
||||
}[];
|
||||
title: string;
|
||||
};
|
||||
Blocks: {
|
||||
default: [];
|
||||
};
|
||||
Element: HTMLElement;
|
||||
}
|
||||
export default class SSUReportingDonutChart extends Component<SSUReportingDonutChartSignature> {
|
||||
get data(): {
|
||||
scaleIndex: number;
|
||||
value: number;
|
||||
label: string;
|
||||
}[];
|
||||
get total(): number;
|
||||
get a11yLabel(): string;
|
||||
getOffset(width: number, height: number): string;
|
||||
getInnerRadius(width: number, height: number): number;
|
||||
getOuterRadius(width: number, height: number): number;
|
||||
}
|
||||
//# sourceMappingURL=donut-chart.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"donut-chart.d.ts","sourceRoot":"","sources":["../../../src/components/vault-reporting/donut-chart.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,oBAAoB,CAAC;AAE5B,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAW3C,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE;QACJ,IAAI,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACzC,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AACD,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,SAAS,CAAC,+BAA+B,CAAC;IAC5F,IAAI,IAAI;;eAXS,MAAM;eAAS,MAAM;QAkBrC;IAED,IAAI,KAAK,WAIR;IAED,IAAI,SAAS,WAUZ;IAED,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAIvC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAM5C,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CA0I7C"}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import Component from '@glimmer/component';
|
||||
import { type Filter } from '../../utils/cel.ts';
|
||||
export interface FilterFieldDefinition {
|
||||
name: string;
|
||||
label: string;
|
||||
type: 'text' | 'multiselect' | 'number' | 'daterange';
|
||||
options?: {
|
||||
name: string;
|
||||
value: string;
|
||||
}[];
|
||||
}
|
||||
export interface FilterBarSignature {
|
||||
Args: {
|
||||
onFiltersApplied: (filters: Filter[]) => void;
|
||||
appliedFilters: Filter[];
|
||||
filterFieldDefinitions: FilterFieldDefinition[];
|
||||
};
|
||||
Blocks: {
|
||||
default: [];
|
||||
};
|
||||
Element: HTMLElement;
|
||||
}
|
||||
export default class FilterBar extends Component<FilterBarSignature> {
|
||||
updateFilters: (filters: Record<string, Filter>) => void;
|
||||
handleClearFilters: () => void;
|
||||
handleDismissFilter: (key: string) => void;
|
||||
handleMultiselectChange: (name: string, event: Event) => void;
|
||||
handleTextInputChange: (name: string, event: Event) => void;
|
||||
handleNumberChange: (event: Event) => void;
|
||||
handleDateRangeChange: (name: string, event: Event) => void;
|
||||
isEqual: (a: string, b: string) => boolean;
|
||||
isChecked: (name: string, value: string) => boolean;
|
||||
getValue: (name: string) => string;
|
||||
getOperator: (name: string) => "" | ">=" | "<=" | ">" | "<" | "=" | "!=" | "IN" | "NOT IN";
|
||||
friendlyAppliedString: (appliedFilter: Filter) => string;
|
||||
get appliedFilters(): Record<string, Filter>;
|
||||
get appliedFiltersCount(): number;
|
||||
get hasAppliedFilters(): boolean;
|
||||
}
|
||||
//# sourceMappingURL=filter-bar.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"filter-bar.d.ts","sourceRoot":"","sources":["../../../src/components/vault-reporting/filter-bar.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,QAAQ,GAAG,WAAW,CAAC;IACtD,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE;QACJ,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;QAC9C,cAAc,EAAE,MAAM,EAAE,CAAC;QACzB,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;KACjD,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IACF,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IAClE,aAAa,YAAa,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAE9C;IAEF,kBAAkB,aAEhB;IAEF,mBAAmB,QAAS,MAAM,UAIhC;IAEF,uBAAuB,SAAU,MAAM,SAAS,KAAK,UA8BnD;IAEF,qBAAqB,SAAU,MAAM,SAAS,KAAK,UAajD;IAEF,kBAAkB,UAAW,KAAK,UAiBhC;IAEF,qBAAqB,SAAU,MAAM,SAAS,KAAK,UAcjD;IAEF,OAAO,MAAO,MAAM,KAAK,MAAM,aAE7B;IAEF,SAAS,SAAU,MAAM,SAAS,MAAM,aAGtC;IAEF,QAAQ,SAAU,MAAM,YAEtB;IAEF,WAAW,SAAU,MAAM,iEAEzB;IAEF,qBAAqB,kBAAmB,MAAM,YAM5C;IAEF,IAAI,cAAc,2BAgBjB;IAED,IAAI,mBAAmB,WAEtB;IAED,IAAI,iBAAiB,YAEpB;CAoSF"}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import Component from '@glimmer/component';
|
||||
import './global-lease.scss';
|
||||
import type { HdsApplicationStateSignature } from '@hashicorp/design-system-components/components/hds/application-state/index';
|
||||
export interface GlobalLeaseSignature {
|
||||
Args: {
|
||||
count?: number;
|
||||
quota?: number;
|
||||
};
|
||||
Blocks: {
|
||||
default: [];
|
||||
/** We optionally yield application state to allow for overrides on empty state eg:
|
||||
* <SSUReportingGlobalLease ...>
|
||||
* <:empty as |A|>
|
||||
* <A.Header @title="Custom Title" />
|
||||
* <A.Body @text="Custom description" />
|
||||
* </:empty>
|
||||
* </SSUReportingGlobalLease>
|
||||
* */
|
||||
empty: HdsApplicationStateSignature['Blocks']['default'];
|
||||
};
|
||||
Element: HTMLElement;
|
||||
}
|
||||
export default class GlobalLease extends Component<GlobalLeaseSignature> {
|
||||
get percentage(): number;
|
||||
get progressFillClass(): "" | "ssu-global-lease__progress-fill--exceeded";
|
||||
get formattedCount(): string;
|
||||
get percentageString(): string;
|
||||
get hasData(): boolean | 0 | undefined;
|
||||
get description(): import("@ember/template").SafeString | undefined;
|
||||
get linkUrl(): "https://developer.hashicorp.com/vault/tutorials/operations/resource-quotas#global-default-lease-count-quota" | undefined;
|
||||
get alert(): {
|
||||
color: 'warning' | 'neutral';
|
||||
description: string;
|
||||
} | undefined;
|
||||
}
|
||||
//# sourceMappingURL=global-lease.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"global-lease.d.ts","sourceRoot":"","sources":["../../../src/components/vault-reporting/global-lease.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAS3C,OAAO,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4EAA4E,CAAC;AAG/H,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;QACZ;;;;;;;aAOK;QACL,KAAK,EAAE,4BAA4B,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC;KAC1D,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IACtE,IAAI,UAAU,WAIb;IAED,IAAI,iBAAiB,qDAKpB;IAED,IAAI,cAAc,WAWjB;IAED,IAAI,gBAAgB,WAEnB;IAED,IAAI,OAAO,4BAEV;IAED,IAAI,WAAW,qDAMd;IAED,IAAI,OAAO,8HAIV;IAED,IAAI,KAAK,IACL;QAAE,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GACrD,SAAS,CAgBZ;CAgIF"}
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import './horizontal-bar-chart.scss';
|
||||
import Component from '@glimmer/component';
|
||||
import { HdsLinkStandalone } from '@hashicorp/design-system-components/components';
|
||||
import type { SimpleDatum } from '../../types/index.ts';
|
||||
import type { HdsApplicationStateSignature } from '@hashicorp/design-system-components/components/hds/application-state/index';
|
||||
export interface SSUReportingHorizontalBarChartSignature {
|
||||
Args: {
|
||||
data: SimpleDatum[];
|
||||
title: string;
|
||||
description?: string;
|
||||
/** Custom text for the link (defaults to "View all") */
|
||||
linkText?: string;
|
||||
/** Icon to display with the link (defaults to "arrow-right") */
|
||||
linkIcon?: HdsLinkStandalone['icon'];
|
||||
/** URL for the link - if not provided, no link will be shown */
|
||||
linkUrl?: string;
|
||||
/** Target for the link - defaults to "_self" */
|
||||
linkTarget?: '_blank' | '_self';
|
||||
};
|
||||
Blocks: {
|
||||
default: [];
|
||||
/** We optionally yield application state to allow for overrides on empty state eg:
|
||||
* <SSUReportingHorizontalBarChart ...>
|
||||
* <:empty as |A|>
|
||||
* <A.Header @title="Custom Title" />
|
||||
* <A.Body @text="Custom description" />
|
||||
* </:empty>
|
||||
* </SSUReportingHorizontalBarChart>
|
||||
* */
|
||||
empty: HdsApplicationStateSignature['Blocks']['default'];
|
||||
};
|
||||
Element: HTMLElement;
|
||||
}
|
||||
export default class SSUReportingHorizontalBarChart extends Component<SSUReportingHorizontalBarChartSignature> {
|
||||
xRangeOffsetWidth: number;
|
||||
get hasData(): boolean;
|
||||
get data(): SimpleDatum[];
|
||||
get total(): number;
|
||||
get a11yLabel(): string;
|
||||
get yDomain(): string[];
|
||||
get xDomain(): number[];
|
||||
get rangeHeight(): number;
|
||||
get yRange(): number[];
|
||||
get emptyStateTitle(): string;
|
||||
get emptyStateDescription(): string;
|
||||
get emptyStateLinkText(): string;
|
||||
get description(): string | undefined;
|
||||
get linkUrl(): string | undefined;
|
||||
getXRange: (width: number) => number[];
|
||||
handleAxisOffset: (offsetWidth: number) => void;
|
||||
}
|
||||
//# sourceMappingURL=horizontal-bar-chart.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"horizontal-bar-chart.d.ts","sourceRoot":"","sources":["../../../src/components/vault-reporting/horizontal-bar-chart.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,6BAA6B,CAAC;AACrC,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAKL,iBAAiB,EAClB,MAAM,gDAAgD,CAAC;AAWxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4EAA4E,CAAC;AAE/H,MAAM,WAAW,uCAAuC;IACtD,IAAI,EAAE;QACJ,IAAI,EAAE,WAAW,EAAE,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,wDAAwD;QACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,gEAAgE;QAChE,QAAQ,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACrC,gEAAgE;QAChE,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,gDAAgD;QAChD,UAAU,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;KACjC,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;QACZ;;;;;;;aAOK;QACL,KAAK,EAAE,4BAA4B,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC;KAC1D,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AACD,MAAM,CAAC,OAAO,OAAO,8BAA+B,SAAQ,SAAS,CAAC,uCAAuC,CAAC;IACnG,iBAAiB,SAAK;IAE/B,IAAI,OAAO,YAMV;IAED,IAAI,IAAI,kBAUP;IAED,IAAI,KAAK,WAIR;IAED,IAAI,SAAS,WAUZ;IAED,IAAI,OAAO,aAEV;IAED,IAAI,OAAO,aAEV;IAED,IAAI,WAAW,WAEd;IAED,IAAI,MAAM,aAET;IAED,IAAI,eAAe,WAElB;IAED,IAAI,qBAAqB,WAGxB;IAED,IAAI,kBAAkB,WAGrB;IAED,IAAI,WAAW,uBAId;IAED,IAAI,OAAO,uBAIV;IAED,SAAS,UAAW,MAAM,cAExB;IAEF,gBAAgB,gBAAiB,MAAM,UAErC;CAoKH"}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"title-row.d.ts","sourceRoot":"","sources":["../../../../../src/components/vault-reporting/reporting/base/title-row.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAGL,iBAAiB,EAClB,MAAM,gDAAgD,CAAC;AACxD,OAAO,kBAAkB,CAAC;AAE1B;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE;QACJ,qCAAqC;QACrC,KAAK,EAAE,MAAM,CAAC;QACd,6DAA6D;QAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,wDAAwD;QACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,gEAAgE;QAChE,QAAQ,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACrC,gEAAgE;QAChE,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAChE,IAAI,OAAO,uBAEV;IAED,IAAI,QAAQ,WAEX;IAED,IAAI,OAAO,WAEV;IAED,IAAI,QAAQ,snTAEX;CAoDF"}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import Component from '@glimmer/component';
|
||||
import './cluster-replication.scss';
|
||||
export declare const ENABLED_STATE = "enabled";
|
||||
export declare const DISABLED_STATE = "disabled";
|
||||
export interface ClusterReplicationSignature {
|
||||
Args: {
|
||||
isDisasterRecoveryPrimary: boolean;
|
||||
disasterRecoveryState: string;
|
||||
isPerformancePrimary: boolean;
|
||||
performanceState: string;
|
||||
};
|
||||
Blocks: {
|
||||
default: [];
|
||||
};
|
||||
Element: HTMLElement;
|
||||
}
|
||||
export default class ClusterReplication extends Component<ClusterReplicationSignature> {
|
||||
get disasterRecoveryBadge(): {
|
||||
icon: 'check' | 'x';
|
||||
text: string;
|
||||
color: 'success' | 'neutral';
|
||||
};
|
||||
get performanceBadge(): {
|
||||
icon: 'check' | 'x';
|
||||
text: string;
|
||||
color: 'success' | 'neutral';
|
||||
};
|
||||
get disasterRecoveryRole(): "Primary" | "Secondary";
|
||||
get performanceRole(): "Primary" | "Secondary";
|
||||
}
|
||||
//# sourceMappingURL=cluster-replication.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"cluster-replication.d.ts","sourceRoot":"","sources":["../../../../src/components/vault-reporting/reporting/cluster-replication.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAQ3C,OAAO,4BAA4B,CAAC;AAMpC,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE;QACJ,yBAAyB,EAAE,OAAO,CAAC;QACnC,qBAAqB,EAAE,MAAM,CAAC;QAC9B,oBAAoB,EAAE,OAAO,CAAC;QAC9B,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,SAAS,CAAC,2BAA2B,CAAC;IACpF,IAAI,qBAAqB,IAAI;QAC3B,IAAI,EAAE,OAAO,GAAG,GAAG,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;KAC9B,CAIA;IAED,IAAI,gBAAgB,IAAI;QACtB,IAAI,EAAE,OAAO,GAAG,GAAG,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;KAC9B,CAIA;IAED,IAAI,oBAAoB,4BAEvB;IAED,IAAI,eAAe,4BAElB;CAwFF"}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../../../src/components/vault-reporting/reporting/counter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAE3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,gBAAgB,CAAC;AAExB,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,QAAQ,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AACD,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,SAAS,CAAC,4BAA4B,CAAC;IACtF,IAAI,KAAK,oBAKR;IAED,IAAI,IAAI,snTAEP;CAuDF"}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import './donut-chart.scss';
|
||||
import Component from '@glimmer/component';
|
||||
export interface SSUReportingDonutChartSignature {
|
||||
Args: {
|
||||
data: {
|
||||
value: number;
|
||||
label: string;
|
||||
}[];
|
||||
title: string;
|
||||
};
|
||||
Blocks: {
|
||||
default: [];
|
||||
};
|
||||
Element: HTMLElement;
|
||||
}
|
||||
export default class SSUReportingDonutChart extends Component<SSUReportingDonutChartSignature> {
|
||||
get data(): {
|
||||
scaleIndex: number;
|
||||
value: number;
|
||||
label: string;
|
||||
}[];
|
||||
get total(): number;
|
||||
get a11yLabel(): string;
|
||||
getOffset(width: number, height: number): string;
|
||||
getInnerRadius(width: number, height: number): number;
|
||||
getOuterRadius(width: number, height: number): number;
|
||||
}
|
||||
//# sourceMappingURL=donut-chart.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"donut-chart.d.ts","sourceRoot":"","sources":["../../../../src/components/vault-reporting/reporting/donut-chart.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,oBAAoB,CAAC;AAE5B,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAW3C,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE;QACJ,IAAI,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACzC,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AACD,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,SAAS,CAAC,+BAA+B,CAAC;IAC5F,IAAI,IAAI;;eAXS,MAAM;eAAS,MAAM;QAkBrC;IAED,IAAI,KAAK,WAIR;IAED,IAAI,SAAS,WAUZ;IAED,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAIvC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAM5C,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CA0I7C"}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import Component from '@glimmer/component';
|
||||
import './global-lease.scss';
|
||||
export interface GlobalLeaseSignature {
|
||||
Args: {
|
||||
count: number;
|
||||
quota: number;
|
||||
};
|
||||
Blocks: {
|
||||
default: [];
|
||||
};
|
||||
Element: HTMLElement;
|
||||
}
|
||||
export default class GlobalLease extends Component<GlobalLeaseSignature> {
|
||||
get percentage(): number;
|
||||
get progressFillClass(): "ssu-global-lease__progress-fill--low" | "ssu-global-lease__progress-fill--medium" | "ssu-global-lease__progress-fill--high";
|
||||
get formattedCount(): string;
|
||||
}
|
||||
//# sourceMappingURL=global-lease.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"global-lease.d.ts","sourceRoot":"","sources":["../../../../src/components/vault-reporting/reporting/global-lease.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAO3C,OAAO,qBAAqB,CAAC;AAE7B,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IACtE,IAAI,UAAU,WAEb;IAED,IAAI,iBAAiB,iIAQpB;IAED,IAAI,cAAc,WASjB;CAiEF"}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import './horizontal-bar-chart.scss';
|
||||
import Component from '@glimmer/component';
|
||||
import type { SimpleDatum } from '../../../types/reporting/index.ts';
|
||||
export interface SSUReportingHorizontalBarChartSignature {
|
||||
Args: {
|
||||
data: SimpleDatum[];
|
||||
title: string;
|
||||
description?: string;
|
||||
linkUrl?: string;
|
||||
};
|
||||
Blocks: {
|
||||
default: [];
|
||||
};
|
||||
Element: HTMLElement;
|
||||
}
|
||||
export default class SSUReportingHorizontalBarChart extends Component<SSUReportingHorizontalBarChartSignature> {
|
||||
xRangeOffsetWidth: number;
|
||||
get data(): SimpleDatum[];
|
||||
get total(): number;
|
||||
get a11yLabel(): string;
|
||||
get yDomain(): string[];
|
||||
get xDomain(): number[];
|
||||
get rangeHeight(): number;
|
||||
get yRange(): number[];
|
||||
getXRange: (width: number) => number[];
|
||||
handleAxisOffset: (offsetWidth: number) => void;
|
||||
}
|
||||
//# sourceMappingURL=horizontal-bar-chart.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"horizontal-bar-chart.d.ts","sourceRoot":"","sources":["../../../../src/components/vault-reporting/reporting/horizontal-bar-chart.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,6BAA6B,CAAC;AACrC,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAiB3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAErE,MAAM,WAAW,uCAAuC;IACtD,IAAI,EAAE;QACJ,IAAI,EAAE,WAAW,EAAE,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AACD,MAAM,CAAC,OAAO,OAAO,8BAA+B,SAAQ,SAAS,CAAC,uCAAuC,CAAC;IACnG,iBAAiB,SAAK;IAE/B,IAAI,IAAI,kBAOP;IAED,IAAI,KAAK,WAIR;IAED,IAAI,SAAS,WAUZ;IAED,IAAI,OAAO,aAEV;IAED,IAAI,OAAO,aAEV;IAED,IAAI,WAAW,WAEd;IAED,IAAI,MAAM,aAET;IAED,SAAS,UAAW,MAAM,cAExB;IAEF,gBAAgB,gBAAiB,MAAM,UAErC;CAqHH"}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import Component from '@glimmer/component';
|
||||
import './plugin-card.scss';
|
||||
import type { RegistryPlugin } from '../../../types/vault-registry';
|
||||
export interface Plugin {
|
||||
Args: {
|
||||
plugin: RegistryPlugin;
|
||||
};
|
||||
Blocks: {
|
||||
default: [];
|
||||
};
|
||||
Element: HTMLElement;
|
||||
}
|
||||
export default class PluginCard extends Component<Plugin> {
|
||||
get isEnterprisePlugin(): boolean;
|
||||
get pluginPublishDate(): string;
|
||||
}
|
||||
//# sourceMappingURL=plugin-card.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"plugin-card.d.ts","sourceRoot":"","sources":["../../../../src/components/vault-reporting/vault-registry/plugin-card.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAO3C,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE;QACJ,MAAM,EAAE,cAAc,CAAC;KACxB,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,SAAS,CAAC,MAAM,CAAC;IACvD,IAAI,kBAAkB,YAErB;IAED,IAAI,iBAAiB,WAEpB;CAyHF"}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import Component from '@glimmer/component';
|
||||
import type { RegistryPlugin } from '../../../types/vault-registry';
|
||||
export interface PluginList {
|
||||
Args: {
|
||||
plugins?: RegistryPlugin[];
|
||||
};
|
||||
Blocks: {
|
||||
default: [];
|
||||
};
|
||||
Element: HTMLElement;
|
||||
}
|
||||
export default class Plugins extends Component<PluginList> {
|
||||
get plugins(): RegistryPlugin[] | undefined;
|
||||
}
|
||||
//# sourceMappingURL=plugins.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../src/components/vault-reporting/vault-registry/plugins.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE;QACJ,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;KAC5B,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AACD,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,SAAS,CAAC,UAAU,CAAC;IACxD,IAAI,OAAO,iCAEV;CAgBF"}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import Component from '@glimmer/component';
|
||||
import './dashboard.scss';
|
||||
import type { UsageDashboardData, SimpleDatum, getUsageDataFunction } from '../../../types';
|
||||
import type { IconName } from '@hashicorp/flight-icons/svg';
|
||||
import type ReportingAnalyticsService from '../../../services/reporting-analytics';
|
||||
interface CounterBlock {
|
||||
title: string;
|
||||
tooltipMessage: string;
|
||||
data: number;
|
||||
icon?: IconName;
|
||||
suffix?: string;
|
||||
link?: string;
|
||||
emptyText?: string;
|
||||
emptyLink?: string;
|
||||
}
|
||||
export interface SSUViewDashboardSignature {
|
||||
Args: {
|
||||
onFetchUsageData: getUsageDataFunction;
|
||||
isVaultDedicated: boolean;
|
||||
};
|
||||
Blocks: {
|
||||
default: [];
|
||||
};
|
||||
Element: HTMLElement;
|
||||
}
|
||||
export default class SSUViewDashboard extends Component<SSUViewDashboardSignature> {
|
||||
readonly reportingAnalytics: ReportingAnalyticsService;
|
||||
data?: UsageDashboardData;
|
||||
lastUpdatedTime: string;
|
||||
error?: unknown;
|
||||
constructor(owner: unknown, args: SSUViewDashboardSignature['Args']);
|
||||
fetchAllData: () => void;
|
||||
handleTrackAnalyticsEvent: (eventName: string, properties?: object, options?: object) => void;
|
||||
handleTrackSurveyLink: () => void;
|
||||
handleRefresh: () => void;
|
||||
getBarChartData: (map: Record<string, number>, exclude?: string[]) => SimpleDatum[];
|
||||
get isVaultDedicated(): boolean;
|
||||
get kvSecretsTooltipMessage(): string;
|
||||
get counters(): CounterBlock[];
|
||||
get namespace(): string;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=dashboard.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../../src/components/vault-reporting/views/dashboard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAE3C,OAAO,kBAAkB,CAAC;AAO1B,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAS5D,OAAO,KAAK,yBAAyB,MAAM,uCAAuC,CAAC;AAEnF,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE;QACJ,gBAAgB,EAAE,oBAAoB,CAAC;QACvC,gBAAgB,EAAE,OAAO,CAAC;KAC3B,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AACD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,SAAS,CAAC,yBAAyB,CAAC;IAChF,SAA0B,kBAAkB,EAAE,yBAAyB,CAAC;IAGxE,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAG1B,eAAe,EAAE,MAAM,CAAM;IAG7B,KAAK,CAAC,EAAE,OAAO,CAAC;gBAEJ,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,yBAAyB,CAAC,MAAM,CAAC;IAKnE,YAAY,EAAE,MAAM,IAAI,CAUtB;IAEF,yBAAyB,cACZ,MAAM,eACJ,MAAM,YACT,MAAM,UAGhB;IAEF,qBAAqB,EAAE,MAAM,IAAI,CAE/B;IAEF,aAAa,EAAE,MAAM,IAAI,CAGvB;IAEF,eAAe,EAAE,CACf,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3B,OAAO,CAAC,EAAE,MAAM,EAAE,KACf,WAAW,EAAE,CAWhB;IAEF,IAAI,gBAAgB,IAAI,OAAO,CAE9B;IAED,IAAI,uBAAuB,IAAI,MAAM,CAepC;IAED,IAAI,QAAQ,IAAI,YAAY,EAAE,CAgC7B;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;CAwMF"}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import { type FilterFieldDefinition } from '../filter-bar';
|
||||
import './secret-inventory.scss';
|
||||
import Component from '@glimmer/component';
|
||||
import { type Filter } from '@hashicorp/vault-reporting/utils/cel';
|
||||
export interface SecretInventorySignature {
|
||||
Args: {
|
||||
onFilterApplied: (value: string) => void;
|
||||
filterString: string;
|
||||
};
|
||||
Blocks: {
|
||||
default: [];
|
||||
};
|
||||
Element: HTMLElement;
|
||||
}
|
||||
export default class SecretInventory extends Component<SecretInventorySignature> {
|
||||
quickFilters: {
|
||||
label: string;
|
||||
applyFilter: () => void;
|
||||
}[];
|
||||
filterFieldDefinitions: FilterFieldDefinition[];
|
||||
handleApplyFilters: (filters: Filter[]) => void;
|
||||
get appliedFilters(): Filter[];
|
||||
}
|
||||
//# sourceMappingURL=secret-inventory.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"secret-inventory.d.ts","sourceRoot":"","sources":["../../../../src/components/vault-reporting/views/secret-inventory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAkB,EAAE,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,yBAAyB,CAAC;AACjC,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAEL,KAAK,MAAM,EAEZ,MAAM,sCAAsC,CAAC;AAE9C,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE;QACJ,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACzC,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IAEF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,EAAE,WAAW,CAAC;CACtB;AAQD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,SAAS,CAAC,wBAAwB,CAAC;IAC9E,YAAY;;;QAyEV;IACF,sBAAsB,EAAE,qBAAqB,EAAE,CAgD7C;IACF,kBAAkB,YAAa,MAAM,EAAE,UAErC;IAEF,IAAI,cAAc,aAKjB;CA2EF"}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
/**
|
||||
* By default the axis elements are outside of the bounds of the svg and rely on the containing element having
|
||||
* enough padding to compensate. A fixed padding is not flexible to varied width of axis labels.
|
||||
*
|
||||
* This modifier is used to pad compensate for the width of the axis element. It also returns a value
|
||||
* that can be used to set the chart width based on the offset amount.
|
||||
*/
|
||||
declare const _default: import("ember-modifier").FunctionBasedModifier<{
|
||||
Args: {
|
||||
Positional: [(offset: number) => unknown, additionalPadding?: number | undefined];
|
||||
Named: import("ember-modifier/-private/signature").EmptyObject;
|
||||
};
|
||||
Element: SVGElement;
|
||||
}>;
|
||||
export default _default;
|
||||
//# sourceMappingURL=axis-offset.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"axis-offset.d.ts","sourceRoot":"","sources":["../../src/modifiers/axis-offset.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH;;;;;;GAMG;;;8BAKY,MAAM,KAAK,OAAO;;;;;AAJjC,wBAoBE"}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
/**
|
||||
* Applies and updates a custom CSS property based on updates to a tracked/computed ember value.
|
||||
*/
|
||||
declare const _default: import("ember-modifier").FunctionBasedModifier<{
|
||||
Args: {
|
||||
Positional: [string, string];
|
||||
Named: import("ember-modifier/-private/signature").EmptyObject;
|
||||
};
|
||||
Element: HTMLElement;
|
||||
}>;
|
||||
export default _default;
|
||||
//# sourceMappingURL=css-custom-property.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"css-custom-property.d.ts","sourceRoot":"","sources":["../../src/modifiers/css-custom-property.ts"],"names":[],"mappings":"AACA;;;GAGG;AAEH;;GAEG;;;;;;;;AACH,wBAgBG"}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import Service from '@ember/service';
|
||||
/**
|
||||
* This service is used to look up the `analytics` service in the host application and track events if it exists. If it doesn't exist
|
||||
* or the implementation breaks it falls back gracefully to do nothing.
|
||||
*/
|
||||
export default class ReportingAnalytics extends Service {
|
||||
get analytics(): {
|
||||
trackEvent: (event: string, properties?: object, options?: object) => void;
|
||||
} | undefined;
|
||||
trackEvent(event: string, properties?: object, options?: object): void;
|
||||
}
|
||||
declare module '@ember/service' {
|
||||
interface Registry {
|
||||
reportingAnalytics: ReportingAnalytics;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=reporting-analytics.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"reporting-analytics.d.ts","sourceRoot":"","sources":["../../src/services/reporting-analytics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,OAAO;IAGrD,IAAI,SAAS,IAEP;QACE,UAAU,EAAE,CACV,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,MAAM,KACb,IAAI,CAAC;KACX,GACD,SAAS,CACd;IAED,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAahE;AAGD,OAAO,QAAQ,gBAAgB,CAAC;IAC9B,UAAU,QAAQ;QAChB,kBAAkB,EAAE,kBAAkB,CAAC;KACxC;CACF"}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
//# sourceMappingURL=template-registry.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"template-registry.d.ts","sourceRoot":"","sources":["../src/template-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
||||
53
ui/vault-reporting/declarations/types/index.d.ts
vendored
53
ui/vault-reporting/declarations/types/index.d.ts
vendored
|
|
@ -1,53 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
type ISODateString = `${number}${number}-${number}${number}-${number}${number}`;
|
||||
type ISOTimeString = `${number}${number}:${number}${number}:${number}${number}`;
|
||||
type ISODateTimeString = `${ISODateString}T${ISOTimeString}`;
|
||||
export interface TimeSeriesDatum {
|
||||
date: ISODateTimeString;
|
||||
value: number;
|
||||
}
|
||||
export interface SimpleDatum {
|
||||
value: number;
|
||||
label: string;
|
||||
}
|
||||
export declare enum REPLICATION_ENABLED_STATE {
|
||||
PRIMARY = "primary",
|
||||
SECONDARY = "secondary",
|
||||
BOOTSTRAPPING = "bootstrapping"
|
||||
}
|
||||
export declare const REPLICATION_DISABLED_STATE = "disabled";
|
||||
export interface UsageDashboardData {
|
||||
authMethods: Record<string, number>;
|
||||
leasesByAuthMethod: Record<string, number>;
|
||||
kvv1Secrets: number;
|
||||
kvv2Secrets: number;
|
||||
leaseCountQuotas: {
|
||||
globalLeaseCountQuota: {
|
||||
capacity: number;
|
||||
count: number;
|
||||
name: string;
|
||||
};
|
||||
totalLeaseCountQuotas: number;
|
||||
};
|
||||
namespaces: number;
|
||||
secretSync: {
|
||||
totalDestinations: number;
|
||||
};
|
||||
pki: {
|
||||
totalIssuers: number;
|
||||
totalRoles: number;
|
||||
};
|
||||
replicationStatus: {
|
||||
drPrimary: boolean;
|
||||
drState: REPLICATION_ENABLED_STATE | typeof REPLICATION_DISABLED_STATE;
|
||||
prPrimary: boolean;
|
||||
prState: REPLICATION_ENABLED_STATE | typeof REPLICATION_DISABLED_STATE;
|
||||
};
|
||||
secretEngines: Record<string, number>;
|
||||
}
|
||||
export type getUsageDataFunction = () => Promise<UsageDashboardData>;
|
||||
export {};
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,KAAK,aAAa,GAAG,GAAG,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC;AAChF,KAAK,aAAa,GAAG,GAAG,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC;AAChF,KAAK,iBAAiB,GAAG,GAAG,aAAa,IAAI,aAAa,EAAE,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAMD,oBAAY,yBAAyB;IACnC,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,aAAa,kBAAkB;CAChC;AACD,eAAO,MAAM,0BAA0B,aAAa,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE;QAChB,qBAAqB,EAAE;YACrB,QAAQ,EAAE,MAAM,CAAC;YACjB,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QACF,qBAAqB,EAAE,MAAM,CAAC;KAC/B,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,GAAG,EAAE;QACH,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,iBAAiB,EAAE;QACjB,SAAS,EAAE,OAAO,CAAC;QACnB,OAAO,EAAE,yBAAyB,GAAG,OAAO,0BAA0B,CAAC;QACvE,SAAS,EAAE,OAAO,CAAC;QACnB,OAAO,EAAE,yBAAyB,GAAG,OAAO,0BAA0B,CAAC;KACxE,CAAC;IACF,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC"}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
type ISODateString = `${number}${number}-${number}${number}-${number}${number}`;
|
||||
type ISOTimeString = `${number}${number}:${number}${number}:${number}${number}`;
|
||||
type ISODateTimeString = `${ISODateString}T${ISOTimeString}`;
|
||||
export interface TimeSeriesDatum {
|
||||
date: ISODateTimeString;
|
||||
value: number;
|
||||
}
|
||||
export interface SimpleDatum {
|
||||
value: number;
|
||||
label: string;
|
||||
}
|
||||
export interface UsageDashboardData {
|
||||
auth_methods: Record<string, number>;
|
||||
kvv1_secrets: number;
|
||||
kvv2_secrets: number;
|
||||
lease_count_quotas: {
|
||||
global_lease_count_quota: {
|
||||
capacity: number;
|
||||
count: number;
|
||||
name: string;
|
||||
};
|
||||
total_lease_count_quotas: number;
|
||||
};
|
||||
namespaces: number;
|
||||
secrets_sync: number;
|
||||
pki: {
|
||||
total_issuers: number;
|
||||
total_roles: number;
|
||||
};
|
||||
replication_status: {
|
||||
dr_primary: boolean;
|
||||
dr_state: string;
|
||||
pr_primary: boolean;
|
||||
pr_state: string;
|
||||
};
|
||||
secret_engines: Record<string, number>;
|
||||
}
|
||||
export interface IUsageDashboardService {
|
||||
getUsageData(): Promise<UsageDashboardData>;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/reporting/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,KAAK,aAAa,GAAG,GAAG,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC;AAChF,KAAK,aAAa,GAAG,GAAG,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC;AAChF,KAAK,iBAAiB,GAAG,GAAG,aAAa,IAAI,aAAa,EAAE,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE;QAClB,wBAAwB,EAAE;YACxB,QAAQ,EAAE,MAAM,CAAC;YACjB,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QACF,wBAAwB,EAAE,MAAM,CAAC;KAClC,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE;QACH,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,kBAAkB,EAAE;QAClB,UAAU,EAAE,OAAO,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,OAAO,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC7C"}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
import type { HdsBadgeSignature } from '@hashicorp/design-system-components/components/hds/badge/index';
|
||||
type PluginTag = 'built-in' | 'official' | 'partner' | 'community' | 'enterprise';
|
||||
export interface RegistryPlugin {
|
||||
id: string;
|
||||
pluginName: string;
|
||||
author: string;
|
||||
description: string;
|
||||
externalUrl: string;
|
||||
pluginType: 'AUTH' | 'SECRET' | 'DATABASE';
|
||||
pluginVersion: string;
|
||||
isRegistered?: boolean;
|
||||
official: OfficialPlugin;
|
||||
tags: PluginTag;
|
||||
publishDate: Date;
|
||||
}
|
||||
interface OfficialPlugin {
|
||||
author: HdsBadgeSignature['Args']['icon'];
|
||||
tags: string;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/vault-registry/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gEAAgE,CAAC;AAExG,KAAK,SAAS,GACV,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,GACX,YAAY,CAAC;AAEjB,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,cAAc,CAAC;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,IAAI,CAAC;CACnB;AAED,UAAU,cAAc;IACtB,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;CACd"}
|
||||
15
ui/vault-reporting/declarations/utils/cel.d.ts
vendored
15
ui/vault-reporting/declarations/utils/cel.d.ts
vendored
|
|
@ -1,15 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
export interface Filter {
|
||||
field: string;
|
||||
operator: '>=' | '<=' | '>' | '<' | '=' | '!=' | 'IN' | 'NOT IN';
|
||||
value: {
|
||||
type: 'timestamp' | 'list' | 'string' | 'number';
|
||||
value: unknown;
|
||||
};
|
||||
}
|
||||
export declare const expressionToFilters: (expression: string) => Filter[];
|
||||
export declare const filtersToExpression: (filters: Filter[]) => string;
|
||||
//# sourceMappingURL=cel.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"cel.d.ts","sourceRoot":"","sources":["../../src/utils/cel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsCH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,QAAQ,CAAC;IACjE,KAAK,EAAE;QACL,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;QACjD,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;CACH;AAiCD,eAAO,MAAM,mBAAmB,eAAgB,MAAM,aA4BrD,CAAC;AAEF,eAAO,MAAM,mBAAmB,YAAa,MAAM,EAAE,WAepD,CAAC"}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
*/
|
||||
|
||||
export { default } from "@hashicorp/vault-reporting/components/vault-reporting/base/title-row";
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
*/
|
||||
|
||||
export { default } from "@hashicorp/vault-reporting/components/vault-reporting/cluster-replication";
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
*/
|
||||
|
||||
export { default } from "@hashicorp/vault-reporting/components/vault-reporting/counter";
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
*/
|
||||
|
||||
export { default } from "@hashicorp/vault-reporting/components/vault-reporting/dashboard/export";
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
*/
|
||||
|
||||
export { default } from "@hashicorp/vault-reporting/components/vault-reporting/donut-chart";
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
*/
|
||||
|
||||
export { default } from "@hashicorp/vault-reporting/components/vault-reporting/global-lease";
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
*/
|
||||
|
||||
export { default } from "@hashicorp/vault-reporting/components/vault-reporting/horizontal-bar-chart";
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
*/
|
||||
|
||||
export { default } from "@hashicorp/vault-reporting/components/vault-reporting/views/dashboard";
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
*/
|
||||
|
||||
export { default } from "@hashicorp/vault-reporting/modifiers/axis-offset";
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
*/
|
||||
|
||||
export { default } from "@hashicorp/vault-reporting/modifiers/css-custom-property";
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
*/
|
||||
|
||||
export { default } from "@hashicorp/vault-reporting/services/reporting-analytics";
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
import Component from '@glimmer/component';
|
||||
import { HdsTextBody, HdsLinkStandalone, HdsTextDisplay } from '@hashicorp/design-system-components/components';
|
||||
import { on } from '@ember/modifier';
|
||||
import { service } from '@ember/service';
|
||||
import { precompileTemplate } from '@ember/template-compilation';
|
||||
import { setComponentTemplate } from '@ember/component';
|
||||
import { g, i } from 'decorator-transforms/runtime';
|
||||
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
class TitleRow extends Component {
|
||||
static {
|
||||
g(this.prototype, "reportingAnalytics", [service]);
|
||||
}
|
||||
#reportingAnalytics = (i(this, "reportingAnalytics"), void 0);
|
||||
get hasLink() {
|
||||
return this.args.linkUrl;
|
||||
}
|
||||
get linkText() {
|
||||
return this.args.linkText || 'View all';
|
||||
}
|
||||
get linkUrl() {
|
||||
return this.args.linkUrl || '#';
|
||||
}
|
||||
get linkIcon() {
|
||||
return this.args.linkIcon || 'arrow-right';
|
||||
}
|
||||
get linkTarget() {
|
||||
return this.args.linkTarget || '_self';
|
||||
}
|
||||
handleLinkClick = () => {
|
||||
this.reportingAnalytics.trackEvent(`card_link`, {
|
||||
card: this.args.title,
|
||||
link: this.linkText,
|
||||
target: this.linkTarget
|
||||
});
|
||||
};
|
||||
static {
|
||||
setComponentTemplate(precompileTemplate("\n <div class=\"ssu-title-row\" data-test-vault-reporting-dashboard-card-title-row>\n <div class=\"ssu-title-row__container\">\n <HdsTextDisplay data-test-vault-reporting-dashboard-card-title @size=\"300\">\n {{@title}}\n </HdsTextDisplay>\n\n {{#if this.hasLink}}\n <HdsLinkStandalone data-test-vault-reporting-dashboard-card-title-link class=\"ssu-title-row__container__link\" @text={{this.linkText}} @href={{this.linkUrl}} @icon={{this.linkIcon}} target={{this.linkTarget}} @iconPosition=\"trailing\" {{on \"click\" this.handleLinkClick}} />\n {{/if}}\n </div>\n\n {{#if @description}}\n <HdsTextBody class=\"ssu-title-row__description\" data-test-vault-reporting-dashboard-card-description>\n {{@description}}\n </HdsTextBody>\n {{/if}}\n </div>\n ", {
|
||||
strictMode: true,
|
||||
scope: () => ({
|
||||
HdsTextDisplay,
|
||||
HdsLinkStandalone,
|
||||
on,
|
||||
HdsTextBody
|
||||
})
|
||||
}), this);
|
||||
}
|
||||
}
|
||||
|
||||
export { TitleRow as default };
|
||||
//# sourceMappingURL=title-row.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"title-row.js","sources":["../../../../src/components/vault-reporting/base/title-row.gts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: BUSL-1.1\n */\n\nimport Component from '@glimmer/component';\nimport {\n HdsTextDisplay,\n HdsTextBody,\n HdsLinkStandalone,\n} from '@hashicorp/design-system-components/components';\nimport './title-row.scss';\nimport { on } from '@ember/modifier';\n\nimport { service } from '@ember/service';\nimport type ReportingAnalyticsService from '../../../services/reporting-analytics';\nimport type { SafeString } from '@ember/template';\n\n/**\n * TitleRow Component\n *\n * A reusable component that displays a title with an optional description and link.\n * Used in dashboard cards to create consistent header styling.\n */\nexport interface TitleRowSignature {\n Args: {\n /** The main title text to display */\n title: string;\n /** Optional description text to display beneath the title */\n description?: string | SafeString;\n /** Custom text for the link (defaults to \"View all\") */\n linkText?: string;\n /** Icon to display with the link (defaults to \"arrow-right\") */\n linkIcon?: HdsLinkStandalone['icon'];\n /** URL for the link - if not provided, no link will be shown */\n linkUrl?: string;\n /** Target for the link - defaults to \"_self\" */\n linkTarget?: '_blank' | '_self';\n };\n\n Blocks: {\n default: [];\n };\n\n Element: HTMLElement;\n}\n\nexport default class TitleRow extends Component<TitleRowSignature> {\n @service declare readonly reportingAnalytics: ReportingAnalyticsService;\n\n get hasLink() {\n return this.args.linkUrl;\n }\n\n get linkText() {\n return this.args.linkText || 'View all';\n }\n\n get linkUrl() {\n return this.args.linkUrl || '#';\n }\n\n get linkIcon() {\n return this.args.linkIcon || 'arrow-right';\n }\n\n get linkTarget() {\n return this.args.linkTarget || '_self';\n }\n\n handleLinkClick = () => {\n this.reportingAnalytics.trackEvent(`card_link`, {\n card: this.args.title,\n link: this.linkText,\n target: this.linkTarget,\n });\n };\n\n <template>\n <div\n class=\"ssu-title-row\"\n data-test-vault-reporting-dashboard-card-title-row\n >\n <div class=\"ssu-title-row__container\">\n <HdsTextDisplay\n data-test-vault-reporting-dashboard-card-title\n @size=\"300\"\n >\n {{@title}}\n </HdsTextDisplay>\n\n {{#if this.hasLink}}\n <HdsLinkStandalone\n data-test-vault-reporting-dashboard-card-title-link\n class=\"ssu-title-row__container__link\"\n @text={{this.linkText}}\n @href={{this.linkUrl}}\n @icon={{this.linkIcon}}\n target={{this.linkTarget}}\n @iconPosition=\"trailing\"\n {{on \"click\" this.handleLinkClick}}\n />\n {{/if}}\n </div>\n\n {{#if @description}}\n <HdsTextBody\n class=\"ssu-title-row__description\"\n data-test-vault-reporting-dashboard-card-description\n >\n {{@description}}\n </HdsTextBody>\n {{/if}}\n </div>\n </template>\n}\n"],"names":["TitleRow","Component","g","prototype","service","i","void 0","hasLink","args","linkUrl","linkText","linkIcon","linkTarget","handleLinkClick","reportingAnalytics","trackEvent","card","title","link","target","setComponentTemplate","precompileTemplate","strictMode","scope","HdsTextDisplay","HdsLinkStandalone","on","HdsTextBody"],"mappings":";;;;;;;;AAAA;;;AAGC;AA4Cc,MAAMA,iBAAiBC,SAAU,CAAA;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,oBAAA,EAAA,CAC7CC,OAAA,CAAA,CAAA;AAAA;AAAA,EAAA,mBAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,oBAAA,CAAA,EAAAC,MAAA;EAED,IAAIC,OAAUA,GAAA;AACZ,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,OAAO;AAC1B;EAEA,IAAIC,QAAWA,GAAA;AACb,IAAA,OAAO,IAAI,CAACF,IAAI,CAACE,QAAQ,IAAI,UAAA;AAC/B;EAEA,IAAID,OAAUA,GAAA;AACZ,IAAA,OAAO,IAAI,CAACD,IAAI,CAACC,OAAO,IAAI,GAAA;AAC9B;EAEA,IAAIE,QAAWA,GAAA;AACb,IAAA,OAAO,IAAI,CAACH,IAAI,CAACG,QAAQ,IAAI,aAAA;AAC/B;EAEA,IAAIC,UAAaA,GAAA;AACf,IAAA,OAAO,IAAI,CAACJ,IAAI,CAACI,UAAU,IAAI,OAAA;AACjC;EAEAC,eAAkB,GAAAA,MAAA;AAChB,IAAA,IAAI,CAACC,kBAAkB,CAACC,UAAU,CAAC,WAAW,EAAE;AAC9CC,MAAAA,IAAA,EAAM,IAAI,CAACR,IAAI,CAACS,KAAK;MACrBC,IAAM,EAAA,IAAI,CAACR,QAAQ;MACnBS,MAAQ,EAAA,IAAI,CAACP;AACf,KAAA,CAAA;GACA;AAEF,EAAA;IAAAQ,oBAAA,CAAAC,kBAAA,CAoCA,k1BAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,cAAA;QAAAC,iBAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
import Component from '@glimmer/component';
|
||||
import { HdsBadge, HdsTextBody, HdsCardContainer } from '@hashicorp/design-system-components/components';
|
||||
import TitleRow from './base/title-row.js';
|
||||
import { htmlSafe } from '@ember/template';
|
||||
import { precompileTemplate } from '@ember/template-compilation';
|
||||
import { setComponentTemplate } from '@ember/component';
|
||||
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
class ClusterReplication extends Component {
|
||||
getState = (state = 'disabled') => {
|
||||
return state;
|
||||
};
|
||||
get isEmpty() {
|
||||
return this.getState(this.args.disasterRecoveryState) === 'disabled' && this.getState(this.args.performanceState) === 'disabled';
|
||||
}
|
||||
get description() {
|
||||
if (this.isEmpty) {
|
||||
return htmlSafe('Enable <a class="hds-link-inline--color-secondary" href="https://developer.hashicorp.com/vault/docs/internals/replication" target="_blank" data-test-vault-reporting-cluster-replication-description-link>replication</a> to replicate data across clusters.');
|
||||
} else {
|
||||
return 'Status of disaster recovery and performance replication.';
|
||||
}
|
||||
}
|
||||
getIcon = (state = 'disabled') => {
|
||||
const iconMap = {
|
||||
disabled: 'x',
|
||||
primary: 'check',
|
||||
secondary: 'check',
|
||||
bootstrapping: 'loading'
|
||||
};
|
||||
return iconMap[state] || iconMap['disabled'];
|
||||
};
|
||||
getColor = (state = 'disabled') => {
|
||||
const colorMap = {
|
||||
disabled: 'neutral',
|
||||
primary: 'success',
|
||||
secondary: 'success',
|
||||
bootstrapping: 'neutral'
|
||||
};
|
||||
return colorMap[state] || colorMap['disabled'];
|
||||
};
|
||||
get linkUrl() {
|
||||
const {
|
||||
isVaultDedicated = false
|
||||
} = this.args;
|
||||
if (isVaultDedicated) {
|
||||
return;
|
||||
}
|
||||
return 'replication';
|
||||
}
|
||||
static {
|
||||
setComponentTemplate(precompileTemplate("\n <HdsCardContainer data-test-vault-reporting-cluster-replication @hasBorder={{true}} class=\"ssu-cluster-replication\" ...attributes>\n <TitleRow @title=\"Cluster replication\" @description={{this.description}} @linkUrl={{this.linkUrl}} />\n\n <HdsTextBody @size=\"300\" data-test-vault-reporting-cluster-replication-dr-row>\n Disaster Recovery\n <HdsBadge class=\"ssu-cluster-replication__list-row__badge\" data-test-vault-reporting-cluster-replication-dr-badge @icon={{this.getIcon @disasterRecoveryState}} @text={{this.getState @disasterRecoveryState}} @color={{this.getColor @disasterRecoveryState}} @type=\"outlined\" @size=\"small\" />\n </HdsTextBody>\n\n <HdsTextBody @size=\"300\" data-test-vault-reporting-cluster-replication-perf-row>\n Performance\n <HdsBadge class=\"ssu-cluster-replication__list-row__badge\" data-test-vault-reporting-cluster-replication-perf-badge @icon={{this.getIcon @performanceState}} @text={{this.getState @performanceState}} @color={{this.getColor @performanceState}} @type=\"outlined\" @size=\"small\" />\n </HdsTextBody>\n\n </HdsCardContainer>\n ", {
|
||||
strictMode: true,
|
||||
scope: () => ({
|
||||
HdsCardContainer,
|
||||
TitleRow,
|
||||
HdsTextBody,
|
||||
HdsBadge
|
||||
})
|
||||
}), this);
|
||||
}
|
||||
}
|
||||
|
||||
export { ClusterReplication as default };
|
||||
//# sourceMappingURL=cluster-replication.js.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,46 +0,0 @@
|
|||
import Component from '@glimmer/component';
|
||||
import { HdsLinkInline, HdsIcon, HdsTooltipButton, HdsTextBody } from '@hashicorp/design-system-components/components';
|
||||
import { precompileTemplate } from '@ember/template-compilation';
|
||||
import { setComponentTemplate } from '@ember/component';
|
||||
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
class SSUReportingCounter extends Component {
|
||||
get shouldShowEmptyState() {
|
||||
return this.args.count === 0 && this.args.emptyText;
|
||||
}
|
||||
get count() {
|
||||
if (this.shouldShowEmptyState) {
|
||||
return this.args.emptyText;
|
||||
}
|
||||
if (this.args.suffix) {
|
||||
return `${this.args.count} ${this.args.suffix}`;
|
||||
}
|
||||
return this.args.count;
|
||||
}
|
||||
get icon() {
|
||||
return this.args.icon || 'info';
|
||||
}
|
||||
get link() {
|
||||
if (this.shouldShowEmptyState && this.args.emptyLink) {
|
||||
return this.args.emptyLink;
|
||||
}
|
||||
return this.args.link;
|
||||
}
|
||||
static {
|
||||
setComponentTemplate(precompileTemplate("\n <div ...attributes data-test-vault-reporting-counter={{@title}} class=\"ssu-counter\" aria-label=\"{{@title}} {{this.count}}\">\n <div class=\"ssu-counter__title-row\">\n <HdsTextBody @weight=\"semibold\" @size=\"200\" @color=\"primary\">{{@title}}\n {{#if @tooltipMessage}}\n <HdsTooltipButton data-test-vault-reporting-counter-tooltip-button class=\"ssu-counter__title-row__tooltip\" @text={{@tooltipMessage}} aria-label=\"Tooltip for {{@title}}\" @isInline={{true}}>\n <HdsIcon @name=\"help\" @isInline={{true}} />\n </HdsTooltipButton>\n {{/if}}\n </HdsTextBody>\n </div>\n\n <HdsTextBody>\n {{#if this.link}}\n <HdsLinkInline @href={{this.link}} @color=\"secondary\" class=\"ssu-counter__link\" target=\"_self\">{{this.count}}\n </HdsLinkInline>\n {{else}}\n {{this.count}}\n {{/if}}\n </HdsTextBody>\n </div>\n ", {
|
||||
strictMode: true,
|
||||
scope: () => ({
|
||||
HdsTextBody,
|
||||
HdsTooltipButton,
|
||||
HdsIcon,
|
||||
HdsLinkInline
|
||||
})
|
||||
}), this);
|
||||
}
|
||||
}
|
||||
|
||||
export { SSUReportingCounter as default };
|
||||
//# sourceMappingURL=counter.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"counter.js","sources":["../../../src/components/vault-reporting/counter.gts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: BUSL-1.1\n */\n\nimport Component from '@glimmer/component';\nimport {\n HdsTextBody,\n HdsIcon,\n HdsTooltipButton,\n HdsLinkInline,\n} from '@hashicorp/design-system-components/components';\nimport type { IconName } from '@hashicorp/flight-icons/svg';\n\nimport './counter.scss';\n\nexport interface SSUReportingCounterSignature {\n Args: {\n count: number;\n title: string;\n tooltipMessage?: string;\n icon?: IconName;\n suffix?: string;\n link?: string;\n emptyText?: string;\n emptyLink?: string;\n };\n\n Blocks: {\n default: [];\n };\n\n Element: HTMLElement;\n}\nexport default class SSUReportingCounter extends Component<SSUReportingCounterSignature> {\n get shouldShowEmptyState() {\n return this.args.count === 0 && this.args.emptyText;\n }\n\n get count() {\n if (this.shouldShowEmptyState) {\n return this.args.emptyText;\n }\n\n if (this.args.suffix) {\n return `${this.args.count} ${this.args.suffix}`;\n }\n\n return this.args.count;\n }\n\n get icon() {\n return this.args.icon || 'info';\n }\n\n get link() {\n if (this.shouldShowEmptyState && this.args.emptyLink) {\n return this.args.emptyLink;\n }\n return this.args.link;\n }\n\n <template>\n <div\n ...attributes\n data-test-vault-reporting-counter={{@title}}\n class=\"ssu-counter\"\n aria-label=\"{{@title}} {{this.count}}\"\n >\n <div class=\"ssu-counter__title-row\">\n <HdsTextBody @weight=\"semibold\" @size=\"200\" @color=\"primary\">{{@title}}\n {{#if @tooltipMessage}}\n <HdsTooltipButton\n data-test-vault-reporting-counter-tooltip-button\n class=\"ssu-counter__title-row__tooltip\"\n @text={{@tooltipMessage}}\n aria-label=\"Tooltip for {{@title}}\"\n @isInline={{true}}\n >\n <HdsIcon @name=\"help\" @isInline={{true}} />\n </HdsTooltipButton>\n {{/if}}\n </HdsTextBody>\n </div>\n\n <HdsTextBody>\n {{#if this.link}}\n <HdsLinkInline\n @href={{this.link}}\n @color=\"secondary\"\n class=\"ssu-counter__link\"\n target=\"_self\"\n >{{this.count}}\n </HdsLinkInline>\n {{else}}\n {{this.count}}\n {{/if}}\n </HdsTextBody>\n </div>\n </template>\n}\n"],"names":["SSUReportingCounter","Component","shouldShowEmptyState","args","count","emptyText","suffix","icon","link","emptyLink","setComponentTemplate","precompileTemplate","strictMode","scope","HdsTextBody","HdsTooltipButton","HdsIcon","HdsLinkInline"],"mappings":";;;;;AAAA;;;AAGC;AA+Bc,MAAMA,4BAA4BC,SAAU,CAAA;EACzD,IAAIC,oBAAuBA,GAAA;AACzB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,KAAK,KAAK,CAAA,IAAK,IAAI,CAACD,IAAI,CAACE,SAAS;AACrD;EAEA,IAAID,KAAQA,GAAA;IACV,IAAI,IAAI,CAACF,oBAAoB,EAAE;AAC7B,MAAA,OAAO,IAAI,CAACC,IAAI,CAACE,SAAS;AAC5B;AAEA,IAAA,IAAI,IAAI,CAACF,IAAI,CAACG,MAAM,EAAE;AACpB,MAAA,OAAO,CAAG,EAAA,IAAI,CAACH,IAAI,CAACC,KAAK,CAAI,CAAA,EAAA,IAAI,CAACD,IAAI,CAACG,MAAM,CAAE,CAAA;AACjD;AAEA,IAAA,OAAO,IAAI,CAACH,IAAI,CAACC,KAAK;AACxB;EAEA,IAAIG,IAAOA,GAAA;AACT,IAAA,OAAO,IAAI,CAACJ,IAAI,CAACI,IAAI,IAAI,MAAA;AAC3B;EAEA,IAAIC,IAAOA,GAAA;IACT,IAAI,IAAI,CAACN,oBAAoB,IAAI,IAAI,CAACC,IAAI,CAACM,SAAS,EAAE;AACpD,MAAA,OAAO,IAAI,CAACN,IAAI,CAACM,SAAS;AAC5B;AACA,IAAA,OAAO,IAAI,CAACN,IAAI,CAACK,IAAI;AACvB;AAEA,EAAA;IAAAE,oBAAA,CAAAC,kBAAA,CAqCA,o8BAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,WAAA;QAAAC,gBAAA;QAAAC,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
import Component from '@glimmer/component';
|
||||
import { HdsDropdown } from '@hashicorp/design-system-components/components';
|
||||
import { on } from '@ember/modifier';
|
||||
import { fn } from '@ember/helper';
|
||||
import { service } from '@ember/service';
|
||||
import { precompileTemplate } from '@ember/template-compilation';
|
||||
import { setComponentTemplate } from '@ember/component';
|
||||
import { g, i } from 'decorator-transforms/runtime';
|
||||
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
class DashboardExport extends Component {
|
||||
static {
|
||||
g(this.prototype, "reportingAnalytics", [service]);
|
||||
}
|
||||
#reportingAnalytics = (i(this, "reportingAnalytics"), void 0);
|
||||
#getNestedRows(records, prefix = '') {
|
||||
return Object.entries(records).map(([key, value]) => {
|
||||
return [`${prefix} ${key}`, value];
|
||||
});
|
||||
}
|
||||
handleTrackExportToggle = () => {
|
||||
this.reportingAnalytics.trackEvent('export_toggle');
|
||||
};
|
||||
handleTrackExportOption = option => {
|
||||
this.reportingAnalytics.trackEvent(`export_option`, {
|
||||
option
|
||||
});
|
||||
};
|
||||
get dataAsDownloadableJSONString() {
|
||||
const {
|
||||
data
|
||||
} = this.args;
|
||||
const file = new Blob([JSON.stringify(data, null, ' ')], {
|
||||
type: 'application/json'
|
||||
});
|
||||
return URL.createObjectURL(file);
|
||||
}
|
||||
get dataAsDownloadableCSVString() {
|
||||
const headers = ['Metric', 'Count/Breakdown'];
|
||||
// Manually define rows as looping through the data does not leave the most legible structure
|
||||
const rows = [headers, ['Child Namespaces', this.args?.data?.namespaces || 0], ['Total KV Secrets', (this.args.data?.kvv1Secrets || 0) + (this.args.data?.kvv2Secrets || 0)], ['KV V1 Secrets', this.args.data?.kvv1Secrets || 0], ['KV V2 Secrets', this.args.data?.kvv2Secrets || 0], ['Secret Syncs', this.args.data?.secretSync?.totalDestinations || 0], ['PKI Roles', this.args.data?.pki?.totalRoles || 0], ...this.#getNestedRows(this.args.data?.secretEngines || {}, 'Secret Engine'), ...this.#getNestedRows(this.args.data?.authMethods || {}, 'Auth Method'), ['Global Lease Count', this.args.data?.leaseCountQuotas.globalLeaseCountQuota.count || 0], ['Global Lease Quota', this.args.data?.leaseCountQuotas.globalLeaseCountQuota.capacity || 0], ['Cluster Disaster Recovery', this.args?.data?.replicationStatus.drState || '-'], ['Cluster Disaster Recovery Primary', this.args?.data?.replicationStatus.drPrimary ?? '-'], ['Cluster Performance', this.args?.data?.replicationStatus.prState || '-'], ['Cluster Performance Primary', this.args?.data?.replicationStatus.prPrimary ?? '-']];
|
||||
// Escape double quotes, quote cell content and separate with comma
|
||||
const csvString = rows.map(row => row.map(cell => {
|
||||
const escaped = String(cell).replace(/"/g, '""');
|
||||
return `"${escaped}"`;
|
||||
}).join(',')).join('\r\n');
|
||||
const blob = new Blob([csvString], {
|
||||
type: 'text/csv'
|
||||
});
|
||||
return URL.createObjectURL(blob);
|
||||
}
|
||||
static {
|
||||
setComponentTemplate(precompileTemplate("\n {{#if @data}}\n <HdsDropdown @matchToggleWidth={{true}} as |D|>\n <D.ToggleButton data-test-vault-reporting-export-toggle @text=\"Export\" {{on \"click\" this.handleTrackExportToggle}} />\n <D.Interactive data-test-vault-reporting-export-json @href={{this.dataAsDownloadableJSONString}} download=\"vault-usage-dashboard.json\" {{on \"click\" (fn this.handleTrackExportOption \"json\")}}>JSON</D.Interactive>\n <D.Interactive data-test-vault-reporting-export-csv @href={{this.dataAsDownloadableCSVString}} download=\"vault-usage-dashboard.csv\" {{on \"click\" (fn this.handleTrackExportOption \"csv\")}}>CSV</D.Interactive>\n </HdsDropdown>\n {{/if}}\n ", {
|
||||
strictMode: true,
|
||||
scope: () => ({
|
||||
HdsDropdown,
|
||||
on,
|
||||
fn
|
||||
})
|
||||
}), this);
|
||||
}
|
||||
}
|
||||
|
||||
export { DashboardExport as default };
|
||||
//# sourceMappingURL=export.js.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,69 +0,0 @@
|
|||
import Component from '@glimmer/component';
|
||||
import { HdsTextDisplay, HdsCardContainer } from '@hashicorp/design-system-components/components';
|
||||
import LinealArc from '@lineal-viz/lineal/components/lineal/arc/index.js';
|
||||
import LinealArcs from '@lineal-viz/lineal/components/lineal/arcs/index.js';
|
||||
import LinealFluid from '@lineal-viz/lineal/components/lineal/fluid/index.js';
|
||||
import { concat } from '@ember/helper';
|
||||
import { precompileTemplate } from '@ember/template-compilation';
|
||||
import { setComponentTemplate } from '@ember/component';
|
||||
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
class SSUReportingDonutChart extends Component {
|
||||
get data() {
|
||||
return (this.args.data || []).map((datum, index) => {
|
||||
return {
|
||||
...datum,
|
||||
scaleIndex: index + 1
|
||||
};
|
||||
});
|
||||
}
|
||||
get total() {
|
||||
return this.data.reduce((runningTotal, {
|
||||
value
|
||||
}) => {
|
||||
return runningTotal + value;
|
||||
}, 0);
|
||||
}
|
||||
get a11yLabel() {
|
||||
const title = `Total of ${this.total} ${this.args.title}.`;
|
||||
const itemsDescription = this.data.map(({
|
||||
value,
|
||||
label
|
||||
}) => {
|
||||
return `${value} ${label}`;
|
||||
}).join(', ');
|
||||
return `${title} Comprised of ${itemsDescription}.`;
|
||||
}
|
||||
getOffset(width, height) {
|
||||
return `translate(${width / 2}, ${height / 2})`;
|
||||
}
|
||||
getInnerRadius(width, height) {
|
||||
const computedRadius = Math.min(width, height) / 2 - 50;
|
||||
// Smallest inner radius is 60 to allow for text
|
||||
return Math.max(computedRadius, 60);
|
||||
}
|
||||
getOuterRadius(width, height) {
|
||||
// Smallest inner radius is 60 to allow for text
|
||||
const computedRadius = Math.min(width, height) / 2;
|
||||
return Math.max(computedRadius, 110);
|
||||
}
|
||||
static {
|
||||
setComponentTemplate(precompileTemplate("\n <HdsCardContainer ...attributes class=\"ssu-donut-chart__container\" @hasBorder={{true}}>\n <div class=\"ssu-donut-chart__row\">\n {{!-- TODO: Figure out glint errors on lineal components --}}\n {{!-- @glint-expect-error --}}\n <LinealFluid class=\"ssu-donut-chart__fluid\" as |width height|>\n <svg width=\"100%\" height=\"100%\" class=\"ssu-donut-chart__chart\" tabindex=\"0\" role=\"img\" aria-label={{this.a11yLabel}}>\n <g transform={{this.getOffset width height}}>\n {{!-- @glint-expect-error --}}\n <LinealArcs @data={{this.data}} {{!-- @glint-expect-error --}} @theta=\"value\" @colorScale=\"nominal\" as |pie|>\n {{#each pie as |slice|}}\n {{!-- @glint-expect-error --}}\n <LinealArc data-test-vault-reporting-slice={{slice.data.label}} @startAngle={{slice.startAngle}} @endAngle={{slice.endAngle}} @outerRadius={{this.getOuterRadius width height}} @innerRadius={{this.getInnerRadius width height}} stroke-width=\"2\" class={{slice.cssClass}} />\n {{/each}}\n </LinealArcs>\n <foreignObject transform=\"translate(-60 -30)\" width=\"120\" height=\"120\">\n <div class=\"ssu-donut-chart__total-summary\">\n <HdsTextDisplay @size=\"500\">\n {{this.total}}\n </HdsTextDisplay>\n <HdsTextDisplay @size=\"200\">\n {{@title}}\n </HdsTextDisplay>\n </div>\n </foreignObject>\n </g>\n </svg>\n </LinealFluid>\n <div class=\"ssu-donut-chart__legend\">\n {{#each this.data as |datum|}}\n <HdsTextDisplay data-test-vault-reporting-legend-item={{datum.label}} class=\"ssu-donut-chart__legend-item\n {{concat \"ssu-donut-chart__legend-item-\" datum.scaleIndex}}\">{{datum.value}} {{datum.label}} </HdsTextDisplay>\n {{/each}}\n </div>\n </div>\n </HdsCardContainer>\n ", {
|
||||
strictMode: true,
|
||||
scope: () => ({
|
||||
HdsCardContainer,
|
||||
LinealFluid,
|
||||
LinealArcs,
|
||||
LinealArc,
|
||||
HdsTextDisplay,
|
||||
concat
|
||||
})
|
||||
}), this);
|
||||
}
|
||||
}
|
||||
|
||||
export { SSUReportingDonutChart as default };
|
||||
//# sourceMappingURL=donut-chart.js.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,86 +0,0 @@
|
|||
import Component from '@glimmer/component';
|
||||
import { HdsApplicationState, HdsAlert, HdsTextDisplay, HdsCardContainer } from '@hashicorp/design-system-components/components';
|
||||
import TitleRow from './base/title-row.js';
|
||||
import cssCustomProperty from '../../modifiers/css-custom-property.js';
|
||||
import { htmlSafe } from '@ember/template';
|
||||
import { precompileTemplate } from '@ember/template-compilation';
|
||||
import { setComponentTemplate } from '@ember/component';
|
||||
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
class GlobalLease extends Component {
|
||||
get percentage() {
|
||||
const {
|
||||
count = 0,
|
||||
quota = 0
|
||||
} = this.args;
|
||||
return Math.round(Math.min(count / quota * 100, 100));
|
||||
}
|
||||
get progressFillClass() {
|
||||
if (this.percentage >= 100) {
|
||||
return 'ssu-global-lease__progress-fill--exceeded';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
get formattedCount() {
|
||||
const formatter = new Intl.NumberFormat('en-US', {
|
||||
notation: 'compact',
|
||||
compactDisplay: 'short'
|
||||
});
|
||||
const {
|
||||
count = 0,
|
||||
quota = 0
|
||||
} = this.args;
|
||||
const formattedCount = formatter.format(count);
|
||||
const formattedTotal = formatter.format(quota);
|
||||
return `${formattedCount} / ${formattedTotal}`;
|
||||
}
|
||||
get percentageString() {
|
||||
return `${this.percentage}%`;
|
||||
}
|
||||
get hasData() {
|
||||
return this.args.quota && typeof this.args.quota === 'number';
|
||||
}
|
||||
get description() {
|
||||
if (this.hasData) {
|
||||
return htmlSafe('Total number of active <a class="hds-link-inline--color-secondary" href="https://developer.hashicorp.com/vault/docs/concepts/lease" target="_blank" data-test-vault-reporting-global-lease-description-link>leases</a> for this quota.');
|
||||
}
|
||||
}
|
||||
get linkUrl() {
|
||||
if (this.hasData) {
|
||||
return 'https://developer.hashicorp.com/vault/tutorials/operations/resource-quotas#global-default-lease-count-quota';
|
||||
}
|
||||
}
|
||||
get alert() {
|
||||
if (this.percentage >= 100) {
|
||||
return {
|
||||
color: 'warning',
|
||||
description: 'Global lease quota limit reached. If lease creation is blocked, reduce usage or increase the limit.'
|
||||
};
|
||||
}
|
||||
if (this.percentage >= 95) {
|
||||
return {
|
||||
color: 'neutral',
|
||||
description: 'Approaching quota limit. Reduce usage or increase the lease limit to avoid blocking new leases.'
|
||||
};
|
||||
}
|
||||
}
|
||||
static {
|
||||
setComponentTemplate(precompileTemplate("\n <HdsCardContainer data-test-vault-reporting-global-lease @hasBorder={{true}} class=\"ssu-global-lease\" {{cssCustomProperty \"--vault-reporting-global-lease-percentage\" this.percentageString}} ...attributes>\n <TitleRow @title=\"Global lease count quota\" @description={{this.description}} @linkText=\"Documentation\" @linkIcon=\"docs-link\" @linkUrl={{this.linkUrl}} @linkTarget=\"_blank\" />\n {{#if this.hasData}}\n <HdsTextDisplay @size=\"300\" @weight=\"medium\" data-test-vault-reporting-global-lease-percentage-text>{{this.percentage}}%</HdsTextDisplay>\n\n {{#if this.alert}}\n <HdsAlert data-test-vault-reporting-global-lease-alert class=\"ssu-global-lease__alert\" @type=\"compact\" @color={{this.alert.color}} as |A|>\n <A.Description>{{this.alert.description}}</A.Description>\n </HdsAlert>\n {{/if}}\n\n <div class=\"ssu-global-lease__progress-wrapper\">\n <div class=\"ssu-global-lease__progress-bar\">\n <div class=\"ssu-global-lease__progress-fill {{this.progressFillClass}}\" data-test-vault-reporting-global-lease-fill></div>\n </div>\n <span>\n <HdsTextDisplay @size=\"200\" @weight=\"semibold\" data-test-vault-reporting-global-lease-count-text>\n {{this.formattedCount}}\n </HdsTextDisplay>\n </span>\n </div>\n {{else}}\n\n <HdsApplicationState data-test-vault-reporting-global-lease-empty-state class=\"ssu-global-lease__empty-state\" as |A|>\n {{#if (has-block \"empty\")}}\n {{yield A to=\"empty\"}}\n {{else}}\n <A.Body data-test-vault-reporting-global-lease-empty-state-description @text=\"Lease quotas enforce limits on active secrets and tokens. It's recommended to enable this to protect stability for this Vault cluster.\" />\n\n <A.Footer as |F|>\n <F.LinkStandalone data-test-vault-reporting-global-lease-empty-state-link @icon=\"docs-link\" @iconPosition=\"trailing\" @text=\"Global lease count quota\" @href=\"https://developer.hashicorp.com/vault/tutorials/operations/resource-quotas#global-default-lease-count-quota\" target=\"_blank\" />\n </A.Footer>\n {{/if}}\n </HdsApplicationState>\n {{/if}}\n\n </HdsCardContainer>\n ", {
|
||||
strictMode: true,
|
||||
scope: () => ({
|
||||
HdsCardContainer,
|
||||
cssCustomProperty,
|
||||
TitleRow,
|
||||
HdsTextDisplay,
|
||||
HdsAlert,
|
||||
HdsApplicationState
|
||||
})
|
||||
}), this);
|
||||
}
|
||||
}
|
||||
|
||||
export { GlobalLease as default };
|
||||
//# sourceMappingURL=global-lease.js.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,123 +0,0 @@
|
|||
import Component from '@glimmer/component';
|
||||
import { HdsApplicationState, HdsTextBody, HdsSeparator, HdsCardContainer } from '@hashicorp/design-system-components/components';
|
||||
import TitleRow from './base/title-row.js';
|
||||
import LinealFluid from '@lineal-viz/lineal/components/lineal/fluid/index.js';
|
||||
import LinealHBars from '@lineal-viz/lineal/components/lineal/h-bars/index.js';
|
||||
import scaleLinear from '@lineal-viz/lineal/helpers/scale-linear.js';
|
||||
import scaleBand from '@lineal-viz/lineal/helpers/scale-band.js';
|
||||
import stackH from '@lineal-viz/lineal/helpers/stack-h.js';
|
||||
import LinealAxis from '@lineal-viz/lineal/components/lineal/axis/index.js';
|
||||
import axisOffset from '../../modifiers/axis-offset.js';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
import { precompileTemplate } from '@ember/template-compilation';
|
||||
import { setComponentTemplate } from '@ember/component';
|
||||
import { g, i } from 'decorator-transforms/runtime';
|
||||
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
class SSUReportingHorizontalBarChart extends Component {
|
||||
static {
|
||||
g(this.prototype, "xRangeOffsetWidth", [tracked], function () {
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
#xRangeOffsetWidth = (i(this, "xRangeOffsetWidth"), void 0);
|
||||
get hasData() {
|
||||
return this.args.data && Array.isArray(this.args.data) && this.args.data.length > 0;
|
||||
}
|
||||
get data() {
|
||||
if (!this.hasData) {
|
||||
return [];
|
||||
}
|
||||
// Filtering DESC for now per designs, could make configurable if needed
|
||||
return this.args.data.filter(({
|
||||
value
|
||||
}) => value !== 0).sort((a, b) => {
|
||||
return b.value - a.value;
|
||||
});
|
||||
}
|
||||
get total() {
|
||||
return this.data.reduce((runningTotal, {
|
||||
value
|
||||
}) => {
|
||||
return runningTotal + value;
|
||||
}, 0);
|
||||
}
|
||||
get a11yLabel() {
|
||||
const title = `Total of ${this.total} ${this.args.title}.`;
|
||||
const itemsDescription = this.data.map(({
|
||||
value,
|
||||
label
|
||||
}) => {
|
||||
return `${value} ${label}`;
|
||||
}).join(', ');
|
||||
return `${title} Comprised of ${itemsDescription}.`;
|
||||
}
|
||||
get yDomain() {
|
||||
return this.data.map(({
|
||||
label
|
||||
}) => label);
|
||||
}
|
||||
get xDomain() {
|
||||
return [0, Math.max(0, ...this.data.map(({
|
||||
value
|
||||
}) => value))];
|
||||
}
|
||||
get rangeHeight() {
|
||||
return this.data.length * 26;
|
||||
}
|
||||
get yRange() {
|
||||
return [0, this.rangeHeight];
|
||||
}
|
||||
get emptyStateTitle() {
|
||||
return 'None enabled';
|
||||
}
|
||||
get emptyStateDescription() {
|
||||
const entitiesTitle = this.args.title;
|
||||
return `${entitiesTitle} in this namespace will appear here.`;
|
||||
}
|
||||
get emptyStateLinkText() {
|
||||
const entities = this.args.title.toLowerCase();
|
||||
return `Enable ${entities}`;
|
||||
}
|
||||
get description() {
|
||||
if (this.hasData) {
|
||||
return this.args.description;
|
||||
}
|
||||
}
|
||||
get linkUrl() {
|
||||
if (this.hasData) {
|
||||
return this.args.linkUrl;
|
||||
}
|
||||
}
|
||||
getXRange = width => {
|
||||
return [0, Math.max(0, width - this.xRangeOffsetWidth - 32)];
|
||||
};
|
||||
handleAxisOffset = offsetWidth => {
|
||||
this.xRangeOffsetWidth = offsetWidth;
|
||||
};
|
||||
static {
|
||||
setComponentTemplate(precompileTemplate("\n <HdsCardContainer ...attributes class=\"ssu-horizontal-bar-chart__container\" @hasBorder={{true}}>\n <TitleRow @title={{@title}} @description={{this.description}} @linkUrl={{this.linkUrl}} @linkText={{@linkText}} @linkTarget={{@linkTarget}} @linkIcon={{@linkIcon}} />\n {{#if this.hasData}}\n {{!-- TODO: Figure out glint errors on lineal components --}}\n {{!-- @glint-expect-error --}}\n <LinealFluid class=\"ssu-horizontal-bar-chart__chart\" as |width|>\n <svg height={{this.rangeHeight}} width=\"100%\" {{axisOffset this.handleAxisOffset 8}} data-test-vault-reporting-horizontal-bar-chart-svg>\n {{!-- We are using the stacked version of the HBars as there seems to be an issue in the non-stacked version for how the x position is calculated. --}}\n {{#let (scaleLinear range=(this.getXRange width) domain=this.xDomain) (scaleBand range=this.yRange domain=this.yDomain) (stackH data=this.data x=\"value\" y=\"label\" z=\"\") as |xScale yScale stacked|}}\n {{#if xScale.isValid}}\n <LinealAxis @scale={{yScale}} {{!-- @glint-expect-error --}} @orientation=\"left\" @includeDomain={{false}} />\n {{!-- TODO: Extra wrapper exists only for test attribute, figure out a better way --}}\n <g data-test-vault-reporting-horizontal-bar-chart-bars>\n <LinealHBars @data={{stacked.data}} {{!-- @glint-expect-error --}} @x=\"x\" {{!-- @glint-expect-error --}} @y=\"y\" {{!-- @glint-expect-error --}} @height={{6}} @xScale={{xScale}} @yScale={{yScale}} />\n </g>\n <g>\n {{!-- @glint-expect-error --}}\n {{#each stacked.data as |dataset|}}\n {{#each dataset as |datum|}}\n <text class=\"ssu-horizontal-bar-chart__label\" {{!-- @glint-expect-error --}} y={{yScale.compute datum.y}} x={{xScale.compute datum.x}} dy=\"17.5px\" dx=\"8px\" data-test-vault-reporting-horizontal-bar-chart-inline-count aria-label=\"{{datum.y}} {{datum.x}}\">\n {{datum.x}}\n </text>\n {{/each}}\n {{/each}}\n </g>\n {{/if}}\n {{/let}}\n </svg>\n </LinealFluid>\n <HdsSeparator class=\"ssu-horizontal-bar-chart__separator\" @spacing=\"0\" />\n <HdsTextBody class=\"ssu-horizontal-bar-chart__total\" @size=\"200\" @tag=\"p\" data-test-vault-reporting-horizontal-bar-chart-total>\n Total:\n {{this.total}}\n </HdsTextBody>\n {{else}}\n\n <HdsApplicationState data-test-vault-reporting-horizontal-bar-chart-empty-state class=\"ssu-horizontal-bar-chart__empty-state\" as |A|>\n {{#if (has-block \"empty\")}}\n {{yield A to=\"empty\"}}\n {{else}}\n <A.Header data-test-vault-reporting-horizontal-bar-chart-empty-state-title @title={{this.emptyStateTitle}} />\n <A.Body data-test-vault-reporting-horizontal-bar-chart-empty-state-description @text={{this.emptyStateDescription}} />\n {{#if @linkUrl}}\n <A.Footer as |F|>\n <F.LinkStandalone data-test-vault-reporting-horizontal-bar-chart-empty-state-link @icon=\"plus\" @text={{this.emptyStateLinkText}} @href={{@linkUrl}} />\n </A.Footer>\n {{/if}}\n {{/if}}\n </HdsApplicationState>\n {{/if}}\n </HdsCardContainer>\n ", {
|
||||
strictMode: true,
|
||||
scope: () => ({
|
||||
HdsCardContainer,
|
||||
TitleRow,
|
||||
LinealFluid,
|
||||
axisOffset,
|
||||
scaleLinear,
|
||||
scaleBand,
|
||||
stackH,
|
||||
LinealAxis,
|
||||
LinealHBars,
|
||||
HdsSeparator,
|
||||
HdsTextBody,
|
||||
HdsApplicationState
|
||||
})
|
||||
}), this);
|
||||
}
|
||||
}
|
||||
|
||||
export { SSUReportingHorizontalBarChart as default };
|
||||
//# sourceMappingURL=horizontal-bar-chart.js.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,148 +0,0 @@
|
|||
import Component from '@glimmer/component';
|
||||
import { array } from '@ember/helper';
|
||||
import SSUReportingCounter from '../counter.js';
|
||||
import SSUReportingHorizontalBarChart from '../horizontal-bar-chart.js';
|
||||
import GlobalLease from '../global-lease.js';
|
||||
import ClusterReplication from '../cluster-replication.js';
|
||||
import DashboardExport from '../dashboard/export.js';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
import { HdsCardContainer, HdsAlert, HdsTextBody, HdsBadge, HdsPageHeader } from '@hashicorp/design-system-components/components';
|
||||
import { service } from '@ember/service';
|
||||
import { precompileTemplate } from '@ember/template-compilation';
|
||||
import { setComponentTemplate } from '@ember/component';
|
||||
import { g, i } from 'decorator-transforms/runtime';
|
||||
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
class SSUViewDashboard extends Component {
|
||||
static {
|
||||
g(this.prototype, "reportingAnalytics", [service]);
|
||||
}
|
||||
#reportingAnalytics = (i(this, "reportingAnalytics"), void 0);
|
||||
static {
|
||||
g(this.prototype, "data", [tracked]);
|
||||
}
|
||||
#data = (i(this, "data"), void 0);
|
||||
static {
|
||||
g(this.prototype, "lastUpdatedTime", [tracked], function () {
|
||||
return '';
|
||||
});
|
||||
}
|
||||
#lastUpdatedTime = (i(this, "lastUpdatedTime"), void 0);
|
||||
static {
|
||||
g(this.prototype, "error", [tracked]);
|
||||
}
|
||||
#error = (i(this, "error"), void 0);
|
||||
constructor(owner, args) {
|
||||
super(owner, args);
|
||||
this.fetchAllData();
|
||||
}
|
||||
fetchAllData = async () => {
|
||||
try {
|
||||
this.error = undefined;
|
||||
this.data = await this.args.onFetchUsageData();
|
||||
this.lastUpdatedTime = new Intl.DateTimeFormat('en-US', {
|
||||
timeStyle: 'medium'
|
||||
}).format(new Date());
|
||||
} catch (e) {
|
||||
this.error = e;
|
||||
}
|
||||
};
|
||||
handleTrackAnalyticsEvent = (eventName, properties, options) => {
|
||||
this.reportingAnalytics.trackEvent(eventName, properties, options);
|
||||
};
|
||||
handleTrackSurveyLink = () => {
|
||||
this.handleTrackAnalyticsEvent('survey_link');
|
||||
};
|
||||
handleRefresh = () => {
|
||||
this.fetchAllData();
|
||||
this.handleTrackAnalyticsEvent('refresh_button');
|
||||
};
|
||||
getBarChartData = (map = {}, exclude) => {
|
||||
return Object.entries(map).map(([label, value]) => {
|
||||
return {
|
||||
label,
|
||||
value
|
||||
};
|
||||
}).filter(item => {
|
||||
return !exclude?.includes(item.label);
|
||||
});
|
||||
};
|
||||
get isVaultDedicated() {
|
||||
return this.args.isVaultDedicated ?? false;
|
||||
}
|
||||
get kvSecretsTooltipMessage() {
|
||||
const {
|
||||
kvv1Secrets = 0,
|
||||
kvv2Secrets = 0
|
||||
} = this.data ?? {};
|
||||
const kvv1Formatted = Intl.NumberFormat().format(kvv1Secrets);
|
||||
const kvv2Formatted = Intl.NumberFormat().format(kvv2Secrets);
|
||||
if (kvv1Secrets && kvv2Secrets) {
|
||||
return `Combined count of ${kvv1Formatted} KV version 1 secrets and ${kvv2Formatted} KV version 2 secrets.`;
|
||||
}
|
||||
if (kvv1Secrets) {
|
||||
return `Total number of ${kvv1Formatted} KV version 1 secrets.`;
|
||||
}
|
||||
if (kvv2Secrets) {
|
||||
return `Total number of ${kvv2Formatted} KV version 2 secrets.`;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
get counters() {
|
||||
const {
|
||||
kvv1Secrets = 0,
|
||||
kvv2Secrets = 0
|
||||
} = this.data ?? {};
|
||||
return [{
|
||||
title: 'Child namespaces',
|
||||
tooltipMessage: 'Total number of namespaces for this cluster.',
|
||||
data: this.data?.namespaces ?? 0,
|
||||
link: 'access/namespaces'
|
||||
}, {
|
||||
title: 'KV secrets',
|
||||
tooltipMessage: this.kvSecretsTooltipMessage,
|
||||
data: kvv1Secrets + kvv2Secrets,
|
||||
emptyText: 'No secrets stored',
|
||||
emptyLink: 'secrets'
|
||||
}, {
|
||||
title: 'Secrets sync',
|
||||
tooltipMessage: 'Total number of destinations (e.g. third-party integrations) synced with secrets from this namespace.',
|
||||
data: this.data?.secretSync?.totalDestinations ?? 0,
|
||||
link: 'sync/secrets/overview',
|
||||
emptyText: 'Not activated',
|
||||
suffix: 'destinations'
|
||||
}, {
|
||||
title: 'PKI roles',
|
||||
tooltipMessage: 'Total number of PKI roles configured.',
|
||||
data: this.data?.pki?.totalRoles ?? 0,
|
||||
emptyText: 'No roles created'
|
||||
}];
|
||||
}
|
||||
get namespace() {
|
||||
return this.isVaultDedicated ? 'admin' : 'root';
|
||||
}
|
||||
static {
|
||||
setComponentTemplate(precompileTemplate("\n <div class=\"dashboard\" data-test-dashboard-container>\n <HdsPageHeader as |PH|>\n <PH.Title>\n Vault Usage\n <HdsBadge class=\"dashboard__badge\" @size=\"medium\" @icon=\"org\" @color=\"neutral\" @text={{this.namespace}} />\n </PH.Title>\n <PH.Description class=\"dashboard__description\">\n {{#if this.lastUpdatedTime}}\n <HdsTextBody @tag=\"p\" @size=\"200\" @color=\"faint\">\n Updated today at\n {{this.lastUpdatedTime}}.\n\n </HdsTextBody>\n {{/if}}\n <HdsTextBody @tag=\"p\" @size=\"200\" @color=\"primary\">\n View and export your Vault usage.\n </HdsTextBody>\n </PH.Description>\n <PH.Actions>\n <DashboardExport @data={{this.data}} />\n </PH.Actions>\n </HdsPageHeader>\n {{#if this.error}}\n <HdsAlert data-test-vault-reporting-dashboard-error @type=\"inline\" @color=\"critical\" class=\"dashboard__error\" as |A|>\n <A.Title>Error</A.Title>\n <A.Description data-test-vault-reporting-dashboard-error-description>An error occurred, please try again.</A.Description>\n </HdsAlert>\n {{/if}}\n {{#if this.data}}\n <HdsCardContainer @hasBorder={{true}} {{!-- @glint-expect-error --}} @background=\"neutral-secondary\" class=\"dashboard__counters\" data-test-vault-reporting-dashboard-counters>\n {{#each this.counters as |counter|}}\n <ReportingCounter @title={{counter.title}} @tooltipMessage={{counter.tooltipMessage}} @count={{counter.data}} @icon={{counter.icon}} @suffix={{counter.suffix}} @link={{counter.link}} @emptyText={{counter.emptyText}} @emptyLink={{counter.emptyLink}} />\n {{/each}}\n </HdsCardContainer>\n <div data-test-vault-reporting-dashboard-viz-blocks class=\"dashboard__viz-blocks\">\n <div>\n <ReportingHorizontalBarChart @data={{this.getBarChartData this.data.authMethods}} @title=\"Authentication methods\" @description=\"Enabled authentication methods for this cluster.\" @linkUrl=\"access\" class=\"dashboard__viz-block\" data-test-vault-reporting-dashboard-auth-methods />\n\n <ReportingHorizontalBarChart @data={{this.getBarChartData this.data.secretEngines (array \"system\" \"identity\")}} @title=\"Secret engines\" @description=\"Enabled secret engines for this cluster.\" @linkUrl=\"secrets\" class=\"dashboard__viz-block\" data-test-vault-reporting-dashboard-secret-engines />\n\n <ClusterReplication @disasterRecoveryState={{this.data.replicationStatus.drState}} @performanceState={{this.data.replicationStatus.prState}} @isVaultDedicated={{this.isVaultDedicated}} data-test-vault-reporting-dashboard-cluster-replication />\n </div>\n\n <div>\n <ReportingHorizontalBarChart @data={{this.getBarChartData this.data.leasesByAuthMethod}} @title=\"Leases by authentication methods\" @description=\"Active leases issued per authentication method.\" @linkUrl=\"https://developer.hashicorp.com/vault/docs/concepts/auth#auth-leases\" @linkText=\"Documentation\" @linkIcon=\"docs-link\" @linkTarget=\"_blank\" class=\"dashboard__viz-block\" data-test-vault-reporting-dashboard-leases-by-auth-method>\n <:empty as |A|>\n <A.Body @text=\"Lease are created when clients authenticate. Add an authentication method to monitor leases across this namespace.\" />\n <A.Footer as |F|>\n <F.LinkStandalone @icon=\"docs-link\" @text=\"Authentication leases\" @href=\"https://developer.hashicorp.com/vault/docs/concepts/auth#auth-leases\" />\n </A.Footer>\n </:empty>\n </ReportingHorizontalBarChart>\n <GlobalLease @count={{this.data.leaseCountQuotas.globalLeaseCountQuota.count}} @quota={{this.data.leaseCountQuotas.globalLeaseCountQuota.capacity}} class=\"dashboard__viz-block\" data-test-vault-reporting-dashboard-lease-count />\n </div>\n\n </div>\n {{/if}}\n </div>\n ", {
|
||||
strictMode: true,
|
||||
scope: () => ({
|
||||
HdsPageHeader,
|
||||
HdsBadge,
|
||||
HdsTextBody,
|
||||
DashboardExport,
|
||||
HdsAlert,
|
||||
HdsCardContainer,
|
||||
ReportingCounter: SSUReportingCounter,
|
||||
ReportingHorizontalBarChart: SSUReportingHorizontalBarChart,
|
||||
array,
|
||||
ClusterReplication,
|
||||
GlobalLease
|
||||
})
|
||||
}), this);
|
||||
}
|
||||
}
|
||||
|
||||
export { SSUViewDashboard as default };
|
||||
//# sourceMappingURL=dashboard.js.map
|
||||
File diff suppressed because one or more lines are too long
28
ui/vault-reporting/dist/modifiers/axis-offset.js
vendored
28
ui/vault-reporting/dist/modifiers/axis-offset.js
vendored
|
|
@ -1,28 +0,0 @@
|
|||
import { modifier } from 'ember-modifier';
|
||||
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
/**
|
||||
* By default the axis elements are outside of the bounds of the svg and rely on the containing element having
|
||||
* enough padding to compensate. A fixed padding is not flexible to varied width of axis labels.
|
||||
*
|
||||
* This modifier is used to pad compensate for the width of the axis element. It also returns a value
|
||||
* that can be used to set the chart width based on the offset amount.
|
||||
*/
|
||||
var axisOffset = modifier((element, [onOffset, additionalPadding = 0]) => {
|
||||
const axis = element.querySelector('g.axis');
|
||||
if (!axis) {
|
||||
return;
|
||||
}
|
||||
const axisOffset = axis.getBoundingClientRect().width;
|
||||
element.style.transform = `translateX(${axisOffset + additionalPadding}px)`;
|
||||
if (onOffset) {
|
||||
onOffset(axisOffset + additionalPadding);
|
||||
}
|
||||
});
|
||||
|
||||
export { axisOffset as default };
|
||||
//# sourceMappingURL=axis-offset.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"axis-offset.js","sources":["../../src/modifiers/axis-offset.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: BUSL-1.1\n */\n\nimport { modifier } from 'ember-modifier';\n/**\n * By default the axis elements are outside of the bounds of the svg and rely on the containing element having\n * enough padding to compensate. A fixed padding is not flexible to varied width of axis labels.\n *\n * This modifier is used to pad compensate for the width of the axis element. It also returns a value\n * that can be used to set the chart width based on the offset amount.\n */\nexport default modifier(\n (\n element: SVGElement,\n [onOffset, additionalPadding = 0]: [\n (offset: number) => unknown,\n additionalPadding?: number,\n ],\n ) => {\n const axis = element.querySelector('g.axis');\n\n if (!axis) {\n return;\n }\n\n const axisOffset = axis.getBoundingClientRect().width;\n element.style.transform = `translateX(${axisOffset + additionalPadding}px)`;\n if (onOffset) {\n onOffset(axisOffset + additionalPadding);\n }\n },\n);\n"],"names":["modifier","element","onOffset","additionalPadding","axis","querySelector","axisOffset","getBoundingClientRect","width","style","transform"],"mappings":";;AAAA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAeA,QAAQ,CACrB,CACEC,OAAmB,EACnB,CAACC,QAAQ,EAAEC,iBAAiB,GAAG,CAAC,CAG/B,KACE;AACH,EAAA,MAAMC,IAAI,GAAGH,OAAO,CAACI,aAAa,CAAC,QAAQ,CAAC;EAE5C,IAAI,CAACD,IAAI,EAAE;AACT,IAAA;AACF;EAEA,MAAME,UAAU,GAAGF,IAAI,CAACG,qBAAqB,EAAE,CAACC,KAAK;EACrDP,OAAO,CAACQ,KAAK,CAACC,SAAS,GAAG,CAAcJ,WAAAA,EAAAA,UAAU,GAAGH,iBAAiB,CAAK,GAAA,CAAA;AAC3E,EAAA,IAAID,QAAQ,EAAE;AACZA,IAAAA,QAAQ,CAACI,UAAU,GAAGH,iBAAiB,CAAC;AAC1C;AACF,CACF,CAAC;;;;"}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
import { modifier } from 'ember-modifier';
|
||||
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
/**
|
||||
* Applies and updates a custom CSS property based on updates to a tracked/computed ember value.
|
||||
*/
|
||||
var cssCustomProperty = modifier(function customProperty(element, [prop, value]) {
|
||||
if (!value) {
|
||||
element.style.removeProperty(prop);
|
||||
return;
|
||||
}
|
||||
// Allow only basic unit type values
|
||||
const safeValuePattern = /^[-a-zA-Z0-9\s#(),.%]+$/;
|
||||
if (!safeValuePattern.test(value)) {
|
||||
console.warn(`Blocked potentially unsafe variable value: ${value}`);
|
||||
return;
|
||||
}
|
||||
element.style.setProperty(prop, value);
|
||||
});
|
||||
|
||||
export { cssCustomProperty as default };
|
||||
//# sourceMappingURL=css-custom-property.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"css-custom-property.js","sources":["../../src/modifiers/css-custom-property.ts"],"sourcesContent":["import { modifier } from 'ember-modifier';\n/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: BUSL-1.1\n */\n\n/**\n * Applies and updates a custom CSS property based on updates to a tracked/computed ember value.\n */\nexport default modifier(function customProperty(\n element: HTMLElement,\n [prop, value]: [string, string],\n) {\n if (!value) {\n element.style.removeProperty(prop);\n return;\n }\n // Allow only basic unit type values\n const safeValuePattern = /^[-a-zA-Z0-9\\s#(),.%]+$/;\n if (!safeValuePattern.test(value)) {\n console.warn(`Blocked potentially unsafe variable value: ${value}`);\n return;\n }\n\n element.style.setProperty(prop, value);\n});\n"],"names":["modifier","customProperty","element","prop","value","style","removeProperty","safeValuePattern","test","console","warn","setProperty"],"mappings":";;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAeA,QAAQ,CAAC,SAASC,cAAcA,CAC7CC,OAAoB,EACpB,CAACC,IAAI,EAAEC,KAAK,CAAmB,EAC/B;EACA,IAAI,CAACA,KAAK,EAAE;AACVF,IAAAA,OAAO,CAACG,KAAK,CAACC,cAAc,CAACH,IAAI,CAAC;AAClC,IAAA;AACF;AACA;EACA,MAAMI,gBAAgB,GAAG,yBAAyB;AAClD,EAAA,IAAI,CAACA,gBAAgB,CAACC,IAAI,CAACJ,KAAK,CAAC,EAAE;AACjCK,IAAAA,OAAO,CAACC,IAAI,CAAC,CAA8CN,2CAAAA,EAAAA,KAAK,EAAE,CAAC;AACnE,IAAA;AACF;EAEAF,OAAO,CAACG,KAAK,CAACM,WAAW,CAACR,IAAI,EAAEC,KAAK,CAAC;AACxC,CAAC,CAAC;;;;"}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
import { getOwner } from '@ember/owner';
|
||||
import Service from '@ember/service';
|
||||
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
/**
|
||||
* This service is used to look up the `analytics` service in the host application and track events if it exists. If it doesn't exist
|
||||
* or the implementation breaks it falls back gracefully to do nothing.
|
||||
*/
|
||||
class ReportingAnalytics extends Service {
|
||||
// Using the `@service` decorator will throw an error if the service does not exist on the host application.
|
||||
// This allows us to be defensive and have `trackEvent` be a no-op if the service is not present.
|
||||
get analytics() {
|
||||
return getOwner(this)?.lookup('service:analytics');
|
||||
}
|
||||
trackEvent(event, properties, options) {
|
||||
if (!this.analytics?.trackEvent) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const prefix = 'vault_reporting';
|
||||
const prefixedEvent = `${prefix}_${event}`;
|
||||
this.analytics.trackEvent(prefixedEvent, properties, options);
|
||||
} catch (e) {
|
||||
// no-op
|
||||
console.warn('Error tracking event:', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DO NOT DELETE: this is how TypeScript knows how to look up your services.
|
||||
|
||||
export { ReportingAnalytics as default };
|
||||
//# sourceMappingURL=reporting-analytics.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"reporting-analytics.js","sources":["../../src/services/reporting-analytics.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: BUSL-1.1\n */\n\nimport { getOwner } from '@ember/owner';\nimport Service from '@ember/service';\n/**\n * This service is used to look up the `analytics` service in the host application and track events if it exists. If it doesn't exist\n * or the implementation breaks it falls back gracefully to do nothing.\n */\nexport default class ReportingAnalytics extends Service {\n // Using the `@service` decorator will throw an error if the service does not exist on the host application.\n // This allows us to be defensive and have `trackEvent` be a no-op if the service is not present.\n get analytics() {\n return getOwner(this)?.lookup('service:analytics') as\n | {\n trackEvent: (\n event: string,\n properties?: object,\n options?: object,\n ) => void;\n }\n | undefined;\n }\n\n trackEvent(event: string, properties?: object, options?: object) {\n if (!this.analytics?.trackEvent) {\n return;\n }\n try {\n const prefix = 'vault_reporting';\n const prefixedEvent = `${prefix}_${event}`;\n this.analytics.trackEvent(prefixedEvent, properties, options);\n } catch (e) {\n // no-op\n console.warn('Error tracking event:', e);\n }\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your services.\ndeclare module '@ember/service' {\n interface Registry {\n reportingAnalytics: ReportingAnalytics;\n }\n}\n"],"names":["ReportingAnalytics","Service","analytics","getOwner","lookup","trackEvent","event","properties","options","prefix","prefixedEvent","e","console","warn"],"mappings":";;;AAAA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACe,MAAMA,kBAAkB,SAASC,OAAO,CAAC;AACtD;AACA;EACA,IAAIC,SAASA,GAAG;IACd,OAAOC,QAAQ,CAAC,IAAI,CAAC,EAAEC,MAAM,CAAC,mBAAmB,CAAC;AASpD;AAEAC,EAAAA,UAAUA,CAACC,KAAa,EAAEC,UAAmB,EAAEC,OAAgB,EAAE;AAC/D,IAAA,IAAI,CAAC,IAAI,CAACN,SAAS,EAAEG,UAAU,EAAE;AAC/B,MAAA;AACF;IACA,IAAI;MACF,MAAMI,MAAM,GAAG,iBAAiB;AAChC,MAAA,MAAMC,aAAa,GAAG,CAAA,EAAGD,MAAM,CAAA,CAAA,EAAIH,KAAK,CAAE,CAAA;MAC1C,IAAI,CAACJ,SAAS,CAACG,UAAU,CAACK,aAAa,EAAEH,UAAU,EAAEC,OAAO,CAAC;KAC9D,CAAC,OAAOG,CAAC,EAAE;AACV;AACAC,MAAAA,OAAO,CAACC,IAAI,CAAC,uBAAuB,EAAEF,CAAC,CAAC;AAC1C;AACF;AACF;;AAEA;;;;"}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
*/
|
||||
|
||||
.dashboard{padding:16px}.dashboard__error{margin-top:16px}.dashboard__counters{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));gap:16px;margin:32px 0}.dashboard__viz-blocks{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:16px}.dashboard__viz-block{margin-bottom:16px}.dashboard__badge{margin-left:5px}.dashboard__description p{margin-bottom:8px}.ssu-cluster-replication{padding:16px;display:flex;flex-direction:column;justify-content:center;gap:1rem}.ssu-cluster-replication__list-row__badge{margin:0 .25rem;text-transform:capitalize}.ssu-title-row{margin-bottom:8px}.ssu-title-row__description{display:block;margin-top:.25rem;color:var(--token-color-foreground-faint)}.ssu-title-row__container{display:flex;justify-content:space-between}.ssu-title-row__container__link{padding:0}.ssu-horizontal-bar-chart__container{padding:16px;overflow:hidden;font-size:13px}.ssu-horizontal-bar-chart__chart{box-sizing:border-box;margin-top:15px;color:var(--token-color-foreground-primary);fill:var(--token-color-foreground-primary)}.ssu-horizontal-bar-chart__chart svg{overflow:visible}.ssu-horizontal-bar-chart__chart rect{fill:var(--token-color-palette-blue-200);transform:translateY(10.5px);rx:3px;ry:3px}.ssu-horizontal-bar-chart__chart .axis line{display:none}.ssu-horizontal-bar-chart__separator{margin-bottom:10px}.ssu-horizontal-bar-chart__empty-state{min-width:66%;margin:16px auto}.ssu-horizontal-bar-chart__total{color:var(--token-color-foreground-primary)}.ssu-global-lease{padding:16px}.ssu-global-lease__progress-wrapper{display:flex;align-items:center;gap:1rem;height:15px}.ssu-global-lease__progress-bar{flex:1;height:100%;background-color:var(--token-color-palette-neutral-100);border:1.5px solid var(--token-color-palette-neutral-200);border-radius:4px;overflow:hidden;font-size:40px;display:inline-block}@keyframes initialWidth{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}.ssu-global-lease__progress-fill{height:100%;width:var(--vault-reporting-global-lease-percentage);animation:1s ease-out initialWidth;transform-origin:left;transition:width 1s ease-out,background-color 1s ease-out;background-color:var(--token-color-palette-neutral-300)}.ssu-global-lease__progress-fill--exceeded{background-color:var(--token-color-palette-red-100)}.ssu-global-lease__empty-state{min-width:66%;margin:16px auto;color:var(--token-color-foreground-faint)}.ssu-global-lease__alert{margin-bottom:8px}.ssu-counter{padding:16px}.ssu-counter__title-row{display:flex;align-items:center;gap:8px;margin-bottom:8px}.ssu-counter__title-row__tooltip{margin-left:3px;top:3px}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue