mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-23 10:26:40 +00:00
* feat: restrict the rendering of img tags in the logs content * fix: forbidden tags code cleanup
37 lines
946 B
TypeScript
37 lines
946 B
TypeScript
import getLocalStorage from 'api/browser/localstorage/get';
|
|
import { SKIP_ONBOARDING } from 'constants/onboarding';
|
|
|
|
export const isOnboardingSkipped = (): boolean =>
|
|
getLocalStorage(SKIP_ONBOARDING) === 'true';
|
|
|
|
export function extractDomain(email: string): string {
|
|
const emailParts = email.split('@');
|
|
if (emailParts.length !== 2) {
|
|
return email;
|
|
}
|
|
return emailParts[1];
|
|
}
|
|
|
|
export const isCloudUser = (): boolean => {
|
|
const { hostname } = window.location;
|
|
|
|
return hostname?.endsWith('signoz.cloud');
|
|
};
|
|
|
|
export const isEECloudUser = (): boolean => {
|
|
const { hostname } = window.location;
|
|
|
|
return hostname?.endsWith('signoz.io');
|
|
};
|
|
|
|
export const checkVersionState = (
|
|
currentVersion: string,
|
|
latestVersion: string,
|
|
): boolean => {
|
|
const versionCore = currentVersion?.split('-')[0];
|
|
return versionCore === latestVersion;
|
|
};
|
|
|
|
// list of forbidden tags to remove in dompurify
|
|
export const FORBID_DOM_PURIFY_TAGS = ['img', 'form'];
|