mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
feat(k8sconfigure): migrate configure to react [EE-5524] (#10218)
This commit is contained in:
parent
0f1e77a6d5
commit
515b02813b
59 changed files with 1819 additions and 833 deletions
|
@ -1,7 +1,5 @@
|
|||
import _ from 'lodash';
|
||||
|
||||
import { usePublicSettings } from '@/react/portainer/settings/queries';
|
||||
|
||||
const categories = [
|
||||
'docker',
|
||||
'kubernetes',
|
||||
|
@ -18,7 +16,7 @@ enum DimensionConfig {
|
|||
PortainerEndpointUserRole,
|
||||
}
|
||||
|
||||
interface TrackEventProps {
|
||||
export interface TrackEventProps {
|
||||
category: Category;
|
||||
metadata?: Record<string, unknown>;
|
||||
value?: string | number;
|
||||
|
@ -63,20 +61,6 @@ export function push(
|
|||
}
|
||||
}
|
||||
|
||||
export function useAnalytics() {
|
||||
const telemetryQuery = usePublicSettings({
|
||||
select: (settings) => settings.EnableTelemetry,
|
||||
});
|
||||
|
||||
return { trackEvent: handleTrackEvent };
|
||||
|
||||
function handleTrackEvent(...args: Parameters<typeof trackEvent>) {
|
||||
if (telemetryQuery.data) {
|
||||
trackEvent(...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function trackEvent(action: string, properties: TrackEventProps) {
|
||||
/**
|
||||
* @description Logs an event with an event category (Videos, Music, Games...), an event
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue