234 lines
5.8 KiB
TypeScript
Raw Normal View History

Logs explorer design update (#4352) * feat: logs explorer - new design * feat: update styles * feat: added new toolbar for logs explorer (#4336) * feat: logs list view changes (#4348) * feat: logs list view changes * fix: list view and toolbar styles * feat: side btns * feat: added auto refresh handler * feat: handle popover close for btn click date time * feat: extract the common log actions btn component * feat: update the button for log line actions * fix: event propagation from context button * feat: use styles from ui-library * Query builder design update (#4359) * feat: QB design update * fix: add functionality and light mode styles * fix: ts issues * fix: update all css color variables to correct names * fix: lint errors * feat: new table view for logs explorer list section (#4353) * feat: table view changes for logs list * feat: code refactor to support log line actions * feat: code refactor to support log line actions * fix: the positioning of the btns * feat: fix the table onclick * fix: header issue * fix: on hover * fix: type issue * fix: eslint error * fix: type errors (#4360) * feat: handle light theme for logs explorer design changes (#4363) * feat: handle light theme for list tables and dateTime selection * feat: handle light theme for popover * fix: address review comments * feat: date time custom time modal to render inside the new popover (#4366) * feat: single calender for range picker * fix: edgecases * feat: integrate date time selector across app * fix: remove dangling border after element removal * feat: handle qb design changes across the application * feat: handle light theme * feat: handle light theme * fix: virtuoso scroll refresh issue * feat: handle new typing changes for date time picker v2 (#4386) Co-authored-by: Yunus M <myounis.ar@live.com> * chore: styles improvement across new design (#4389) * fix: improve date time styles * feat: table view changes according to new design * fix: button visibility in clickhouse and promQL headers (#4390) * feat: change the tabs to new design buttons for query builder * Settings theme change (#4368) * feat: settings theme change * [Refactor]: New design for Log details page (#4362) New design for Log details page Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Yunus M <myounis.ar@live.com> * feat: save view for new design (#4392) * feat: save view for new design * refactor: done with save view * feat: update styles for logs detail view (#4407) * feat: update styles for logs detail view * feat: update styles for logs detail view * feat: add raw view attributes in the logs list view (#4422) * feat: add raw view attributes in the logs list view * feat: add raw view attributes in the logs list view * fix: raw attributes * fix: logs UI improvements (#4426) * fix: remove fixed times from the date time picker v2 * fix: added old logs explorer CTA in new designs * feat: handle active logs indicator update * fix: address review comments * fix: old logs explorer page * fix: remove info text and add relative time buttons * fix: update logs explorer tab designs * fix: update logs explorer tab designs * fix: update logs explorer tab designs * refactor: New design for Save views. (#4435) * feat: [GH-4436]: date range enhancements (#4448) * feat: [GH-4436]: when selecting custom time range it should be from start of day to end of date * fix: custom time width and refresh text visibility issues (#4428) --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: update ui (#4449) * feat: added loading and error states for logs design (#4452) * feat: added loading and error states for logs design * feat: added error states for table view and time series view * feat: handle error and loading states * feat: loading states * [Refactor]: Tab Switch deplay issue and UI improvement for Clickhouse (#4409) * fix: switching between logs display tabs (#4457) * [Feat]: View in Traces (#4450) * refactor: datetime selector beside run query removed add to dashboard * refactor: added tab for traces view details page * refactor: done with the save view in traces * fix: the gittery effect when navigatigating from views * refactor: view tab view title light mode support * refactor: removed console * fix: gittery effect when switch view from views tabs * refactor: separate traces routes * refactor: remove query params * chore: fix tsc issues * fix: jest config issues * fix: update TODO and remove extra braces * feat: handle loading states and incorporate ui feedback (#4479) * UI feedback updates (#4482) * feat: handle loading and fix ui issues * feat: ui updates * fix: logs explorer issues (#4483) * fix: logs explorer issues * fix: jest test cases * feat: support custom times unique to pages new design changes (#4485) * fix: loading states for list log view (#4486) * fix: logs search view query fix, logs details view - attribute tags alignment fix (#4489) * fix: delete empty file * fix: chart loading when scrolling logs (#4495) * fix: chart should not load when scrolling the logs as it is already fetched * fix: make the search bar as default rather than advanced options * fix: rename show context to show in context * fix: query range api not triggering on default select first load (#4498) * Refactor: Log Explorer UI changes. (#4502) * refactor: used selected view enum * refactor: updated hight of switch old button and tab border * refactor: import fixes * refactor: query builder border and button groups * refactor: removed hypen from refreshed * refactor: show delete button only when there is more than one query * refactor: sqaure up the query build button groups * refactor: updated css * fix: additional filter color button shadow * refactor: removed commented code and used selected panel enum * refactor: updated typecheck script * refactor: used enum selected view (#4504) * fix: retain the current query on date time change (#4510) * feat: added new icon for promQL and added tooltips for dashboards and alerts (#4512) * feat: added new icon for promQL and added tooltips for dashboards and alerts * fix: styles at 1440 px zoom * fix: rename clickhouse to clickHouse --------- Co-authored-by: Vikrant Gupta <54737045+Vikrant2520@users.noreply.github.com> Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
2024-02-12 00:23:19 +05:30
import './QuerySection.styles.scss';
import { Color } from '@signozhq/design-tokens';
Logs explorer design update (#4352) * feat: logs explorer - new design * feat: update styles * feat: added new toolbar for logs explorer (#4336) * feat: logs list view changes (#4348) * feat: logs list view changes * fix: list view and toolbar styles * feat: side btns * feat: added auto refresh handler * feat: handle popover close for btn click date time * feat: extract the common log actions btn component * feat: update the button for log line actions * fix: event propagation from context button * feat: use styles from ui-library * Query builder design update (#4359) * feat: QB design update * fix: add functionality and light mode styles * fix: ts issues * fix: update all css color variables to correct names * fix: lint errors * feat: new table view for logs explorer list section (#4353) * feat: table view changes for logs list * feat: code refactor to support log line actions * feat: code refactor to support log line actions * fix: the positioning of the btns * feat: fix the table onclick * fix: header issue * fix: on hover * fix: type issue * fix: eslint error * fix: type errors (#4360) * feat: handle light theme for logs explorer design changes (#4363) * feat: handle light theme for list tables and dateTime selection * feat: handle light theme for popover * fix: address review comments * feat: date time custom time modal to render inside the new popover (#4366) * feat: single calender for range picker * fix: edgecases * feat: integrate date time selector across app * fix: remove dangling border after element removal * feat: handle qb design changes across the application * feat: handle light theme * feat: handle light theme * fix: virtuoso scroll refresh issue * feat: handle new typing changes for date time picker v2 (#4386) Co-authored-by: Yunus M <myounis.ar@live.com> * chore: styles improvement across new design (#4389) * fix: improve date time styles * feat: table view changes according to new design * fix: button visibility in clickhouse and promQL headers (#4390) * feat: change the tabs to new design buttons for query builder * Settings theme change (#4368) * feat: settings theme change * [Refactor]: New design for Log details page (#4362) New design for Log details page Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Yunus M <myounis.ar@live.com> * feat: save view for new design (#4392) * feat: save view for new design * refactor: done with save view * feat: update styles for logs detail view (#4407) * feat: update styles for logs detail view * feat: update styles for logs detail view * feat: add raw view attributes in the logs list view (#4422) * feat: add raw view attributes in the logs list view * feat: add raw view attributes in the logs list view * fix: raw attributes * fix: logs UI improvements (#4426) * fix: remove fixed times from the date time picker v2 * fix: added old logs explorer CTA in new designs * feat: handle active logs indicator update * fix: address review comments * fix: old logs explorer page * fix: remove info text and add relative time buttons * fix: update logs explorer tab designs * fix: update logs explorer tab designs * fix: update logs explorer tab designs * refactor: New design for Save views. (#4435) * feat: [GH-4436]: date range enhancements (#4448) * feat: [GH-4436]: when selecting custom time range it should be from start of day to end of date * fix: custom time width and refresh text visibility issues (#4428) --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: update ui (#4449) * feat: added loading and error states for logs design (#4452) * feat: added loading and error states for logs design * feat: added error states for table view and time series view * feat: handle error and loading states * feat: loading states * [Refactor]: Tab Switch deplay issue and UI improvement for Clickhouse (#4409) * fix: switching between logs display tabs (#4457) * [Feat]: View in Traces (#4450) * refactor: datetime selector beside run query removed add to dashboard * refactor: added tab for traces view details page * refactor: done with the save view in traces * fix: the gittery effect when navigatigating from views * refactor: view tab view title light mode support * refactor: removed console * fix: gittery effect when switch view from views tabs * refactor: separate traces routes * refactor: remove query params * chore: fix tsc issues * fix: jest config issues * fix: update TODO and remove extra braces * feat: handle loading states and incorporate ui feedback (#4479) * UI feedback updates (#4482) * feat: handle loading and fix ui issues * feat: ui updates * fix: logs explorer issues (#4483) * fix: logs explorer issues * fix: jest test cases * feat: support custom times unique to pages new design changes (#4485) * fix: loading states for list log view (#4486) * fix: logs search view query fix, logs details view - attribute tags alignment fix (#4489) * fix: delete empty file * fix: chart loading when scrolling logs (#4495) * fix: chart should not load when scrolling the logs as it is already fetched * fix: make the search bar as default rather than advanced options * fix: rename show context to show in context * fix: query range api not triggering on default select first load (#4498) * Refactor: Log Explorer UI changes. (#4502) * refactor: used selected view enum * refactor: updated hight of switch old button and tab border * refactor: import fixes * refactor: query builder border and button groups * refactor: removed hypen from refreshed * refactor: show delete button only when there is more than one query * refactor: sqaure up the query build button groups * refactor: updated css * fix: additional filter color button shadow * refactor: removed commented code and used selected panel enum * refactor: updated typecheck script * refactor: used enum selected view (#4504) * fix: retain the current query on date time change (#4510) * feat: added new icon for promQL and added tooltips for dashboards and alerts (#4512) * feat: added new icon for promQL and added tooltips for dashboards and alerts * fix: styles at 1440 px zoom * fix: rename clickhouse to clickHouse --------- Co-authored-by: Vikrant Gupta <54737045+Vikrant2520@users.noreply.github.com> Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
2024-02-12 00:23:19 +05:30
import { Button, Tabs, Tooltip } from 'antd';
import PromQLIcon from 'assets/Dashboard/PromQl';
import { ALERTS_DATA_SOURCE_MAP } from 'constants/alerts';
import { ENTITY_VERSION_V4 } from 'constants/app';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { QBShortcuts } from 'constants/shortcuts/QBShortcuts';
import { QueryBuilder } from 'container/QueryBuilder';
import { useKeyboardHotkeys } from 'hooks/hotkeys/useKeyboardHotkeys';
import { useIsDarkMode } from 'hooks/useDarkMode';
Logs explorer design update (#4352) * feat: logs explorer - new design * feat: update styles * feat: added new toolbar for logs explorer (#4336) * feat: logs list view changes (#4348) * feat: logs list view changes * fix: list view and toolbar styles * feat: side btns * feat: added auto refresh handler * feat: handle popover close for btn click date time * feat: extract the common log actions btn component * feat: update the button for log line actions * fix: event propagation from context button * feat: use styles from ui-library * Query builder design update (#4359) * feat: QB design update * fix: add functionality and light mode styles * fix: ts issues * fix: update all css color variables to correct names * fix: lint errors * feat: new table view for logs explorer list section (#4353) * feat: table view changes for logs list * feat: code refactor to support log line actions * feat: code refactor to support log line actions * fix: the positioning of the btns * feat: fix the table onclick * fix: header issue * fix: on hover * fix: type issue * fix: eslint error * fix: type errors (#4360) * feat: handle light theme for logs explorer design changes (#4363) * feat: handle light theme for list tables and dateTime selection * feat: handle light theme for popover * fix: address review comments * feat: date time custom time modal to render inside the new popover (#4366) * feat: single calender for range picker * fix: edgecases * feat: integrate date time selector across app * fix: remove dangling border after element removal * feat: handle qb design changes across the application * feat: handle light theme * feat: handle light theme * fix: virtuoso scroll refresh issue * feat: handle new typing changes for date time picker v2 (#4386) Co-authored-by: Yunus M <myounis.ar@live.com> * chore: styles improvement across new design (#4389) * fix: improve date time styles * feat: table view changes according to new design * fix: button visibility in clickhouse and promQL headers (#4390) * feat: change the tabs to new design buttons for query builder * Settings theme change (#4368) * feat: settings theme change * [Refactor]: New design for Log details page (#4362) New design for Log details page Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Yunus M <myounis.ar@live.com> * feat: save view for new design (#4392) * feat: save view for new design * refactor: done with save view * feat: update styles for logs detail view (#4407) * feat: update styles for logs detail view * feat: update styles for logs detail view * feat: add raw view attributes in the logs list view (#4422) * feat: add raw view attributes in the logs list view * feat: add raw view attributes in the logs list view * fix: raw attributes * fix: logs UI improvements (#4426) * fix: remove fixed times from the date time picker v2 * fix: added old logs explorer CTA in new designs * feat: handle active logs indicator update * fix: address review comments * fix: old logs explorer page * fix: remove info text and add relative time buttons * fix: update logs explorer tab designs * fix: update logs explorer tab designs * fix: update logs explorer tab designs * refactor: New design for Save views. (#4435) * feat: [GH-4436]: date range enhancements (#4448) * feat: [GH-4436]: when selecting custom time range it should be from start of day to end of date * fix: custom time width and refresh text visibility issues (#4428) --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: update ui (#4449) * feat: added loading and error states for logs design (#4452) * feat: added loading and error states for logs design * feat: added error states for table view and time series view * feat: handle error and loading states * feat: loading states * [Refactor]: Tab Switch deplay issue and UI improvement for Clickhouse (#4409) * fix: switching between logs display tabs (#4457) * [Feat]: View in Traces (#4450) * refactor: datetime selector beside run query removed add to dashboard * refactor: added tab for traces view details page * refactor: done with the save view in traces * fix: the gittery effect when navigatigating from views * refactor: view tab view title light mode support * refactor: removed console * fix: gittery effect when switch view from views tabs * refactor: separate traces routes * refactor: remove query params * chore: fix tsc issues * fix: jest config issues * fix: update TODO and remove extra braces * feat: handle loading states and incorporate ui feedback (#4479) * UI feedback updates (#4482) * feat: handle loading and fix ui issues * feat: ui updates * fix: logs explorer issues (#4483) * fix: logs explorer issues * fix: jest test cases * feat: support custom times unique to pages new design changes (#4485) * fix: loading states for list log view (#4486) * fix: logs search view query fix, logs details view - attribute tags alignment fix (#4489) * fix: delete empty file * fix: chart loading when scrolling logs (#4495) * fix: chart should not load when scrolling the logs as it is already fetched * fix: make the search bar as default rather than advanced options * fix: rename show context to show in context * fix: query range api not triggering on default select first load (#4498) * Refactor: Log Explorer UI changes. (#4502) * refactor: used selected view enum * refactor: updated hight of switch old button and tab border * refactor: import fixes * refactor: query builder border and button groups * refactor: removed hypen from refreshed * refactor: show delete button only when there is more than one query * refactor: sqaure up the query build button groups * refactor: updated css * fix: additional filter color button shadow * refactor: removed commented code and used selected panel enum * refactor: updated typecheck script * refactor: used enum selected view (#4504) * fix: retain the current query on date time change (#4510) * feat: added new icon for promQL and added tooltips for dashboards and alerts (#4512) * feat: added new icon for promQL and added tooltips for dashboards and alerts * fix: styles at 1440 px zoom * fix: rename clickhouse to clickHouse --------- Co-authored-by: Vikrant Gupta <54737045+Vikrant2520@users.noreply.github.com> Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
2024-02-12 00:23:19 +05:30
import { Atom, Play, Terminal } from 'lucide-react';
import { useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
import { AppState } from 'store/reducers';
import { AlertTypes } from 'types/api/alerts/alertTypes';
import { AlertDef } from 'types/api/alerts/def';
import { EQueryType } from 'types/common/dashboard';
import AppReducer from 'types/reducer/app';
import ChQuerySection from './ChQuerySection';
import PromqlSection from './PromqlSection';
import { FormContainer, StepHeading } from './styles';
function QuerySection({
queryCategory,
setQueryCategory,
alertType,
runQuery,
alertDef,
panelType,
}: QuerySectionProps): JSX.Element {
// init namespace for translations
const { t } = useTranslation('alerts');
Logs explorer design update (#4352) * feat: logs explorer - new design * feat: update styles * feat: added new toolbar for logs explorer (#4336) * feat: logs list view changes (#4348) * feat: logs list view changes * fix: list view and toolbar styles * feat: side btns * feat: added auto refresh handler * feat: handle popover close for btn click date time * feat: extract the common log actions btn component * feat: update the button for log line actions * fix: event propagation from context button * feat: use styles from ui-library * Query builder design update (#4359) * feat: QB design update * fix: add functionality and light mode styles * fix: ts issues * fix: update all css color variables to correct names * fix: lint errors * feat: new table view for logs explorer list section (#4353) * feat: table view changes for logs list * feat: code refactor to support log line actions * feat: code refactor to support log line actions * fix: the positioning of the btns * feat: fix the table onclick * fix: header issue * fix: on hover * fix: type issue * fix: eslint error * fix: type errors (#4360) * feat: handle light theme for logs explorer design changes (#4363) * feat: handle light theme for list tables and dateTime selection * feat: handle light theme for popover * fix: address review comments * feat: date time custom time modal to render inside the new popover (#4366) * feat: single calender for range picker * fix: edgecases * feat: integrate date time selector across app * fix: remove dangling border after element removal * feat: handle qb design changes across the application * feat: handle light theme * feat: handle light theme * fix: virtuoso scroll refresh issue * feat: handle new typing changes for date time picker v2 (#4386) Co-authored-by: Yunus M <myounis.ar@live.com> * chore: styles improvement across new design (#4389) * fix: improve date time styles * feat: table view changes according to new design * fix: button visibility in clickhouse and promQL headers (#4390) * feat: change the tabs to new design buttons for query builder * Settings theme change (#4368) * feat: settings theme change * [Refactor]: New design for Log details page (#4362) New design for Log details page Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Yunus M <myounis.ar@live.com> * feat: save view for new design (#4392) * feat: save view for new design * refactor: done with save view * feat: update styles for logs detail view (#4407) * feat: update styles for logs detail view * feat: update styles for logs detail view * feat: add raw view attributes in the logs list view (#4422) * feat: add raw view attributes in the logs list view * feat: add raw view attributes in the logs list view * fix: raw attributes * fix: logs UI improvements (#4426) * fix: remove fixed times from the date time picker v2 * fix: added old logs explorer CTA in new designs * feat: handle active logs indicator update * fix: address review comments * fix: old logs explorer page * fix: remove info text and add relative time buttons * fix: update logs explorer tab designs * fix: update logs explorer tab designs * fix: update logs explorer tab designs * refactor: New design for Save views. (#4435) * feat: [GH-4436]: date range enhancements (#4448) * feat: [GH-4436]: when selecting custom time range it should be from start of day to end of date * fix: custom time width and refresh text visibility issues (#4428) --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: update ui (#4449) * feat: added loading and error states for logs design (#4452) * feat: added loading and error states for logs design * feat: added error states for table view and time series view * feat: handle error and loading states * feat: loading states * [Refactor]: Tab Switch deplay issue and UI improvement for Clickhouse (#4409) * fix: switching between logs display tabs (#4457) * [Feat]: View in Traces (#4450) * refactor: datetime selector beside run query removed add to dashboard * refactor: added tab for traces view details page * refactor: done with the save view in traces * fix: the gittery effect when navigatigating from views * refactor: view tab view title light mode support * refactor: removed console * fix: gittery effect when switch view from views tabs * refactor: separate traces routes * refactor: remove query params * chore: fix tsc issues * fix: jest config issues * fix: update TODO and remove extra braces * feat: handle loading states and incorporate ui feedback (#4479) * UI feedback updates (#4482) * feat: handle loading and fix ui issues * feat: ui updates * fix: logs explorer issues (#4483) * fix: logs explorer issues * fix: jest test cases * feat: support custom times unique to pages new design changes (#4485) * fix: loading states for list log view (#4486) * fix: logs search view query fix, logs details view - attribute tags alignment fix (#4489) * fix: delete empty file * fix: chart loading when scrolling logs (#4495) * fix: chart should not load when scrolling the logs as it is already fetched * fix: make the search bar as default rather than advanced options * fix: rename show context to show in context * fix: query range api not triggering on default select first load (#4498) * Refactor: Log Explorer UI changes. (#4502) * refactor: used selected view enum * refactor: updated hight of switch old button and tab border * refactor: import fixes * refactor: query builder border and button groups * refactor: removed hypen from refreshed * refactor: show delete button only when there is more than one query * refactor: sqaure up the query build button groups * refactor: updated css * fix: additional filter color button shadow * refactor: removed commented code and used selected panel enum * refactor: updated typecheck script * refactor: used enum selected view (#4504) * fix: retain the current query on date time change (#4510) * feat: added new icon for promQL and added tooltips for dashboards and alerts (#4512) * feat: added new icon for promQL and added tooltips for dashboards and alerts * fix: styles at 1440 px zoom * fix: rename clickhouse to clickHouse --------- Co-authored-by: Vikrant Gupta <54737045+Vikrant2520@users.noreply.github.com> Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
2024-02-12 00:23:19 +05:30
const [currentTab, setCurrentTab] = useState(queryCategory);
const { featureResponse } = useSelector<AppState, AppReducer>(
(state) => state.app,
);
const handleQueryCategoryChange = (queryType: string): void => {
featureResponse.refetch().then(() => {
setQueryCategory(queryType as EQueryType);
});
Logs explorer design update (#4352) * feat: logs explorer - new design * feat: update styles * feat: added new toolbar for logs explorer (#4336) * feat: logs list view changes (#4348) * feat: logs list view changes * fix: list view and toolbar styles * feat: side btns * feat: added auto refresh handler * feat: handle popover close for btn click date time * feat: extract the common log actions btn component * feat: update the button for log line actions * fix: event propagation from context button * feat: use styles from ui-library * Query builder design update (#4359) * feat: QB design update * fix: add functionality and light mode styles * fix: ts issues * fix: update all css color variables to correct names * fix: lint errors * feat: new table view for logs explorer list section (#4353) * feat: table view changes for logs list * feat: code refactor to support log line actions * feat: code refactor to support log line actions * fix: the positioning of the btns * feat: fix the table onclick * fix: header issue * fix: on hover * fix: type issue * fix: eslint error * fix: type errors (#4360) * feat: handle light theme for logs explorer design changes (#4363) * feat: handle light theme for list tables and dateTime selection * feat: handle light theme for popover * fix: address review comments * feat: date time custom time modal to render inside the new popover (#4366) * feat: single calender for range picker * fix: edgecases * feat: integrate date time selector across app * fix: remove dangling border after element removal * feat: handle qb design changes across the application * feat: handle light theme * feat: handle light theme * fix: virtuoso scroll refresh issue * feat: handle new typing changes for date time picker v2 (#4386) Co-authored-by: Yunus M <myounis.ar@live.com> * chore: styles improvement across new design (#4389) * fix: improve date time styles * feat: table view changes according to new design * fix: button visibility in clickhouse and promQL headers (#4390) * feat: change the tabs to new design buttons for query builder * Settings theme change (#4368) * feat: settings theme change * [Refactor]: New design for Log details page (#4362) New design for Log details page Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Yunus M <myounis.ar@live.com> * feat: save view for new design (#4392) * feat: save view for new design * refactor: done with save view * feat: update styles for logs detail view (#4407) * feat: update styles for logs detail view * feat: update styles for logs detail view * feat: add raw view attributes in the logs list view (#4422) * feat: add raw view attributes in the logs list view * feat: add raw view attributes in the logs list view * fix: raw attributes * fix: logs UI improvements (#4426) * fix: remove fixed times from the date time picker v2 * fix: added old logs explorer CTA in new designs * feat: handle active logs indicator update * fix: address review comments * fix: old logs explorer page * fix: remove info text and add relative time buttons * fix: update logs explorer tab designs * fix: update logs explorer tab designs * fix: update logs explorer tab designs * refactor: New design for Save views. (#4435) * feat: [GH-4436]: date range enhancements (#4448) * feat: [GH-4436]: when selecting custom time range it should be from start of day to end of date * fix: custom time width and refresh text visibility issues (#4428) --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: update ui (#4449) * feat: added loading and error states for logs design (#4452) * feat: added loading and error states for logs design * feat: added error states for table view and time series view * feat: handle error and loading states * feat: loading states * [Refactor]: Tab Switch deplay issue and UI improvement for Clickhouse (#4409) * fix: switching between logs display tabs (#4457) * [Feat]: View in Traces (#4450) * refactor: datetime selector beside run query removed add to dashboard * refactor: added tab for traces view details page * refactor: done with the save view in traces * fix: the gittery effect when navigatigating from views * refactor: view tab view title light mode support * refactor: removed console * fix: gittery effect when switch view from views tabs * refactor: separate traces routes * refactor: remove query params * chore: fix tsc issues * fix: jest config issues * fix: update TODO and remove extra braces * feat: handle loading states and incorporate ui feedback (#4479) * UI feedback updates (#4482) * feat: handle loading and fix ui issues * feat: ui updates * fix: logs explorer issues (#4483) * fix: logs explorer issues * fix: jest test cases * feat: support custom times unique to pages new design changes (#4485) * fix: loading states for list log view (#4486) * fix: logs search view query fix, logs details view - attribute tags alignment fix (#4489) * fix: delete empty file * fix: chart loading when scrolling logs (#4495) * fix: chart should not load when scrolling the logs as it is already fetched * fix: make the search bar as default rather than advanced options * fix: rename show context to show in context * fix: query range api not triggering on default select first load (#4498) * Refactor: Log Explorer UI changes. (#4502) * refactor: used selected view enum * refactor: updated hight of switch old button and tab border * refactor: import fixes * refactor: query builder border and button groups * refactor: removed hypen from refreshed * refactor: show delete button only when there is more than one query * refactor: sqaure up the query build button groups * refactor: updated css * fix: additional filter color button shadow * refactor: removed commented code and used selected panel enum * refactor: updated typecheck script * refactor: used enum selected view (#4504) * fix: retain the current query on date time change (#4510) * feat: added new icon for promQL and added tooltips for dashboards and alerts (#4512) * feat: added new icon for promQL and added tooltips for dashboards and alerts * fix: styles at 1440 px zoom * fix: rename clickhouse to clickHouse --------- Co-authored-by: Vikrant Gupta <54737045+Vikrant2520@users.noreply.github.com> Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
2024-02-12 00:23:19 +05:30
setCurrentTab(queryType as EQueryType);
};
const renderPromqlUI = (): JSX.Element => <PromqlSection />;
const renderChQueryUI = (): JSX.Element => <ChQuerySection />;
const isDarkMode = useIsDarkMode();
const renderMetricUI = (): JSX.Element => (
<QueryBuilder
panelType={panelType}
config={{
queryVariant: 'static',
initialDataSource: ALERTS_DATA_SOURCE_MAP[alertType],
}}
showFunctions={
(alertType === AlertTypes.METRICS_BASED_ALERT &&
alertDef.version === ENTITY_VERSION_V4) ||
alertType === AlertTypes.LOGS_BASED_ALERT
}
version={alertDef.version || 'v3'}
/>
);
const tabs = [
{
Logs explorer design update (#4352) * feat: logs explorer - new design * feat: update styles * feat: added new toolbar for logs explorer (#4336) * feat: logs list view changes (#4348) * feat: logs list view changes * fix: list view and toolbar styles * feat: side btns * feat: added auto refresh handler * feat: handle popover close for btn click date time * feat: extract the common log actions btn component * feat: update the button for log line actions * fix: event propagation from context button * feat: use styles from ui-library * Query builder design update (#4359) * feat: QB design update * fix: add functionality and light mode styles * fix: ts issues * fix: update all css color variables to correct names * fix: lint errors * feat: new table view for logs explorer list section (#4353) * feat: table view changes for logs list * feat: code refactor to support log line actions * feat: code refactor to support log line actions * fix: the positioning of the btns * feat: fix the table onclick * fix: header issue * fix: on hover * fix: type issue * fix: eslint error * fix: type errors (#4360) * feat: handle light theme for logs explorer design changes (#4363) * feat: handle light theme for list tables and dateTime selection * feat: handle light theme for popover * fix: address review comments * feat: date time custom time modal to render inside the new popover (#4366) * feat: single calender for range picker * fix: edgecases * feat: integrate date time selector across app * fix: remove dangling border after element removal * feat: handle qb design changes across the application * feat: handle light theme * feat: handle light theme * fix: virtuoso scroll refresh issue * feat: handle new typing changes for date time picker v2 (#4386) Co-authored-by: Yunus M <myounis.ar@live.com> * chore: styles improvement across new design (#4389) * fix: improve date time styles * feat: table view changes according to new design * fix: button visibility in clickhouse and promQL headers (#4390) * feat: change the tabs to new design buttons for query builder * Settings theme change (#4368) * feat: settings theme change * [Refactor]: New design for Log details page (#4362) New design for Log details page Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Yunus M <myounis.ar@live.com> * feat: save view for new design (#4392) * feat: save view for new design * refactor: done with save view * feat: update styles for logs detail view (#4407) * feat: update styles for logs detail view * feat: update styles for logs detail view * feat: add raw view attributes in the logs list view (#4422) * feat: add raw view attributes in the logs list view * feat: add raw view attributes in the logs list view * fix: raw attributes * fix: logs UI improvements (#4426) * fix: remove fixed times from the date time picker v2 * fix: added old logs explorer CTA in new designs * feat: handle active logs indicator update * fix: address review comments * fix: old logs explorer page * fix: remove info text and add relative time buttons * fix: update logs explorer tab designs * fix: update logs explorer tab designs * fix: update logs explorer tab designs * refactor: New design for Save views. (#4435) * feat: [GH-4436]: date range enhancements (#4448) * feat: [GH-4436]: when selecting custom time range it should be from start of day to end of date * fix: custom time width and refresh text visibility issues (#4428) --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: update ui (#4449) * feat: added loading and error states for logs design (#4452) * feat: added loading and error states for logs design * feat: added error states for table view and time series view * feat: handle error and loading states * feat: loading states * [Refactor]: Tab Switch deplay issue and UI improvement for Clickhouse (#4409) * fix: switching between logs display tabs (#4457) * [Feat]: View in Traces (#4450) * refactor: datetime selector beside run query removed add to dashboard * refactor: added tab for traces view details page * refactor: done with the save view in traces * fix: the gittery effect when navigatigating from views * refactor: view tab view title light mode support * refactor: removed console * fix: gittery effect when switch view from views tabs * refactor: separate traces routes * refactor: remove query params * chore: fix tsc issues * fix: jest config issues * fix: update TODO and remove extra braces * feat: handle loading states and incorporate ui feedback (#4479) * UI feedback updates (#4482) * feat: handle loading and fix ui issues * feat: ui updates * fix: logs explorer issues (#4483) * fix: logs explorer issues * fix: jest test cases * feat: support custom times unique to pages new design changes (#4485) * fix: loading states for list log view (#4486) * fix: logs search view query fix, logs details view - attribute tags alignment fix (#4489) * fix: delete empty file * fix: chart loading when scrolling logs (#4495) * fix: chart should not load when scrolling the logs as it is already fetched * fix: make the search bar as default rather than advanced options * fix: rename show context to show in context * fix: query range api not triggering on default select first load (#4498) * Refactor: Log Explorer UI changes. (#4502) * refactor: used selected view enum * refactor: updated hight of switch old button and tab border * refactor: import fixes * refactor: query builder border and button groups * refactor: removed hypen from refreshed * refactor: show delete button only when there is more than one query * refactor: sqaure up the query build button groups * refactor: updated css * fix: additional filter color button shadow * refactor: removed commented code and used selected panel enum * refactor: updated typecheck script * refactor: used enum selected view (#4504) * fix: retain the current query on date time change (#4510) * feat: added new icon for promQL and added tooltips for dashboards and alerts (#4512) * feat: added new icon for promQL and added tooltips for dashboards and alerts * fix: styles at 1440 px zoom * fix: rename clickhouse to clickHouse --------- Co-authored-by: Vikrant Gupta <54737045+Vikrant2520@users.noreply.github.com> Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
2024-02-12 00:23:19 +05:30
label: (
<Tooltip title="Query Builder">
<Button className="nav-btns">
<Atom size={14} />
</Button>
</Tooltip>
),
key: EQueryType.QUERY_BUILDER,
},
{
Logs explorer design update (#4352) * feat: logs explorer - new design * feat: update styles * feat: added new toolbar for logs explorer (#4336) * feat: logs list view changes (#4348) * feat: logs list view changes * fix: list view and toolbar styles * feat: side btns * feat: added auto refresh handler * feat: handle popover close for btn click date time * feat: extract the common log actions btn component * feat: update the button for log line actions * fix: event propagation from context button * feat: use styles from ui-library * Query builder design update (#4359) * feat: QB design update * fix: add functionality and light mode styles * fix: ts issues * fix: update all css color variables to correct names * fix: lint errors * feat: new table view for logs explorer list section (#4353) * feat: table view changes for logs list * feat: code refactor to support log line actions * feat: code refactor to support log line actions * fix: the positioning of the btns * feat: fix the table onclick * fix: header issue * fix: on hover * fix: type issue * fix: eslint error * fix: type errors (#4360) * feat: handle light theme for logs explorer design changes (#4363) * feat: handle light theme for list tables and dateTime selection * feat: handle light theme for popover * fix: address review comments * feat: date time custom time modal to render inside the new popover (#4366) * feat: single calender for range picker * fix: edgecases * feat: integrate date time selector across app * fix: remove dangling border after element removal * feat: handle qb design changes across the application * feat: handle light theme * feat: handle light theme * fix: virtuoso scroll refresh issue * feat: handle new typing changes for date time picker v2 (#4386) Co-authored-by: Yunus M <myounis.ar@live.com> * chore: styles improvement across new design (#4389) * fix: improve date time styles * feat: table view changes according to new design * fix: button visibility in clickhouse and promQL headers (#4390) * feat: change the tabs to new design buttons for query builder * Settings theme change (#4368) * feat: settings theme change * [Refactor]: New design for Log details page (#4362) New design for Log details page Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Yunus M <myounis.ar@live.com> * feat: save view for new design (#4392) * feat: save view for new design * refactor: done with save view * feat: update styles for logs detail view (#4407) * feat: update styles for logs detail view * feat: update styles for logs detail view * feat: add raw view attributes in the logs list view (#4422) * feat: add raw view attributes in the logs list view * feat: add raw view attributes in the logs list view * fix: raw attributes * fix: logs UI improvements (#4426) * fix: remove fixed times from the date time picker v2 * fix: added old logs explorer CTA in new designs * feat: handle active logs indicator update * fix: address review comments * fix: old logs explorer page * fix: remove info text and add relative time buttons * fix: update logs explorer tab designs * fix: update logs explorer tab designs * fix: update logs explorer tab designs * refactor: New design for Save views. (#4435) * feat: [GH-4436]: date range enhancements (#4448) * feat: [GH-4436]: when selecting custom time range it should be from start of day to end of date * fix: custom time width and refresh text visibility issues (#4428) --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: update ui (#4449) * feat: added loading and error states for logs design (#4452) * feat: added loading and error states for logs design * feat: added error states for table view and time series view * feat: handle error and loading states * feat: loading states * [Refactor]: Tab Switch deplay issue and UI improvement for Clickhouse (#4409) * fix: switching between logs display tabs (#4457) * [Feat]: View in Traces (#4450) * refactor: datetime selector beside run query removed add to dashboard * refactor: added tab for traces view details page * refactor: done with the save view in traces * fix: the gittery effect when navigatigating from views * refactor: view tab view title light mode support * refactor: removed console * fix: gittery effect when switch view from views tabs * refactor: separate traces routes * refactor: remove query params * chore: fix tsc issues * fix: jest config issues * fix: update TODO and remove extra braces * feat: handle loading states and incorporate ui feedback (#4479) * UI feedback updates (#4482) * feat: handle loading and fix ui issues * feat: ui updates * fix: logs explorer issues (#4483) * fix: logs explorer issues * fix: jest test cases * feat: support custom times unique to pages new design changes (#4485) * fix: loading states for list log view (#4486) * fix: logs search view query fix, logs details view - attribute tags alignment fix (#4489) * fix: delete empty file * fix: chart loading when scrolling logs (#4495) * fix: chart should not load when scrolling the logs as it is already fetched * fix: make the search bar as default rather than advanced options * fix: rename show context to show in context * fix: query range api not triggering on default select first load (#4498) * Refactor: Log Explorer UI changes. (#4502) * refactor: used selected view enum * refactor: updated hight of switch old button and tab border * refactor: import fixes * refactor: query builder border and button groups * refactor: removed hypen from refreshed * refactor: show delete button only when there is more than one query * refactor: sqaure up the query build button groups * refactor: updated css * fix: additional filter color button shadow * refactor: removed commented code and used selected panel enum * refactor: updated typecheck script * refactor: used enum selected view (#4504) * fix: retain the current query on date time change (#4510) * feat: added new icon for promQL and added tooltips for dashboards and alerts (#4512) * feat: added new icon for promQL and added tooltips for dashboards and alerts * fix: styles at 1440 px zoom * fix: rename clickhouse to clickHouse --------- Co-authored-by: Vikrant Gupta <54737045+Vikrant2520@users.noreply.github.com> Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
2024-02-12 00:23:19 +05:30
label: (
<Tooltip title="ClickHouse">
<Button className="nav-btns">
<Terminal size={14} />
</Button>
</Tooltip>
),
key: EQueryType.CLICKHOUSE,
},
];
const items = useMemo(
() => [
Logs explorer design update (#4352) * feat: logs explorer - new design * feat: update styles * feat: added new toolbar for logs explorer (#4336) * feat: logs list view changes (#4348) * feat: logs list view changes * fix: list view and toolbar styles * feat: side btns * feat: added auto refresh handler * feat: handle popover close for btn click date time * feat: extract the common log actions btn component * feat: update the button for log line actions * fix: event propagation from context button * feat: use styles from ui-library * Query builder design update (#4359) * feat: QB design update * fix: add functionality and light mode styles * fix: ts issues * fix: update all css color variables to correct names * fix: lint errors * feat: new table view for logs explorer list section (#4353) * feat: table view changes for logs list * feat: code refactor to support log line actions * feat: code refactor to support log line actions * fix: the positioning of the btns * feat: fix the table onclick * fix: header issue * fix: on hover * fix: type issue * fix: eslint error * fix: type errors (#4360) * feat: handle light theme for logs explorer design changes (#4363) * feat: handle light theme for list tables and dateTime selection * feat: handle light theme for popover * fix: address review comments * feat: date time custom time modal to render inside the new popover (#4366) * feat: single calender for range picker * fix: edgecases * feat: integrate date time selector across app * fix: remove dangling border after element removal * feat: handle qb design changes across the application * feat: handle light theme * feat: handle light theme * fix: virtuoso scroll refresh issue * feat: handle new typing changes for date time picker v2 (#4386) Co-authored-by: Yunus M <myounis.ar@live.com> * chore: styles improvement across new design (#4389) * fix: improve date time styles * feat: table view changes according to new design * fix: button visibility in clickhouse and promQL headers (#4390) * feat: change the tabs to new design buttons for query builder * Settings theme change (#4368) * feat: settings theme change * [Refactor]: New design for Log details page (#4362) New design for Log details page Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Yunus M <myounis.ar@live.com> * feat: save view for new design (#4392) * feat: save view for new design * refactor: done with save view * feat: update styles for logs detail view (#4407) * feat: update styles for logs detail view * feat: update styles for logs detail view * feat: add raw view attributes in the logs list view (#4422) * feat: add raw view attributes in the logs list view * feat: add raw view attributes in the logs list view * fix: raw attributes * fix: logs UI improvements (#4426) * fix: remove fixed times from the date time picker v2 * fix: added old logs explorer CTA in new designs * feat: handle active logs indicator update * fix: address review comments * fix: old logs explorer page * fix: remove info text and add relative time buttons * fix: update logs explorer tab designs * fix: update logs explorer tab designs * fix: update logs explorer tab designs * refactor: New design for Save views. (#4435) * feat: [GH-4436]: date range enhancements (#4448) * feat: [GH-4436]: when selecting custom time range it should be from start of day to end of date * fix: custom time width and refresh text visibility issues (#4428) --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: update ui (#4449) * feat: added loading and error states for logs design (#4452) * feat: added loading and error states for logs design * feat: added error states for table view and time series view * feat: handle error and loading states * feat: loading states * [Refactor]: Tab Switch deplay issue and UI improvement for Clickhouse (#4409) * fix: switching between logs display tabs (#4457) * [Feat]: View in Traces (#4450) * refactor: datetime selector beside run query removed add to dashboard * refactor: added tab for traces view details page * refactor: done with the save view in traces * fix: the gittery effect when navigatigating from views * refactor: view tab view title light mode support * refactor: removed console * fix: gittery effect when switch view from views tabs * refactor: separate traces routes * refactor: remove query params * chore: fix tsc issues * fix: jest config issues * fix: update TODO and remove extra braces * feat: handle loading states and incorporate ui feedback (#4479) * UI feedback updates (#4482) * feat: handle loading and fix ui issues * feat: ui updates * fix: logs explorer issues (#4483) * fix: logs explorer issues * fix: jest test cases * feat: support custom times unique to pages new design changes (#4485) * fix: loading states for list log view (#4486) * fix: logs search view query fix, logs details view - attribute tags alignment fix (#4489) * fix: delete empty file * fix: chart loading when scrolling logs (#4495) * fix: chart should not load when scrolling the logs as it is already fetched * fix: make the search bar as default rather than advanced options * fix: rename show context to show in context * fix: query range api not triggering on default select first load (#4498) * Refactor: Log Explorer UI changes. (#4502) * refactor: used selected view enum * refactor: updated hight of switch old button and tab border * refactor: import fixes * refactor: query builder border and button groups * refactor: removed hypen from refreshed * refactor: show delete button only when there is more than one query * refactor: sqaure up the query build button groups * refactor: updated css * fix: additional filter color button shadow * refactor: removed commented code and used selected panel enum * refactor: updated typecheck script * refactor: used enum selected view (#4504) * fix: retain the current query on date time change (#4510) * feat: added new icon for promQL and added tooltips for dashboards and alerts (#4512) * feat: added new icon for promQL and added tooltips for dashboards and alerts * fix: styles at 1440 px zoom * fix: rename clickhouse to clickHouse --------- Co-authored-by: Vikrant Gupta <54737045+Vikrant2520@users.noreply.github.com> Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
2024-02-12 00:23:19 +05:30
{
label: (
<Tooltip title="Query Builder">
<Button className="nav-btns">
<Atom size={14} />
</Button>
</Tooltip>
),
key: EQueryType.QUERY_BUILDER,
},
{
label: (
<Tooltip title="ClickHouse">
<Button className="nav-btns">
<Terminal size={14} />
</Button>
</Tooltip>
),
key: EQueryType.CLICKHOUSE,
},
{
label: (
<Tooltip title="PromQL">
<Button className="nav-btns">
<PromQLIcon
fillColor={isDarkMode ? Color.BG_VANILLA_200 : Color.BG_INK_300}
/>
Logs explorer design update (#4352) * feat: logs explorer - new design * feat: update styles * feat: added new toolbar for logs explorer (#4336) * feat: logs list view changes (#4348) * feat: logs list view changes * fix: list view and toolbar styles * feat: side btns * feat: added auto refresh handler * feat: handle popover close for btn click date time * feat: extract the common log actions btn component * feat: update the button for log line actions * fix: event propagation from context button * feat: use styles from ui-library * Query builder design update (#4359) * feat: QB design update * fix: add functionality and light mode styles * fix: ts issues * fix: update all css color variables to correct names * fix: lint errors * feat: new table view for logs explorer list section (#4353) * feat: table view changes for logs list * feat: code refactor to support log line actions * feat: code refactor to support log line actions * fix: the positioning of the btns * feat: fix the table onclick * fix: header issue * fix: on hover * fix: type issue * fix: eslint error * fix: type errors (#4360) * feat: handle light theme for logs explorer design changes (#4363) * feat: handle light theme for list tables and dateTime selection * feat: handle light theme for popover * fix: address review comments * feat: date time custom time modal to render inside the new popover (#4366) * feat: single calender for range picker * fix: edgecases * feat: integrate date time selector across app * fix: remove dangling border after element removal * feat: handle qb design changes across the application * feat: handle light theme * feat: handle light theme * fix: virtuoso scroll refresh issue * feat: handle new typing changes for date time picker v2 (#4386) Co-authored-by: Yunus M <myounis.ar@live.com> * chore: styles improvement across new design (#4389) * fix: improve date time styles * feat: table view changes according to new design * fix: button visibility in clickhouse and promQL headers (#4390) * feat: change the tabs to new design buttons for query builder * Settings theme change (#4368) * feat: settings theme change * [Refactor]: New design for Log details page (#4362) New design for Log details page Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Yunus M <myounis.ar@live.com> * feat: save view for new design (#4392) * feat: save view for new design * refactor: done with save view * feat: update styles for logs detail view (#4407) * feat: update styles for logs detail view * feat: update styles for logs detail view * feat: add raw view attributes in the logs list view (#4422) * feat: add raw view attributes in the logs list view * feat: add raw view attributes in the logs list view * fix: raw attributes * fix: logs UI improvements (#4426) * fix: remove fixed times from the date time picker v2 * fix: added old logs explorer CTA in new designs * feat: handle active logs indicator update * fix: address review comments * fix: old logs explorer page * fix: remove info text and add relative time buttons * fix: update logs explorer tab designs * fix: update logs explorer tab designs * fix: update logs explorer tab designs * refactor: New design for Save views. (#4435) * feat: [GH-4436]: date range enhancements (#4448) * feat: [GH-4436]: when selecting custom time range it should be from start of day to end of date * fix: custom time width and refresh text visibility issues (#4428) --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: update ui (#4449) * feat: added loading and error states for logs design (#4452) * feat: added loading and error states for logs design * feat: added error states for table view and time series view * feat: handle error and loading states * feat: loading states * [Refactor]: Tab Switch deplay issue and UI improvement for Clickhouse (#4409) * fix: switching between logs display tabs (#4457) * [Feat]: View in Traces (#4450) * refactor: datetime selector beside run query removed add to dashboard * refactor: added tab for traces view details page * refactor: done with the save view in traces * fix: the gittery effect when navigatigating from views * refactor: view tab view title light mode support * refactor: removed console * fix: gittery effect when switch view from views tabs * refactor: separate traces routes * refactor: remove query params * chore: fix tsc issues * fix: jest config issues * fix: update TODO and remove extra braces * feat: handle loading states and incorporate ui feedback (#4479) * UI feedback updates (#4482) * feat: handle loading and fix ui issues * feat: ui updates * fix: logs explorer issues (#4483) * fix: logs explorer issues * fix: jest test cases * feat: support custom times unique to pages new design changes (#4485) * fix: loading states for list log view (#4486) * fix: logs search view query fix, logs details view - attribute tags alignment fix (#4489) * fix: delete empty file * fix: chart loading when scrolling logs (#4495) * fix: chart should not load when scrolling the logs as it is already fetched * fix: make the search bar as default rather than advanced options * fix: rename show context to show in context * fix: query range api not triggering on default select first load (#4498) * Refactor: Log Explorer UI changes. (#4502) * refactor: used selected view enum * refactor: updated hight of switch old button and tab border * refactor: import fixes * refactor: query builder border and button groups * refactor: removed hypen from refreshed * refactor: show delete button only when there is more than one query * refactor: sqaure up the query build button groups * refactor: updated css * fix: additional filter color button shadow * refactor: removed commented code and used selected panel enum * refactor: updated typecheck script * refactor: used enum selected view (#4504) * fix: retain the current query on date time change (#4510) * feat: added new icon for promQL and added tooltips for dashboards and alerts (#4512) * feat: added new icon for promQL and added tooltips for dashboards and alerts * fix: styles at 1440 px zoom * fix: rename clickhouse to clickHouse --------- Co-authored-by: Vikrant Gupta <54737045+Vikrant2520@users.noreply.github.com> Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
2024-02-12 00:23:19 +05:30
</Button>
</Tooltip>
),
key: EQueryType.PROM,
},
],
[isDarkMode],
);
const { registerShortcut, deregisterShortcut } = useKeyboardHotkeys();
useEffect(() => {
registerShortcut(QBShortcuts.StageAndRunQuery, runQuery);
return (): void => {
deregisterShortcut(QBShortcuts.StageAndRunQuery);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [runQuery]);
const renderTabs = (typ: AlertTypes): JSX.Element | null => {
switch (typ) {
case AlertTypes.TRACES_BASED_ALERT:
case AlertTypes.LOGS_BASED_ALERT:
case AlertTypes.EXCEPTIONS_BASED_ALERT:
return (
Logs explorer design update (#4352) * feat: logs explorer - new design * feat: update styles * feat: added new toolbar for logs explorer (#4336) * feat: logs list view changes (#4348) * feat: logs list view changes * fix: list view and toolbar styles * feat: side btns * feat: added auto refresh handler * feat: handle popover close for btn click date time * feat: extract the common log actions btn component * feat: update the button for log line actions * fix: event propagation from context button * feat: use styles from ui-library * Query builder design update (#4359) * feat: QB design update * fix: add functionality and light mode styles * fix: ts issues * fix: update all css color variables to correct names * fix: lint errors * feat: new table view for logs explorer list section (#4353) * feat: table view changes for logs list * feat: code refactor to support log line actions * feat: code refactor to support log line actions * fix: the positioning of the btns * feat: fix the table onclick * fix: header issue * fix: on hover * fix: type issue * fix: eslint error * fix: type errors (#4360) * feat: handle light theme for logs explorer design changes (#4363) * feat: handle light theme for list tables and dateTime selection * feat: handle light theme for popover * fix: address review comments * feat: date time custom time modal to render inside the new popover (#4366) * feat: single calender for range picker * fix: edgecases * feat: integrate date time selector across app * fix: remove dangling border after element removal * feat: handle qb design changes across the application * feat: handle light theme * feat: handle light theme * fix: virtuoso scroll refresh issue * feat: handle new typing changes for date time picker v2 (#4386) Co-authored-by: Yunus M <myounis.ar@live.com> * chore: styles improvement across new design (#4389) * fix: improve date time styles * feat: table view changes according to new design * fix: button visibility in clickhouse and promQL headers (#4390) * feat: change the tabs to new design buttons for query builder * Settings theme change (#4368) * feat: settings theme change * [Refactor]: New design for Log details page (#4362) New design for Log details page Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Yunus M <myounis.ar@live.com> * feat: save view for new design (#4392) * feat: save view for new design * refactor: done with save view * feat: update styles for logs detail view (#4407) * feat: update styles for logs detail view * feat: update styles for logs detail view * feat: add raw view attributes in the logs list view (#4422) * feat: add raw view attributes in the logs list view * feat: add raw view attributes in the logs list view * fix: raw attributes * fix: logs UI improvements (#4426) * fix: remove fixed times from the date time picker v2 * fix: added old logs explorer CTA in new designs * feat: handle active logs indicator update * fix: address review comments * fix: old logs explorer page * fix: remove info text and add relative time buttons * fix: update logs explorer tab designs * fix: update logs explorer tab designs * fix: update logs explorer tab designs * refactor: New design for Save views. (#4435) * feat: [GH-4436]: date range enhancements (#4448) * feat: [GH-4436]: when selecting custom time range it should be from start of day to end of date * fix: custom time width and refresh text visibility issues (#4428) --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: update ui (#4449) * feat: added loading and error states for logs design (#4452) * feat: added loading and error states for logs design * feat: added error states for table view and time series view * feat: handle error and loading states * feat: loading states * [Refactor]: Tab Switch deplay issue and UI improvement for Clickhouse (#4409) * fix: switching between logs display tabs (#4457) * [Feat]: View in Traces (#4450) * refactor: datetime selector beside run query removed add to dashboard * refactor: added tab for traces view details page * refactor: done with the save view in traces * fix: the gittery effect when navigatigating from views * refactor: view tab view title light mode support * refactor: removed console * fix: gittery effect when switch view from views tabs * refactor: separate traces routes * refactor: remove query params * chore: fix tsc issues * fix: jest config issues * fix: update TODO and remove extra braces * feat: handle loading states and incorporate ui feedback (#4479) * UI feedback updates (#4482) * feat: handle loading and fix ui issues * feat: ui updates * fix: logs explorer issues (#4483) * fix: logs explorer issues * fix: jest test cases * feat: support custom times unique to pages new design changes (#4485) * fix: loading states for list log view (#4486) * fix: logs search view query fix, logs details view - attribute tags alignment fix (#4489) * fix: delete empty file * fix: chart loading when scrolling logs (#4495) * fix: chart should not load when scrolling the logs as it is already fetched * fix: make the search bar as default rather than advanced options * fix: rename show context to show in context * fix: query range api not triggering on default select first load (#4498) * Refactor: Log Explorer UI changes. (#4502) * refactor: used selected view enum * refactor: updated hight of switch old button and tab border * refactor: import fixes * refactor: query builder border and button groups * refactor: removed hypen from refreshed * refactor: show delete button only when there is more than one query * refactor: sqaure up the query build button groups * refactor: updated css * fix: additional filter color button shadow * refactor: removed commented code and used selected panel enum * refactor: updated typecheck script * refactor: used enum selected view (#4504) * fix: retain the current query on date time change (#4510) * feat: added new icon for promQL and added tooltips for dashboards and alerts (#4512) * feat: added new icon for promQL and added tooltips for dashboards and alerts * fix: styles at 1440 px zoom * fix: rename clickhouse to clickHouse --------- Co-authored-by: Vikrant Gupta <54737045+Vikrant2520@users.noreply.github.com> Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
2024-02-12 00:23:19 +05:30
<div className="alert-tabs">
<Tabs
type="card"
style={{ width: '100%' }}
defaultActiveKey={currentTab}
activeKey={currentTab}
onChange={handleQueryCategoryChange}
tabBarExtraContent={
<span style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
<Button
type="primary"
onClick={runQuery}
className="stage-run-query"
icon={<Play size={14} />}
>
Stage & Run Query
</Button>
</span>
}
items={tabs}
/>
</div>
);
case AlertTypes.METRICS_BASED_ALERT:
default:
return (
Logs explorer design update (#4352) * feat: logs explorer - new design * feat: update styles * feat: added new toolbar for logs explorer (#4336) * feat: logs list view changes (#4348) * feat: logs list view changes * fix: list view and toolbar styles * feat: side btns * feat: added auto refresh handler * feat: handle popover close for btn click date time * feat: extract the common log actions btn component * feat: update the button for log line actions * fix: event propagation from context button * feat: use styles from ui-library * Query builder design update (#4359) * feat: QB design update * fix: add functionality and light mode styles * fix: ts issues * fix: update all css color variables to correct names * fix: lint errors * feat: new table view for logs explorer list section (#4353) * feat: table view changes for logs list * feat: code refactor to support log line actions * feat: code refactor to support log line actions * fix: the positioning of the btns * feat: fix the table onclick * fix: header issue * fix: on hover * fix: type issue * fix: eslint error * fix: type errors (#4360) * feat: handle light theme for logs explorer design changes (#4363) * feat: handle light theme for list tables and dateTime selection * feat: handle light theme for popover * fix: address review comments * feat: date time custom time modal to render inside the new popover (#4366) * feat: single calender for range picker * fix: edgecases * feat: integrate date time selector across app * fix: remove dangling border after element removal * feat: handle qb design changes across the application * feat: handle light theme * feat: handle light theme * fix: virtuoso scroll refresh issue * feat: handle new typing changes for date time picker v2 (#4386) Co-authored-by: Yunus M <myounis.ar@live.com> * chore: styles improvement across new design (#4389) * fix: improve date time styles * feat: table view changes according to new design * fix: button visibility in clickhouse and promQL headers (#4390) * feat: change the tabs to new design buttons for query builder * Settings theme change (#4368) * feat: settings theme change * [Refactor]: New design for Log details page (#4362) New design for Log details page Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Yunus M <myounis.ar@live.com> * feat: save view for new design (#4392) * feat: save view for new design * refactor: done with save view * feat: update styles for logs detail view (#4407) * feat: update styles for logs detail view * feat: update styles for logs detail view * feat: add raw view attributes in the logs list view (#4422) * feat: add raw view attributes in the logs list view * feat: add raw view attributes in the logs list view * fix: raw attributes * fix: logs UI improvements (#4426) * fix: remove fixed times from the date time picker v2 * fix: added old logs explorer CTA in new designs * feat: handle active logs indicator update * fix: address review comments * fix: old logs explorer page * fix: remove info text and add relative time buttons * fix: update logs explorer tab designs * fix: update logs explorer tab designs * fix: update logs explorer tab designs * refactor: New design for Save views. (#4435) * feat: [GH-4436]: date range enhancements (#4448) * feat: [GH-4436]: when selecting custom time range it should be from start of day to end of date * fix: custom time width and refresh text visibility issues (#4428) --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: update ui (#4449) * feat: added loading and error states for logs design (#4452) * feat: added loading and error states for logs design * feat: added error states for table view and time series view * feat: handle error and loading states * feat: loading states * [Refactor]: Tab Switch deplay issue and UI improvement for Clickhouse (#4409) * fix: switching between logs display tabs (#4457) * [Feat]: View in Traces (#4450) * refactor: datetime selector beside run query removed add to dashboard * refactor: added tab for traces view details page * refactor: done with the save view in traces * fix: the gittery effect when navigatigating from views * refactor: view tab view title light mode support * refactor: removed console * fix: gittery effect when switch view from views tabs * refactor: separate traces routes * refactor: remove query params * chore: fix tsc issues * fix: jest config issues * fix: update TODO and remove extra braces * feat: handle loading states and incorporate ui feedback (#4479) * UI feedback updates (#4482) * feat: handle loading and fix ui issues * feat: ui updates * fix: logs explorer issues (#4483) * fix: logs explorer issues * fix: jest test cases * feat: support custom times unique to pages new design changes (#4485) * fix: loading states for list log view (#4486) * fix: logs search view query fix, logs details view - attribute tags alignment fix (#4489) * fix: delete empty file * fix: chart loading when scrolling logs (#4495) * fix: chart should not load when scrolling the logs as it is already fetched * fix: make the search bar as default rather than advanced options * fix: rename show context to show in context * fix: query range api not triggering on default select first load (#4498) * Refactor: Log Explorer UI changes. (#4502) * refactor: used selected view enum * refactor: updated hight of switch old button and tab border * refactor: import fixes * refactor: query builder border and button groups * refactor: removed hypen from refreshed * refactor: show delete button only when there is more than one query * refactor: sqaure up the query build button groups * refactor: updated css * fix: additional filter color button shadow * refactor: removed commented code and used selected panel enum * refactor: updated typecheck script * refactor: used enum selected view (#4504) * fix: retain the current query on date time change (#4510) * feat: added new icon for promQL and added tooltips for dashboards and alerts (#4512) * feat: added new icon for promQL and added tooltips for dashboards and alerts * fix: styles at 1440 px zoom * fix: rename clickhouse to clickHouse --------- Co-authored-by: Vikrant Gupta <54737045+Vikrant2520@users.noreply.github.com> Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
2024-02-12 00:23:19 +05:30
<div className="alert-tabs">
<Tabs
type="card"
style={{ width: '100%' }}
defaultActiveKey={currentTab}
activeKey={currentTab}
onChange={handleQueryCategoryChange}
tabBarExtraContent={
<span style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
<Button
type="primary"
onClick={runQuery}
className="stage-run-query"
icon={<Play size={14} />}
>
Stage & Run Query
</Button>
</span>
}
items={items}
/>
</div>
);
}
};
const renderQuerySection = (c: EQueryType): JSX.Element | null => {
switch (c) {
case EQueryType.PROM:
return renderPromqlUI();
case EQueryType.CLICKHOUSE:
return renderChQueryUI();
case EQueryType.QUERY_BUILDER:
return renderMetricUI();
default:
return null;
}
};
return (
<>
<StepHeading> {t('alert_form_step1')}</StepHeading>
<FormContainer>
Logs explorer design update (#4352) * feat: logs explorer - new design * feat: update styles * feat: added new toolbar for logs explorer (#4336) * feat: logs list view changes (#4348) * feat: logs list view changes * fix: list view and toolbar styles * feat: side btns * feat: added auto refresh handler * feat: handle popover close for btn click date time * feat: extract the common log actions btn component * feat: update the button for log line actions * fix: event propagation from context button * feat: use styles from ui-library * Query builder design update (#4359) * feat: QB design update * fix: add functionality and light mode styles * fix: ts issues * fix: update all css color variables to correct names * fix: lint errors * feat: new table view for logs explorer list section (#4353) * feat: table view changes for logs list * feat: code refactor to support log line actions * feat: code refactor to support log line actions * fix: the positioning of the btns * feat: fix the table onclick * fix: header issue * fix: on hover * fix: type issue * fix: eslint error * fix: type errors (#4360) * feat: handle light theme for logs explorer design changes (#4363) * feat: handle light theme for list tables and dateTime selection * feat: handle light theme for popover * fix: address review comments * feat: date time custom time modal to render inside the new popover (#4366) * feat: single calender for range picker * fix: edgecases * feat: integrate date time selector across app * fix: remove dangling border after element removal * feat: handle qb design changes across the application * feat: handle light theme * feat: handle light theme * fix: virtuoso scroll refresh issue * feat: handle new typing changes for date time picker v2 (#4386) Co-authored-by: Yunus M <myounis.ar@live.com> * chore: styles improvement across new design (#4389) * fix: improve date time styles * feat: table view changes according to new design * fix: button visibility in clickhouse and promQL headers (#4390) * feat: change the tabs to new design buttons for query builder * Settings theme change (#4368) * feat: settings theme change * [Refactor]: New design for Log details page (#4362) New design for Log details page Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Yunus M <myounis.ar@live.com> * feat: save view for new design (#4392) * feat: save view for new design * refactor: done with save view * feat: update styles for logs detail view (#4407) * feat: update styles for logs detail view * feat: update styles for logs detail view * feat: add raw view attributes in the logs list view (#4422) * feat: add raw view attributes in the logs list view * feat: add raw view attributes in the logs list view * fix: raw attributes * fix: logs UI improvements (#4426) * fix: remove fixed times from the date time picker v2 * fix: added old logs explorer CTA in new designs * feat: handle active logs indicator update * fix: address review comments * fix: old logs explorer page * fix: remove info text and add relative time buttons * fix: update logs explorer tab designs * fix: update logs explorer tab designs * fix: update logs explorer tab designs * refactor: New design for Save views. (#4435) * feat: [GH-4436]: date range enhancements (#4448) * feat: [GH-4436]: when selecting custom time range it should be from start of day to end of date * fix: custom time width and refresh text visibility issues (#4428) --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: update ui (#4449) * feat: added loading and error states for logs design (#4452) * feat: added loading and error states for logs design * feat: added error states for table view and time series view * feat: handle error and loading states * feat: loading states * [Refactor]: Tab Switch deplay issue and UI improvement for Clickhouse (#4409) * fix: switching between logs display tabs (#4457) * [Feat]: View in Traces (#4450) * refactor: datetime selector beside run query removed add to dashboard * refactor: added tab for traces view details page * refactor: done with the save view in traces * fix: the gittery effect when navigatigating from views * refactor: view tab view title light mode support * refactor: removed console * fix: gittery effect when switch view from views tabs * refactor: separate traces routes * refactor: remove query params * chore: fix tsc issues * fix: jest config issues * fix: update TODO and remove extra braces * feat: handle loading states and incorporate ui feedback (#4479) * UI feedback updates (#4482) * feat: handle loading and fix ui issues * feat: ui updates * fix: logs explorer issues (#4483) * fix: logs explorer issues * fix: jest test cases * feat: support custom times unique to pages new design changes (#4485) * fix: loading states for list log view (#4486) * fix: logs search view query fix, logs details view - attribute tags alignment fix (#4489) * fix: delete empty file * fix: chart loading when scrolling logs (#4495) * fix: chart should not load when scrolling the logs as it is already fetched * fix: make the search bar as default rather than advanced options * fix: rename show context to show in context * fix: query range api not triggering on default select first load (#4498) * Refactor: Log Explorer UI changes. (#4502) * refactor: used selected view enum * refactor: updated hight of switch old button and tab border * refactor: import fixes * refactor: query builder border and button groups * refactor: removed hypen from refreshed * refactor: show delete button only when there is more than one query * refactor: sqaure up the query build button groups * refactor: updated css * fix: additional filter color button shadow * refactor: removed commented code and used selected panel enum * refactor: updated typecheck script * refactor: used enum selected view (#4504) * fix: retain the current query on date time change (#4510) * feat: added new icon for promQL and added tooltips for dashboards and alerts (#4512) * feat: added new icon for promQL and added tooltips for dashboards and alerts * fix: styles at 1440 px zoom * fix: rename clickhouse to clickHouse --------- Co-authored-by: Vikrant Gupta <54737045+Vikrant2520@users.noreply.github.com> Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
2024-02-12 00:23:19 +05:30
<div>{renderTabs(alertType)}</div>
{renderQuerySection(currentTab)}
</FormContainer>
</>
);
}
interface QuerySectionProps {
queryCategory: EQueryType;
setQueryCategory: (n: EQueryType) => void;
alertType: AlertTypes;
2023-06-13 16:26:12 +05:30
runQuery: VoidFunction;
alertDef: AlertDef;
panelType: PANEL_TYPES;
}
export default QuerySection;