mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-29 20:35:22 -04:00
* no-op commit * Migrate Vault Reporting Dashboard from shared package into Vault Enterprise (#14892) * Migrate Vault Reporting Dashboard from shared package into Vault Enterprise * Add click interactions for export toggle in usage reporting dashboard tests * feat(reporting): enhance external link security with rel attributes * feat(reporting): migrate Vault Reporting Dashboard components and integrate meter chart visualization * feat(reporting): remove deprecated meter.js and migration instructions for Vault Reporting Dashboard * Migrate Vault Reporting Dashboard from shared package into Vault Enterprise * Add click interactions for export toggle in usage reporting dashboard tests * feat(reporting): enhance external link security with rel attributes * feat(reporting): migrate Vault Reporting Dashboard components and integrate meter chart visualization * feat(reporting): remove deprecated meter.js and migration instructions for Vault Reporting Dashboard * feat(reporting): migrate horizontal bar chart to new viz-card component and remove deprecated files * feat(reporting): remove horizontal bar chart component and associated files * feat(reporting): update dashboard to force remount of chart layers on namespace refresh and improve data fetching logic * feat(reporting): remove usage reporting handler and associated imports * feat(reporting): refactor route handling and remove safeRoute utility; update data download methods- copilot recommendation * feat(reporting): enhance tooltip interaction by replacing mouse events with pointer events for better responsiveness * feat(reporting): remove reporting analytics service and associated tracking logic from dashboard components * feat(reporting): standardize text casing in dashboard and export components * feat(reporting): standardize text casing in usage reporting tests * feat(reporting): add padding to carbon chart for improved layout * feat(reporting): implement toSentenceCase utility and update chart labels for consistency * feat(reporting): enhance toSentenceCase utility to handle acronyms and branded names * feat(reporting): migrate vault-reporting module from shared package to Vault Enterprise * feat(reporting): enhance tooltip functionality and styling for usage reporting charts * Fix formatting in pnpm-lock.yaml * Refactor CSV export to use sentence case for labels and enhance toSentenceCase utility * Refactor CSV download test to simplify URL handling and assert sentence case labels * Enhance destination name formatting to use sentence case in reporting dashboard * Add RabbitMQ branding override and update tests for sentence case handling --------- Co-authored-by: Aravind VM <aravind.vm@ibm.com>
70 lines
2 KiB
TypeScript
70 lines
2 KiB
TypeScript
/**
|
|
* Copyright IBM Corp. 2025, 2026
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Component from '@glimmer/component';
|
|
import { htmlSafe } from '@ember/template';
|
|
|
|
import { REPLICATION_ENABLED_STATE } from 'vault/types/usage-reporting';
|
|
|
|
interface VaultReportingClusterReplicationSignature {
|
|
Args: {
|
|
disasterRecoveryState: REPLICATION_ENABLED_STATE | 'disabled';
|
|
performanceState: REPLICATION_ENABLED_STATE | 'disabled';
|
|
isVaultDedicated: boolean;
|
|
};
|
|
}
|
|
|
|
export default class VaultReportingClusterReplication extends Component<VaultReportingClusterReplicationSignature> {
|
|
getState = (state: REPLICATION_ENABLED_STATE | 'disabled' = '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" rel="noopener noreferrer" data-test-vault-reporting-cluster-replication-description-link>replication</a> to replicate data across clusters.'
|
|
);
|
|
}
|
|
|
|
return 'Status of disaster recovery and performance replication.';
|
|
}
|
|
|
|
getIcon = (state: REPLICATION_ENABLED_STATE | 'disabled' = 'disabled') => {
|
|
const iconMap: Record<string, string> = {
|
|
disabled: 'x',
|
|
primary: 'check',
|
|
secondary: 'check',
|
|
bootstrapping: 'loading',
|
|
};
|
|
|
|
return iconMap[state] || iconMap['disabled'];
|
|
};
|
|
|
|
getColor = (state: REPLICATION_ENABLED_STATE | 'disabled' = 'disabled') => {
|
|
const colorMap: Record<string, string> = {
|
|
disabled: 'neutral',
|
|
primary: 'success',
|
|
secondary: 'success',
|
|
bootstrapping: 'neutral',
|
|
};
|
|
|
|
return colorMap[state] || colorMap['disabled'];
|
|
};
|
|
|
|
get linkRoute() {
|
|
if (this.args.isVaultDedicated) {
|
|
return;
|
|
}
|
|
|
|
return 'vault.cluster.replication';
|
|
}
|
|
}
|