Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

Logs explorer design update (#4352)

Yunus Mab4f6adb1983
diff --git a/frontend/jest.config.ts b/frontend/jest.config.ts
index c9a67b3d26..20bf44bf96 100644
--- a/frontend/jest.config.ts
+++ b/frontend/jest.config.ts
@@ -22,7 +22,7 @@ const config: Config.InitialOptions = {
'^.+\\.(js|jsx)$': 'babel-jest',
},
transformIgnorePatterns: [
- 'node_modules/(?!(lodash-es|react-dnd|core-dnd|@react-dnd|dnd-core|react-dnd-html5-backend|axios)/)',
+ 'node_modules/(?!(lodash-es|react-dnd|core-dnd|@react-dnd|dnd-core|react-dnd-html5-backend|axios|@signozhq/design-tokens)/)',
],
setupFilesAfterEnv: ['<rootDir>jest.setup.ts'],
testPathIgnorePatterns: ['/node_modules/', '/public/'],
diff --git a/frontend/package.json b/frontend/package.json
index c104f3715b..1a7acae5ad 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -36,7 +36,9 @@
"@mdx-js/loader": "2.3.0",
"@mdx-js/react": "2.3.0",
"@monaco-editor/react": "^4.3.1",
- "@signozhq/design-tokens": "0.0.6",
+ "@radix-ui/react-tabs": "1.0.4",
+ "@radix-ui/react-tooltip": "1.0.7",
+ "@signozhq/design-tokens": "0.0.8",
"@uiw/react-md-editor": "3.23.5",
"@xstate/react": "^3.0.0",
"ansi-to-html": "0.7.2",
diff --git a/frontend/public/Icons/awwSnap.svg b/frontend/public/Icons/awwSnap.svg
new file mode 100644
index 0000000000..19088a1898
--- /dev/null
+++ b/frontend/public/Icons/awwSnap.svg
@@ -0,0 +1 @@
+<svg width="32" height="33" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.91 28.675c-6.199 0-12.888-3.888-12.888-12.421S9.711 3.832 15.911 3.832c3.444 0 6.621 1.134 8.977 3.2 2.555 2.267 3.91 5.466 3.91 9.222 0 3.755-1.355 6.933-3.91 9.2-2.356 2.066-5.555 3.221-8.977 3.221z" fill="url(#prefix__paint0_radial_2122_6520)"/><path d="M26.552 8.87c1.185 1.91 1.803 4.186 1.803 6.717 0 3.756-1.356 6.933-3.911 9.2-2.356 2.066-5.556 3.222-8.978 3.222-4.013 0-8.221-1.634-10.706-5.098 2.391 3.924 6.889 5.764 11.15 5.764 3.423 0 6.623-1.155 8.978-3.222 2.555-2.266 3.911-5.444 3.911-9.2 0-2.83-.771-5.346-2.247-7.383z" fill="#EB8F00"/><path d="M20.123 22.905c0 1.685-1.846 2.667-4.124 2.667-2.277 0-4.124-.989-4.124-2.667 0-1.677 1.847-3.522 4.124-3.522 2.278 0 4.124 1.838 4.124 3.522zM12.06 14.852l1.88-1.748c.267-.331.307-.778.038-1.045-.353-.355-.98-.269-1.32.136-.018.033-.03.042-.049.075l-1.333 1.938-1.804-1.682c-.027-.03-.042-.034-.067-.062-.42-.32-1.05-.267-1.315.157-.207.32-.07.745.264 1.011l2.313 1.372-1.96 1.833c-.262.326-.31.77-.04 1.044.351.358.978.276 1.32-.127.018-.033.031-.042.051-.075l1.405-2.031 1.706 1.609c.027.029.043.035.067.064.418.322 1.049.273 1.318-.149.206-.32.07-.746-.26-1.013l-2.213-1.307zM20.61 14.852l-1.879-1.748c-.267-.331-.307-.778-.036-1.045.354-.355.978-.269 1.318.136.018.033.034.042.051.075l1.334 1.938 1.806-1.682c.025-.03.04-.034.065-.062.422-.32 1.05-.267 1.317.157.205.32.067.745-.266 1.011L22 15.004l1.96 1.833c.268.33.313.775.042 1.044-.349.358-.976.276-1.318-.127-.02-.033-.033-.042-.051-.075l-1.404-2.031-1.71 1.609c-.024.029-.04.035-.066.064-.418.322-1.046.273-1.315-.149-.21-.32-.074-.746.257-1.013l2.216-1.307zM11.911 8.696c.511.044.711-.645.178-.8a4.07 4.07 0 00-1.289-.133A4.596 4.596 0 007.689 9.14c-.378.4.156.89.556.6a5.829 5.829 0 013.666-1.044zM20.044 8.696a5.85 5.85 0 013.689 1.044c.4.29.933-.2.555-.6a4.645 4.645 0 00-3.11-1.377 4.07 4.07 0 00-1.29.133.408.408 0 00-.282.504c.053.194.24.318.438.296z" fill="#422B0D"/><defs><radialGradient id="prefix__paint0_radial_2122_6520" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(15.91 16.254) scale(12.657)"><stop offset=".5" stop-color="#FDE030"/><stop offset=".92" stop-color="#F7C02B"/><stop offset="1" stop-color="#F4A223"/></radialGradient></defs></svg>
\ No newline at end of file
diff --git a/frontend/public/Icons/emptyState.svg b/frontend/public/Icons/emptyState.svg
new file mode 100644
index 0000000000..b00fbb67ab
--- /dev/null
+++ b/frontend/public/Icons/emptyState.svg
@@ -0,0 +1 @@
+<svg width="32" height="33" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.909 28.672c-6.2 0-12.888-3.889-12.888-12.422C3.02 7.717 9.709 3.83 15.909 3.83c3.444 0 6.622 1.133 8.977 3.2 2.555 2.266 3.91 5.466 3.91 9.221 0 3.756-1.355 6.933-3.91 9.2-2.355 2.066-5.555 3.222-8.977 3.222z" fill="url(#prefix__paint0_radial_2122_5962)"/><path d="M26.551 8.866c1.184 1.911 1.802 4.187 1.802 6.718 0 3.755-1.355 6.933-3.91 9.2-2.356 2.066-5.556 3.221-8.978 3.221-4.013 0-8.23-1.633-10.706-5.097 2.39 3.924 6.886 5.764 11.15 5.764 3.422 0 6.622-1.156 8.978-3.222 2.555-2.267 3.91-5.444 3.91-9.2 0-2.83-.77-5.346-2.246-7.384z" fill="#EB8F00"/><path d="M18.286 7.717c.2-.178.4-.334.623-.49.222-.155.466-.266.688-.4.49-.222 1.023-.444 1.667-.466.156-.022.311.022.489.022.155 0 .333.067.489.111.044.023.089.023.11.045l.112.066.222.112c.134.088.267.2.4.31.245.223.4.512.533.778.067.134.111.267.156.4.044.134.067.267.089.356l.022.067a.502.502 0 01-.933.333c-.067-.133-.133-.245-.178-.333-.044-.09-.111-.178-.155-.267a2.167 2.167 0 00-.378-.4.484.484 0 00-.111-.067c-.045-.022-.067-.044-.09-.066-.044-.023-.066-.023-.11-.045l-.045-.022h-.066c-.156-.044-.312-.067-.49-.044-.355 0-.777.133-1.2.288-.2.09-.421.178-.621.267-.2.111-.423.2-.645.289l-.044.022a.483.483 0 01-.645-.267.497.497 0 01.111-.6zM11.91 10.829a1.662 1.662 0 01-.445.066c-.133 0-.289.023-.422 0-.29 0-.578-.044-.845-.133a5.419 5.419 0 00-1.266-.178c-.178 0-.356.022-.49.067a.87.87 0 00-.355.222c-.222.222-.444.622-.666 1.022a.51.51 0 01-.69.2.541.541 0 01-.266-.533c.045-.245.111-.511.2-.778.111-.267.222-.533.445-.8.222-.266.51-.489.844-.6.333-.11.644-.155.956-.155.6.022 1.11.177 1.6.355.2.067.4.134.6.178.11.022.2.044.31.044.09 0 .223.023.29.023h.088a.48.48 0 01.467.51c.022.267-.133.445-.356.49zM11.555 22.56c.4-.444 1.467-.955 2.956-.933 1.977.044 3.044.933 3.044.933.644.534.355 1.356-.334 1.289-1.11-.133-1.044-.333-3.044-.378-1.444-.022-2.133.2-2.2.2-.4.022-.555-.133-.622-.4a.74.74 0 01.2-.71zM20.065 12.009c.977 0 1.866.822 1.866 2.2 0 1.377-.889 2.2-1.866 2.2-.978 0-1.867-.823-1.867-2.2 0-1.378.89-2.2 1.867-2.2zM10.043 12.386c-.933 0-1.777.778-1.777 2.089 0 1.31.844 2.088 1.777 2.088.934 0 1.778-.777 1.778-2.088s-.844-2.09-1.778-2.09z" fill="#422B0D"/><path d="M19.858 13.02c-.229-.16-.573-.11-.795.21-.223.323-.15.66.08.82.229.16.573.11.795-.21.225-.322.15-.662-.08-.82z" fill="#896024"/><path d="M25.443 13.363h-1.245v2h1.245c.6 0 1.2-.378 1.2-.956v-.089c0-.6-.6-.955-1.2-.955zm-.112 1.71a.745.745 0 01-.755-.732c0-.4.333-.734.755-.734.423 0 .756.334.756.734 0 .4-.333.733-.756.733zM25.354 18.009c-.067 0-.133-.045-.133-.111v-1.022c0-.067.044-.111.11-.111h.023c.067 0 .111.044.111.11v1.023c0 .044-.044.11-.111.11zM25.354 19.697c-.067 0-.133-.044-.133-.11v-1.023c0-.067.044-.111.11-.111h.023c.067 0 .111.044.111.111v1.022c0 .067-.044.111-.111.111zM25.354 21.407c-.067 0-.133-.044-.133-.11v-1.023c0-.067.044-.111.11-.111h.023c.067 0 .111.044.111.111v1.022c0 .067-.044.111-.111.111zM25.354 23.117c-.067 0-.133-.044-.133-.11v-1.023c0-.066.044-.11.11-.11h.023c.067 0 .111.044.111.11v1.022c0 .067-.044.111-.111.111zM25.354 24.83c-.067 0-.133-.044-.133-.11v-1.023c0-.066.044-.11.11-.11h.023c.067 0 .111.044.111.11v1.023c0 .066-.044.11-.111.11zM25.354 26.54c-.067 0-.133-.044-.133-.11v-1.023c0-.066.044-.11.11-.11h.023c.067 0 .111.044.111.11v1.023c0 .066-.044.11-.111.11zM25.354 28.25c-.067 0-.133-.044-.133-.11v-1.022c0-.067.044-.111.11-.111h.023c.067 0 .111.044.111.11v1.023c0 .066-.044.11-.111.11z" fill="#404040"/><path d="M25.354 16.21c-.067 0-.133-.045-.133-.112v-1.022c0-.067.044-.111.11-.111h.023c.067 0 .111.044.111.111v1.022c0 .045-.044.111-.111.111z" fill="#404040"/><path fill-rule="evenodd" clip-rule="evenodd" d="M25.354 16.051a.467.467 0 100 .934.467.467 0 000-.934zm-.689.467a.689.689 0 111.378 0 .689.689 0 01-1.378 0zM25.354 17.765a.467.467 0 100 .933.467.467 0 000-.933zm-.689.466a.689.689 0 111.378 0 .689.689 0 01-1.378 0zM25.354 19.453a.467.467 0 100 .934.467.467 0 000-.934zm-.689.467a.689.689 0 111.378 0 .689.689 0 01-1.378 0zM25.354 21.163a.467.467 0 100 .934.467.467 0 000-.934zm-.689.467a.689.689 0 111.378 0 .689.689 0 01-1.378 0zM25.354 22.852a.467.467 0 100 .933.467.467 0 000-.933zm-.689.466a.689.689 0 111.378 0 .689.689 0 01-1.378 0zM25.354 24.562a.467.467 0 100 .933.467.467 0 000-.933zm-.689.466a.689.689 0 111.378 0 .689.689 0 01-1.378 0zM25.354 26.253a.467.467 0 100 .934.467.467 0 000-.934zm-.689.467a.689.689 0 111.378 0 .689.689 0 01-1.378 0zM25.354 27.963a.467.467 0 100 .934.467.467 0 000-.934zm-.689.467a.689.689 0 111.378 0 .689.689 0 01-1.378 0z" fill="#404040"/><path d="M19.464 18.786a4.578 4.578 0 100-9.155 4.578 4.578 0 000 9.155z" fill="#CCC" fill-opacity=".5"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.464 10.02a4.189 4.189 0 100 8.377 4.189 4.189 0 000-8.377zm-4.966 4.188a4.966 4.966 0 119.933 0 4.966 4.966 0 01-9.933 0z" fill="#404040"/><path d="M22.843 13.942c-.09-.845-.467-1.623-1.09-2.156a3.436 3.436 0 00-2.221-.822c-.823 0-1.622.267-2.245.778a3.079 3.079 0 00-1.088 2.133c0 .067-.067.111-.112.089-.044 0-.088-.045-.088-.111a3.088 3.088 0 01.244-1.333c.178-.423.444-.8.778-1.134.666-.644 1.622-.955 2.533-.955.933 0 1.844.355 2.51 1 .334.333.6.71.779 1.133.177.422.244.889.222 1.333 0 .067-.045.111-.111.111-.067.023-.111-.022-.111-.066z" fill="#fff"/><path d="M10.006 13.247c-.23-.16-.574-.109-.796.211-.222.32-.149.66.08.82.229.16.573.11.796-.21.224-.323.15-.663-.08-.82z" fill="#896024"/><defs><radialGradient id="prefix__paint0_radial_2122_5962" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(15.909 16.25) scale(12.657)"><stop offset=".5" stop-color="#FDE030"/><stop offset=".919" stop-color="#F7C02B"/><stop offset="1" stop-color="#F4A223"/></radialGradient></defs></svg>
\ No newline at end of file
diff --git a/frontend/public/Icons/loading-plane.gif b/frontend/public/Icons/loading-plane.gif
new file mode 100644
index 0000000000..9d5817746b
Binary files /dev/null and b/frontend/public/Icons/loading-plane.gif differ
diff --git a/frontend/public/Icons/promQL.svg b/frontend/public/Icons/promQL.svg
new file mode 100644
index 0000000000..d02bcc2a4d
--- /dev/null
+++ b/frontend/public/Icons/promQL.svg
@@ -0,0 +1 @@
+<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c1 2.538 2.5 2.962 3.5 3.808.942.78 1.481 1.845 1.5 2.961 0 1.122-.527 2.198-1.464 2.992C14.598 12.554 13.326 13 12 13s-2.598-.446-3.536-1.24C7.527 10.968 7 9.892 7 8.77c0-.255 0-.508.1-.762.085.25.236.48.443.673.207.193.463.342.75.437a2.334 2.334 0 001.767-.128c.263-.135.485-.32.65-.539.166-.22.269-.468.301-.727a1.452 1.452 0 00-.11-.765 1.699 1.699 0 00-.501-.644C8 4.115 11 2 12 2zM17 16l-5 6-5-6h10z" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
\ No newline at end of file
diff --git a/frontend/public/Icons/tetra-pack.svg b/frontend/public/Icons/tetra-pack.svg
new file mode 100644
index 0000000000..13fd4f25bf
--- /dev/null
+++ b/frontend/public/Icons/tetra-pack.svg
@@ -0,0 +1 @@
+<svg width="32" height="33" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.309 13.108l-6.704-3.32s-.016-.317.284-.477c.302-.16 5.053-2.107 5.435-2.107.383 0 2.62.431 4.249.793 1.629.363 5.933 1.287 5.953 1.57.02.281-4.404 4.806-4.404 4.806l-4.813-1.265z" fill="#C3FECE"/><path d="M20.423 11.037s-2.811-.826-5.546-1.469c-1.274-.3-5.016-1.084-5.016-1.084s.398-.173.698-.3c.305-.127.547-.193.547-.193s2.44.486 4.253.873c2.453.522 5.886 1.547 5.966 1.709.082.16-.902.464-.902.464z" fill="#fff"/><path d="M14.98 10.26c-.598.415-.011.666 1.09.924 1.207.282 2.127.698 2.903.247.7-.405-1.014-.845-1.8-1.014-.6-.129-1.731-.478-2.193-.158z" fill="#ACB1B2"/><path d="M17.17 11.095c-.005 0 .02-4.869.02-5.049 0-.18-.203-.342.02-.724.222-.382.804-.342.804-.342s2.416-.702 3.38-.945c.964-.242 3.098-.804 3.098-.804l.142 1.22s-2.236.631-3.342.913c-1.107.282-2.616.745-2.616.745l-.222.202.064 4.757s-.206.231-.668.231c-.45-.002-.68-.204-.68-.204z" fill="#FFD816"/><path d="M24.095 3.855c.018.38.22.616.46.616.24 0 .404-.307.369-.707-.038-.398-.296-.58-.516-.506-.22.073-.327.32-.313.597zM18.46 6.422a.209.209 0 01-.123-.038l-1.153-.769a.225.225 0 01-.063-.309.222.222 0 01.31-.062l1.153.769a.224.224 0 01.062.309.228.228 0 01-.187.1z" fill="#FEB804"/><path d="M18.636 6.235a.225.225 0 01-.178-.089c-.295-.393-.633-.84-.693-.909a.225.225 0 01-.031-.284.222.222 0 01.309-.062c.04.027.062.042.771.986.073.098.007.238-.091.312-.04.03-.04.046-.087.046z" fill="#FEB804"/><path d="M18.365 6.609c-.01 0-.022 0-.035-.003l-1.111-.175a.221.221 0 11.069-.438l1.11.176c.12.02.225.042.205.164-.016.107-.129.276-.238.276z" fill="#FEB804"/><path d="M7.596 9.764c.353 0 3.188.744 4.65 1.013 1.463.27 5.878 1.314 6.027 1.342.149.03.12 1.94.12 1.94s2.089 10.8 2.029 11.309c-.06.506-1.431 4.415-1.431 4.415s-.807.12-2.865-.478c-2.057-.598-7.488-2.089-7.817-2.506-.329-.418-.12-5.938-.298-9.338-.182-3.402-.415-7.697-.415-7.697z" fill="#79DD8A"/><path d="M24.06 27.036c.113-.375-.518-4.402-.607-8.101-.089-3.698.229-9.324.076-9.369-.154-.042-5.256 2.553-5.256 2.553s-.022 3.671.04 7.133c.08 4.48.438 10.41.676 10.53.238.12 2.302-1.035 2.924-1.372 1.102-.598 2.058-1.074 2.147-1.374z" fill="#02AB46"/><path d="M20.408 13.82l.011-2.787.914-.45.026 3.056-.422.74-.529-.56z" fill="#DBDFE1"/><path d="M12.322 14.797c-1.973-.211-3.34 1.549-3.233 3.842.127 2.709 1.91 4.704 3.842 5.102 1.93.398 3.802-.44 3.842-3.402.044-3.087-2.669-5.353-4.451-5.542z" fill="#FEFEFD"/><path d="M13.637 17.27s-.4-1.344-1.602-.986c-1.202.357-1.853 2.973.187 4.15 1.96 1.131 3.764-.944 3.133-2.288-.574-1.227-1.718-.876-1.718-.876z" fill="#EF5B44"/><path d="M13.18 15.626c-.136.049-.243.602-.1 1.13.106.396.446.939.643.903.158-.029.278-.651.13-1.173-.174-.602-.516-.918-.674-.86z" fill="#B8CF17"/><path d="M13.15 18.746c-.564-.171-1.2 1.769-.057 2.977 1.26 1.331 2.73.158 2.69-.1-.057-.358-1.044-.615-1.53-1.215-.487-.605-.774-1.562-1.102-1.662z" fill="#FD8F01"/><path d="M11.346 18.417s.113-.849-.673-.802c-.76.046-.574.944-.574.944s-.633.076-.526.778c.08.53.64.524.64.524s-.616.242-.336.945c.249.624.822.373.822.373s-.21.609.287.93c.42.272.787.043.787.043s-.023.52.557.616c.703.115 1.007-.74.507-1.136-.38-.3-.724-.067-.724-.067s.07-.166.004-.357c-.045-.125-.116-.171-.116-.171s.616-.058.516-.758c-.1-.702-.716-.616-.716-.616s.358-.286.216-.802c-.14-.518-.671-.444-.671-.444z" fill="#A281D0"/><path d="M21.04 14.595c-.511 0-2.691-2.167-2.711-2.189a.222.222 0 01.024-.313.224.224 0 01.314.022c.14.155 1.806 1.702 2.286 2 .311-.465 1.322-2.498 2.191-4.333a.224.224 0 01.296-.107.223.223 0 01.106.296c-2.142 4.526-2.353 4.586-2.466 4.617-.013.007-.027.007-.04.007z" fill="#2D802D"/></svg>
\ No newline at end of file
diff --git a/frontend/public/Images/eyesEmoji.svg b/frontend/public/Images/eyesEmoji.svg
new file mode 100644
index 0000000000..5d7e56aa2c
--- /dev/null
+++ b/frontend/public/Images/eyesEmoji.svg
@@ -0,0 +1,19 @@
+<svg width="32" height="33" viewBox="0 0 32 33" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M9.36806 25.9481C5.93935 25.9481 3.15283 21.7098 3.15283 16.5002C3.15283 11.2907 5.94157 7.05238 9.36806 7.05238C12.7945 7.05238 15.5833 11.2907 15.5833 16.5002C15.5833 21.7098 12.7945 25.9481 9.36806 25.9481Z" fill="#FAFAFA"/>
+<path d="M9.36815 7.49694C10.8414 7.49694 12.2524 8.38594 13.3391 10.0017C14.499 11.7241 15.139 14.0333 15.139 16.5003C15.139 18.9673 14.499 21.2764 13.3391 22.9989C12.2524 24.6146 10.8414 25.5036 9.36815 25.5036C7.89489 25.5036 6.48385 24.6146 5.39724 22.9989C4.23508 21.2764 3.59734 18.9673 3.59734 16.5003C3.59734 14.0333 4.23731 11.7241 5.39724 10.0017C6.48385 8.38594 7.89267 7.49694 9.36815 7.49694ZM9.36815 6.60794C5.69056 6.60794 2.7085 11.0374 2.7085 16.5003C2.7085 21.9632 5.69056 26.3926 9.36815 26.3926C13.0457 26.3926 16.0278 21.9632 16.0278 16.5003C16.0278 11.0374 13.0457 6.60794 9.36815 6.60794Z" fill="#B0BEC5"/>
+<path d="M7.47266 15.5762C6.87269 15.0118 7.00602 13.8919 7.77487 13.0741C7.81486 13.0319 7.85486 12.9919 7.89708 12.9541C7.55488 12.7608 7.17934 12.6519 6.78381 12.6519C5.18611 12.6519 3.89062 14.414 3.89062 16.585C3.89062 18.756 5.18611 20.5182 6.78381 20.5182C8.3815 20.5182 9.67699 18.756 9.67699 16.585C9.67699 16.1962 9.63477 15.8184 9.55699 15.4629C8.83703 15.9806 7.97708 16.0495 7.47266 15.5762Z" fill="url(#paint0_linear_2122_5062)"/>
+<path d="M22.6294 26.3932C26.3074 26.3932 29.289 21.9642 29.289 16.5008C29.289 11.0374 26.3074 6.60847 22.6294 6.60847C18.9514 6.60847 15.9697 11.0374 15.9697 16.5008C15.9697 21.9642 18.9514 26.3932 22.6294 26.3932Z" fill="#EEEEEE"/>
+<path d="M22.6283 25.9493C19.2018 25.9493 16.4131 21.711 16.4131 16.5014C16.4131 11.2919 19.2018 7.05357 22.6283 7.05357C26.0548 7.05357 28.8435 11.2919 28.8435 16.5014C28.8435 21.711 26.057 25.9493 22.6283 25.9493Z" fill="#FAFAFA"/>
+<path d="M22.6284 7.49816C24.1017 7.49816 25.5127 8.38716 26.5993 10.0029C27.7592 11.7254 28.3992 14.0345 28.3992 16.5015C28.3992 18.9685 27.7592 21.2777 26.5993 23.0001C25.5127 24.6159 24.1017 25.5049 22.6284 25.5049C21.1551 25.5049 19.7441 24.6159 18.6575 23.0001C17.4976 21.2777 16.8576 18.9685 16.8576 16.5015C16.8576 14.0345 17.4976 11.7254 18.6575 10.0029C19.7441 8.38716 21.1551 7.49816 22.6284 7.49816ZM22.6284 6.60916C18.9508 6.60916 15.9688 11.0386 15.9688 16.5015C15.9688 21.9644 18.9508 26.3939 22.6284 26.3939C26.306 26.3939 29.2881 21.9644 29.2881 16.5015C29.2881 11.0386 26.306 6.60916 22.6284 6.60916Z" fill="#B0BEC5"/>
+<path d="M20.7339 15.5767C20.1339 15.0123 20.2672 13.8924 21.0361 13.0746C21.0761 13.0324 21.1161 12.9924 21.1583 12.9546C20.8161 12.7613 20.4406 12.6524 20.045 12.6524C18.4473 12.6524 17.1519 14.4146 17.1519 16.5856C17.1519 18.7566 18.4473 20.5187 20.045 20.5187C21.6427 20.5187 22.9382 18.7566 22.9382 16.5856C22.9382 16.1967 22.896 15.8189 22.8182 15.4634C22.1005 15.9812 21.2383 16.05 20.7339 15.5767Z" fill="url(#paint1_linear_2122_5062)"/>
+<defs>
+<linearGradient id="paint0_linear_2122_5062" x1="6.78232" y1="12.651" x2="6.78232" y2="20.5188" gradientUnits="userSpaceOnUse">
+<stop stop-color="#424242"/>
+<stop offset="1" stop-color="#212121"/>
+</linearGradient>
+<linearGradient id="paint1_linear_2122_5062" x1="20.0449" y1="12.6515" x2="20.0449" y2="20.5193" gradientUnits="userSpaceOnUse">
+<stop stop-color="#424242"/>
+<stop offset="1" stop-color="#212121"/>
+</linearGradient>
+</defs>
+</svg>
diff --git a/frontend/public/locales/en/explorer.json b/frontend/public/locales/en/explorer.json
index b4ffa6148c..65e4fc2053 100644
--- a/frontend/public/locales/en/explorer.json
+++ b/frontend/public/locales/en/explorer.json
@@ -1,3 +1,4 @@
{
- "name_of_the_view": "Name of the view"
+ "name_of_the_view": "Name of the view",
+ "delete_confirm_message": "Are you sure you want to delete {{viewName}} view? Deleting a view is irreversible and cannot be undone."
}
\ No newline at end of file
diff --git a/frontend/public/locales/en/titles.json b/frontend/public/locales/en/titles.json
index 71ec805100..2c5d2bd887 100644
--- a/frontend/public/locales/en/titles.json
+++ b/frontend/public/locales/en/titles.json
@@ -39,5 +39,7 @@
"LIST_LICENSES": "SigNoz | List of Licenses",
"WORKSPACE_LOCKED": "SigNoz | Workspace Locked",
"SUPPORT": "SigNoz | Support",
+ "LOGS_SAVE_VIEWS": "SigNoz | Logs Save Views",
+ "TRACES_SAVE_VIEWS": "SigNoz | Traces Save Views",
"DEFAULT": "Open source Observability Platform | SigNoz"
}
diff --git a/frontend/scripts/typecheck-staged.sh b/frontend/scripts/typecheck-staged.sh
index ea4fdaad86..e67cf54a72 100644
--- a/frontend/scripts/typecheck-staged.sh
+++ b/frontend/scripts/typecheck-staged.sh
@@ -9,7 +9,7 @@ done
# create temporary tsconfig which includes only passed files
str="{
\"extends\": \"./tsconfig.json\",
- \"include\": [\"src/types/global.d.ts\",\"src/typings/window.ts\", $files]
+ \"include\": [\"src/types/global.d.ts\",\"src/typings/window.ts\", \"src/typings/chartjs-adapter-date-fns.d.ts\", \"src/typings/environment.ts\" ,$files]
}"
echo $str > tsconfig.tmp
@@ -22,4 +22,4 @@ code=$?
# delete temp config
rm ./tsconfig.tmp
-exit $code
\ No newline at end of file
+exit $code
diff --git a/frontend/src/AppRoutes/Private.tsx b/frontend/src/AppRoutes/Private.tsx
index f559dc633f..aafaa932af 100644
--- a/frontend/src/AppRoutes/Private.tsx
+++ b/frontend/src/AppRoutes/Private.tsx
@@ -160,7 +160,7 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
if (currentRoute) {
const { isPrivate, key } = currentRoute;
- if (isPrivate && key !== ROUTES.WORKSPACE_LOCKED) {
+ if (isPrivate && key !== String(ROUTES.WORKSPACE_LOCKED)) {
handlePrivateRoutes(key);
} else {
// no need to fetch the user and make user fetching false
diff --git a/frontend/src/AppRoutes/pageComponents.ts b/frontend/src/AppRoutes/pageComponents.ts
index aca7de9730..749a9ebfe7 100644
--- a/frontend/src/AppRoutes/pageComponents.ts
+++ b/frontend/src/AppRoutes/pageComponents.ts
@@ -15,9 +15,20 @@ export const ServiceMapPage = Loadable(
() => import(/* webpackChunkName: "ServiceMapPage" */ 'modules/Servicemap'),
);
+export const LogsSaveViews = Loadable(
+ () => import(/* webpackChunkName: "LogsSaveViews" */ 'pages/LogsModulePage'), // TODO: Add a wrapper so that the same component can be used in traces
+);
+
export const TracesExplorer = Loadable(
() =>
- import(/* webpackChunkName: "Traces Explorer Page" */ 'pages/TracesExplorer'),
+ import(
+ /* webpackChunkName: "Traces Explorer Page" */ 'pages/TracesModulePage'
+ ),
+);
+
+export const TracesSaveViews = Loadable(
+ () =>
+ import(/* webpackChunkName: "Traces Save Views" */ 'pages/TracesModulePage'),
);
export const TraceFilter = Loadable(
diff --git a/frontend/src/AppRoutes/routes.ts b/frontend/src/AppRoutes/routes.ts
index f6923c809a..dbf7c2a35f 100644
--- a/frontend/src/AppRoutes/routes.ts
+++ b/frontend/src/AppRoutes/routes.ts
@@ -21,6 +21,7 @@ import {
Logs,
LogsExplorer,
LogsIndexToFields,
+ LogsSaveViews,
MySettings,
NewDashboardPage,
OldLogsExplorer,
@@ -39,6 +40,7 @@ import {
TraceDetail,
TraceFilter,
TracesExplorer,
+ TracesSaveViews,
UnAuthorized,
UsageExplorerPage,
} from './pageComponents';
@@ -86,6 +88,13 @@ const routes: AppRoutes[] = [
exact: true,
key: 'SERVICE_MAP',
},
+ {
+ path: ROUTES.LOGS_SAVE_VIEWS,
+ component: LogsSaveViews,
+ isPrivate: true,
+ exact: true,
+ key: 'LOGS_SAVE_VIEWS',
+ },
{
path: ROUTES.TRACE_DETAIL,
exact: true,
@@ -163,6 +172,13 @@ const routes: AppRoutes[] = [
isPrivate: true,
key: 'TRACES_EXPLORER',
},
+ {
+ path: ROUTES.TRACES_SAVE_VIEWS,
+ exact: true,
+ component: TracesSaveViews,
+ isPrivate: true,
+ key: 'TRACES_SAVE_VIEWS',
+ },
{
path: ROUTES.CHANNELS_NEW,
exact: true,
diff --git a/frontend/src/components/CustomTimePicker/CustomTimePicker.styles.scss b/frontend/src/components/CustomTimePicker/CustomTimePicker.styles.scss
index 6e38e84300..14f80a9b93 100644
--- a/frontend/src/components/CustomTimePicker/CustomTimePicker.styles.scss
+++ b/frontend/src/components/CustomTimePicker/CustomTimePicker.styles.scss
@@ -33,6 +33,7 @@
.timeSelection-input {
display: flex;
gap: 8px;
+ height: 33px;
align-items: center;
padding: 4px 8px;
padding-left: 0px !important;
@@ -59,6 +60,26 @@
font-weight: 400 !important;
}
+.info-text {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 4px;
+ cursor: default;
+ color: var(--bg-vanilla-400, #c0c1c3) !important;
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: normal;
+ letter-spacing: 0.14px;
+}
+
+.info-text:hover {
+ &.ant-btn-text {
+ background-color: unset !important;
+ }
+}
+
.lightMode {
.time-options-container {
.time-options-item {
@@ -93,4 +114,8 @@
color: rgba($color: #000000, $alpha: 0.4);
}
}
+
+ .info-text {
+ color: var(--bg-slate-400) !important;
+ }
}
diff --git a/frontend/src/components/CustomTimePicker/CustomTimePicker.tsx b/frontend/src/components/CustomTimePicker/CustomTimePicker.tsx
index 4ded57d250..5586d2230c 100644
--- a/frontend/src/components/CustomTimePicker/CustomTimePicker.tsx
+++ b/frontend/src/components/CustomTimePicker/CustomTimePicker.tsx
@@ -4,22 +4,43 @@ import './CustomTimePicker.styles.scss';
import { Input, Popover, Tooltip, Typography } from 'antd';
import cx from 'classnames';
+import { DateTimeRangeType } from 'container/TopNav/CustomDateTimeModal';
import { Options } from 'container/TopNav/DateTimeSelection/config';
+import {
+ FixedDurationSuggestionOptions,
+ RelativeDurationSuggestionOptions,
+} from 'container/TopNav/DateTimeSelectionV2/config';
import dayjs from 'dayjs';
+import { defaultTo, noop } from 'lodash-es';
import debounce from 'lodash-es/debounce';
import { CheckCircle, ChevronDown, Clock } from 'lucide-react';
-import { ChangeEvent, useEffect, useState } from 'react';
+import {
+ ChangeEvent,
+ Dispatch,
+ SetStateAction,
+ useEffect,
+ useState,
+} from 'react';
import { popupContainer } from 'utils/selectPopupContainer';
+import CustomTimePickerPopoverContent from './CustomTimePickerPopoverContent';
+
const maxAllowedMinTimeInMonths = 6;
interface CustomTimePickerProps {
onSelect: (value: string) => void;
onError: (value: boolean) => void;
- items: any[];
selectedValue: string;
selectedTime: string;
onValidCustomDateChange: ([t1, t2]: any[]) => void;
+ open: boolean;
+ setOpen: Dispatch<SetStateAction<boolean>>;
+ items: any[];
+ newPopover?: boolean;
+ customDateTimeVisible?: boolean;
+ setCustomDTPickerVisible?: Dispatch<SetStateAction<boolean>>;
+ onCustomDateHandler?: (dateTimeRange: DateTimeRangeType) => void;
+ handleGoLive?: () => void;
}
function CustomTimePicker({
@@ -28,9 +49,15 @@ function CustomTimePicker({
items,
selectedValue,
selectedTime,
+ open,
+ setOpen,
onValidCustomDateChange,
+ newPopover,
+ customDateTimeVisible,
+ setCustomDTPickerVisible,
+ onCustomDateHandler,
+ handleGoLive,
}: CustomTimePickerProps): JSX.Element {
- const [open, setOpen] = useState(false);
const [
selectedTimePlaceholderValue,
setSelectedTimePlaceholderValue,
@@ -56,6 +83,20 @@ function CustomTimePicker({
return Options[index].label;
}
}
+ for (
+ let index = 0;
+ index < RelativeDurationSuggestionOptions.length;
+ index++
+ ) {
+ if (RelativeDurationSuggestionOptions[index].value === selectedTime) {
+ return RelativeDurationSuggestionOptions[index].label;
+ }
+ }
+ for (let index = 0; index < FixedDurationSuggestionOptions.length; index++) {
+ if (FixedDurationSuggestionOptions[index].value === selectedTime) {
+ return FixedDurationSuggestionOptions[index].label;
+ }
+ }
return '';
};
@@ -140,19 +181,25 @@ function CustomTimePicker({
debouncedHandleInputChange(inputValue);
};
+ const handleSelect = (label: string, value: string): void => {
+ onSelect(value);
+ setSelectedTimePlaceholderValue(label);
+ setInputStatus('');
+ onError(false);
+ setInputErrorMessage(null);
+ setInputValue('');
+ if (value !== 'custom') {
+ hide();
+ }
+ };
+
const content = (
<div className="time-selection-dropdown-content">
<div className="time-options-container">
- {items.map(({ value, label }) => (
+ {items?.map(({ value, label }) => (
<div
onClick={(): void => {
- onSelect(value);
- setSelectedTimePlaceholderValue(label);
- setInputStatus('');
- onError(false);
- setInputErrorMessage(null);
- setInputValue('');
- hide();
+ handleSelect(label, value);
}}
key={value}
className={cx(
@@ -184,11 +231,27 @@ function CustomTimePicker({
)}
placement="bottomRight"
getPopupContainer={popupContainer}
- content={content}
+ rootClassName="date-time-root"
+ content={
+ newPopover ? (
+ <CustomTimePickerPopoverContent
+ setIsOpen={setOpen}
+ customDateTimeVisible={defaultTo(customDateTimeVisible, false)}
+ setCustomDTPickerVisible={defaultTo(setCustomDTPickerVisible, noop)}
+ onCustomDateHandler={defaultTo(onCustomDateHandler, noop)}
+ onSelectHandler={handleSelect}
+ handleGoLive={defaultTo(handleGoLive, noop)}
+ options={items}
+ selectedTime={selectedTime}
+ />
+ ) : (
+ content
+ )
+ }
arrow={false}
+ trigger="hover"
open={open}
onOpenChange={handleOpenChange}
- trigger={['click']}
style={{
padding: 0,
}}
@@ -236,3 +299,11 @@ function CustomTimePicker({
}
export default CustomTimePicker;
+
+CustomTimePicker.defaultProps = {
+ newPopover: false,
+ customDateTimeVisible: false,
+ setCustomDTPickerVisible: noop,
+ onCustomDateHandler: noop,
+ handleGoLive: noop,
+};
diff --git a/frontend/src/components/CustomTimePicker/CustomTimePickerPopoverContent.tsx b/frontend/src/components/CustomTimePicker/CustomTimePickerPopoverContent.tsx
new file mode 100644
index 0000000000..e7bd571f35
--- /dev/null
+++ b/frontend/src/components/CustomTimePicker/CustomTimePickerPopoverContent.tsx
@@ -0,0 +1,133 @@
+import './CustomTimePicker.styles.scss';
+
+import { Button, DatePicker } from 'antd';
+import cx from 'classnames';
+import ROUTES from 'constants/routes';
+import { DateTimeRangeType } from 'container/TopNav/CustomDateTimeModal';
+import {
+ Option,
+ RelativeDurationSuggestionOptions,
+} from 'container/TopNav/DateTimeSelectionV2/config';
+import dayjs, { Dayjs } from 'dayjs';
+import { Dispatch, SetStateAction, useMemo } from 'react';
+import { useSelector } from 'react-redux';
+import { useLocation } from 'react-router-dom';
+import { AppState } from 'store/reducers';
+import { GlobalReducer } from 'types/reducer/globalTime';
+
+interface CustomTimePickerPopoverContentProps {
+ options: any[];
+ setIsOpen: Dispatch<SetStateAction<boolean>>;
+ customDateTimeVisible: boolean;
+ setCustomDTPickerVisible: Dispatch<SetStateAction<boolean>>;
+ onCustomDateHandler: (dateTimeRange: DateTimeRangeType) => void;
+ onSelectHandler: (label: string, value: string) => void;
+ handleGoLive: () => void;
+ selectedTime: string;
+}
+
+function CustomTimePickerPopoverContent({
+ options,
+ setIsOpen,
+ customDateTimeVisible,
+ setCustomDTPickerVisible,
+ onCustomDateHandler,
+ onSelectHandler,
+ handleGoLive,
+ selectedTime,
+}: CustomTimePickerPopoverContentProps): JSX.Element {
+ const { RangePicker } = DatePicker;
+ const { pathname } = useLocation();
+
+ const { maxTime, minTime } = useSelector<AppState, GlobalReducer>(
+ (state) => state.globalTime,
+ );
+
+ const isLogsExplorerPage = useMemo(() => pathname === ROUTES.LOGS_EXPLORER, [
+ pathname,
+ ]);
+
+ const disabledDate = (current: Dayjs): boolean => {
+ const currentDay = dayjs(current);
+ return currentDay.isAfter(dayjs());
+ };
+
+ const onPopoverClose = (visible: boolean): void => {
+ if (!visible) {
+ setCustomDTPickerVisible(false);
+ }
+ setIsOpen(visible);
+ };
+
+ const onModalOkHandler = (date_time: any): void => {
+ if (date_time?.[1]) {
+ onPopoverClose(false);
+ }
+ onCustomDateHandler(date_time);
+ };
+ function getTimeChips(options: Option[]): JSX.Element {
+ return (
+ <div className="relative-date-time-section">
+ {options.map((option) => (
+ <Button
+ type="text"
+ className="time-btns"
+ key={option.label + option.value}
+ onClick={(): void => {
+ onSelectHandler(option.label, option.value);
+ }}
+ >
+ {option.label}
+ </Button>
+ ))}
+ </div>
+ );
+ }
+
+ return (
+ <div className="date-time-popover">
+ <div className="date-time-options">
+ {isLogsExplorerPage && (
+ <Button className="data-time-live" type="text" onClick={handleGoLive}>
+ Live
+ </Button>
+ )}
+ {options.map((option) => (
+ <Button
+ type="text"
+ key={option.label + option.value}
+ onClick={(): void => {
+ onSelectHandler(option.label, option.value);
+ }}
+ className={cx(
+ 'date-time-options-btn',
+ selectedTime === option.value && 'active',
+ )}
+ >
+ {option.label}
+ </Button>
+ ))}
+ </div>
+ <div className="relative-date-time">
+ {selectedTime === 'custom' || customDateTimeVisible ? (
+ <RangePicker
+ disabledDate={disabledDate}
+ allowClear
+ onCalendarChange={onModalOkHandler}
+ // eslint-disable-next-line react/jsx-props-no-spreading
+ {...(selectedTime === 'custom' && {
+ defaultValue: [dayjs(minTime / 1000000), dayjs(maxTime / 1000000)],
+ })}
+ />
+ ) : (
+ <div>
+ <div className="time-heading">RELATIVE TIMES</div>
+ <div>{getTimeChips(RelativeDurationSuggestionOptions)}</div>
+ </div>
+ )}
+ </div>
+ </div>
+ );
+}
+
+export default CustomTimePickerPopoverContent;
diff --git a/frontend/src/components/ExplorerCard/ExplorerCard.tsx b/frontend/src/components/ExplorerCard/ExplorerCard.tsx
index b55f019bc1..73d7a24c74 100644
--- a/frontend/src/components/ExplorerCard/ExplorerCard.tsx
+++ b/frontend/src/components/ExplorerCard/ExplorerCard.tsx
@@ -6,7 +6,6 @@ import {
} from '@ant-design/icons';
import {
Button,
- Card,
Col,
Dropdown,
MenuProps,
@@ -152,95 +151,100 @@ function ExplorerCard({
const saveButtonType = isQueryUpdated ? 'default' : 'primary';
const saveButtonIcon = isQueryUpdated ? null : <SaveOutlined />;
+ const showSaveView = false;
+
return (
<>
- <ExplorerCardHeadContainer size="small">
- <Row align="middle">
- <Col span={6}>
- <Space>
- <Typography>Query Builder</Typography>
- <TextToolTip
- url={ExploreHeaderToolTip.url}
- text={ExploreHeaderToolTip.text}
- useFilledIcon={false}
- />
- </Space>
- </Col>
- <OffSetCol span={18}>
- <Space size="large">
- {viewsData?.data.data && viewsData?.data.data.length && (
- <Space>
- <Select
- getPopupContainer={popupContainer}
- loading={isLoading || isRefetching}
- showSearch
- placeholder="Select a view"
- dropdownStyle={DropDownOverlay}
- dropdownMatchSelectWidth={false}
- optionLabelProp="value"
- value={viewName || undefined}
+ {showSaveView && (
+ <ExplorerCardHeadContainer size="small">
+ <Row align="middle">
+ <Col span={6}>
+ <Space>
+ <Typography>Query Builder</Typography>
+ <TextToolTip
+ url={ExploreHeaderToolTip.url}
+ text={ExploreHeaderToolTip.text}
+ useFilledIcon={false}
+ />
+ </Space>
+ </Col>
+ <OffSetCol span={18}>
+ <Space size="large">
+ {viewsData?.data.data && viewsData?.data.data.length && (
+ <Space>
+ <Select
+ getPopupContainer={popupContainer}
+ loading={isLoading || isRefetching}
+ showSearch
+ placeholder="Select a view"
+ dropdownStyle={DropDownOverlay}
+ dropdownMatchSelectWidth={false}
+ optionLabelProp="value"
+ value={viewName || undefined}
+ >
+ {viewsData?.data.data.map((view) => (
+ <Select.Option key={view.uuid} value={view.name}>
+ <MenuItemGenerator
+ viewName={view.name}
+ viewKey={viewKey}
+ createdBy={view.createdBy}
+ uuid={view.uuid}
+ refetchAllView={refetchAllView}
+ viewData={viewsData.data.data}
+ sourcePage={sourcepage}
+ />
+ </Select.Option>
+ ))}
+ </Select>
+ </Space>
+ )}
+ {isQueryUpdated && (
+ <Button
+ type="primary"
+ icon={<SaveOutlined />}
+ onClick={onUpdateQueryHandler}
>
- {viewsData?.data.data.map((view) => (
- <Select.Option key={view.uuid} value={view.name}>
- <MenuItemGenerator
- viewName={view.name}
- viewKey={viewKey}
- createdBy={view.createdBy}
- uuid={view.uuid}
- refetchAllView={refetchAllView}
- viewData={viewsData.data.data}
- sourcePage={sourcepage}
- />
- </Select.Option>
- ))}
- </Select>
- </Space>
- )}
- {isQueryUpdated && (
- <Button
- type="primary"
- icon={<SaveOutlined />}
- onClick={onUpdateQueryHandler}
- >
- Save changes
- </Button>
- )}
- <Popover
- getPopupContainer={popupContainer}
- placement="bottomLeft"
- trigger="click"
- content={
- <SaveViewWithName
- sourcePage={sourcepage}
- handlePopOverClose={handleOpenChange}
- refetchAllView={refetchAllView}
- />
- }
- showArrow={false}
- open={isOpen}
- onOpenChange={handleOpenChange}
- >
- <Button
- type={saveButtonType}
- icon={saveButtonIcon}
- data-testid="traces-save-view-action"
+ Save changes
+ </Button>
+ )}
+ <Popover
+ getPopupContainer={popupContainer}
+ placement="bottomLeft"
+ trigger="click"
+ content={
+ <SaveViewWithName
+ sourcePage={sourcepage}
+ handlePopOverClose={handleOpenChange}
+ refetchAllView={refetchAllView}
+ />
+ }
+ showArrow={false}
+ open={isOpen}
+ onOpenChange={handleOpenChange}
>
- {isQueryUpdated
- ? SaveButtonText.SAVE_AS_NEW_VIEW
- : SaveButtonText.SAVE_VIEW}
- </Button>
- </Popover>
- <ShareAltOutlined onClick={onCopyUrlHandler} />
- {viewKey && (
- <Dropdown trigger={['click']} menu={moreOptionMenu}>
- <MoreOutlined />
- </Dropdown>
- )}
- </Space>
- </OffSetCol>
- </Row>
- </ExplorerCardHeadContainer>
- <Card>{children}</Card>
+ <Button
+ type={saveButtonType}
+ icon={saveButtonIcon}
+ data-testid="traces-save-view-action"
+ >
+ {isQueryUpdated
+ ? SaveButtonText.SAVE_AS_NEW_VIEW
+ : SaveButtonText.SAVE_VIEW}
+ </Button>
+ </Popover>
+ <ShareAltOutlined onClick={onCopyUrlHandler} />
+ {viewKey && (
+ <Dropdown trigger={['click']} menu={moreOptionMenu}>
+ <MoreOutlined />
+ </Dropdown>
+ )}
+ </Space>
+ </OffSetCol>
+ </Row>
+ </ExplorerCardHeadContainer>
+ )}
+
+ <div>{children}</div>
</>
);
}
diff --git a/frontend/src/components/ExplorerCard/styles.ts b/frontend/src/components/ExplorerCard/styles.ts
index 63ed068c53..56c3d38c75 100644
--- a/frontend/src/components/ExplorerCard/styles.ts
+++ b/frontend/src/components/ExplorerCard/styles.ts
@@ -3,6 +3,7 @@ import styled, { CSSProperties } from 'styled-components';
export const ExplorerCardHeadContainer = styled(Card)`
margin: 1rem 0;
+ padding: 0;
`;
export const OffSetCol = styled(Col)`
diff --git a/frontend/src/components/ExplorerCard/test/ExplorerCard.test.tsx b/frontend/src/components/ExplorerCard/test/ExplorerCard.test.tsx
index 7efc8a65cd..1fdb29d281 100644
--- a/frontend/src/components/ExplorerCard/test/ExplorerCard.test.tsx
+++ b/frontend/src/components/ExplorerCard/test/ExplorerCard.test.tsx
@@ -1,4 +1,4 @@
-import { fireEvent, render, screen } from '@testing-library/react';
+import { render, screen } from '@testing-library/react';
import ROUTES from 'constants/routes';
import MockQueryClientProvider from 'providers/test/MockQueryClientProvider';
import { DataSource } from 'types/common/queryBuilder';
@@ -46,7 +46,7 @@ describe('ExplorerCard', () => {
<ExplorerCard sourcepage={DataSource.TRACES}>child</ExplorerCard>
</MockQueryClientProvider>,
);
- expect(screen.getByText('Query Builder')).toBeInTheDocument();
+ expect(screen.queryByText('Query Builder')).not.toBeInTheDocument();
});
it('renders a save view button', () => {
@@ -55,19 +55,6 @@ describe('ExplorerCard', () => {
<ExplorerCard sourcepage={DataSource.TRACES}>child</ExplorerCard>
</MockQueryClientProvider>,
);
- expect(screen.getByText('Save view')).toBeInTheDocument();
- });
-
- it('should see all the view listed in dropdown', async () => {
- const screen = render(
- <ExplorerCard sourcepage={DataSource.TRACES}>Mock Children</ExplorerCard>,
- );
- const selectPlaceholder = screen.getByText('Select a view');
-
- fireEvent.mouseDown(selectPlaceholder);
- const viewNameText = await screen.getAllByText('View 1');
- viewNameText.forEach((element) => {
- expect(element).toBeInTheDocument();
- });
+ expect(screen.queryByText('Save view')).not.toBeInTheDocument();
});
});
diff --git a/frontend/src/components/ExplorerCard/utils.ts b/frontend/src/components/ExplorerCard/utils.ts
index 3a2eeac95f..48af06bb3d 100644
--- a/frontend/src/components/ExplorerCard/utils.ts
+++ b/frontend/src/components/ExplorerCard/utils.ts
@@ -14,7 +14,7 @@ import {
SaveViewHandlerProps,
} from './types';
-const showErrorNotification = (
+export const showErrorNotification = (
notifications: NotificationInstance,
err: Error,
): void => {
@@ -90,6 +90,14 @@ export const isQueryUpdatedInView = ({
// Omitting id from aggregateAttribute and groupBy
const updatedCurrentQuery = omitIdFromQuery(stagedQuery);
+ if (
+ updatedCurrentQuery?.builder === undefined ||
+ updatedCurrentQuery.clickhouse_sql === undefined ||
+ updatedCurrentQuery.promql === undefined
+ ) {
+ return false;
+ }
+
return (
panelType !== currentPanelType ||
!isEqual(query.builder, updatedCurrentQuery?.builder) ||
diff --git a/frontend/src/components/LogDetail/LogDetail.interfaces.ts b/frontend/src/components/LogDetail/LogDetail.interfaces.ts
index a67dfc10c8..991fb4488e 100644
--- a/frontend/src/components/LogDetail/LogDetail.interfaces.ts
+++ b/frontend/src/components/LogDetail/LogDetail.interfaces.ts
@@ -3,8 +3,11 @@ import { AddToQueryHOCProps } from 'components/Logs/AddToQueryHOC';
import { ActionItemProps } from 'container/LogDetailedView/ActionItem';
import { ILog } from 'types/api/logs/log';
+import { VIEWS } from './constants';
+
export type LogDetailProps = {
log: ILog | null;
+ selectedTab: VIEWS;
} & Pick<AddToQueryHOCProps, 'onAddToQuery'> &
- Pick<ActionItemProps, 'onClickActionItem'> &
+ Partial<Pick<ActionItemProps, 'onClickActionItem'>> &
Pick<DrawerProps, 'onClose'>;
diff --git a/frontend/src/components/LogDetail/LogDetails.styles.scss b/frontend/src/components/LogDetail/LogDetails.styles.scss
new file mode 100644
index 0000000000..0dcdc1e5c1
--- /dev/null
+++ b/frontend/src/components/LogDetail/LogDetails.styles.scss
@@ -0,0 +1,230 @@
+.log-detail-drawer {
+ border-left: 1px solid var(--bg-slate-500);
+ background: var(--bg-ink-400);
+ box-shadow: -4px 10px 16px 2px rgba(0, 0, 0, 0.2);
+
+ .ant-drawer-header {
+ padding: 8px 16px;
+ border-bottom: none;
+
+ align-items: stretch;
+
+ border-bottom: 1px solid var(--bg-slate-500);
+ background: var(--bg-ink-400);
+ }
+
+ .ant-drawer-close {
+ margin-inline-end: 0px;
+ }
+
+ .ant-drawer-body {
+ padding: 16px;
+ }
+
+ .title {
+ color: var(--text-vanilla-400);
+ font-family: Inter;
+ font-size: var(--font-size-sm);
+ font-style: normal;
+ font-weight: var(--font-weight-normal);
+ line-height: 20px; /* 142.857% */
+ letter-spacing: -0.07px;
+ }
+
+ .radio-button {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding-top: var(--padding-1);
+ border: 1px solid var(--bg-slate-400);
+ background: var(--bg-ink-300);
+ box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
+ }
+
+ .log-detail-drawer__log {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ position: relative;
+
+ .log-body {
+ font-family: 'SF Mono';
+ font-family: 'Space Mono', monospace;
+
+ font-size: var(--font-size-sm);
+ font-weight: var(--font-weight-normal);
+ line-height: 18px;
+ letter-spacing: -0.07px;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ color: var(--text-vanilla-400);
+ opacity: 0.6;
+ }
+
+ .log-type-indicator {
+ height: 24px;
+ border: 2px solid var(--bg-slate-400);
+ border-radius: 5px;
+ margin-left: 0;
+
+ &.INFO {
+ border-color: #1d212d;
+ }
+
+ &.WARNING {
+ border-color: #ffcd56;
+ }
+
+ &.ERROR {
+ border-color: #e5484d;
+ }
+ }
+
+ .log-overflow-shadow {
+ background: linear-gradient(270deg, #121317 10.4%, rgba(18, 19, 23, 0) 100%);
+
+ width: 196px;
+ position: absolute;
+ right: 0;
+ }
+ }
+
+ .tabs-and-search {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin: 16px 0;
+
+ .action-btn {
+ border-radius: 2px;
+ border: 1px solid var(--bg-slate-400);
+ background: var(--bg-ink-300);
+ box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .json-action-btn {
+ display: flex;
+ gap: 8px;
+ }
+ }
+
+ .views-tabs {
+ color: var(--text-vanilla-400);
+
+ .view-title {
+ display: flex;
+ gap: var(--margin-2);
+ align-items: center;
+ justify-content: center;
+ font-size: var(--font-size-xs);
+ font-style: normal;
+ font-weight: var(--font-weight-normal);
+ }
+
+ .tab {
+ border: 1px solid var(--bg-slate-400);
+ width: 114px;
+ }
+
+ .tab::before {
+ background: var(--bg-slate-400);
+ }
+
+ .selected_view {
+ background: var(--bg-slate-300);
+ color: var(--text-vanilla-100);
+ border: 1px solid var(--bg-slate-400);
+ }
+
+ .selected_view::before {
+ background: var(--bg-slate-400);
+ }
+ }
+
+ .search-input {
+ margin-top: var(--margin-2);
+ border: 1px solid var(--bg-slate-400);
+ height: 46px;
+ padding: var(--padding-1) var(--padding-2);
+ box-shadow: none;
+ border-radius: 0;
+ }
+
+ .ant-drawer-close {
+ padding: 0px;
+ }
+}
+
+.lightMode {
+ .ant-drawer-header {
+ border-bottom: 1px solid var(--bg-vanilla-400);
+ background: var(--bg-vanilla-100);
+ }
+
+ .log-detail-drawer {
+ .title {
+ color: var(--text-ink-300);
+ }
+
+ .log-detail-drawer__log {
+ .log-overflow-shadow {
+ background: linear-gradient(
+ 270deg,
+ var(--bg-vanilla-100) 10.4%,
+ rgba(255, 255, 255, 0) 100%
+ );
+ }
+
+ .log-type-indicator {
+ border: 2px solid var(--bg-vanilla-400);
+ }
+
+ .ant-typography {
+ color: var(--text-ink-300);
+ background: transparent;
+ }
+ }
+
+ .radio-button {
+ border: 1px solid var(--bg-vanilla-400);
+ background: var(--bg-vanilla-100);
+ color: var(--text-ink-300);
+ }
+
+ .views-tabs {
+ .tab {
+ background: var(--bg-vanilla-100);
+ }
+
+ .selected_view {
+ background: var(--bg-vanilla-300);
+ border: 1px solid var(--bg-slate-300);
+ color: var(--text-ink-400);
+ }
+
+ .selected_view::before {
+ background: var(--bg-vanilla-300);
+ border-left: 1px solid var(--bg-slate-300);
+ }
+ }
+
+ .tabs-and-search {
+ .action-btn {
+ border: 1px solid var(--bg-vanilla-400);
+ background: var(--bg-vanilla-100);
+ color: var(--text-ink-300);
+ }
+ }
+
+ .search-input {
+ border: 1px solid var(--bg-vanilla-200);
+ background: var(--bg-vanilla-100);
+ color: var(--text-ink-300);
+ }
+ }
+}
diff --git a/frontend/src/components/LogDetail/QueryBuilderSearchWrapper.styles.scss b/frontend/src/components/LogDetail/QueryBuilderSearchWrapper.styles.scss
new file mode 100644
index 0000000000..e3da355621
--- /dev/null
+++ b/frontend/src/components/LogDetail/QueryBuilderSearchWrapper.styles.scss
@@ -0,0 +1,10 @@
+.query-builder-search-wrapper {
+ margin-top: 10px;
+ height: 46px;
+ border: 1px solid var(--bg-slate-400);
+ border-bottom: none;
+
+ .ant-select-selector {
+ border: none !important;
+ }
+}
\ No newline at end of file
diff --git a/frontend/src/components/LogDetail/QueryBuilderSearchWrapper.tsx b/frontend/src/components/LogDetail/QueryBuilderSearchWrapper.tsx
new file mode 100644
index 0000000000..72d18b7e12
--- /dev/null
+++ b/frontend/src/components/LogDetail/QueryBuilderSearchWrapper.tsx
@@ -0,0 +1,77 @@
+import './QueryBuilderSearchWrapper.styles.scss';
+
+import useInitialQuery from 'container/LogsExplorerContext/useInitialQuery';
+import QueryBuilderSearch from 'container/QueryBuilder/filters/QueryBuilderSearch';
+import { Dispatch, SetStateAction, useEffect } from 'react';
+import { ILog } from 'types/api/logs/log';
+import { Query, TagFilter } from 'types/api/queryBuilder/queryBuilderData';
+
+function QueryBuilderSearchWrapper({
+ log,
+ filters,
+ contextQuery,
+ isEdit,
+ suffixIcon,
+ setFilters,
+ setContextQuery,
+}: QueryBuilderSearchWraperProps): JSX.Element {
+ const initialContextQuery = useInitialQuery(log);
+
+ useEffect(() => {
+ setContextQuery(initialContextQuery);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
+ const handleSearch = (tagFilters: TagFilter): void => {
+ const tagFiltersLength = tagFilters.items.length;
+
+ if (
+ (!tagFiltersLength && (!filters || !filters.items.length)) ||
+ tagFiltersLength === filters?.items.length ||
+ !contextQuery
+ )
+ return;
+
+ const nextQuery: Query = {
+ ...contextQuery,
+ builder: {
+ ...contextQuery.builder,
+ queryData: contextQuery.builder.queryData.map((item) => ({
+ ...item,
+ filters: tagFilters,
+ })),
+ },
+ };
+
+ setFilters({ ...tagFilters });
+ setContextQuery({ ...nextQuery });
+ };
+
+ // eslint-disable-next-line react/jsx-no-useless-fragment
+ if (!contextQuery || !isEdit) return <></>;
+
+ return (
+ <QueryBuilderSearch
+ query={contextQuery?.builder.queryData[0]}
+ onChange={handleSearch}
+ className="query-builder-search-wrapper"
+ suffixIcon={suffixIcon}
+ />
+ );
+}
+
+interface QueryBuilderSearchWraperProps {
+ log: ILog;
+ isEdit: boolean;
+ contextQuery: Query | undefined;
+ setContextQuery: Dispatch<SetStateAction<Query | undefined>>;
+ filters: TagFilter | null;
+ setFilters: Dispatch<SetStateAction<TagFilter | null>>;
+ suffixIcon?: React.ReactNode;
+}
+
+QueryBuilderSearchWrapper.defaultProps = {
+ suffixIcon: undefined,
+};
+
+export default QueryBuilderSearchWrapper;
diff --git a/frontend/src/components/LogDetail/constants.ts b/frontend/src/components/LogDetail/constants.ts
new file mode 100644
index 0000000000..92199d4441
--- /dev/null
+++ b/frontend/src/components/LogDetail/constants.ts
@@ -0,0 +1,7 @@
+export const VIEW_TYPES = {
+ OVERVIEW: 'OVERVIEW',
+ JSON: 'JSON',
+ CONTEXT: 'CONTEXT',
+} as const;
+
+export type VIEWS = typeof VIEW_TYPES[keyof typeof VIEW_TYPES];
diff --git a/frontend/src/components/LogDetail/index.tsx b/frontend/src/components/LogDetail/index.tsx
index b787322ca7..ffa1c07e9c 100644
--- a/frontend/src/components/LogDetail/index.tsx
+++ b/frontend/src/components/LogDetail/index.tsx
@@ -1,50 +1,207 @@
-import { Drawer, Tabs } from 'antd';
+/* eslint-disable sonarjs/cognitive-complexity */
+import './LogDetails.styles.scss';
+
+import { Color, Spacing } from '@signozhq/design-tokens';
+import { Button, Divider, Drawer, Radio, Tooltip, Typography } from 'antd';
+import { RadioChangeEvent } from 'antd/lib';
+import cx from 'classnames';
+import { LogType } from 'components/Logs/LogStateIndicator/LogStateIndicator';
+import ContextView from 'container/LogDetailedView/ContextView/ContextView';
import JSONView from 'container/LogDetailedView/JsonView';
-import TableView from 'container/LogDetailedView/TableView';
-import { useMemo } from 'react';
+import Overview from 'container/LogDetailedView/Overview';
+import { aggregateAttributesResourcesToString } from 'container/LogDetailedView/utils';
+import { useIsDarkMode } from 'hooks/useDarkMode';
+import { useNotifications } from 'hooks/useNotifications';
+import {
+ Braces,
+ Copy,
+ Filter,
+ HardHat,
+ Table,
+ TextSelect,
+ X,
+} from 'lucide-react';
+import { useState } from 'react';
+import { useCopyToClipboard } from 'react-use';
+import { Query, TagFilter } from 'types/api/queryBuilder/queryBuilderData';
+import { VIEW_TYPES, VIEWS } from './constants';
import { LogDetailProps } from './LogDetail.interfaces';
+import QueryBuilderSearchWrapper from './QueryBuilderSearchWrapper';
function LogDetail({
log,
onClose,
onAddToQuery,
onClickActionItem,
+ selectedTab,
}: LogDetailProps): JSX.Element {
- const items = useMemo(
- () => [
- {
- label: 'Table',
- key: '1',
- children: log && (
- <TableView
- logData={log}
- onAddToQuery={onAddToQuery}
- onClickActionItem={onClickActionItem}
- />
- ),
- },
- {
- label: 'JSON',
- key: '2',
- children: log && <JSONView logData={log} />,
- },
- ],
- [log, onAddToQuery, onClickActionItem],
- );
+ const [, copyToClipboard] = useCopyToClipboard();
+ const [selectedView, setSelectedView] = useState<VIEWS>(selectedTab);
+
+ const [isFilterVisibile, setIsFilterVisible] = useState<boolean>(false);
+
+ const [contextQuery, setContextQuery] = useState<Query | undefined>();
+ const [filters, setFilters] = useState<TagFilter | null>(null);
+ const [isEdit, setIsEdit] = useState<boolean>(false);
+
+ const isDarkMode = useIsDarkMode();
+
+ const { notifications } = useNotifications();
+
+ const LogJsonData = log ? aggregateAttributesResourcesToString(log) : '';
+
+ const handleModeChange = (e: RadioChangeEvent): void => {
+ setSelectedView(e.target.value);
+ setIsEdit(false);
+ setIsFilterVisible(false);
+ };
+
+ const handleFilterVisible = (): void => {
+ setIsFilterVisible(!isFilterVisibile);
+ setIsEdit(!isEdit);
+ };
+
+ const drawerCloseHandler = (
+ e: React.MouseEvent | React.KeyboardEvent,
+ ): void => {
+ if (onClose) {
+ onClose(e);
+ }
+ };
+
+ const handleJSONCopy = (): void => {
+ copyToClipboard(LogJsonData);
+ notifications.success({
+ message: 'Copied to clipboard',
+ });
+ };
+
+ if (!log) {
+ // eslint-disable-next-line react/jsx-no-useless-fragment
+ return <></>;
+ }
+
+ const logType = log?.attributes_string?.log_level || LogType.INFO;
return (
<Drawer
width="60%"
- title="Log Details"
+ title={
+ <>
+ <Divider type="vertical" className={cx('log-type-indicator', LogType)} />
+ <Typography.Text className="title">Log details</Typography.Text>
+ </>
+ }
placement="right"
- closable
- onClose={onClose}
+ // closable
+ onClose={drawerCloseHandler}
open={log !== null}
- style={{ overscrollBehavior: 'contain' }}
+ style={{
+ overscrollBehavior: 'contain',
+ background: isDarkMode ? Color.BG_INK_400 : Color.BG_VANILLA_100,
+ }}
+ className="log-detail-drawer"
destroyOnClose
+ closeIcon={<X size={16} style={{ marginTop: Spacing.MARGIN_1 }} />}
>
- <Tabs defaultActiveKey="1" items={items} />
+ <div className="log-detail-drawer__log">
+ <Divider type="vertical" className={cx('log-type-indicator', logType)} />
+ <Tooltip title={log?.body} placement="left">
+ <Typography.Text className="log-body">{log?.body}</Typography.Text>
+ </Tooltip>
+
+ <div className="log-overflow-shadow">&nbsp;</div>
+ </div>
+
+ <div className="tabs-and-search">
+ <Radio.Group
+ className="views-tabs"
+ onChange={handleModeChange}
+ value={selectedView}
+ >
+ <Radio.Button
+ className={
+ // eslint-disable-next-line sonarjs/no-duplicate-string
+ selectedView === VIEW_TYPES.OVERVIEW ? 'selected_view tab' : 'tab'
+ }
+ value={VIEW_TYPES.OVERVIEW}
+ >
+ <div className="view-title">
+ <Table size={14} />
+ Overview
+ </div>
+ </Radio.Button>
+ <Radio.Button
+ className={selectedView === VIEW_TYPES.JSON ? 'selected_view tab' : 'tab'}
+ value={VIEW_TYPES.JSON}
+ >
+ <div className="view-title">
+ <Braces size={14} />
+ JSON
+ </div>
+ </Radio.Button>
+ <Radio.Button
+ className={
+ selectedView === VIEW_TYPES.CONTEXT ? 'selected_view tab' : 'tab'
+ }
+ value={VIEW_TYPES.CONTEXT}
+ >
+ <div className="view-title">
+ <TextSelect size={14} />
+ Context
+ </div>
+ </Radio.Button>
+ </Radio.Group>
+
+ {selectedView === VIEW_TYPES.JSON && (
+ <div className="json-action-btn">
+ <Button
+ className="action-btn"
+ icon={<Copy size={16} />}
+ onClick={handleJSONCopy}
+ />
+ </div>
+ )}
+
+ {selectedView === VIEW_TYPES.CONTEXT && (
+ <Button
+ className="action-btn"
+ icon={<Filter size={16} />}
+ onClick={handleFilterVisible}
+ />
+ )}
+ </div>
+
+ <QueryBuilderSearchWrapper
+ isEdit={isEdit}
+ log={log}
+ filters={filters}
+ setContextQuery={setContextQuery}
+ setFilters={setFilters}
+ contextQuery={contextQuery}
+ suffixIcon={
+ <HardHat size={12} style={{ paddingRight: Spacing.PADDING_2 }} />
+ }
+ />
+
+ {selectedView === VIEW_TYPES.OVERVIEW && (
+ <Overview
+ logData={log}
+ onAddToQuery={onAddToQuery}
+ onClickActionItem={onClickActionItem}
+ />
+ )}
+ {selectedView === VIEW_TYPES.JSON && <JSONView logData={log} />}
+
+ {selectedView === VIEW_TYPES.CONTEXT && (
+ <ContextView
+ log={log}
+ filters={filters}
+ contextQuery={contextQuery}
+ isEdit={isEdit}
+ />
+ )}
</Drawer>
);
}
diff --git a/frontend/src/components/Logs/AddToQueryHOC.styles.scss b/frontend/src/components/Logs/AddToQueryHOC.styles.scss
new file mode 100644
index 0000000000..42baabd02a
--- /dev/null
+++ b/frontend/src/components/Logs/AddToQueryHOC.styles.scss
@@ -0,0 +1,3 @@
+.addToQueryContainer {
+ cursor: pointer;
+}
diff --git a/frontend/src/components/Logs/AddToQueryHOC.tsx b/frontend/src/components/Logs/AddToQueryHOC.tsx
index 35fed9c92a..609840477b 100644
--- a/frontend/src/components/Logs/AddToQueryHOC.tsx
+++ b/frontend/src/components/Logs/AddToQueryHOC.tsx
@@ -1,9 +1,9 @@
+import './AddToQueryHOC.styles.scss';
+
import { Popover } from 'antd';
import { OPERATORS } from 'constants/queryBuilder';
import { memo, ReactNode, useCallback, useMemo } from 'react';
-import { ButtonContainer } from './styles';
-
function AddToQueryHOC({
fieldKey,
fieldValue,
@@ -19,11 +19,12 @@ function AddToQueryHOC({
]);
return (
- <ButtonContainer size="small" type="text" onClick={handleQueryAdd}>
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
+ <div className="addToQueryContainer" onClick={handleQueryAdd}>
<Popover placement="top" content={popOverContent}>
{children}
</Popover>
- </ButtonContainer>
+ </div>
);
}
diff --git a/frontend/src/components/Logs/ListLogView/ListLogView.styles.scss b/frontend/src/components/Logs/ListLogView/ListLogView.styles.scss
new file mode 100644
index 0000000000..3caf6a3282
--- /dev/null
+++ b/frontend/src/components/Logs/ListLogView/ListLogView.styles.scss
@@ -0,0 +1,103 @@
+.log-field-key {
+ padding-right: 5px;
+ color: var(--text-vanilla-400, #c0c1c3);
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 18px; /* 128.571% */
+ letter-spacing: -0.07px;
+}
+.log-value {
+ color: var(--text-vanilla-400, #c0c1c3);
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 18px; /* 128.571% */
+ letter-spacing: -0.07px;
+}
+.log-line {
+ display: flex;
+ overflow: hidden;
+ .log-state-indicator {
+ padding-left: 0;
+ }
+ transition: background-color 0.2s ease-in;
+ &:hover {
+ background-color: rgba(171, 189, 255, 0.04) !important;
+ }
+}
+
+.log-selected-fields {
+ display: flex;
+ width: 100%;
+ overflow: hidden;
+ align-items: center;
+
+ .selected-log-field-key {
+ color: var(--bg-robin-400) !important;
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 18px; /* 128.571% */
+ letter-spacing: -0.07px;
+ }
+
+ .selected-log-value {
+ color: var(--bg-sienna-500);
+ border-radius: 2px;
+ background: rgba(173, 127, 88, 0.08);
+ padding: 0px 2px;
+ margin-left: 7px;
+ font-weight: 400;
+ line-height: 18px;
+ letter-spacing: -0.07px;
+ font-size: 14px;
+ }
+
+ .selected-log-kv {
+ min-height: 24px;
+ display: flex;
+ align-items: center;
+ }
+}
+
+.log-action-buttons {
+ position: absolute;
+ transform: translate(-50%, -50%);
+ top: 50%;
+ right: 0;
+ cursor: pointer;
+ height: 32px;
+ width: 68px;
+ border-radius: 2px;
+ border: 1px solid var(--bg-slate-400, #1d212d);
+ background: var(--bg-ink-400, #121317);
+ box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
+
+ .context-btn {
+ width: 50% !important;
+ }
+ .copy-link-btn {
+ width: 50% !important;
+ border-left: 1px solid var(--bg-slate-400, #1d212d) !important;
+ }
+
+ .ant-btn-default {
+ border: none;
+ box-shadow: none;
+ }
+}
+
+.lightMode {
+ .log-field-key {
+ color: var(--text-slate-400);
+ }
+ .log-value {
+ color: var(--text-slate-400);
+ }
+ .log-line {
+ &:hover {
+ background-color: var(--text-vanilla-200) !important;
+ }
+ }
+}
diff --git a/frontend/src/components/Logs/ListLogView/index.tsx b/frontend/src/components/Logs/ListLogView/index.tsx
index 8a40febfb5..74deef6cdf 100644
--- a/frontend/src/components/Logs/ListLogView/index.tsx
+++ b/frontend/src/components/Logs/ListLogView/index.tsx
@@ -1,35 +1,32 @@
-import { blue, grey, orange } from '@ant-design/colors';
-import {
- CopyFilled,
- ExpandAltOutlined,
- LinkOutlined,
- MonitorOutlined,
-} from '@ant-design/icons';
+import './ListLogView.styles.scss';
+
+import { blue } from '@ant-design/colors';
import Convert from 'ansi-to-html';
-import { Button, Divider, Row, Typography } from 'antd';
-import LogsExplorerContext from 'container/LogsExplorerContext';
+import { Typography } from 'antd';
+import LogDetail from 'components/LogDetail';
+import { VIEW_TYPES } from 'components/LogDetail/constants';
import dayjs from 'dayjs';
import dompurify from 'dompurify';
import { useActiveLog } from 'hooks/logs/useActiveLog';
import { useCopyLogLink } from 'hooks/logs/useCopyLogLink';
-import { useNotifications } from 'hooks/useNotifications';
// utils
import { FlatLogData } from 'lib/logs/flatLogData';
-import { useCallback, useMemo } from 'react';
-import { useCopyToClipboard } from 'react-use';
+import { useCallback, useMemo, useState } from 'react';
// interfaces
import { IField } from 'types/api/logs/fields';
import { ILog } from 'types/api/logs/log';
// components
import AddToQueryHOC, { AddToQueryHOCProps } from '../AddToQueryHOC';
-import CopyClipboardHOC from '../CopyClipboardHOC';
+import LogLinesActionButtons from '../LogLinesActionButtons/LogLinesActionButtons';
+import LogStateIndicator, {
+ LogType,
+} from '../LogStateIndicator/LogStateIndicator';
// styles
import {
Container,
LogContainer,
LogText,
- SelectedLog,
Text,
TextContainer,
} from './styles';
@@ -55,12 +52,10 @@ function LogGeneralField({ fieldKey, fieldValue }: LogFieldProps): JSX.Element {
return (
<TextContainer>
- <Text ellipsis type="secondary">
- {`${fieldKey}: `}
+ <Text ellipsis type="secondary" className="log-field-key">
+ {`${fieldKey} : `}
</Text>
- <CopyClipboardHOC textToCopy={fieldValue}>
- <LogText dangerouslySetInnerHTML={html} />
- </CopyClipboardHOC>
+ <LogText dangerouslySetInnerHTML={html} className="log-value" />
</TextContainer>
);
}
@@ -71,23 +66,23 @@ function LogSelectedField({
onAddToQuery,
}: LogSelectedFieldProps): JSX.Element {
return (
- <SelectedLog>
+ <div className="log-selected-fields">
<AddToQueryHOC
fieldKey={fieldKey}
fieldValue={fieldValue}
onAddToQuery={onAddToQuery}
>
<Typography.Text>
- <span style={{ color: blue[4] }}>{fieldKey}</span>
+ <span style={{ color: blue[4] }} className="selected-log-field-key">
+ {fieldKey}
+ </span>
</Typography.Text>
</AddToQueryHOC>
- <CopyClipboardHOC textToCopy={fieldValue}>
- <Typography.Text ellipsis>
- <span>{': '}</span>
- <span style={{ color: orange[6] }}>{fieldValue || "''"}</span>
- </Typography.Text>
- </CopyClipboardHOC>
- </SelectedLog>
+ <Typography.Text ellipsis className="selected-log-kv">
+ <span className="selected-log-field-key">{': '}</span>
+ <span className="selected-log-value">{fieldValue || "''"}</span>
+ </Typography.Text>
+ </div>
);
}
@@ -96,6 +91,7 @@ type ListLogViewProps = {
selectedFields: IField[];
onSetActiveLog: (log: ILog) => void;
onAddToQuery: AddToQueryHOCProps['onAddToQuery'];
+ activeLog?: ILog | null;
};
function ListLogView({
@@ -103,34 +99,42 @@ function ListLogView({
selectedFields,
onSetActiveLog,
onAddToQuery,
+ activeLog,
}: ListLogViewProps): JSX.Element {
const flattenLogData = useMemo(() => FlatLogData(logData), [logData]);
- const [, setCopy] = useCopyToClipboard();
- const { notifications } = useNotifications();
+ const [hasActionButtons, setHasActionButtons] = useState<boolean>(false);
const { isHighlighted, isLogsExplorerPage, onLogCopy } = useCopyLogLink(
logData.id,
);
const {
activeLog: activeContextLog,
+ onAddToQuery: handleAddToQuery,
onSetActiveLog: handleSetActiveContextLog,
onClearActiveLog: handleClearActiveContextLog,
} = useActiveLog();
+ const handlerClearActiveContextLog = useCallback(
+ (event: React.MouseEvent | React.KeyboardEvent) => {
+ event.preventDefault();
+ event.stopPropagation();
+ handleClearActiveContextLog();
+ },
+ [handleClearActiveContextLog],
+ );
+
const handleDetailedView = useCallback(() => {
onSetActiveLog(logData);
}, [logData, onSetActiveLog]);
- const handleShowContext = useCallback(() => {
- handleSetActiveContextLog(logData);
- }, [logData, handleSetActiveContextLog]);
-
- const handleCopyJSON = (): void => {
- setCopy(JSON.stringify(logData, null, 2));
- notifications.success({
- message: 'Copied to clipboard',
- });
- };
+ const handleShowContext = useCallback(
+ (event: React.MouseEvent) => {
+ event.preventDefault();
+ event.stopPropagation();
+ handleSetActiveContextLog(logData);
+ },
+ [logData, handleSetActiveContextLog],
+ );
const updatedSelecedFields = useMemo(
() => selectedFields.filter((e) => e.name !== 'id'),
@@ -145,84 +149,74 @@ function ListLogView({
[flattenLogData.timestamp],
);
+ const logType = logData?.attributes_string?.log_level || LogType.INFO;
+
+ const handleMouseEnter = (): void => {
+ setHasActionButtons(true);
+ };
+
+ const handleMouseLeave = (): void => {
+ setHasActionButtons(false);
+ };
+
return (
- <Container $isActiveLog={isHighlighted}>
- <div>
- <LogContainer>
- <>
- <LogGeneralField fieldKey="log" fieldValue={flattenLogData.body} />
- {flattenLogData.stream && (
- <LogGeneralField fieldKey="stream" fieldValue={flattenLogData.stream} />
- )}
- <LogGeneralField fieldKey="timestamp" fieldValue={timestampValue} />
- </>
- </LogContainer>
- <div>
- {updatedSelecedFields.map((field) =>
- isValidLogField(flattenLogData[field.name] as never) ? (
- <LogSelectedField
- key={field.name}
- fieldKey={field.name}
- fieldValue={flattenLogData[field.name] as never}
- onAddToQuery={onAddToQuery}
- />
- ) : null,
- )}
+ <>
+ <Container
+ $isActiveLog={isHighlighted}
+ onMouseEnter={handleMouseEnter}
+ onMouseLeave={handleMouseLeave}
+ onClick={handleDetailedView}
+ >
+ <div className="log-line">
+ <LogStateIndicator
+ type={logType}
+ isActive={
+ activeLog?.id === logData.id || activeContextLog?.id === logData.id
+ }
+ />
+ <div>
+ <LogContainer>
+ <LogGeneralField fieldKey="Log" fieldValue={flattenLogData.body} />
+ {flattenLogData.stream && (
+ <LogGeneralField fieldKey="Stream" fieldValue={flattenLogData.stream} />
+ )}
+ <LogGeneralField fieldKey="Timestamp" fieldValue={timestampValue} />
+
+ {updatedSelecedFields.map((field) =>
+ isValidLogField(flattenLogData[field.name] as never) ? (
+ <LogSelectedField
+ key={field.name}
+ fieldKey={field.name}
+ fieldValue={flattenLogData[field.name] as never}
+ onAddToQuery={onAddToQuery}
+ />
+ ) : null,
+ )}
+ </LogContainer>
+ </div>
</div>
- </div>
- <Divider style={{ padding: 0, margin: '0.4rem 0', opacity: 0.5 }} />
- <Row>
- <Button
- size="small"
- type="text"
- onClick={handleDetailedView}
- style={{ color: blue[5] }}
- icon={<ExpandAltOutlined />}
- >
- View Details
- </Button>
- <Button
- size="small"
- type="text"
- onClick={handleCopyJSON}
- style={{ color: grey[1] }}
- icon={<CopyFilled />}
- >
- Copy JSON
- </Button>
-
- {isLogsExplorerPage && (
- <>
- <Button
- size="small"
- type="text"
- onClick={handleShowContext}
- style={{ color: grey[1] }}
- icon={<MonitorOutlined />}
- >
- Show in Context
- </Button>
- <Button
- size="small"
- type="text"
- onClick={onLogCopy}
- style={{ color: grey[1] }}
- icon={<LinkOutlined />}
- >
- Copy Link
- </Button>
- </>
- )}
- {activeContextLog && (
- <LogsExplorerContext
- log={activeContextLog}
- onClose={handleClearActiveContextLog}
+ {hasActionButtons && isLogsExplorerPage && (
+ <LogLinesActionButtons
+ handleShowContext={handleShowContext}
+ onLogCopy={onLogCopy}
/>
)}
- </Row>
- </Container>
+ </Container>
+ {activeContextLog && (
+ <LogDetail
+ log={activeContextLog}
+ onAddToQuery={handleAddToQuery}
+ selectedTab={VIEW_TYPES.CONTEXT}
+ onClose={handlerClearActiveContextLog}
+ />
+ )}
+ </>
);
}
+ListLogView.defaultProps = {
+ activeLog: null,
+};
+
export default ListLogView;
diff --git a/frontend/src/components/Logs/ListLogView/styles.ts b/frontend/src/components/Logs/ListLogView/styles.ts
index 0db1baafe5..79812c4400 100644
--- a/frontend/src/components/Logs/ListLogView/styles.ts
+++ b/frontend/src/components/Logs/ListLogView/styles.ts
@@ -7,6 +7,7 @@ export const Container = styled(Card)<{
}>`
width: 100% !important;
margin-bottom: 0.3rem;
+ cursor: pointer;
.ant-card-body {
padding: 0.3rem 0.6rem;
}
@@ -29,11 +30,13 @@ export const TextContainer = styled.div`
export const LogContainer = styled.div`
margin-left: 0.5rem;
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
`;
export const LogText = styled.div`
display: inline-block;
-
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
diff --git a/frontend/src/components/Logs/LogLinesActionButtons/LogLinesActionButtons.styles.scss b/frontend/src/components/Logs/LogLinesActionButtons/LogLinesActionButtons.styles.scss
new file mode 100644
index 0000000000..6044671ea1
--- /dev/null
+++ b/frontend/src/components/Logs/LogLinesActionButtons/LogLinesActionButtons.styles.scss
@@ -0,0 +1,44 @@
+.log-line-action-buttons {
+ display: flex;
+ position: absolute;
+ transform: translate(-50%, -50%);
+ top: 50%;
+ right: 0;
+ cursor: pointer;
+ border-radius: 2px;
+ border: 1px solid var(--bg-slate-400);
+ background: var(--bg-ink-400);
+
+ .ant-btn-default {
+ border: none;
+ box-shadow: none;
+ padding: 9px;
+ justify-content: center;
+ align-items: center;
+ display: flex;
+
+ &.active-tab {
+ background-color: var(--bg-slate-400);
+ }
+ }
+
+ .copy-log-btn {
+ border-left: 1px solid var(--bg-slate-400);
+ border-color: var(--bg-slate-400) !important;
+ }
+}
+
+.lightMode {
+ .log-line-action-buttons {
+ border: 1px solid var(--bg-vanilla-400);
+ background: var(--bg-vanilla-400);
+
+ .ant-btn-default {
+ }
+
+ .copy-log-btn {
+ border-left: 1px solid var(--bg-vanilla-400);
+ border-color: var(--bg-vanilla-400) !important;
+ }
+ }
+}
diff --git a/frontend/src/components/Logs/LogLinesActionButtons/LogLinesActionButtons.tsx b/frontend/src/components/Logs/LogLinesActionButtons/LogLinesActionButtons.tsx
new file mode 100644
index 0000000000..af6da290fb
--- /dev/null
+++ b/frontend/src/components/Logs/LogLinesActionButtons/LogLinesActionButtons.tsx
@@ -0,0 +1,42 @@
+import './LogLinesActionButtons.styles.scss';
+
+import { LinkOutlined } from '@ant-design/icons';
+import { Button, Tooltip } from 'antd';
+import { TextSelect } from 'lucide-react';
+import { MouseEventHandler } from 'react';
+
+export interface LogLinesActionButtonsProps {
+ handleShowContext: MouseEventHandler<HTMLElement>;
+ onLogCopy: MouseEventHandler<HTMLElement>;
+ customClassName?: string;
+}
+export default function LogLinesActionButtons({
+ handleShowContext,
+ onLogCopy,
+ customClassName = '',
+}: LogLinesActionButtonsProps): JSX.Element {
+ return (
+ <div className={`log-line-action-buttons ${customClassName}`}>
+ <Tooltip title="Show in Context">
+ <Button
+ size="small"
+ icon={<TextSelect size={14} />}
+ className="show-context-btn"
+ onClick={handleShowContext}
+ />
+ </Tooltip>
+ <Tooltip title="Copy Link">
+ <Button
+ size="small"
+ icon={<LinkOutlined size={14} />}
+ onClick={onLogCopy}
+ className="copy-log-btn"
+ />
+ </Tooltip>
+ </div>
+ );
+}
+
+LogLinesActionButtons.defaultProps = {
+ customClassName: '',
+};
diff --git a/frontend/src/components/Logs/LogStateIndicator/LogStateIndicator.styles.scss b/frontend/src/components/Logs/LogStateIndicator/LogStateIndicator.styles.scss
new file mode 100644
index 0000000000..6d2429b592
--- /dev/null
+++ b/frontend/src/components/Logs/LogStateIndicator/LogStateIndicator.styles.scss
@@ -0,0 +1,30 @@
+.log-state-indicator {
+ padding-left: 8px;
+
+ .line {
+ margin: 0 8px;
+ min-height: 24px;
+ height: 100%;
+ width: 3px;
+ border-radius: 50px;
+ background-color: transparent;
+
+ &.INFO {
+ background-color: #1d212d;
+ }
+
+ &.WARNING {
+ background-color: #ffcd56;
+ }
+
+ &.ERROR {
+ background-color: #e5484d;
+ }
+ }
+
+ &.isActive {
+ .line {
+ background-color: var(--bg-robin-400, #7190f9);
+ }
+ }
+}
diff --git a/frontend/src/components/Logs/LogStateIndicator/LogStateIndicator.tsx b/frontend/src/components/Logs/LogStateIndicator/LogStateIndicator.tsx
new file mode 100644
index 0000000000..4c9b7de903
--- /dev/null
+++ b/frontend/src/components/Logs/LogStateIndicator/LogStateIndicator.tsx
@@ -0,0 +1,28 @@
+import './LogStateIndicator.styles.scss';
+
+import cx from 'classnames';
+
+export const LogType = {
+ INFO: 'INFO',
+ WARNING: 'WARNING',
+ ERROR: 'ERROR',
+};
+function LogStateIndicator({
+ type,
+ isActive,
+}: {
+ type: string;
+ isActive?: boolean;
+}): JSX.Element {
+ return (
+ <div className={cx('log-state-indicator', isActive ? 'isActive' : '')}>
+ <div className={cx('line', type)}> </div>
+ </div>
+ );
+}
+
+LogStateIndicator.defaultProps = {
+ isActive: false,
+};
+
+export default LogStateIndicator;
diff --git a/frontend/src/components/Logs/RawLogView/RawLogView.styles.scss b/frontend/src/components/Logs/RawLogView/RawLogView.styles.scss
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/frontend/src/components/Logs/RawLogView/index.tsx b/frontend/src/components/Logs/RawLogView/index.tsx
index bdf623daf4..7aa00f3611 100644
--- a/frontend/src/components/Logs/RawLogView/index.tsx
+++ b/frontend/src/components/Logs/RawLogView/index.tsx
@@ -1,11 +1,9 @@
-import {
- ExpandAltOutlined,
- LinkOutlined,
- MonitorOutlined,
-} from '@ant-design/icons';
+import './RawLogView.styles.scss';
+
import Convert from 'ansi-to-html';
-import { Button, DrawerProps, Tooltip } from 'antd';
+import { DrawerProps } from 'antd';
import LogDetail from 'components/LogDetail';
+import { VIEW_TYPES, VIEWS } from 'components/LogDetail/constants';
import LogsExplorerContext from 'container/LogsExplorerContext';
import dayjs from 'dayjs';
import dompurify from 'dompurify';
@@ -24,13 +22,12 @@ import {
useState,
} from 'react';
+import LogLinesActionButtons from '../LogLinesActionButtons/LogLinesActionButtons';
+import LogStateIndicator, {
+ LogType,
+} from '../LogStateIndicator/LogStateIndicator';
// styles
-import {
- ActionButtonsWrapper,
- ExpandIconWrapper,
- RawLogContent,
- RawLogViewContainer,
-} from './styles';
+import { RawLogContent, RawLogViewContainer } from './styles';
import { RawLogViewProps } from './types';
const convert = new Convert();
@@ -50,7 +47,6 @@ function RawLogView({
const {
activeLog: activeContextLog,
- onSetActiveLog: handleSetActiveContextLog,
onClearActiveLog: handleClearActiveContextLog,
} = useActiveLog();
const {
@@ -61,12 +57,15 @@ function RawLogView({
} = useActiveLog();
const [hasActionButtons, setHasActionButtons] = useState<boolean>(false);
+ const [selectedTab, setSelectedTab] = useState<VIEWS | undefined>();
const isDarkMode = useIsDarkMode();
const isReadOnlyLog = !isLogsExplorerPage || isReadOnly;
const severityText = data.severity_text ? `${data.severity_text} |` : '';
+ const logType = data?.attributes_string?.log_level || LogType.INFO;
+
const updatedSelecedFields = useMemo(
() => selectedFields.filter((e) => e.name !== 'id'),
[selectedFields],
@@ -98,6 +97,7 @@ function RawLogView({
if (activeContextLog || isReadOnly) return;
onSetActiveLog(data);
+ setSelectedTab(VIEW_TYPES.OVERVIEW);
}, [activeContextLog, isReadOnly, data, onSetActiveLog]);
const handleCloseLogDetail: DrawerProps['onClose'] = useCallback(
@@ -108,6 +108,7 @@ function RawLogView({
event.stopPropagation();
onClearActiveLog();
+ setSelectedTab(undefined);
},
[onClearActiveLog],
);
@@ -128,9 +129,11 @@ function RawLogView({
(event) => {
event.preventDefault();
event.stopPropagation();
- handleSetActiveContextLog(data);
+ // handleSetActiveContextLog(data);
+ setSelectedTab(VIEW_TYPES.CONTEXT);
+ onSetActiveLog(data);
},
- [data, handleSetActiveContextLog],
+ [data, onSetActiveLog],
);
const html = useMemo(
@@ -147,37 +150,30 @@ function RawLogView({
align="middle"
$isDarkMode={isDarkMode}
$isReadOnly={isReadOnly}
- $isActiveLog={isHighlighted}
+ $isHightlightedLog={isHighlighted}
+ $isActiveLog={isActiveLog}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
>
- {!isReadOnly && (
- <ExpandIconWrapper flex="30px">
- <ExpandAltOutlined />
- </ExpandIconWrapper>
- )}
+ <LogStateIndicator
+ type={logType}
+ isActive={activeLog?.id === data.id || activeContextLog?.id === data.id}
+ />
<RawLogContent
$isReadOnly={isReadOnly}
$isActiveLog={isActiveLog}
+ $isDarkMode={isDarkMode}
$isTextOverflowEllipsisDisabled={isTextOverflowEllipsisDisabled}
linesPerRow={linesPerRow}
dangerouslySetInnerHTML={html}
/>
{hasActionButtons && (
- <ActionButtonsWrapper>
- <Tooltip title="Show Context">
- <Button
- size="small"
- icon={<MonitorOutlined />}
- onClick={handleShowContext}
- />
- </Tooltip>
- <Tooltip title="Copy Link">
- <Button size="small" icon={<LinkOutlined />} onClick={onLogCopy} />
- </Tooltip>
- </ActionButtonsWrapper>
+ <LogLinesActionButtons
+ handleShowContext={handleShowContext}
+ onLogCopy={onLogCopy}
+ />
)}
{activeContextLog && (
@@ -186,12 +182,15 @@ function RawLogView({
onClose={handleClearActiveContextLog}
/>
)}
- <LogDetail
- log={activeLog}
- onClose={handleCloseLogDetail}
- onAddToQuery={onAddToQuery}
- onClickActionItem={onAddToQuery}
- />
+ {selectedTab && (
+ <LogDetail
+ selectedTab={selectedTab}
+ log={activeLog}
+ onClose={handleCloseLogDetail}
+ onAddToQuery={onAddToQuery}
+ onClickActionItem={onAddToQuery}
+ />
+ )}
</RawLogViewContainer>
);
}
diff --git a/frontend/src/components/Logs/RawLogView/styles.ts b/frontend/src/components/Logs/RawLogView/styles.ts
index a3df1c3dca..5806ce2b48 100644
--- a/frontend/src/components/Logs/RawLogView/styles.ts
+++ b/frontend/src/components/Logs/RawLogView/styles.ts
@@ -1,4 +1,5 @@
import { blue } from '@ant-design/colors';
+import { Color } from '@signozhq/design-tokens';
import { Col, Row, Space } from 'antd';
import styled from 'styled-components';
import { getActiveLogBackground, getDefaultLogBackground } from 'utils/logs';
@@ -9,20 +10,25 @@ export const RawLogViewContainer = styled(Row)<{
$isDarkMode: boolean;
$isReadOnly?: boolean;
$isActiveLog?: boolean;
+ $isHightlightedLog: boolean;
}>`
position: relative;
width: 100%;
- font-weight: 700;
- font-size: 0.625rem;
- line-height: 1.25rem;
+
+ display: flex;
+ align-items: stretch;
transition: background-color 0.2s ease-in;
+ .log-state-indicator {
+ margin: 4px 0;
+ }
+
${({ $isActiveLog }): string => getActiveLogBackground($isActiveLog)}
- ${({ $isReadOnly, $isDarkMode, $isActiveLog }): string =>
+ ${({ $isReadOnly, $isActiveLog, $isDarkMode }): string =>
$isActiveLog
- ? getActiveLogBackground()
+ ? getActiveLogBackground($isActiveLog, $isDarkMode)
: getDefaultLogBackground($isReadOnly, $isDarkMode)}
`;
@@ -30,13 +36,17 @@ export const ExpandIconWrapper = styled(Col)`
color: ${blue[6]};
padding: 0.25rem 0.375rem;
cursor: pointer;
- font-size: 12px;
`;
export const RawLogContent = styled.div<RawLogContentProps>`
margin-bottom: 0;
- font-family: Fira Code, monospace;
- font-weight: 300;
+ font-family: 'SF Mono', monospace;
+ font-family: 'Space Mono', monospace;
+ font-size: 13px;
+ font-weight: 400;
+ text-align: left;
+ color: ${({ $isDarkMode }): string =>
+ $isDarkMode ? Color.BG_VANILLA_400 : Color.BG_INK_400};
${({ $isTextOverflowEllipsisDisabled, linesPerRow }): string =>
$isTextOverflowEllipsisDisabled
@@ -48,15 +58,12 @@ export const RawLogContent = styled.div<RawLogContentProps>`
line-clamp: ${linesPerRow};
-webkit-box-orient: vertical;`};
- font-size: 12px;
line-height: 24px;
+ letter-spacing: -0.07px;
padding: 4px;
cursor: ${({ $isActiveLog, $isReadOnly }): string =>
$isActiveLog || $isReadOnly ? 'initial' : 'pointer'};
-
- ${({ $isActiveLog, $isReadOnly }): string =>
- $isReadOnly && $isActiveLog ? 'padding: 0 1.5rem;' : ''}
`;
export const ActionButtonsWrapper = styled(Space)`
diff --git a/frontend/src/components/Logs/RawLogView/types.ts b/frontend/src/components/Logs/RawLogView/types.ts
index 7c16de7a12..a9c85c2ad6 100644
--- a/frontend/src/components/Logs/RawLogView/types.ts
+++ b/frontend/src/components/Logs/RawLogView/types.ts
@@ -14,5 +14,6 @@ export interface RawLogContentProps {
linesPerRow: number;
$isReadOnly?: boolean;
$isActiveLog?: boolean;
+ $isDarkMode?: boolean;
$isTextOverflowEllipsisDisabled?: boolean;
}
diff --git a/frontend/src/components/Logs/TableView/config.ts b/frontend/src/components/Logs/TableView/config.ts
index 39622a4466..c532981ad7 100644
--- a/frontend/src/components/Logs/TableView/config.ts
+++ b/frontend/src/components/Logs/TableView/config.ts
@@ -1,12 +1,21 @@
import { TableProps } from 'antd';
import { CSSProperties } from 'react';
-export const defaultCellStyle: CSSProperties = {
- paddingTop: 4,
- paddingBottom: 6,
- paddingRight: 8,
- paddingLeft: 8,
-};
+export function getDefaultCellStyle(isDarkMode?: boolean): CSSProperties {
+ return {
+ paddingTop: 4,
+ paddingBottom: 6,
+ paddingRight: 8,
+ paddingLeft: 8,
+ color: isDarkMode ? 'var(--bg-vanilla-400)' : 'var(--bg-slate-400)',
+ fontSize: '14px',
+ fontStyle: 'normal',
+ fontWeight: 400,
+ lineHeight: '18px',
+ letterSpacing: '-0.07px',
+ marginBottom: '0px',
+ };
+}
export const defaultTableStyle: CSSProperties = {
minWidth: '40rem',
diff --git a/frontend/src/components/Logs/TableView/styles.ts b/frontend/src/components/Logs/TableView/styles.ts
index 951404afec..9213021971 100644
--- a/frontend/src/components/Logs/TableView/styles.ts
+++ b/frontend/src/components/Logs/TableView/styles.ts
@@ -2,18 +2,22 @@ import styled from 'styled-components';
interface TableBodyContentProps {
linesPerRow: number;
+ isDarkMode?: boolean;
}
export const TableBodyContent = styled.div<TableBodyContentProps>`
margin-bottom: 0;
+ color: ${(props): string =>
+ props.isDarkMode ? 'var(--bg-vanilla-400, #c0c1c3)' : 'var(--bg-slate-400)'};
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 18px; /* 128.571% */
+ letter-spacing: -0.07px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: ${(props): number => props.linesPerRow};
line-clamp: ${(props): number => props.linesPerRow};
-webkit-box-orient: vertical;
-
- font-size: 0.875rem;
-
- line-height: 2rem;
`;
diff --git a/frontend/src/components/Logs/TableView/types.ts b/frontend/src/components/Logs/TableView/types.ts
index 446e99f32c..35ef198ac6 100644
--- a/frontend/src/components/Logs/TableView/types.ts
+++ b/frontend/src/components/Logs/TableView/types.ts
@@ -22,6 +22,8 @@ export type UseTableViewProps = {
appendTo?: 'center' | 'end';
onOpenLogsContext?: (log: ILog) => void;
onClickExpand?: (log: ILog) => void;
+ activeLog?: ILog | null;
+ activeContextLog?: ILog | null;
} & LogsTableViewProps;
export type ActionsColumnProps = {
diff --git a/frontend/src/components/Logs/TableView/useTableView.styles.scss b/frontend/src/components/Logs/TableView/useTableView.styles.scss
new file mode 100644
index 0000000000..3723ecc705
--- /dev/null
+++ b/frontend/src/components/Logs/TableView/useTableView.styles.scss
@@ -0,0 +1,27 @@
+.text {
+ color: var(--bg-vanilla-400);
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 18px; /* 128.571% */
+ letter-spacing: -0.07px;
+}
+
+.table-timestamp {
+ display: flex;
+ align-items: center;
+
+ .ant-typography {
+ margin-bottom: 0;
+ }
+
+ .log-state-indicator {
+ padding: 0px;
+ }
+}
+
+.lightMode {
+ .text {
+ color: var(--bg-slate-400);
+ }
+}
diff --git a/frontend/src/components/Logs/TableView/useTableView.tsx b/frontend/src/components/Logs/TableView/useTableView.tsx
index c7e59c7a1a..5fad6e3896 100644
--- a/frontend/src/components/Logs/TableView/useTableView.tsx
+++ b/frontend/src/components/Logs/TableView/useTableView.tsx
@@ -1,22 +1,21 @@
-import {
- ExpandAltOutlined,
- LinkOutlined,
- MonitorOutlined,
-} from '@ant-design/icons';
+import './useTableView.styles.scss';
+
import Convert from 'ansi-to-html';
-import { Button, Space, Typography } from 'antd';
+import { Typography } from 'antd';
import { ColumnsType } from 'antd/es/table';
import dayjs from 'dayjs';
import dompurify from 'dompurify';
-import { useCopyLogLink } from 'hooks/logs/useCopyLogLink';
+import { useIsDarkMode } from 'hooks/useDarkMode';
import { FlatLogData } from 'lib/logs/flatLogData';
-import { useCallback, useMemo } from 'react';
+import { defaultTo } from 'lodash-es';
+import { useMemo } from 'react';
-import { ExpandIconWrapper } from '../RawLogView/styles';
-import { defaultCellStyle, defaultTableStyle } from './config';
+import LogStateIndicator, {
+ LogType,
+} from '../LogStateIndicator/LogStateIndicator';
+import { defaultTableStyle, getDefaultCellStyle } from './config';
import { TableBodyContent } from './styles';
import {
- ActionsColumnProps,
ColumnTypeRender,
UseTableViewProps,
UseTableViewResult,
@@ -24,60 +23,22 @@ import {
const convert = new Convert();
-function ActionsColumn({
- logId,
- logs,
- onOpenLogsContext,
-}: ActionsColumnProps): JSX.Element {
- const currentLog = useMemo(() => logs.find(({ id }) => id === logId), [
- logs,
- logId,
- ]);
-
- const { onLogCopy } = useCopyLogLink(currentLog?.id);
-
- const handleShowContext = useCallback(() => {
- if (!onOpenLogsContext || !currentLog) return;
-
- onOpenLogsContext(currentLog);
- }, [currentLog, onOpenLogsContext]);
-
- return (
- <Space>
- <Button
- size="small"
- onClick={handleShowContext}
- icon={<MonitorOutlined />}
- />
- <Button size="small" onClick={onLogCopy} icon={<LinkOutlined />} />
- </Space>
- );
-}
-
export const useTableView = (props: UseTableViewProps): UseTableViewResult => {
const {
logs,
fields,
linesPerRow,
appendTo = 'center',
- onOpenLogsContext,
- onClickExpand,
+ activeContextLog,
+ activeLog,
} = props;
- const { isLogsExplorerPage } = useCopyLogLink();
+
+ const isDarkMode = useIsDarkMode();
const flattenLogData = useMemo(() => logs.map((log) => FlatLogData(log)), [
logs,
]);
- const handleClickExpand = useCallback(
- (index: number): void => {
- if (!onClickExpand) return;
-
- onClickExpand(logs[index]);
- },
- [logs, onClickExpand],
- );
-
const columns: ColumnsType<Record<string, unknown>> = useMemo(() => {
const fieldColumns: ColumnsType<Record<string, unknown>> = fields
.filter((e) => e.name !== 'id')
@@ -87,7 +48,7 @@ export const useTableView = (props: UseTableViewProps): UseTableViewResult => {
key: name,
render: (field): ColumnTypeRender<Record<string, unknown>> => ({
props: {
- style: defaultCellStyle,
+ style: getDefaultCellStyle(isDarkMode),
},
children: (
<Typography.Paragraph ellipsis={{ rows: linesPerRow }}>
@@ -98,38 +59,30 @@ export const useTableView = (props: UseTableViewProps): UseTableViewResult => {
}));
return [
- {
- title: '',
- dataIndex: 'id',
- key: 'expand',
- // https://github.com/ant-design/ant-design/discussions/36886
- render: (_, item, index): ColumnTypeRender<Record<string, unknown>> => ({
- props: {
- style: defaultCellStyle,
- },
- children: (
- <ExpandIconWrapper
- onClick={(): void => {
- handleClickExpand(index);
- }}
- >
- <ExpandAltOutlined />
- </ExpandIconWrapper>
- ),
- }),
- },
{
title: 'timestamp',
dataIndex: 'timestamp',
key: 'timestamp',
// https://github.com/ant-design/ant-design/discussions/36886
- render: (field): ColumnTypeRender<Record<string, unknown>> => {
+ render: (field, item): ColumnTypeRender<Record<string, unknown>> => {
const date =
typeof field === 'string'
? dayjs(field).format()
: dayjs(field / 1e6).format();
return {
- children: <Typography.Paragraph ellipsis>{date}</Typography.Paragraph>,
+ children: (
+ <div className="table-timestamp">
+ <LogStateIndicator
+ type={defaultTo(item.log_level, LogType.INFO) as string}
+ isActive={
+ activeLog?.id === item.id || activeContextLog?.id === item.id
+ }
+ />
+ <Typography.Paragraph ellipsis className="text">
+ {date}
+ </Typography.Paragraph>
+ </div>
+ ),
};
},
},
@@ -148,38 +101,20 @@ export const useTableView = (props: UseTableViewProps): UseTableViewResult => {
__html: convert.toHtml(dompurify.sanitize(field)),
}}
linesPerRow={linesPerRow}
+ isDarkMode={isDarkMode}
/>
),
}),
},
...(appendTo === 'end' ? fieldColumns : []),
- ...(isLogsExplorerPage
- ? ([
- {
- title: 'actions',
- dataIndex: 'actions',
- key: 'actions',
- render: (_, log): ColumnTypeRender<Record<string, unknown>> => ({
- children: (
- <ActionsColumn
- logId={(log.id as unknown) as string}
- logs={logs}
- onOpenLogsContext={onOpenLogsContext}
- />
- ),
- }),
- },
- ] as ColumnsType<Record<string, unknown>>)
- : []),
];
}, [
- logs,
fields,
appendTo,
+ isDarkMode,
linesPerRow,
- isLogsExplorerPage,
- handleClickExpand,
- onOpenLogsContext,
+ activeLog?.id,
+ activeContextLog?.id,
]);
return { columns, dataSource: flattenLogData };
diff --git a/frontend/src/components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.styles.scss b/frontend/src/components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.styles.scss
new file mode 100644
index 0000000000..efd668ffe1
--- /dev/null
+++ b/frontend/src/components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.styles.scss
@@ -0,0 +1,396 @@
+.nested-menu-container {
+ z-index: 2;
+ position: absolute;
+ right: -2px;
+ margin: 6px 0;
+ width: 160px;
+
+ border-radius: 4px;
+
+ border: 1px solid var(--bg-slate-400, #1d212d);
+ background: linear-gradient(
+ 139deg,
+ rgba(18, 19, 23, 0.8) 0%,
+ rgba(18, 19, 23, 0.9) 98.68%
+ );
+
+ box-shadow: 4px 10px 16px 2px rgba(0, 0, 0, 0.2);
+ backdrop-filter: blur(20px);
+
+ .menu-container {
+ padding: 12px;
+
+ .title {
+ font-family: Inter;
+ font-size: 11px;
+ font-weight: 600;
+ line-height: 18px;
+ letter-spacing: 0.08em;
+ text-align: left;
+ color: var(--bg-slate-200, #52575c);
+ }
+
+ .menu-items {
+ display: flex;
+ gap: 8px;
+ flex-direction: column;
+ margin-top: 12px;
+ }
+
+ .item {
+ font-family: Inter;
+ font-size: 13px;
+ font-weight: 400;
+ line-height: 17px;
+ letter-spacing: 0.01em;
+ text-align: left;
+
+ .item-label {
+ display: flex;
+ color: var(--bg-vanilla-400, #c0c1c3);
+ justify-content: space-between;
+ align-items: center;
+ }
+
+ cursor: pointer;
+ }
+ }
+
+ .horizontal-line {
+ height: 1px;
+ background: #1d212d;
+ }
+
+ .max-lines-per-row {
+ padding: 12px;
+
+ .title {
+ color: var(--bg-slate-200, #52575c);
+ font-family: Inter;
+ font-size: 11px;
+ font-style: normal;
+ font-weight: 600;
+ line-height: 18px; /* 163.636% */
+ letter-spacing: 0.88px;
+ text-transform: uppercase;
+
+ margin-bottom: 12px;
+
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+ .lucide {
+ color: var(--bg-vanilla-400, #c0c1c3);
+ cursor: pointer;
+ }
+ }
+
+ .max-lines-per-row-input {
+ display: flex;
+
+ .ant-input-number-handler-wrap {
+ display: none;
+ }
+
+ .ant-input-number {
+ min-width: 36px;
+ width: auto;
+ border-right: none;
+ border-left: none;
+ border-top: 1px solid var(--bg-slate-400);
+ border-bottom: 1px solid var(--bg-slate-400);
+ text-align: center;
+ height: 26px;
+ border-radius: 0;
+
+ &:active,
+ &:focus {
+ border: none;
+ box-shadow: none;
+ }
+ }
+
+ .ant-input-number-focused {
+ box-shadow: none !important;
+ }
+
+ .ant-input-number-input-wrap {
+ input {
+ text-align: center;
+ font-size: 13px;
+
+ &:active,
+ &:focus {
+ border: none;
+ }
+ }
+
+ &:active,
+ &:focus {
+ border: none;
+ }
+ }
+
+ .periscope-btn {
+ box-shadow: none;
+ padding: 6px 12px;
+ height: 26px;
+
+ border-radius: 0px 1px 1px 0px;
+ background: var(--bg-ink-300, #16181d);
+ }
+ }
+ }
+
+ .selected-item-content-container {
+ .add-new-column-header {
+ padding: 8px;
+ }
+
+ .title {
+ color: var(--bg-slate-200, #52575c);
+ font-family: Inter;
+ font-size: 11px;
+ font-style: normal;
+ font-weight: 600;
+ line-height: 18px; /* 163.636% */
+ letter-spacing: 0.88px;
+ text-transform: uppercase;
+
+ margin-bottom: 12px;
+
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+ .lucide {
+ color: var(--bg-vanilla-400, #c0c1c3);
+ cursor: pointer;
+ }
+ }
+
+ .horizontal-line {
+ height: 1px;
+ background: #1d212d;
+ }
+
+ .loading-container {
+ margin: 12px 0;
+ }
+
+ .item-content {
+ padding: 12px;
+
+ .column-format,
+ .column-format-new-options {
+ display: flex;
+ gap: 12px;
+ flex-direction: column;
+ margin-top: 12px;
+
+ .column-name {
+ color: var(--bg-vanilla-400, #c0c1c3);
+ font-family: Inter;
+ font-size: 13px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 20px; /* 142.857% */
+ letter-spacing: -0.07px;
+
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ gap: 8px;
+
+ cursor: pointer;
+
+ .name {
+ flex: 1;
+ overflow: hidden;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+
+ cursor: pointer;
+ }
+
+ .delete-btn {
+ display: none;
+ flex: 0 0 16px;
+ cursor: pointer;
+ }
+
+ &:hover {
+ .delete-btn {
+ display: block;
+ }
+ }
+ }
+
+ overflow-x: hidden;
+
+ &::-webkit-scrollbar {
+ height: 1rem;
+ width: 0.2rem;
+ }
+ }
+
+ .column-format {
+ max-height: 150px;
+ overflow: auto;
+ overflow-x: hidden;
+ }
+
+ .column-format-new-options {
+ max-height: 150px;
+ overflow-y: auto;
+ overflow-x: hidden;
+ }
+
+ .column-divider {
+ margin: 12px 0;
+ border-top: 2px solid var(--bg-slate-400);
+ }
+ }
+ }
+
+ &.active {
+ .nested-menu-container {
+ backdrop-filter: blur(18px);
+
+ .item {
+ .item-label {
+ color: var(--bg-vanilla-400);
+ }
+ }
+ }
+
+ .selected-item-content-container {
+ width: 110%;
+ margin-left: -5%;
+
+ border-radius: 4px;
+ border: 1px solid var(--bg-slate-400);
+ background: linear-gradient(
+ 139deg,
+ rgba(18, 19, 23, 0.8) 0%,
+ rgba(18, 19, 23, 0.9) 98.68%
+ );
+
+ box-shadow: 4px 10px 16px 2px rgba(0, 0, 0, 0.2);
+ backdrop-filter: blur(20px);
+
+ .column-format {
+ margin-top: 0px;
+ }
+ }
+ }
+}
+
+.lightMode {
+ .nested-menu-container {
+ border: 1px solid var(--bg-vanilla-300);
+ background: linear-gradient(
+ 139deg,
+ rgba(255, 255, 255, 0.8) 0%,
+ rgba(255, 255, 255, 0.9) 98.68%
+ );
+
+ box-shadow: 4px 10px 16px 2px rgba(255, 255, 255, 0.2);
+
+ .horizontal-line {
+ background: var(--bg-vanilla-300);
+ }
+
+ .item-content {
+ .column-divider {
+ border-top: 2px solid var(--bg-vanilla-300);
+ }
+ }
+
+ .max-lines-per-row {
+ .title {
+ color: var(--bg-ink-200);
+
+ .lucide {
+ color: var(--bg-ink-300);
+ }
+ }
+
+ .max-lines-per-row-input {
+ border: 1px solid var(--bg-vanilla-300);
+
+ .periscope-btn {
+ background: var(--bg-vanilla-300);
+ }
+ }
+ }
+
+ .menu-container {
+ .title {
+ color: var(--bg-ink-200);
+ }
+
+ .item {
+ .item-label {
+ color: var(--bg-ink-400);
+ }
+ }
+ }
+
+ .selected-item-content-container {
+ .title {
+ color: var(--bg-ink-200);
+
+ .lucide {
+ color: var(--bg-ink-300);
+ }
+ }
+
+ .horizontal-line {
+ background: var(--bg-vanilla-300);
+ }
+
+ .item-content {
+ .max-lines-per-row-input {
+ border: 1px solid var(--bg-vanilla-300);
+
+ .periscope-btn {
+ background: var(--bg-vanilla-300);
+ }
+ }
+
+ .column-format,
+ .column-format-new-options {
+ .column-name {
+ color: var(--bg-ink-300);
+ }
+ }
+ }
+ }
+
+ &.active {
+ .nested-menu-container {
+ backdrop-filter: blur(18px);
+
+ .item {
+ .item-label {
+ color: var(--bg-ink-300);
+ }
+ }
+ }
+
+ .selected-item-content-container {
+ border: 1px solid var(--bg-vanilla-300);
+ background: linear-gradient(
+ 139deg,
+ rgba(255, 255, 255, 0.8) 0%,
+ rgba(255, 255, 255, 0.9) 98.68%
+ );
+
+ box-shadow: 4px 10px 16px 2px rgba(255, 255, 255, 0.2);
+ }
+ }
+ }
+}
diff --git a/frontend/src/components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.tsx b/frontend/src/components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.tsx
new file mode 100644
index 0000000000..dcfa88325e
--- /dev/null
+++ b/frontend/src/components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.tsx
@@ -0,0 +1,248 @@
+/* eslint-disable react-hooks/exhaustive-deps */
+/* eslint-disable jsx-a11y/no-static-element-interactions */
+/* eslint-disable jsx-a11y/click-events-have-key-events */
+import './LogsFormatOptionsMenu.styles.scss';
+
+import { Divider, Input, InputNumber, Tooltip } from 'antd';
+import cx from 'classnames';
+import { LogViewMode } from 'container/LogsTable';
+import { OptionsMenuConfig } from 'container/OptionsMenu/types';
+import useDebouncedFn from 'hooks/useDebouncedFunction';
+import { Check, Minus, Plus, X } from 'lucide-react';
+import { useCallback, useEffect, useState } from 'react';
+
+interface LogsFormatOptionsMenuProps {
+ title: string;
+ items: any;
+ selectedOptionFormat: any;
+ config: OptionsMenuConfig;
+}
+
+export default function LogsFormatOptionsMenu({
+ title,
+ items,
+ selectedOptionFormat,
+ config,
+}: LogsFormatOptionsMenuProps): JSX.Element {
+ const { maxLines, format, addColumn } = config;
+ const [selectedItem, setSelectedItem] = useState(selectedOptionFormat);
+ const maxLinesNumber = (maxLines?.value as number) || 1;
+ const [maxLinesPerRow, setMaxLinesPerRow] = useState<number>(maxLinesNumber);
+
+ const [addNewColumn, setAddNewColumn] = useState(false);
+
+ const onChange = useCallback(
+ (key: LogViewMode) => {
+ if (!format) return;
+
+ format.onChange(key);
+ },
+ [format],
+ );
+
+ const handleMenuItemClick = (key: LogViewMode): void => {
+ setSelectedItem(key);
+ onChange(key);
+ setAddNewColumn(false);
+ };
+
+ const incrementMaxLinesPerRow = (): void => {
+ if (maxLinesPerRow < 10) {
+ setMaxLinesPerRow(maxLinesPerRow + 1);
+ }
+ };
+
+ const decrementMaxLinesPerRow = (): void => {
+ if (maxLinesPerRow > 1) {
+ setMaxLinesPerRow(maxLinesPerRow - 1);
+ }
+ };
+
+ const handleSearchValueChange = useDebouncedFn((event): void => {
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-ignore
+ const value = event?.target?.value || '';
+
+ if (addColumn && addColumn?.onSearch) {
+ addColumn?.onSearch(value);
+ }
+ }, 300);
+
+ const handleToggleAddNewColumn = (): void => {
+ setAddNewColumn(!addNewColumn);
+ };
+
+ // console.log('optionsMenuConfig', config);
+
+ const handleLinesPerRowChange = (maxLinesPerRow: number | null): void => {
+ if (
+ maxLinesPerRow &&
+ Number.isInteger(maxLinesNumber) &&
+ maxLinesPerRow > 1
+ ) {
+ setMaxLinesPerRow(maxLinesPerRow);
+ }
+ };
+
+ useEffect(() => {
+ if (maxLinesPerRow && config && config.maxLines?.onChange) {
+ config.maxLines.onChange(maxLinesPerRow);
+ }
+ }, [maxLinesPerRow]);
+
+ return (
+ <div
+ className={cx('nested-menu-container', addNewColumn ? 'active' : '')}
+ onClick={(event): void => {
+ // this is to restrict click events to propogate to parent
+ event.stopPropagation();
+ }}
+ >
+ <div className="menu-container">
+ <div className="title"> {title} </div>
+
+ <div className="menu-items">
+ {items.map(
+ (item: any): JSX.Element => (
+ <div
+ className="item"
+ key={item.label}
+ onClick={(): void => handleMenuItemClick(item.key)}
+ >
+ <div className={cx('item-label')}>
+ {item.label}
+
+ {selectedItem === item.key && <Check size={12} />}
+ </div>
+ </div>
+ ),
+ )}
+ </div>
+ </div>
+
+ {selectedItem && (
+ <>
+ {selectedItem === 'raw' && (
+ <>
+ <div className="horizontal-line" />
+ <div className="max-lines-per-row">
+ <div className="title"> max lines per row </div>
+ <div className="raw-format max-lines-per-row-input">
+ <button
+ type="button"
+ className="periscope-btn"
+ onClick={decrementMaxLinesPerRow}
+ >
+ {' '}
+ <Minus size={12} />{' '}
+ </button>
+ <InputNumber
+ min={1}
+ max={10}
+ value={maxLinesPerRow}
+ onChange={handleLinesPerRowChange}
+ />
+ <button
+ type="button"
+ className="periscope-btn"
+ onClick={incrementMaxLinesPerRow}
+ >
+ {' '}
+ <Plus size={12} />{' '}
+ </button>
+ </div>
+ </div>
+ </>
+ )}
+
+ <div className="selected-item-content-container active">
+ {!addNewColumn && <div className="horizontal-line" />}
+
+ {addNewColumn && (
+ <div className="add-new-column-header">
+ <div className="title">
+ {' '}
+ columns
+ <X size={14} onClick={handleToggleAddNewColumn} />{' '}
+ </div>
+
+ <Input
+ tabIndex={0}
+ type="text"
+ autoFocus
+ onFocus={addColumn?.onFocus}
+ onChange={handleSearchValueChange}
+ placeholder="Search..."
+ />
+ </div>
+ )}
+
+ <div className="item-content">
+ {!addNewColumn && (
+ <div className="title">
+ columns
+ <Plus size={14} onClick={handleToggleAddNewColumn} />{' '}
+ </div>
+ )}
+
+ <div className="column-format">
+ {addColumn?.value?.map(({ key, id }) => (
+ <div className="column-name" key={id}>
+ <div className="name">
+ <Tooltip placement="left" title={key}>
+ {key}
+ </Tooltip>
+ </div>
+ <X
+ className="delete-btn"
+ size={14}
+ onClick={(): void => addColumn.onRemove(id as string)}
+ />
+ </div>
+ ))}
+ </div>
+
+ {addColumn?.isFetching && (
+ <div className="loading-container"> Loading ... </div>
+ )}
+
+ {addNewColumn &&
+ addColumn &&
+ addColumn.value.length > 0 &&
+ addColumn.options &&
+ addColumn?.options?.length > 0 && (
+ <Divider className="column-divider" />
+ )}
+
+ {addNewColumn && (
+ <div className="column-format-new-options">
+ {addColumn?.options?.map(({ label, value }) => (
+ <div
+ className="column-name"
+ key={value}
+ onClick={(eve): void => {
+ console.log('coluimn name', label, value);
+
+ eve.stopPropagation();
+
+ if (addColumn && addColumn?.onSelect) {
+ addColumn?.onSelect(value, { label, disabled: false });
+ }
+ }}
+ >
+ <div className="name">
+ <Tooltip placement="left" title={label}>
+ {label}
+ </Tooltip>
+ </div>
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ </div>
+ </>
+ )}
+ </div>
+ );
+}
diff --git a/frontend/src/components/ReleaseNote/index.tsx b/frontend/src/components/ReleaseNote/index.tsx
index bfabbd2637..bf788e6a77 100644
--- a/frontend/src/components/ReleaseNote/index.tsx
+++ b/frontend/src/components/ReleaseNote/index.tsx
@@ -25,11 +25,12 @@ const allComponentMap: ComponentMapType[] = [
if (!path) {
return false;
}
- const allowedPaths = [
+ const allowedPaths: string[] = [
ROUTES.LIST_ALL_ALERT,
ROUTES.APPLICATION,
ROUTES.ALL_DASHBOARD,
];
+
return (
userFlags?.ReleaseNote0120Hide !== 'Y' &&
allowedPaths.includes(path) &&
diff --git a/frontend/src/components/RouteTab/types.ts b/frontend/src/components/RouteTab/types.ts
index b8cb5eb722..c8fd2af276 100644
--- a/frontend/src/components/RouteTab/types.ts
+++ b/frontend/src/components/RouteTab/types.ts
@@ -1,13 +1,15 @@
import { TabsProps } from 'antd';
import { History } from 'history';
+export type TabRoutes = {
+ name: React.ReactNode;
+ route: string;
+ Component: () => JSX.Element;
+ key: string;
+};
+
export interface RouteTabProps {
- routes: {
- name: React.ReactNode;
- route: string;
- Component: () => JSX.Element;
- key: string;
- }[];
+ routes: TabRoutes[];
activeKey: TabsProps['activeKey'];
onChangeHandler?: VoidFunction;
history: History<unknown>;
diff --git a/frontend/src/constants/routes.ts b/frontend/src/constants/routes.ts
index 39456318a7..71179a0df9 100644
--- a/frontend/src/constants/routes.ts
+++ b/frontend/src/constants/routes.ts
@@ -41,7 +41,9 @@ const ROUTES = {
TRACE_EXPLORER: '/trace-explorer',
BILLING: '/billing',
SUPPORT: '/support',
+ LOGS_SAVE_VIEWS: '/logs-save-views',
+ TRACES_SAVE_VIEWS: '/traces-save-views',
WORKSPACE_LOCKED: '/workspace-locked',
-};
+} as const;
export default ROUTES;
diff --git a/frontend/src/container/AppLayout/AppLayout.styles.scss b/frontend/src/container/AppLayout/AppLayout.styles.scss
index b62cab0a0d..21dc54fb98 100644
--- a/frontend/src/container/AppLayout/AppLayout.styles.scss
+++ b/frontend/src/container/AppLayout/AppLayout.styles.scss
@@ -1,12 +1,20 @@
-@import '@signozhq/design-tokens';
-
.app-layout {
+ position: relative;
height: 100%;
width: 100%;
.app-content {
width: 100%;
overflow: auto;
+
+ .content-container {
+ position: relative;
+ margin: 0 1rem;
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ width: 100%;
+ }
}
}
diff --git a/frontend/src/container/AppLayout/index.tsx b/frontend/src/container/AppLayout/index.tsx
index 28b48223b4..d44a2d26b8 100644
--- a/frontend/src/container/AppLayout/index.tsx
+++ b/frontend/src/container/AppLayout/index.tsx
@@ -4,10 +4,12 @@
import './AppLayout.styles.scss';
import { Flex } from 'antd';
+import getLocalStorageKey from 'api/browser/localstorage/get';
import getDynamicConfigs from 'api/dynamicConfigs/getDynamicConfigs';
import getUserLatestVersion from 'api/user/getLatestVersion';
import getUserVersion from 'api/user/getVersion';
import cx from 'classnames';
+import { IS_SIDEBAR_COLLAPSED } from 'constants/app';
import ROUTES from 'constants/routes';
import SideNav from 'container/SideNav';
import TopNav from 'container/TopNav';
@@ -16,7 +18,15 @@ import useLicense from 'hooks/useLicense';
import { useNotifications } from 'hooks/useNotifications';
import history from 'lib/history';
import ErrorBoundaryFallback from 'pages/ErrorBoundaryFallback/ErrorBoundaryFallback';
-import { ReactNode, useEffect, useMemo, useRef, useState } from 'react';
+import {
+ ReactNode,
+ useCallback,
+ useEffect,
+ useLayoutEffect,
+ useMemo,
+ useRef,
+ useState,
+} from 'react';
import { ErrorBoundary } from 'react-error-boundary';
import { Helmet } from 'react-helmet-async';
import { useTranslation } from 'react-i18next';
@@ -24,6 +34,7 @@ import { useQueries } from 'react-query';
import { useDispatch, useSelector } from 'react-redux';
import { useLocation } from 'react-router-dom';
import { Dispatch } from 'redux';
+import { sideBarCollapse } from 'store/actions';
import { AppState } from 'store/reducers';
import AppActions from 'types/actions';
import {
@@ -44,6 +55,10 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
(state) => state.app,
);
+ const [collapsed, setCollapsed] = useState<boolean>(
+ getLocalStorageKey(IS_SIDEBAR_COLLAPSED) === 'true',
+ );
+
const isDarkMode = useIsDarkMode();
const { data: licenseData, isFetching } = useLicense();
@@ -92,7 +107,7 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
const { children } = props;
- const dispatch = useDispatch<Dispatch<AppActions>>();
+ const dispatch = useDispatch<Dispatch<AppActions | any>>();
const latestCurrentCounter = useRef(0);
const latestVersionCounter = useRef(0);
@@ -100,6 +115,14 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
const { notifications } = useNotifications();
+ const onCollapse = useCallback(() => {
+ setCollapsed((collapsed) => !collapsed);
+ }, []);
+
+ useLayoutEffect(() => {
+ dispatch(sideBarCollapse(collapsed));
+ }, [collapsed, dispatch]);
+
useEffect(() => {
if (
getUserLatestVersionResponse.isFetched &&
@@ -230,8 +253,34 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
}
};
+ const isLogsView = (): boolean =>
+ routeKey === 'LOGS' ||
+ routeKey === 'LOGS_EXPLORER' ||
+ routeKey === 'LOGS_PIPELINES' ||
+ routeKey === 'LOGS_SAVE_VIEWS';
+
+ const isTracesView = (): boolean =>
+ routeKey === 'TRACES_EXPLORER' || routeKey === 'TRACES_SAVE_VIEWS';
+
+ useEffect(() => {
+ if (isDarkMode) {
+ document.body.classList.remove('lightMode');
+ document.body.classList.add('darkMode');
+ } else {
+ document.body.classList.add('lightMode');
+ document.body.classList.remove('darkMode');
+ }
+ }, [isDarkMode]);
+
+ const isSideNavCollapsed = getLocalStorageKey(IS_SIDEBAR_COLLAPSED);
+
return (
- <Layout className={isDarkMode ? 'darkMode' : 'lightMode'}>
+ <Layout
+ className={cx(
+ isDarkMode ? 'darkMode' : 'lightMode',
+ isSideNavCollapsed ? 'sidebarCollapsed' : '',
+ )}
+ >
<Helmet>
<title>{pageTitle}</title>
</Helmet>
@@ -259,12 +308,21 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
<Flex className={cx('app-layout', isDarkMode ? 'darkMode' : 'lightMode')}>
{isToDisplayLayout && !renderFullScreen && (
- <SideNav licenseData={licenseData} isFetching={isFetching} />
+ <SideNav
+ licenseData={licenseData}
+ isFetching={isFetching}
+ onCollapse={onCollapse}
+ collapsed={collapsed}
+ />
)}
- <div className="app-content">
+ <div className={cx('app-content', collapsed ? 'collapsed' : '')}>
<ErrorBoundary FallbackComponent={ErrorBoundaryFallback}>
<LayoutContent>
- <ChildrenContainer>
+ <ChildrenContainer
+ style={{
+ margin: isLogsView() || isTracesView() ? 0 : ' 0 1rem',
+ }}
+ >
{isToDisplayLayout && !renderFullScreen && <TopNav />}
{children}
</ChildrenContainer>
diff --git a/frontend/src/container/AppLayout/styles.ts b/frontend/src/container/AppLayout/styles.ts
index 81d75ab76a..c2323055b8 100644
--- a/frontend/src/container/AppLayout/styles.ts
+++ b/frontend/src/container/AppLayout/styles.ts
@@ -18,7 +18,6 @@ export const LayoutContent = styled(LayoutComponent.Content)`
`;
export const ChildrenContainer = styled.div`
- margin: 0 1rem;
display: flex;
flex-direction: column;
height: 100%;
diff --git a/frontend/src/container/EditRules/index.tsx b/frontend/src/container/EditRules/index.tsx
index b6a32615a6..206c9d2d3e 100644
--- a/frontend/src/container/EditRules/index.tsx
+++ b/frontend/src/container/EditRules/index.tsx
@@ -7,16 +7,18 @@ function EditRules({ initialValue, ruleId }: EditRulesProps): JSX.Element {
const [formInstance] = Form.useForm();
return (
- <FormAlertRules
- alertType={
- initialValue.alertType
- ? (initialValue.alertType as AlertTypes)
- : AlertTypes.METRICS_BASED_ALERT
- }
- formInstance={formInstance}
- initialValue={initialValue}
- ruleId={ruleId}
- />
+ <div style={{ marginTop: '1rem' }}>
+ <FormAlertRules
+ alertType={
+ initialValue.alertType
+ ? (initialValue.alertType as AlertTypes)
+ : AlertTypes.METRICS_BASED_ALERT
+ }
+ formInstance={formInstance}
+ initialValue={initialValue}
+ ruleId={ruleId}
+ />
+ </div>
);
}
diff --git a/frontend/src/container/EmptyLogsSearch/EmptyLogsSearch.styles.scss b/frontend/src/container/EmptyLogsSearch/EmptyLogsSearch.styles.scss
new file mode 100644
index 0000000000..c9e54599e8
--- /dev/null
+++ b/frontend/src/container/EmptyLogsSearch/EmptyLogsSearch.styles.scss
@@ -0,0 +1,30 @@
+.empty-logs-search-container {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ height: 240px;
+
+ .empty-logs-search-container-content {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+
+ color: var(--text-vanilla-400);
+ font-family: Inter;
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 18px; /* 128.571% */
+ letter-spacing: -0.07px;
+
+ .empty-state-svg {
+ height: 50px;
+ width: 50px;
+ }
+
+ .sub-text {
+ font-weight: 600;
+ }
+ }
+}
diff --git a/frontend/src/container/EmptyLogsSearch/EmptyLogsSearch.tsx b/frontend/src/container/EmptyLogsSearch/EmptyLogsSearch.tsx
new file mode 100644
index 0000000000..af3d768d4b
--- /dev/null
+++ b/frontend/src/container/EmptyLogsSearch/EmptyLogsSearch.tsx
@@ -0,0 +1,21 @@
+import './EmptyLogsSearch.styles.scss';
+
+import { Typography } from 'antd';
+
+export default function EmptyLogsSearch(): JSX.Element {
+ return (
+ <div className="empty-logs-search-container">
+ <div className="empty-logs-search-container-content">
+ <img
+ src="/Icons/emptyState.svg"
+ alt="thinking-emoji"
+ className="empty-state-svg"
+ />
+ <Typography.Text>
+ <span className="sub-text">This query had no results. </span>
+ Edit your query and try again!
+ </Typography.Text>
+ </div>
+ </div>
+ );
+}
diff --git a/frontend/src/container/ExplorerOptions/ExplorerOptions.styles.scss b/frontend/src/container/ExplorerOptions/ExplorerOptions.styles.scss
new file mode 100644
index 0000000000..3d04f3741a
--- /dev/null
+++ b/frontend/src/container/ExplorerOptions/ExplorerOptions.styles.scss
@@ -0,0 +1,307 @@
+.explorer-update {
+ position: fixed;
+ bottom: 16px;
+ left: calc(50% - 225px);
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 10px 12px;
+ border-radius: 50px;
+ border: 1px solid var(--bg-slate-400);
+ background: rgba(22, 24, 29, 0.6);
+ box-shadow: 4px 4px 16px 4px rgba(0, 0, 0, 0.25);
+ backdrop-filter: blur(20px);
+
+ .action-icon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ padding: 8px;
+ border-radius: 50px;
+ border: 1px solid var(--bg-slate-400);
+ background: var(--bg-slate-500);
+ cursor: pointer;
+ }
+
+ .ant-divider {
+ margin: 0;
+ height: 28px;
+ border: 1px solid var(--bg-slate-400);
+ }
+}
+
+.explorer-options {
+ display: flex;
+ gap: 16px;
+ padding: 10px 12px;
+ border-radius: 50px;
+ border: 1px solid var(--bg-slate-400);
+ background: rgba(22, 24, 29, 0.6);
+ box-shadow: 4px 4px 16px 4px rgba(0, 0, 0, 0.25);
+ backdrop-filter: blur(20px);
+ position: fixed;
+ bottom: 16px;
+ left: calc(50% + 240px);
+ transform: translate(calc(-50% - 120px), 0);
+ transition: left 0.2s linear;
+
+ .ant-select-selector {
+ padding: 0 !important;
+ }
+
+ hr {
+ border-color: #1d212d;
+ }
+
+ .view-options,
+ .actions {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: 8px;
+
+ button {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: 8px;
+
+ border: 1px solid #1d2023;
+ color: #c0c1c3;
+ background-color: #161922;
+
+ box-shadow: none !important;
+
+ &.ant-btn-round {
+ padding-inline-start: 10px;
+ padding-inline-end: 8px;
+ font-weight: 500;
+ }
+
+ &.ant-btn-round:disabled {
+ background-color: rgba(209, 209, 209, 0.074);
+ color: #5f5f5f;
+ }
+ }
+
+ .ant-select-focused {
+ border-color: transparent !important;
+
+ .ant-select-selector {
+ border-color: transparent !important;
+ box-shadow: none !important;
+ }
+ }
+
+ .ant-select-selector {
+ border: transparent !important;
+ background-color: transparent !important;
+
+ .ant-select-selection-placeholder {
+ margin-left: 12px;
+ }
+ }
+ }
+}
+
+.app-content {
+ &.collapsed {
+ .explorer-options {
+ left: calc(50% + 72px);
+ }
+ }
+}
+
+.render-options {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ padding: 0 2px;
+ color: var(--bg-vanilla-400);
+ font-family: Inter;
+ font-size: 12px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 20px; /* 142.857% */
+ letter-spacing: -0.07px;
+
+ .dot {
+ margin-left: 6px;
+ min-height: 6px;
+ min-width: 6px;
+ border-radius: 50%;
+ backdrop-filter: blur(20px);
+ }
+}
+
+.save-view-modal {
+ width: 384px !important;
+ .ant-modal-content {
+ padding: 0;
+ border-radius: 4px;
+ border: 1px solid var(--bg-slate-500);
+ background: var(--bg-ink-400);
+ box-shadow: 0px -4px 16px 2px rgba(0, 0, 0, 0.2);
+
+ .ant-modal-header {
+ padding: 16px;
+ background: var(--bg-ink-400);
+ border-bottom: 1px solid var(--bg-slate-500);
+ }
+
+ .ant-modal-body {
+ padding: 12px 16px 0px 16px;
+
+ .ant-typography {
+ color: var(--bg-vanilla-100);
+ font-family: Inter;
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 500;
+ line-height: 20px; /* 142.857% */
+ }
+
+ .save-view-input {
+ margin-top: 8px;
+ display: flex;
+ gap: 8px;
+ }
+
+ .ant-color-picker-trigger {
+ padding: 6px;
+ border-radius: 2px;
+ border: 1px solid var(--bg-slate-400);
+ background: var(--bg-ink-300);
+ width: 32px;
+ height: 32px;
+
+ .ant-color-picker-color-block {
+ border-radius: 50px;
+ width: 16px;
+ height: 16px;
+ flex-shrink: 0;
+
+ .ant-color-picker-color-block-inner {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+ }
+ }
+ }
+
+ .ant-modal-footer {
+ display: flex;
+ justify-content: flex-end;
+ padding: 16px 16px;
+ margin: 0;
+
+ > button {
+ display: flex;
+ align-items: center;
+ border-radius: 2px;
+ background-color: var(--bg-robin-500) !important;
+ color: var(--bg-vanilla-100) !important;
+ font-family: Inter;
+ font-size: 12px;
+ font-style: normal;
+ font-weight: 500;
+ line-height: 24px;
+ }
+ }
+ }
+ .title {
+ color: var(--bg-vanilla-100);
+ font-family: Inter;
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 20px;
+ }
+}
+
+.lightMode {
+ .explorer-options {
+ border: 1px solid var(--bg-vanilla-300);
+ background: rgba(255, 255, 255, 0.8);
+ box-shadow: 4px 4px 16px 4px rgba(255, 255, 255, 0.55);
+ backdrop-filter: blur(20px);
+
+ hr {
+ border-color: var(--bg-vanilla-300);
+ }
+
+ .view-options,
+ .actions {
+ button {
+ border: 1px solid var(--bg-vanilla-300);
+ color: var(--bg-ink-200);
+ background-color: var(--bg-vanilla-300);
+ }
+ }
+ }
+
+ .render-options {
+ color: var(--bg-ink-200);
+ }
+
+ .explorer-update {
+ border: 1px solid var(--bg-vanilla-300);
+ background: transparent;
+ box-shadow: 4px 4px 16px 4px rgba(255, 255, 255, 0.55);
+ backdrop-filter: blur(20px);
+
+ .action-icon {
+ border: 1px solid var(--bg-vanilla-300);
+ background: var(--bg-vanilla-300);
+ }
+
+ .ant-divider {
+ border-color: var(--bg-vanilla-300);
+ }
+ }
+
+ .ant-tooltip-arrow {
+ border-top-color: var(--bg-vanilla-300) !important;
+ }
+
+ .ant-tooltip-inner {
+ background-color: var(--bg-vanilla-300);
+ color: var(--bg-ink-200);
+ }
+
+ .save-view-modal {
+ .ant-modal-content {
+ background: var(--bg-vanilla-200);
+ border-color: var(--bg-vanilla-300);
+
+ .ant-modal-header {
+ background: var(--bg-vanilla-200);
+ border-bottom: 1px solid var(--bg-vanilla-300);
+ }
+
+ .ant-modal-body {
+ .ant-typography {
+ color: var(--bg-ink-200);
+ }
+
+ .ant-color-picker-trigger {
+ border: 1px solid var(--bg-vanilla-300);
+ background: var(--bg-vanilla-100);
+
+ .ant-color-picker-color-block {
+ .ant-color-picker-color-block-inner {
+ svg {
+ fill: var(--bg-ink-200);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ .title {
+ color: var(--bg-ink-200);
+ }
+ }
+}
diff --git a/frontend/src/container/ExplorerOptions/ExplorerOptions.tsx b/frontend/src/container/ExplorerOptions/ExplorerOptions.tsx
new file mode 100644
index 0000000000..7f7675561e
--- /dev/null
+++ b/frontend/src/container/ExplorerOptions/ExplorerOptions.tsx
@@ -0,0 +1,413 @@
+import './ExplorerOptions.styles.scss';
+
+import { Color } from '@signozhq/design-tokens';
+import {
+ Button,
+ ColorPicker,
+ Divider,
+ Input,
+ Modal,
+ RefSelectProps,
+ Select,
+ Tooltip,
+ Typography,
+} from 'antd';
+import axios from 'axios';
+import { getViewDetailsUsingViewKey } from 'components/ExplorerCard/utils';
+import { SOMETHING_WENT_WRONG } from 'constants/api';
+import { QueryParams } from 'constants/query';
+import { PANEL_TYPES } from 'constants/queryBuilder';
+import ROUTES from 'constants/routes';
+import ExportPanelContainer from 'container/ExportPanel/ExportPanelContainer';
+import { useGetSearchQueryParam } from 'hooks/queryBuilder/useGetSearchQueryParam';
+import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
+import { useGetAllViews } from 'hooks/saveViews/useGetAllViews';
+import { useSaveView } from 'hooks/saveViews/useSaveView';
+import { useUpdateView } from 'hooks/saveViews/useUpdateView';
+import { useIsDarkMode } from 'hooks/useDarkMode';
+import useErrorNotification from 'hooks/useErrorNotification';
+import { useHandleExplorerTabChange } from 'hooks/useHandleExplorerTabChange';
+import { useNotifications } from 'hooks/useNotifications';
+import { mapCompositeQueryFromQuery } from 'lib/newQueryBuilder/queryBuilderMappers/mapCompositeQueryFromQuery';
+import { Check, ConciergeBell, Disc3, Plus, X, XCircle } from 'lucide-react';
+import { CSSProperties, useCallback, useMemo, useRef, useState } from 'react';
+import { useHistory } from 'react-router-dom';
+import { Dashboard } from 'types/api/dashboard/getAll';
+import { Query } from 'types/api/queryBuilder/queryBuilderData';
+import { DataSource } from 'types/common/queryBuilder';
+
+import {
+ DATASOURCE_VS_ROUTES,
+ generateRGBAFromHex,
+ getRandomColor,
+ saveNewViewHandler,
+} from './utils';
+
+function ExplorerOptions({
+ disabled,
+ isLoading,
+ onExport,
+ query,
+ sourcepage,
+}: ExplorerOptionsProps): JSX.Element {
+ const [isExport, setIsExport] = useState<boolean>(false);
+ const [isSaveModalOpen, setIsSaveModalOpen] = useState(false);
+ const [newViewName, setNewViewName] = useState<string>('');
+ const [color, setColor] = useState(Color.BG_SIENNA_500);
+ const { notifications } = useNotifications();
+ const history = useHistory();
+ const ref = useRef<RefSelectProps>(null);
+ const isDarkMode = useIsDarkMode();
+
+ const onModalToggle = useCallback((value: boolean) => {
+ setIsExport(value);
+ }, []);
+
+ const handleSaveViewModalToggle = (): void => {
+ setIsSaveModalOpen(!isSaveModalOpen);
+ };
+
+ const hideSaveViewModal = (): void => {
+ setIsSaveModalOpen(false);
+ };
+
+ const onCreateAlertsHandler = useCallback(() => {
+ history.push(
+ `${ROUTES.ALERTS_NEW}?${QueryParams.compositeQuery}=${encodeURIComponent(
+ JSON.stringify(query),
+ )}`,
+ );
+ }, [history, query]);
+
+ const onCancel = (value: boolean) => (): void => {
+ onModalToggle(value);
+ };
+
+ const onAddToDashboard = (): void => {
+ setIsExport(true);
+ };
+
+ const {
+ data: viewsData,
+ isLoading: viewsIsLoading,
+ error,
+ isRefetching,
+ refetch: refetchAllView,
+ } = useGetAllViews(sourcepage);
+
+ const {
+ currentQuery,
+ panelType,
+ isStagedQueryUpdated,
+ redirectWithQueryBuilderData,
+ } = useQueryBuilder();
+
+ const compositeQuery = mapCompositeQueryFromQuery(currentQuery, panelType);
+
+ const viewName = useGetSearchQueryParam(QueryParams.viewName) || '';
+ const viewKey = useGetSearchQueryParam(QueryParams.viewKey) || '';
+
+ const extraData = viewsData?.data.data.find((view) => view.uuid === viewKey)
+ ?.extraData;
+
+ const extraDataColor = extraData ? JSON.parse(extraData).color : '';
+ const rgbaColor = generateRGBAFromHex(
+ extraDataColor || Color.BG_SIENNA_500,
+ 0.08,
+ );
+
+ const {
+ mutateAsync: updateViewAsync,
+ isLoading: isViewUpdating,
+ } = useUpdateView({
+ compositeQuery,
+ viewKey,
+ extraData: extraData || JSON.stringify({ color: Color.BG_SIENNA_500 }),
+ sourcePage: sourcepage,
+ viewName,
+ });
+
+ const showErrorNotification = (err: Error): void => {
+ notifications.error({
+ message: axios.isAxiosError(err) ? err.message : SOMETHING_WENT_WRONG,
+ });
+ };
+
+ const onUpdateQueryHandler = (): void => {
+ const extraData = viewsData?.data.data.find((view) => view.uuid === viewKey)
+ ?.extraData;
+ updateViewAsync(
+ {
+ compositeQuery: mapCompositeQueryFromQuery(currentQuery, panelType),
+ viewKey,
+ extraData: extraData || JSON.stringify({ color: Color.BG_SIENNA_500 }),
+ sourcePage: sourcepage,
+ viewName,
+ },
+ {
+ onSuccess: () => {
+ notifications.success({
+ message: 'View Updated Successfully',
+ });
+ refetchAllView();
+ },
+ onError: (err) => {
+ showErrorNotification(err);
+ },
+ },
+ );
+ };
+
+ useErrorNotification(error);
+
+ const { handleExplorerTabChange } = useHandleExplorerTabChange();
+
+ const onMenuItemSelectHandler = useCallback(
+ ({ key }: { key: string }): void => {
+ const currentViewDetails = getViewDetailsUsingViewKey(
+ key,
+ viewsData?.data.data,
+ );
+ if (!currentViewDetails) return;
+ const {
+ query,
+ name,
+ uuid,
+ panelType: currentPanelType,
+ } = currentViewDetails;
+
+ handleExplorerTabChange(currentPanelType, {
+ query,
+ name,
+ uuid,
+ });
+ },
+ [viewsData, handleExplorerTabChange],
+ );
+
+ const handleSelect = (
+ value: string,
+ option: { key: string; value: string },
+ ): void => {
+ onMenuItemSelectHandler({
+ key: option.key,
+ });
+ if (ref.current) {
+ ref.current.blur();
+ }
+ };
+
+ const handleClearSelect = (): void => {
+ history.replace(DATASOURCE_VS_ROUTES[sourcepage]);
+ };
+
+ const isQueryUpdated = isStagedQueryUpdated(viewsData?.data?.data, viewKey);
+
+ const {
+ isLoading: isSaveViewLoading,
+ mutateAsync: saveViewAsync,
+ } = useSaveView({
+ viewName: newViewName || '',
+ compositeQuery,
+ sourcePage: sourcepage,
+ extraData: JSON.stringify({ color }),
+ });
+
+ const onSaveHandler = (): void => {
+ saveNewViewHandler({
+ compositeQuery,
+ handlePopOverClose: hideSaveViewModal,
+ extraData: JSON.stringify({ color }),
+ notifications,
+ panelType: panelType || PANEL_TYPES.LIST,
+ redirectWithQueryBuilderData,
+ refetchAllView,
+ saveViewAsync,
+ sourcePage: sourcepage,
+ viewName: newViewName,
+ setNewViewName,
+ });
+ };
+
+ // TODO: Remove this and move this to scss file
+ const dropdownStyle: CSSProperties = useMemo(
+ () => ({
+ borderRadius: '4px',
+ border: isDarkMode
+ ? `1px solid ${Color.BG_SLATE_400}`
+ : `1px solid ${Color.BG_VANILLA_300}`,
+ background: isDarkMode
+ ? 'linear-gradient(139deg, rgba(18, 19, 23, 0.80) 0%, rgba(18, 19, 23, 0.90) 98.68%)'
+ : 'linear-gradient(139deg, rgba(241, 241, 241, 0.8) 0%, rgba(241, 241, 241, 0.9) 98.68%)',
+ boxShadow: '4px 10px 16px 2px rgba(0, 0, 0, 0.20)',
+ backdropFilter: 'blur(20px)',
+ bottom: '74px',
+ width: '191px',
+ }),
+ [isDarkMode],
+ );
+
+ return (
+ <>
+ {isQueryUpdated && (
+ <div className="explorer-update">
+ <Tooltip title="Clear this view" placement="top">
+ <Button
+ className="action-icon"
+ onClick={handleClearSelect}
+ icon={<X size={14} />}
+ />
+ </Tooltip>
+ <Divider type="vertical" />
+ <Tooltip title="Update this view" placement="top">
+ <Button
+ className="action-icon"
+ disabled={isViewUpdating}
+ onClick={onUpdateQueryHandler}
+ icon={<Disc3 size={14} />}
+ />
+ </Tooltip>
+ </div>
+ )}
+ <div
+ className="explorer-options"
+ style={{
+ background: extraData
+ ? `linear-gradient(90deg, rgba(0,0,0,0) -5%, ${rgbaColor} 9%, rgba(0,0,0,0) 30%)`
+ : 'transparent',
+ backdropFilter: 'blur(20px)',
+ }}
+ >
+ <div className="view-options">
+ <Select<string, { key: string; value: string }>
+ showSearch
+ placeholder="Select a view"
+ loading={viewsIsLoading || isRefetching}
+ value={viewName || undefined}
+ onSelect={handleSelect}
+ style={{
+ minWidth: 170,
+ }}
+ dropdownStyle={dropdownStyle}
+ className="views-dropdown"
+ allowClear={{
+ clearIcon: <XCircle size={16} style={{ marginTop: '-3px' }} />,
+ }}
+ onClear={handleClearSelect}
+ ref={ref}
+ >
+ {viewsData?.data.data.map((view) => {
+ const extraData =
+ view.extraData !== '' ? JSON.parse(view.extraData) : '';
+ let bgColor = getRandomColor();
+ if (extraData !== '') {
+ bgColor = extraData.color;
+ }
+ return (
+ <Select.Option key={view.uuid} value={view.name}>
+ <div className="render-options">
+ <span
+ className="dot"
+ style={{
+ background: bgColor,
+ boxShadow: `0px 0px 6px 0px ${bgColor}`,
+ }}
+ />{' '}
+ {view.name}
+ </div>
+ </Select.Option>
+ );
+ })}
+ </Select>
+
+ <Button
+ shape="round"
+ onClick={handleSaveViewModalToggle}
+ disabled={viewsIsLoading || isRefetching}
+ >
+ <Disc3 size={16} /> Save this view
+ </Button>
+ </div>
+
+ <hr />
+
+ <div className="actions">
+ <Tooltip title="Create Alerts">
+ <Button
+ disabled={disabled}
+ shape="circle"
+ onClick={onCreateAlertsHandler}
+ >
+ <ConciergeBell size={16} />
+ </Button>
+ </Tooltip>
+
+ <Tooltip title="Add to Dashboard">
+ <Button disabled={disabled} shape="circle" onClick={onAddToDashboard}>
+ <Plus size={16} />
+ </Button>
+ </Tooltip>
+ </div>
+ </div>
+
+ <Modal
+ className="save-view-modal"
+ title={<span className="title">Save this view</span>}
+ open={isSaveModalOpen}
+ closable
+ onCancel={hideSaveViewModal}
+ footer={[
+ <Button
+ key="submit"
+ type="primary"
+ icon={<Check size={16} />}
+ onClick={onSaveHandler}
+ disabled={isSaveViewLoading}
+ >
+ Save this view
+ </Button>,
+ ]}
+ >
+ <Typography.Text>Label</Typography.Text>
+ <div className="save-view-input">
+ <ColorPicker
+ value={color}
+ onChange={(value, hex): void => setColor(hex)}
+ />
+ <Input
+ placeholder="e.g. External http method view"
+ value={newViewName}
+ onChange={(e): void => setNewViewName(e.target.value)}
+ />
+ </div>
+ </Modal>
+
+ <Modal
+ footer={null}
+ onOk={onCancel(false)}
+ onCancel={onCancel(false)}
+ open={isExport}
+ centered
+ destroyOnClose
+ >
+ <ExportPanelContainer
+ query={query}
+ isLoading={isLoading}
+ onExport={onExport}
+ />
+ </Modal>
+ </>
+ );
+}
+
+export interface ExplorerOptionsProps {
+ isLoading?: boolean;
+ onExport: (dashboard: Dashboard | null) => void;
+ query: Query | null;
+ disabled: boolean;
+ sourcepage: DataSource;
+}
+
+ExplorerOptions.defaultProps = { isLoading: false };
+
+export default ExplorerOptions;
diff --git a/frontend/src/container/ExplorerOptions/types.ts b/frontend/src/container/ExplorerOptions/types.ts
new file mode 100644
index 0000000000..398fe0d8a0
--- /dev/null
+++ b/frontend/src/container/ExplorerOptions/types.ts
@@ -0,0 +1,28 @@
+import { NotificationInstance } from 'antd/es/notification/interface';
+import { AxiosResponse } from 'axios';
+import { SaveViewWithNameProps } from 'components/ExplorerCard/types';
+import { PANEL_TYPES } from 'constants/queryBuilder';
+import { Dispatch, SetStateAction } from 'react';
+import { UseMutateAsyncFunction } from 'react-query';
+import { ICompositeMetricQuery } from 'types/api/alerts/compositeQuery';
+import { SaveViewPayloadProps, SaveViewProps } from 'types/api/saveViews/types';
+import { DataSource, QueryBuilderContextType } from 'types/common/queryBuilder';
+
+export interface SaveNewViewHandlerProps {
+ viewName: string;
+ compositeQuery: ICompositeMetricQuery;
+ sourcePage: DataSource;
+ extraData: SaveViewProps['extraData'];
+ panelType: PANEL_TYPES | null;
+ notifications: NotificationInstance;
+ refetchAllView: SaveViewWithNameProps['refetchAllView'];
+ saveViewAsync: UseMutateAsyncFunction<
+ AxiosResponse<SaveViewPayloadProps>,
+ Error,
+ SaveViewProps,
+ SaveViewPayloadProps
+ >;
+ handlePopOverClose: SaveViewWithNameProps['handlePopOverClose'];
+ redirectWithQueryBuilderData: QueryBuilderContextType['redirectWithQueryBuilderData'];
+ setNewViewName: Dispatch<SetStateAction<string>>;
+}
diff --git a/frontend/src/container/ExplorerOptions/utils.ts b/frontend/src/container/ExplorerOptions/utils.ts
new file mode 100644
index 0000000000..e3ac710609
--- /dev/null
+++ b/frontend/src/container/ExplorerOptions/utils.ts
@@ -0,0 +1,69 @@
+import { Color } from '@signozhq/design-tokens';
+import { showErrorNotification } from 'components/ExplorerCard/utils';
+import { QueryParams } from 'constants/query';
+import ROUTES from 'constants/routes';
+import { mapQueryDataFromApi } from 'lib/newQueryBuilder/queryBuilderMappers/mapQueryDataFromApi';
+import { DataSource } from 'types/common/queryBuilder';
+
+import { SaveNewViewHandlerProps } from './types';
+
+export const getRandomColor = (): Color => {
+ const colorKeys = Object.keys(Color) as (keyof typeof Color)[];
+ const randomKey = colorKeys[Math.floor(Math.random() * colorKeys.length)];
+ return Color[randomKey];
+};
+
+export const DATASOURCE_VS_ROUTES: Record<DataSource, string> = {
+ [DataSource.METRICS]: '',
+ [DataSource.TRACES]: ROUTES.TRACES_EXPLORER,
+ [DataSource.LOGS]: ROUTES.LOGS_EXPLORER,
+};
+
+export const saveNewViewHandler = ({
+ saveViewAsync,
+ refetchAllView,
+ notifications,
+ handlePopOverClose,
+ viewName,
+ compositeQuery,
+ sourcePage,
+ extraData,
+ redirectWithQueryBuilderData,
+ panelType,
+ setNewViewName,
+}: SaveNewViewHandlerProps): void => {
+ saveViewAsync(
+ {
+ viewName,
+ compositeQuery,
+ sourcePage,
+ extraData,
+ },
+ {
+ onSuccess: (data) => {
+ refetchAllView();
+ redirectWithQueryBuilderData(mapQueryDataFromApi(compositeQuery), {
+ [QueryParams.panelTypes]: panelType,
+ [QueryParams.viewName]: viewName,
+ [QueryParams.viewKey]: data.data.data,
+ });
+ notifications.success({
+ message: 'View Saved Successfully',
+ });
+ },
+ onError: (err) => {
+ showErrorNotification(notifications, err);
+ },
+ onSettled: () => {
+ handlePopOverClose();
+ setNewViewName('');
+ },
+ },
+ );
+};
+
+export const generateRGBAFromHex = (hex: string, opacity: number): string =>
+ `rgba(${parseInt(hex.slice(1, 3), 16)}, ${parseInt(
+ hex.slice(3, 5),
+ 16,
+ )}, ${parseInt(hex.slice(5, 7), 16)}, ${opacity})`;
diff --git a/frontend/src/container/ExportPanel/ExportPanel.tsx b/frontend/src/container/ExportPanel/ExportPanelContainer.tsx
similarity index 95%
rename from frontend/src/container/ExportPanel/ExportPanel.tsx
rename to frontend/src/container/ExportPanel/ExportPanelContainer.tsx
index eda643dde9..df2d4f8720 100644
--- a/frontend/src/container/ExportPanel/ExportPanel.tsx
+++ b/frontend/src/container/ExportPanel/ExportPanelContainer.tsx
@@ -16,7 +16,10 @@ import {
} from './styles';
import { filterOptions, getSelectOptions } from './utils';
-function ExportPanel({ isLoading, onExport }: ExportPanelProps): JSX.Element {
+function ExportPanelContainer({
+ isLoading,
+ onExport,
+}: ExportPanelProps): JSX.Element {
const { t } = useTranslation(['dashboard']);
const [selectedDashboardId, setSelectedDashboardId] = useState<string | null>(
@@ -118,4 +121,4 @@ function ExportPanel({ isLoading, onExport }: ExportPanelProps): JSX.Element {
);
}
-export default ExportPanel;
+export default ExportPanelContainer;
diff --git a/frontend/src/container/ExportPanel/index.tsx b/frontend/src/container/ExportPanel/index.tsx
index c3751c7e58..f302d83212 100644
--- a/frontend/src/container/ExportPanel/index.tsx
+++ b/frontend/src/container/ExportPanel/index.tsx
@@ -1,13 +1,9 @@
-import { AlertOutlined, AreaChartOutlined } from '@ant-design/icons';
-import { Button, Modal, Space } from 'antd';
-import { QueryParams } from 'constants/query';
-import ROUTES from 'constants/routes';
-import history from 'lib/history';
+import { Modal } from 'antd';
import { useCallback, useState } from 'react';
import { Dashboard } from 'types/api/dashboard/getAll';
import { Query } from 'types/api/queryBuilder/queryBuilderData';
-import ExportPanelContainer from './ExportPanel';
+import ExportPanelContainer from './ExportPanelContainer';
function ExportPanel({
isLoading,
@@ -20,53 +16,25 @@ function ExportPanel({
setIsExport(value);
}, []);
- const onCreateAlertsHandler = useCallback(() => {
- history.push(
- `${ROUTES.ALERTS_NEW}?${QueryParams.compositeQuery}=${encodeURIComponent(
- JSON.stringify(query),
- )}`,
- );
- }, [query]);
-
const onCancel = (value: boolean) => (): void => {
onModalToggle(value);
};
- const onAddToDashboard = (): void => {
- setIsExport(true);
- };
-
return (
- <>
- <Space size={24}>
- <Button
- icon={<AreaChartOutlined />}
- onClick={onAddToDashboard}
- type="primary"
- >
- Add to Dashboard
- </Button>
-
- <Button onClick={onCreateAlertsHandler} icon={<AlertOutlined />}>
- Setup Alerts
- </Button>
- </Space>
-
- <Modal
- footer={null}
- onOk={onCancel(false)}
- onCancel={onCancel(false)}
- open={isExport}
- centered
- destroyOnClose
- >
- <ExportPanelContainer
- query={query}
- isLoading={isLoading}
- onExport={onExport}
- />
- </Modal>
- </>
+ <Modal
+ footer={null}
+ onOk={onCancel(false)}
+ onCancel={onCancel(false)}
+ open={isExport}
+ centered
+ destroyOnClose
+ >
+ <ExportPanelContainer
+ query={query}
+ isLoading={isLoading}
+ onExport={onExport}
+ />
+ </Modal>
);
}
diff --git a/frontend/src/container/FormAlertRules/ChartPreview/index.tsx b/frontend/src/container/FormAlertRules/ChartPreview/index.tsx
index 73b1f4715e..97b540df35 100644
--- a/frontend/src/container/FormAlertRules/ChartPreview/index.tsx
+++ b/frontend/src/container/FormAlertRules/ChartPreview/index.tsx
@@ -5,6 +5,7 @@ import GridPanelSwitch from 'container/GridPanelSwitch';
import { getFormatNameByOptionId } from 'container/NewWidget/RightContainer/alertFomatCategories';
import { timePreferenceType } from 'container/NewWidget/RightContainer/timeItems';
import { Time } from 'container/TopNav/DateTimeSelection/config';
+import { Time as TimeV2 } from 'container/TopNav/DateTimeSelectionV2/config';
import { useGetQueryRange } from 'hooks/queryBuilder/useGetQueryRange';
import { useIsDarkMode } from 'hooks/useDarkMode';
import { useResizeObserver } from 'hooks/useDimensions';
@@ -28,7 +29,7 @@ export interface ChartPreviewProps {
query: Query | null;
graphType?: PANEL_TYPES;
selectedTime?: timePreferenceType;
- selectedInterval?: Time;
+ selectedInterval?: Time | TimeV2;
headline?: JSX.Element;
alertDef?: AlertDef;
userQueryKey?: string;
diff --git a/frontend/src/container/FormAlertRules/QuerySection.styles.scss b/frontend/src/container/FormAlertRules/QuerySection.styles.scss
new file mode 100644
index 0000000000..ee3f4892af
--- /dev/null
+++ b/frontend/src/container/FormAlertRules/QuerySection.styles.scss
@@ -0,0 +1,61 @@
+.alert-tabs {
+ .ant-tabs-tab {
+ border: none !important;
+ margin-left: 0px !important;
+ padding: 0px !important;
+
+ .nav-btns {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ .prom-ql-icon {
+ height: 14px;
+ width: 14px;
+ }
+ }
+ .ant-btn-default {
+ border-color: transparent;
+ }
+ }
+ .ant-tabs-tab-active {
+ .nav-btns {
+ background: var(--bg-slate-400) !important;
+ }
+ }
+
+ .ant-tabs-nav {
+ margin: 0px;
+ margin-bottom: 0.5rem;
+ }
+ .ant-tabs-nav::before {
+ border-bottom: none !important;
+ }
+ .ant-tabs-nav-list {
+ border: 1px solid var(--bg-slate-200);
+ }
+ .ant-tabs-tab + .ant-tabs-tab {
+ border-left: 1px solid var(--bg-slate-200) !important;
+ }
+
+ .stage-run-query {
+ display: flex;
+ align-items: center;
+ }
+}
+
+.lightMode {
+ .alert-tabs {
+ .ant-tabs-nav-list {
+ border: 1px solid var(--bg-vanilla-300);
+ }
+ .ant-tabs-tab + .ant-tabs-tab {
+ border-left: 1px solid var(--bg-vanilla-200) !important;
+ }
+ .ant-tabs-tab-active {
+ .nav-btns {
+ background: var(--bg-vanilla-300) !important;
+ }
+ }
+ }
+}
diff --git a/frontend/src/container/FormAlertRules/QuerySection.tsx b/frontend/src/container/FormAlertRules/QuerySection.tsx
index 4ccac39fc4..619e61af2f 100644
--- a/frontend/src/container/FormAlertRules/QuerySection.tsx
+++ b/frontend/src/container/FormAlertRules/QuerySection.tsx
@@ -1,8 +1,11 @@
-import { Button, Tabs } from 'antd';
+import './QuerySection.styles.scss';
+
+import { Button, Tabs, Tooltip } from 'antd';
import { ALERTS_DATA_SOURCE_MAP } from 'constants/alerts';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { QueryBuilder } from 'container/QueryBuilder';
-import { useMemo } from 'react';
+import { Atom, Play, Terminal } from 'lucide-react';
+import { useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
import { AppState } from 'store/reducers';
@@ -22,6 +25,7 @@ function QuerySection({
}: QuerySectionProps): JSX.Element {
// init namespace for translations
const { t } = useTranslation('alerts');
+ const [currentTab, setCurrentTab] = useState(queryCategory);
const { featureResponse } = useSelector<AppState, AppReducer>(
(state) => state.app,
@@ -31,6 +35,7 @@ function QuerySection({
featureResponse.refetch().then(() => {
setQueryCategory(queryType as EQueryType);
});
+ setCurrentTab(queryType as EQueryType);
};
const renderPromqlUI = (): JSX.Element => <PromqlSection />;
@@ -49,22 +54,61 @@ function QuerySection({
const tabs = [
{
- label: t('tab_qb'),
+ label: (
+ <Tooltip title="Query Builder">
+ <Button className="nav-btns">
+ <Atom size={14} />
+ </Button>
+ </Tooltip>
+ ),
key: EQueryType.QUERY_BUILDER,
},
{
- label: t('tab_chquery'),
+ label: (
+ <Tooltip title="ClickHouse">
+ <Button className="nav-btns">
+ <Terminal size={14} />
+ </Button>
+ </Tooltip>
+ ),
key: EQueryType.CLICKHOUSE,
},
];
const items = useMemo(
() => [
- { label: t('tab_qb'), key: EQueryType.QUERY_BUILDER },
- { label: t('tab_chquery'), key: EQueryType.CLICKHOUSE },
- { label: t('tab_promql'), key: EQueryType.PROM },
+ {
+ 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">
+ <img src="/Icons/promQL.svg" alt="Prom Ql" className="prom-ql-icon" />
+ </Button>
+ </Tooltip>
+ ),
+ key: EQueryType.PROM,
+ },
],
- [t],
+ [],
);
const renderTabs = (typ: AlertTypes): JSX.Element | null => {
@@ -73,40 +117,54 @@ function QuerySection({
case AlertTypes.LOGS_BASED_ALERT:
case AlertTypes.EXCEPTIONS_BASED_ALERT:
return (
- <Tabs
- type="card"
- style={{ width: '100%' }}
- defaultActiveKey={EQueryType.QUERY_BUILDER}
- activeKey={queryCategory}
- onChange={handleQueryCategoryChange}
- tabBarExtraContent={
- <span style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
- <Button type="primary" onClick={runQuery}>
- Run Query
- </Button>
- </span>
- }
- items={tabs}
- />
+ <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 (
- <Tabs
- type="card"
- style={{ width: '100%' }}
- defaultActiveKey={EQueryType.QUERY_BUILDER}
- activeKey={queryCategory}
- onChange={handleQueryCategoryChange}
- tabBarExtraContent={
- <span style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
- <Button type="primary" onClick={runQuery}>
- Run Query
- </Button>
- </span>
- }
- items={items}
- />
+ <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>
);
}
};
@@ -126,8 +184,8 @@ function QuerySection({
<>
<StepHeading> {t('alert_form_step1')}</StepHeading>
<FormContainer>
- <div style={{ display: 'flex' }}>{renderTabs(alertType)}</div>
- {renderQuerySection(queryCategory)}
+ <div>{renderTabs(alertType)}</div>
+ {renderQuerySection(currentTab)}
</FormContainer>
</>
);
diff --git a/frontend/src/container/FormAlertRules/index.tsx b/frontend/src/container/FormAlertRules/index.tsx
index f8c9d36a91..b87f025f9d 100644
--- a/frontend/src/container/FormAlertRules/index.tsx
+++ b/frontend/src/container/FormAlertRules/index.tsx
@@ -142,6 +142,10 @@ function FormAlertRules({
// onQueryCategoryChange handles changes to query category
// in state as well as sets additional defaults
const onQueryCategoryChange = (val: EQueryType): void => {
+ const element = document.getElementById('top');
+ if (element) {
+ element.scrollIntoView({ behavior: 'smooth' });
+ }
if (val === EQueryType.PROM) {
setAlertDef({
...alertDef,
@@ -465,7 +469,7 @@ function FormAlertRules({
<>
{Element}
- <PanelContainer>
+ <PanelContainer id="top">
<StyledLeftContainer flex="5 1 600px" md={18}>
<MainFormContainer
initialValues={initialValue}
diff --git a/frontend/src/container/FormAlertRules/styles.ts b/frontend/src/container/FormAlertRules/styles.ts
index 7c038b358e..9fcaf4c59c 100644
--- a/frontend/src/container/FormAlertRules/styles.ts
+++ b/frontend/src/container/FormAlertRules/styles.ts
@@ -76,6 +76,10 @@ export const FormContainer = styled(Card)`
display: flex;
flex-direction: column;
border-radius: 4px;
+
+ .ant-card-body {
+ padding: 12px;
+ }
`;
export const TextareaMedium = styled(TextArea)`
diff --git a/frontend/src/container/Header/index.tsx b/frontend/src/container/Header/index.tsx
index b008e65537..191f83e38b 100644
--- a/frontend/src/container/Header/index.tsx
+++ b/frontend/src/container/Header/index.tsx
@@ -51,7 +51,7 @@ function HeaderContainer(): JSX.Element {
const isDarkMode = useIsDarkMode();
const { toggleTheme } = useThemeMode();
const [showTrialExpiryBanner, setShowTrialExpiryBanner] = useState(false);
- const [homeRoute, setHomeRoute] = useState(ROUTES.APPLICATION);
+ const [homeRoute, setHomeRoute] = useState<string>(ROUTES.APPLICATION);
const [isUserDropDownOpen, setIsUserDropDownOpen] = useState<boolean>(false);
diff --git a/frontend/src/container/LiveLogs/LiveLogsList/index.tsx b/frontend/src/container/LiveLogs/LiveLogsList/index.tsx
index 39fd297bea..3d208c0e93 100644
--- a/frontend/src/container/LiveLogs/LiveLogsList/index.tsx
+++ b/frontend/src/container/LiveLogs/LiveLogsList/index.tsx
@@ -1,5 +1,6 @@
import { Card, Typography } from 'antd';
import LogDetail from 'components/LogDetail';
+import { VIEW_TYPES } from 'components/LogDetail/constants';
import ListLogView from 'components/Logs/ListLogView';
import RawLogView from 'components/Logs/RawLogView';
import Spinner from 'components/Spinner';
@@ -13,7 +14,6 @@ import { Heading } from 'container/LogsTable/styles';
import { useOptionsMenu } from 'container/OptionsMenu';
import { useActiveLog } from 'hooks/logs/useActiveLog';
import { useCopyLogLink } from 'hooks/logs/useCopyLogLink';
-import useFontFaceObserver from 'hooks/useFontObserver';
import { useEventSource } from 'providers/EventSource';
import { memo, useCallback, useEffect, useMemo, useRef } from 'react';
import { useTranslation } from 'react-i18next';
@@ -51,19 +51,6 @@ function LiveLogsList({ logs }: LiveLogsListProps): JSX.Element {
[logs, activeLogId],
);
- useFontFaceObserver(
- [
- {
- family: 'Fira Code',
- weight: '300',
- },
- ],
- options.format === 'raw',
- {
- timeout: 5000,
- },
- );
-
const selectedFields = convertKeysToColumnFields(options.selectColumns);
const getItemContent = useCallback(
@@ -150,6 +137,7 @@ function LiveLogsList({ logs }: LiveLogsListProps): JSX.Element {
</InfinityWrapperStyled>
)}
<LogDetail
+ selectedTab={VIEW_TYPES.OVERVIEW}
log={activeLog}
onClose={onClearActiveLog}
onAddToQuery={onAddToQuery}
diff --git a/frontend/src/container/LogDetailedView/ActionItem.tsx b/frontend/src/container/LogDetailedView/ActionItem.tsx
index 8c476c2c99..73a662ea91 100644
--- a/frontend/src/container/LogDetailedView/ActionItem.tsx
+++ b/frontend/src/container/LogDetailedView/ActionItem.tsx
@@ -29,11 +29,11 @@ function ActionItem({
() => (
<Col>
<Button type="text" size="small" onClick={onClickHandler(OPERATORS.IN)}>
- <PlusCircleOutlined /> Filter for value
+ <PlusCircleOutlined size={12} /> Filter for value
</Button>
<br />
<Button type="text" size="small" onClick={onClickHandler(OPERATORS.NIN)}>
- <MinusCircleOutlined /> Filter out value
+ <MinusCircleOutlined size={12} /> Filter out value
</Button>
</Col>
),
diff --git a/frontend/src/container/LogDetailedView/ContextView/ContextView.styles.scss b/frontend/src/container/LogDetailedView/ContextView/ContextView.styles.scss
new file mode 100644
index 0000000000..bc8ae4f719
--- /dev/null
+++ b/frontend/src/container/LogDetailedView/ContextView/ContextView.styles.scss
@@ -0,0 +1,3 @@
+.log-context-container {
+ border: 1px solid var(--bg-slate-400);
+}
\ No newline at end of file
diff --git a/frontend/src/container/LogDetailedView/ContextView/ContextView.tsx b/frontend/src/container/LogDetailedView/ContextView/ContextView.tsx
new file mode 100644
index 0000000000..e3a3c2d67b
--- /dev/null
+++ b/frontend/src/container/LogDetailedView/ContextView/ContextView.tsx
@@ -0,0 +1,54 @@
+import './ContextView.styles.scss';
+
+import RawLogView from 'components/Logs/RawLogView';
+import LogsContextList from 'container/LogsContextList';
+import { ORDERBY_FILTERS } from 'container/QueryBuilder/filters/OrderByFilter/config';
+import { ILog } from 'types/api/logs/log';
+import { Query, TagFilter } from 'types/api/queryBuilder/queryBuilderData';
+
+interface LogContextProps {
+ log: ILog;
+ contextQuery: Query | undefined;
+ filters: TagFilter | null;
+ isEdit: boolean;
+}
+
+function ContextView({
+ log,
+ filters,
+ contextQuery,
+ isEdit,
+}: LogContextProps): JSX.Element {
+ // eslint-disable-next-line react/jsx-no-useless-fragment
+ if (!contextQuery) return <></>;
+
+ return (
+ <div className="log-context-container">
+ <LogsContextList
+ className="logs-context-list-asc"
+ order={ORDERBY_FILTERS.ASC}
+ filters={filters}
+ isEdit={isEdit}
+ log={log}
+ query={contextQuery}
+ />
+ <RawLogView
+ isActiveLog
+ isReadOnly
+ isTextOverflowEllipsisDisabled={false}
+ data={log}
+ linesPerRow={1}
+ />
+ <LogsContextList
+ className="logs-context-list-desc"
+ order={ORDERBY_FILTERS.DESC}
+ filters={filters}
+ isEdit={isEdit}
+ log={log}
+ query={contextQuery}
+ />
+ </div>
+ );
+}
+
+export default ContextView;
diff --git a/frontend/src/container/LogDetailedView/FieldRenderer.styles.scss b/frontend/src/container/LogDetailedView/FieldRenderer.styles.scss
new file mode 100644
index 0000000000..bd24601b18
--- /dev/null
+++ b/frontend/src/container/LogDetailedView/FieldRenderer.styles.scss
@@ -0,0 +1,23 @@
+.field-renderer-container {
+ display: flex !important;
+ gap: 8px;
+ align-items: flex-start;
+ justify-content: space-between;
+ flex-direction: column;
+
+ .label {
+ color: var(--text-robin-400);
+ font-family: SF Mono;
+ font-family: 'Space Mono', monospace;
+ font-size: 13px;
+ font-weight: var(--font-weight-normal);
+ line-height: 18px;
+ letter-spacing: -0.005em;
+ text-align: left;
+ }
+
+ .tags {
+ display: flex;
+ gap: 8;
+ }
+}
diff --git a/frontend/src/container/LogDetailedView/FieldRenderer.styles.ts b/frontend/src/container/LogDetailedView/FieldRenderer.styles.ts
index f4aec0f843..62bb220c7e 100644
--- a/frontend/src/container/LogDetailedView/FieldRenderer.styles.ts
+++ b/frontend/src/container/LogDetailedView/FieldRenderer.styles.ts
@@ -3,18 +3,23 @@ import styled from 'styled-components';
export const TagContainer = styled(Tag)`
&&& {
+ border-color: var(--bg-slate-400);
border-radius: 0.25rem;
- padding: 0.063rem 0.5rem;
font-weight: 600;
- font-size: 0.75rem;
+ font-size: var(--font-size-xs);
line-height: 1.25rem;
}
`;
export const TagLabel = styled.span`
font-weight: 400;
+ font-size: 12px;
`;
export const TagValue = styled.span`
+ color: var(--text-sakura-400);
+ /* background-color: var(--bg-slate-400); */
text-transform: capitalize;
+ font-size: var(--font-size-xs);
+ font-weight: 400;
`;
diff --git a/frontend/src/container/LogDetailedView/FieldRenderer.tsx b/frontend/src/container/LogDetailedView/FieldRenderer.tsx
index 8df55e491a..b32017b5d5 100644
--- a/frontend/src/container/LogDetailedView/FieldRenderer.tsx
+++ b/frontend/src/container/LogDetailedView/FieldRenderer.tsx
@@ -1,4 +1,6 @@
-import { blue } from '@ant-design/colors';
+import './FieldRenderer.styles.scss';
+
+import { Divider, Tooltip, Typography } from 'antd';
import { TagContainer, TagLabel, TagValue } from './FieldRenderer.styles';
import { FieldRendererProps } from './LogDetailedView.types';
@@ -8,21 +10,33 @@ function FieldRenderer({ field }: FieldRendererProps): JSX.Element {
const { dataType, newField, logType } = getFieldAttributes(field);
return (
- <span>
+ <span className="field-renderer-container">
{dataType && newField && logType ? (
<>
- <span style={{ color: blue[4] }}>{newField} </span>
- <TagContainer>
- <TagLabel>Type: </TagLabel>
- <TagValue>{logType}</TagValue>
- </TagContainer>
- <TagContainer>
- <TagLabel>Data type: </TagLabel>
- <TagValue>{dataType}</TagValue>
- </TagContainer>
+ <Tooltip placement="left" title={newField}>
+ <Typography.Text ellipsis className="label">
+ {newField}{' '}
+ </Typography.Text>
+ </Tooltip>
+
+ <div className="tags">
+ <TagContainer>
+ <TagLabel>
+ type
+ <Divider type="vertical" />{' '}
+ </TagLabel>
+ <TagValue>{logType}</TagValue>
+ </TagContainer>
+ <TagContainer>
+ <TagLabel>
+ data type <Divider type="vertical" />{' '}
+ </TagLabel>
+ <TagValue>{dataType}</TagValue>
+ </TagContainer>
+ </div>
</>
) : (
- <span style={{ color: blue[4] }}>{field}</span>
+ <span className="label">{field}</span>
)}
</span>
);
diff --git a/frontend/src/container/LogDetailedView/JsonView.styles.scss b/frontend/src/container/LogDetailedView/JsonView.styles.scss
new file mode 100644
index 0000000000..e9a1a4856b
--- /dev/null
+++ b/frontend/src/container/LogDetailedView/JsonView.styles.scss
@@ -0,0 +1,46 @@
+.json-view-container {
+ border-radius: 3px;
+ border: 1px solid var(--bg-slate-500);
+ padding-top: 16px;
+
+ .json-view-footer {
+ height: 36px;
+ display: flex;
+ align-items: center;
+ border-top: 1px solid var(--bg-slate-500);
+ }
+
+ .log-switch {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+ .wrap-word-switch {
+ display: flex;
+ gap: 8px;
+ margin-left: var(--margin-3);
+ align-items: center;
+ }
+
+ .log-switch-btn {
+ border: 1px solid var(--bg-slate-500);
+ background-color: var(--bg-slate-500);
+ width: 40px;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+ }
+}
+
+.lightMode {
+ .json-view-container {
+ .log-switch {
+ .log-switch-btn {
+ background: var(--bg-vanilla-200);
+ border: 1px solid var(--bg-vanilla-400);
+ }
+ }
+ }
+}
diff --git a/frontend/src/container/LogDetailedView/JsonView.tsx b/frontend/src/container/LogDetailedView/JsonView.tsx
index c3ab659567..5984cf9fd0 100644
--- a/frontend/src/container/LogDetailedView/JsonView.tsx
+++ b/frontend/src/container/LogDetailedView/JsonView.tsx
@@ -1,44 +1,90 @@
-import { blue } from '@ant-design/colors';
-import { CopyFilled } from '@ant-design/icons';
-import { Button, Row } from 'antd';
-import Editor from 'components/Editor';
-import { useMemo } from 'react';
-import { useCopyToClipboard } from 'react-use';
+import './JsonView.styles.scss';
+
+import MEditor, { EditorProps, Monaco } from '@monaco-editor/react';
+import { Color } from '@signozhq/design-tokens';
+import { Switch, Typography } from 'antd';
+import { useIsDarkMode } from 'hooks/useDarkMode';
+import { useMemo, useState } from 'react';
import { JSONViewProps } from './LogDetailedView.types';
import { aggregateAttributesResourcesToString } from './utils';
function JSONView({ logData }: JSONViewProps): JSX.Element {
- const [, copyToClipboard] = useCopyToClipboard();
+ const [isWrapWord, setIsWrapWord] = useState<boolean>(false);
const LogJsonData = useMemo(
() => aggregateAttributesResourcesToString(logData),
[logData],
);
+
+ const isDarkMode = useIsDarkMode();
+
+ const options: EditorProps['options'] = {
+ automaticLayout: true,
+ readOnly: true,
+ wordWrap: 'on',
+ minimap: {
+ enabled: false,
+ },
+ fontWeight: 400,
+ // fontFamily: 'SF Mono',
+ fontFamily: 'Space Mono',
+ fontSize: 13,
+ lineHeight: '18px',
+ colorDecorators: true,
+ scrollBeyondLastLine: false,
+ decorationsOverviewRuler: false,
+ scrollbar: {
+ vertical: 'hidden',
+ horizontal: 'hidden',
+ },
+ folding: false,
+ };
+
+ const handleWrapWord = (checked: boolean): void => {
+ setIsWrapWord(checked);
+ };
+
+ function setEditorTheme(monaco: Monaco): void {
+ monaco.editor.defineTheme('my-theme', {
+ base: 'vs-dark',
+ inherit: true,
+ rules: [
+ { token: 'string.key.json', foreground: Color.BG_VANILLA_400 },
+ { token: 'string.value.json', foreground: Color.BG_ROBIN_400 },
+ ],
+ colors: {
+ 'editor.background': Color.BG_INK_400,
+ },
+ // fontFamily: 'SF Mono',
+ fontFamily: 'Space Mono',
+ fontSize: 12,
+ fontWeight: 'normal',
+ lineHeight: 18,
+ letterSpacing: -0.06,
+ });
+ }
+
return (
- <div>
- <Row
- style={{
- justifyContent: 'flex-end',
- margin: '0.5rem 0',
- }}
- >
- <Button
- size="small"
- type="text"
- onClick={(): void => copyToClipboard(LogJsonData)}
- >
- <CopyFilled /> <span style={{ color: blue[5] }}>Copy to Clipboard</span>
- </Button>
- </Row>
- <div style={{ marginTop: '0.5rem' }}>
- <Editor
- value={LogJsonData}
- language="json"
- height="70vh"
- readOnly
- onChange={(): void => {}}
- />
+ <div className="json-view-container">
+ <MEditor
+ value={isWrapWord ? JSON.stringify(LogJsonData) : LogJsonData}
+ language="json"
+ options={options}
+ onChange={(): void => {}}
+ height="68vh"
+ theme={isDarkMode ? 'my-theme' : 'light'}
+ // eslint-disable-next-line react/jsx-no-bind
+ beforeMount={setEditorTheme}
+ />
+
+ <div className="json-view-footer">
+ <div className="log-switch">
+ <div className="wrap-word-switch">
+ <Typography.Text>Wrap text</Typography.Text>
+ <Switch checked={isWrapWord} onChange={handleWrapWord} size="small" />
+ </div>
+ </div>
</div>
</div>
);
diff --git a/frontend/src/container/LogDetailedView/LogContext.styles.scss b/frontend/src/container/LogDetailedView/LogContext.styles.scss
new file mode 100644
index 0000000000..bc8ae4f719
--- /dev/null
+++ b/frontend/src/container/LogDetailedView/LogContext.styles.scss
@@ -0,0 +1,3 @@
+.log-context-container {
+ border: 1px solid var(--bg-slate-400);
+}
\ No newline at end of file
diff --git a/frontend/src/container/LogDetailedView/LogContext.tsx b/frontend/src/container/LogDetailedView/LogContext.tsx
new file mode 100644
index 0000000000..90d4a6e5bb
--- /dev/null
+++ b/frontend/src/container/LogDetailedView/LogContext.tsx
@@ -0,0 +1,52 @@
+import './LogContext.styles.scss';
+
+import RawLogView from 'components/Logs/RawLogView';
+import LogsContextList from 'container/LogsContextList';
+import { ORDERBY_FILTERS } from 'container/QueryBuilder/filters/OrderByFilter/config';
+import { ILog } from 'types/api/logs/log';
+import { Query, TagFilter } from 'types/api/queryBuilder/queryBuilderData';
+
+interface LogContextProps {
+ log: ILog;
+ contextQuery: Query | undefined;
+ filters: TagFilter | null;
+ isEdit: boolean;
+}
+
+function LogContext({
+ log,
+ filters,
+ contextQuery,
+ isEdit,
+}: LogContextProps): JSX.Element {
+ // eslint-disable-next-line react/jsx-no-useless-fragment
+ if (!contextQuery) return <></>;
+
+ return (
+ <div className="log-context-container">
+ <LogsContextList
+ order={ORDERBY_FILTERS.ASC}
+ filters={filters}
+ isEdit={isEdit}
+ log={log}
+ query={contextQuery}
+ />
+ <RawLogView
+ isActiveLog
+ isReadOnly
+ isTextOverflowEllipsisDisabled={false}
+ data={log}
+ linesPerRow={1}
+ />
+ <LogsContextList
+ order={ORDERBY_FILTERS.DESC}
+ filters={filters}
+ isEdit={isEdit}
+ log={log}
+ query={contextQuery}
+ />
+ </div>
+ );
+}
+
+export default LogContext;
diff --git a/frontend/src/container/LogDetailedView/Overview.styles.scss b/frontend/src/container/LogDetailedView/Overview.styles.scss
new file mode 100644
index 0000000000..bc63db442c
--- /dev/null
+++ b/frontend/src/container/LogDetailedView/Overview.styles.scss
@@ -0,0 +1,130 @@
+.overview-container {
+ .tag {
+ border-radius: 20px;
+ border: 1px solid rgba(173, 127, 88, 0.2);
+ background: rgba(173, 127, 88, 0.1);
+ padding: var(--padding-1) var(--padding-2);
+ font-family: 'Inter';
+ font-size: var(--font-size-xs);
+ font-weight: var(--font-weight-medium);
+ line-height: 16px;
+ letter-spacing: -0.005em;
+ text-align: center;
+ color: var(--text-sienna-400);
+ }
+
+ .log-switch {
+ height: 36px;
+ display: flex;
+ align-items: center;
+
+ .wrap-word-switch {
+ display: flex;
+ gap: 8px;
+ margin-left: var(--margin-3);
+ align-items: center;
+ }
+
+ .log-switch-btn {
+ border: 1px solid var(--bg-slate-500);
+ background-color: var(--bg-slate-500);
+ width: 40px;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+ }
+
+ .attribute-table {
+ margin-top: var(--margin-1);
+ }
+
+ .ant-collapse {
+ border: 1px solid var(--bg-slate-400);
+ }
+
+ .collapse-content {
+ border-bottom: 1px solid var(--bg-slate-500);
+
+ .ant-collapse-header {
+ align-items: center;
+ border-radius: 2px;
+ background: rgba(171, 189, 255, 0.04);
+
+ padding: 8px;
+ }
+
+ .ant-collapse-content {
+ padding: 0;
+ background: var(--bg-ink-400);
+ border-top: 1px solid var(--bg-slate-500);
+
+ .ant-collapse-content-box {
+ padding: var(--padding-2) 0 0 0;
+ }
+ }
+ }
+
+ .logs-body-content {
+ padding-top: 12px;
+ }
+
+ .ant-tag-borderless {
+ border-radius: 2px;
+ background: rgba(113, 144, 249, 0.08);
+ }
+
+ .attribute-collapse {
+ .ant-collapse-content {
+ .ant-collapse-content-box {
+ padding: 0;
+ }
+ }
+ }
+
+ .ant-table-wrapper .ant-table-cell {
+ padding: 14px 14px;
+ }
+
+ .attribute-tab-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+
+ .action-btn {
+ border-radius: 2px;
+ border: 1px solid var(--bg-slate-400);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ background: none;
+ border: none;
+ box-shadow: none;
+ }
+ }
+}
+
+.lightMode {
+ .overview-container {
+ .ant-collapse {
+ border: 1px solid var(--bg-vanilla-200);
+ }
+
+ .collapse-content {
+ border-bottom: 1px solid var(--bg-vanilla-200);
+ .ant-collapse-content {
+ background: var(--bg-vanilla-100);
+ border-top: 1px solid var(--bg-vanilla-200);
+ }
+ }
+
+ .log-switch {
+ .log-switch-btn {
+ background: var(--bg-vanilla-200);
+ border: 1px solid var(--bg-vanilla-400);
+ }
+ }
+ }
+}
diff --git a/frontend/src/container/LogDetailedView/Overview.tsx b/frontend/src/container/LogDetailedView/Overview.tsx
new file mode 100644
index 0000000000..b25423b4cb
--- /dev/null
+++ b/frontend/src/container/LogDetailedView/Overview.tsx
@@ -0,0 +1,213 @@
+import './Overview.styles.scss';
+
+import MEditor, { EditorProps, Monaco } from '@monaco-editor/react';
+import { Color } from '@signozhq/design-tokens';
+import {
+ Button,
+ Collapse,
+ Divider,
+ Input,
+ Switch,
+ Tag,
+ Typography,
+} from 'antd';
+import { AddToQueryHOCProps } from 'components/Logs/AddToQueryHOC';
+import { useIsDarkMode } from 'hooks/useDarkMode';
+import { ChevronDown, ChevronRight, Search } from 'lucide-react';
+import { ReactNode, useState } from 'react';
+import { ILog } from 'types/api/logs/log';
+
+import { ActionItemProps } from './ActionItem';
+import TableView from './TableView';
+
+interface OverviewProps {
+ logData: ILog;
+}
+
+type Props = OverviewProps &
+ Partial<Pick<ActionItemProps, 'onClickActionItem'>> &
+ Pick<AddToQueryHOCProps, 'onAddToQuery'>;
+
+function Overview({
+ logData,
+ onAddToQuery,
+ onClickActionItem,
+}: Props): JSX.Element {
+ const [isWrapWord, setIsWrapWord] = useState<boolean>(false);
+ const [isSearchVisible, setIsSearchVisible] = useState<boolean>(false);
+ const [isAttributesExpanded, setIsAttributesExpanded] = useState<boolean>(
+ true,
+ );
+ const [fieldSearchInput, setFieldSearchInput] = useState<string>('');
+
+ const isDarkMode = useIsDarkMode();
+
+ const options: EditorProps['options'] = {
+ automaticLayout: true,
+ readOnly: true,
+ height: '40vh',
+ wordWrap: 'on',
+ minimap: {
+ enabled: false,
+ },
+ fontWeight: 400,
+ // fontFamily: 'SF Mono',
+ fontFamily: 'Space Mono',
+ fontSize: 13,
+ lineHeight: '18px',
+ colorDecorators: true,
+ scrollBeyondLastLine: false,
+ scrollbar: {
+ vertical: 'hidden',
+ horizontal: 'hidden',
+ },
+ };
+
+ const handleWrapWord = (checked: boolean): void => {
+ setIsWrapWord(checked);
+ };
+
+ function setEditorTheme(monaco: Monaco): void {
+ monaco.editor.defineTheme('my-theme', {
+ base: 'vs-dark',
+ inherit: true,
+ rules: [
+ { token: 'string.key.json', foreground: Color.BG_VANILLA_400 },
+ { token: 'string.value.json', foreground: Color.BG_ROBIN_400 },
+ ],
+ colors: {
+ 'editor.background': Color.BG_INK_400,
+ },
+ // fontFamily: 'SF Mono',
+ fontFamily: 'Space Mono',
+ fontSize: 12,
+ fontWeight: 'normal',
+ lineHeight: 18,
+ letterSpacing: -0.06,
+ });
+ }
+
+ const handleSearchVisible = (): void => {
+ setIsSearchVisible(!isSearchVisible);
+ };
+
+ const toogleAttributePanelOpenState = (): void => {
+ setIsAttributesExpanded(!isAttributesExpanded);
+ };
+
+ return (
+ <div className="overview-container">
+ <Collapse
+ defaultActiveKey={['1']}
+ // eslint-disable-next-line react/no-unstable-nested-components
+ expandIcon={(props): ReactNode =>
+ props.isActive ? <ChevronDown size={14} /> : <ChevronRight size={14} />
+ }
+ items={[
+ {
+ key: '1',
+ label: (
+ <Tag bordered={false}>
+ <Typography.Text style={{ color: Color.BG_ROBIN_400 }}>
+ body
+ </Typography.Text>
+ </Tag>
+ ),
+ children: (
+ <div className="logs-body-content">
+ <MEditor
+ value={isWrapWord ? JSON.stringify(logData.body) : logData.body}
+ language={isWrapWord ? 'placetext' : 'json'}
+ options={options}
+ onChange={(): void => {}}
+ height="20vh"
+ theme={isDarkMode ? 'my-theme' : 'light'}
+ // eslint-disable-next-line react/jsx-no-bind
+ beforeMount={setEditorTheme}
+ />
+ <Divider
+ style={{
+ margin: 0,
+ border: isDarkMode
+ ? `1px solid ${Color.BG_SLATE_500}`
+ : `1px solid ${Color.BG_VANILLA_200}`,
+ }}
+ />
+ <div className="log-switch">
+ <div className="wrap-word-switch">
+ <Typography.Text>Wrap text</Typography.Text>
+ <Switch checked={isWrapWord} onChange={handleWrapWord} size="small" />
+ </div>
+ </div>
+ </div>
+ ),
+ extra: <Tag className="tag">{isWrapWord ? 'Raw' : 'JSON'}</Tag>,
+ className: 'collapse-content',
+ },
+ ]}
+ />
+
+ <Collapse
+ className="attribute-table"
+ defaultActiveKey={['1']}
+ bordered={false}
+ // eslint-disable-next-line react/no-unstable-nested-components
+ expandIcon={(props): ReactNode =>
+ props.isActive ? <ChevronDown size={14} /> : <ChevronRight size={14} />
+ }
+ items={[
+ {
+ key: '1',
+ label: (
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
+ <div
+ className="attribute-tab-header"
+ onClick={toogleAttributePanelOpenState}
+ >
+ <Tag bordered={false}>
+ <Typography.Text style={{ color: Color.BG_ROBIN_400 }}>
+ Attributes
+ </Typography.Text>
+ </Tag>
+
+ {isAttributesExpanded && (
+ <Button
+ className="action-btn"
+ icon={<Search size={12} />}
+ onClick={(e): void => {
+ e.stopPropagation();
+ handleSearchVisible();
+ }}
+ />
+ )}
+ </div>
+ ),
+ children: (
+ <>
+ {isSearchVisible && (
+ <Input
+ autoFocus
+ placeholder="Search for a field..."
+ className="search-input"
+ value={fieldSearchInput}
+ onChange={(e): void => setFieldSearchInput(e.target.value)}
+ />
+ )}
+
+ <TableView
+ logData={logData}
+ onAddToQuery={onAddToQuery}
+ fieldSearchInput={fieldSearchInput}
+ onClickActionItem={onClickActionItem}
+ />
+ </>
+ ),
+ className: 'collapse-content attribute-collapse',
+ },
+ ]}
+ />
+ </div>
+ );
+}
+
+export default Overview;
diff --git a/frontend/src/container/LogDetailedView/TableView.styles.scss b/frontend/src/container/LogDetailedView/TableView.styles.scss
new file mode 100644
index 0000000000..89101bf7b2
--- /dev/null
+++ b/frontend/src/container/LogDetailedView/TableView.styles.scss
@@ -0,0 +1,80 @@
+.attribute-table-container {
+ .ant-table {
+ background: var(--bg-ink-400);
+
+ .ant-table-row:hover {
+ .ant-table-cell {
+ .value-field {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ .action-btn {
+ display: flex;
+ gap: 4px;
+ }
+ }
+ }
+ }
+
+ .ant-table-cell {
+ border: 1px solid var(--bg-slate-500);
+ }
+
+ .attribute-name {
+ .ant-btn {
+ &:hover {
+ background-color: none !important;
+ }
+ }
+ }
+
+ .value-field-container {
+ background: rgba(22, 25, 34, 0.4);
+
+ .value-field {
+ position: relative;
+ }
+
+ .action-btn {
+ display: none;
+ width: max-content;
+ position: absolute;
+ padding: 0 16px;
+ right: 0;
+
+ .filter-btn {
+ display: flex;
+ align-items: center;
+ border: none;
+ box-shadow: none;
+ border-radius: 2px;
+ background: var(--bg-slate-400);
+
+ height: 24px;
+ }
+ }
+ }
+ }
+}
+
+.lightMode {
+ .attribute-table-container {
+ .ant-table {
+ background: var(--bg-vanilla-100);
+ }
+
+ .ant-table-cell {
+ border: 1px solid var(--bg-vanilla-200);
+ }
+
+ .value-field-container {
+ background: var(--bg-vanilla-300);
+
+ .action-btn {
+ .filter-btn {
+ background: var(--bg-vanilla-300);
+ }
+ }
+ }
+ }
+}
diff --git a/frontend/src/container/LogDetailedView/TableView.tsx b/frontend/src/container/LogDetailedView/TableView.tsx
index 929e827dc3..29224e65ae 100644
--- a/frontend/src/container/LogDetailedView/TableView.tsx
+++ b/frontend/src/container/LogDetailedView/TableView.tsx
@@ -1,16 +1,21 @@
-import { orange } from '@ant-design/colors';
+import './TableView.styles.scss';
+
import { LinkOutlined } from '@ant-design/icons';
-import { Input, Space, Tooltip, Tree } from 'antd';
+import { Color } from '@signozhq/design-tokens';
+import { Button, Space, Spin, Tooltip, Tree, Typography } from 'antd';
import { ColumnsType } from 'antd/es/table';
import AddToQueryHOC, {
AddToQueryHOCProps,
} from 'components/Logs/AddToQueryHOC';
import CopyClipboardHOC from 'components/Logs/CopyClipboardHOC';
import { ResizeTable } from 'components/ResizeTable';
+import { OPERATORS } from 'constants/queryBuilder';
import ROUTES from 'constants/routes';
import history from 'lib/history';
import { fieldSearchFilter } from 'lib/logs/fieldSearch';
+import { removeJSONStringifyQuotes } from 'lib/removeJSONStringifyQuotes';
import { isEmpty } from 'lodash-es';
+import { ArrowDownToDot, ArrowUpFromDot } from 'lucide-react';
import { useMemo, useState } from 'react';
import { useDispatch } from 'react-redux';
import { generatePath } from 'react-router-dom';
@@ -19,7 +24,7 @@ import AppActions from 'types/actions';
import { SET_DETAILED_LOG_DATA } from 'types/actions/logs';
import { ILog } from 'types/api/logs/log';
-import ActionItem, { ActionItemProps } from './ActionItem';
+import { ActionItemProps } from './ActionItem';
import FieldRenderer from './FieldRenderer';
import {
filterKeyForField,
@@ -34,25 +39,53 @@ const RESTRICTED_FIELDS = ['timestamp'];
interface TableViewProps {
logData: ILog;
+ fieldSearchInput: string;
}
type Props = TableViewProps &
- Pick<AddToQueryHOCProps, 'onAddToQuery'> &
- Pick<ActionItemProps, 'onClickActionItem'>;
+ Partial<Pick<ActionItemProps, 'onClickActionItem'>> &
+ Pick<AddToQueryHOCProps, 'onAddToQuery'>;
function TableView({
logData,
+ fieldSearchInput,
onAddToQuery,
onClickActionItem,
}: Props): JSX.Element | null {
- const [fieldSearchInput, setFieldSearchInput] = useState<string>('');
-
const dispatch = useDispatch<Dispatch<AppActions>>();
+ const [isfilterInLoading, setIsFilterInLoading] = useState<boolean>(false);
+ const [isfilterOutLoading, setIsFilterOutLoading] = useState<boolean>(false);
const flattenLogData: Record<string, string> | null = useMemo(
() => (logData ? flattenObject(logData) : null),
[logData],
);
+
+ const handleClick = (
+ operator: string,
+ fieldKey: string,
+ fieldValue: string,
+ ): void => {
+ const validatedFieldValue = removeJSONStringifyQuotes(fieldValue);
+ if (onClickActionItem) {
+ onClickActionItem(fieldKey, validatedFieldValue, operator);
+ }
+ };
+
+ const onClickHandler = (
+ operator: string,
+ fieldKey: string,
+ fieldValue: string,
+ ) => (): void => {
+ handleClick(operator, fieldKey, fieldValue);
+ if (operator === OPERATORS.IN) {
+ setIsFilterInLoading(true);
+ }
+ if (operator === OPERATORS.NIN) {
+ setIsFilterOutLoading(true);
+ }
+ };
+
if (logData === null) {
return null;
}
@@ -95,24 +128,6 @@ function TableView({
}
const columns: ColumnsType<DataType> = [
- {
- title: 'Action',
- width: 11,
- render: (fieldData: Record<string, string>): JSX.Element | null => {
- const fieldFilterKey = filterKeyForField(fieldData.field);
-
- if (!RESTRICTED_FIELDS.includes(fieldFilterKey)) {
- return (
- <ActionItem
- fieldKey={fieldFilterKey}
- fieldValue={fieldData.value}
- onClickActionItem={onClickActionItem}
- />
- );
- }
- return null;
- },
- },
{
title: 'Field',
dataIndex: 'field',
@@ -120,6 +135,7 @@ function TableView({
width: 50,
align: 'left',
ellipsis: true,
+ className: 'attribute-name',
render: (field: string, record): JSX.Element => {
const renderedField = <FieldRenderer field={field} />;
@@ -127,8 +143,8 @@ function TableView({
const traceId = flattenLogData[record.field];
return (
- <Space size="middle">
- {renderedField}
+ <Space size="middle" className="log-attribute">
+ <Typography.Text>{renderedField}</Typography.Text>
{traceId && (
<Tooltip title="Inspect in Trace">
@@ -166,15 +182,15 @@ function TableView({
},
{
title: 'Value',
- dataIndex: 'value',
key: 'value',
width: 70,
ellipsis: false,
- render: (field, record): JSX.Element => {
- const textToCopy = field.slice(1, -1);
+ className: 'value-field-container attribute-value',
+ render: (fieldData: Record<string, string>, record): JSX.Element => {
+ const textToCopy = fieldData.value.slice(1, -1);
if (record.field === 'body') {
- const parsedBody = recursiveParseJSON(field);
+ const parsedBody = recursiveParseJSON(fieldData.value);
if (!isEmpty(parsedBody)) {
return (
<Tree defaultExpandAll showLine treeData={jsonToDataNodes(parsedBody)} />
@@ -182,30 +198,62 @@ function TableView({
}
}
+ const fieldFilterKey = filterKeyForField(fieldData.field);
+
return (
- <CopyClipboardHOC textToCopy={textToCopy}>
- <span style={{ color: orange[6] }}>{removeEscapeCharacters(field)}</span>
- </CopyClipboardHOC>
+ <div className="value-field">
+ <CopyClipboardHOC textToCopy={textToCopy}>
+ <span style={{ color: Color.BG_SIENNA_400 }}>
+ {removeEscapeCharacters(fieldData.value)}
+ </span>
+ </CopyClipboardHOC>
+ <span className="action-btn">
+ <Tooltip title="Filter for value">
+ <Button
+ className="filter-btn periscope-btn"
+ icon={
+ isfilterInLoading ? (
+ <Spin size="small" />
+ ) : (
+ <ArrowDownToDot size={14} style={{ transform: 'rotate(90deg)' }} />
+ )
+ }
+ onClick={onClickHandler(OPERATORS.IN, fieldFilterKey, fieldData.value)}
+ />
+ </Tooltip>
+ <Tooltip title="Filter out value">
+ <Button
+ className="filter-btn periscope-btn"
+ icon={
+ isfilterOutLoading ? (
+ <Spin size="small" />
+ ) : (
+ <ArrowUpFromDot size={14} style={{ transform: 'rotate(90deg)' }} />
+ )
+ }
+ onClick={onClickHandler(
+ OPERATORS.NIN,
+ fieldFilterKey,
+ fieldData.value,
+ )}
+ />
+ </Tooltip>
+ </span>
+ </div>
);
},
},
];
return (
- <>
- <Input
- placeholder="Search field names"
- size="large"
- value={fieldSearchInput}
- onChange={(e): void => setFieldSearchInput(e.target.value)}
- />
- <ResizeTable
- columns={columns}
- tableLayout="fixed"
- dataSource={dataSource}
- pagination={false}
- />
- </>
+ <ResizeTable
+ columns={columns}
+ tableLayout="fixed"
+ dataSource={dataSource}
+ pagination={false}
+ showHeader={false}
+ className="attribute-table-container"
+ />
);
}
diff --git a/frontend/src/container/LogDetailedView/index.tsx b/frontend/src/container/LogDetailedView/index.tsx
index 588cc7e240..4ff7ab6a99 100644
--- a/frontend/src/container/LogDetailedView/index.tsx
+++ b/frontend/src/container/LogDetailedView/index.tsx
@@ -1,4 +1,5 @@
import LogDetail from 'components/LogDetail';
+import { VIEW_TYPES } from 'components/LogDetail/constants';
import ROUTES from 'constants/routes';
import { getGeneratedFilterQueryString } from 'lib/getGeneratedFilterQueryString';
import getStep from 'lib/getStep';
@@ -136,6 +137,7 @@ function LogDetailedView({
return (
<LogDetail
+ selectedTab={VIEW_TYPES.OVERVIEW}
log={detailedLog}
onClose={onDrawerClose}
onAddToQuery={handleAddToQuery}
diff --git a/frontend/src/container/LogDetailedView/utils.tsx b/frontend/src/container/LogDetailedView/utils.tsx
index cb1b1a2e53..c81b7dc9ed 100644
--- a/frontend/src/container/LogDetailedView/utils.tsx
+++ b/frontend/src/container/LogDetailedView/utils.tsx
@@ -262,3 +262,7 @@ export const removeEscapeCharacters = (str: string): string =>
};
return escapeMap[char as keyof typeof escapeMap];
});
+
+export function removeExtraSpaces(input: string): string {
+ return input.replace(/\s+/g, ' ').trim();
+}
diff --git a/frontend/src/container/LogExplorerQuerySection/LogsExplorerQuerySection.styles.scss b/frontend/src/container/LogExplorerQuerySection/LogsExplorerQuerySection.styles.scss
new file mode 100644
index 0000000000..db79557a71
--- /dev/null
+++ b/frontend/src/container/LogExplorerQuerySection/LogsExplorerQuerySection.styles.scss
@@ -0,0 +1,32 @@
+.qb-search-view-container {
+ padding: 8px 16px;
+ border-top: 1px solid var(--bg-slate-400, #1d212d);
+ border-bottom: 1px solid var(--bg-slate-400, #1d212d);
+
+ .ant-select-selector {
+ border-radius: 2px;
+ border: 1px solid var(--bg-slate-400) !important;
+ background-color: var(--bg-ink-300) !important;
+
+ input {
+ font-size: 12px;
+ }
+
+ .ant-tag .ant-typography {
+ font-size: 12px;
+ }
+ }
+}
+
+.lightMode {
+ .qb-search-view-container {
+ border-top: 1px solid var(--bg-vanilla-300);
+ border-bottom: 1px solid var(--bg-vanilla-300);
+
+ .ant-select-selector {
+ border-color: var(--bg-vanilla-300) !important;
+ background-color: var(--bg-vanilla-100) !important;
+ color: var(--bg-ink-200);
+ }
+ }
+}
diff --git a/frontend/src/container/LogExplorerQuerySection/index.tsx b/frontend/src/container/LogExplorerQuerySection/index.tsx
index 165bc8c20f..8653a75caf 100644
--- a/frontend/src/container/LogExplorerQuerySection/index.tsx
+++ b/frontend/src/container/LogExplorerQuerySection/index.tsx
@@ -1,4 +1,5 @@
-import { Button } from 'antd';
+import './LogsExplorerQuerySection.styles.scss';
+
import {
initialQueriesMap,
OPERATORS,
@@ -7,17 +8,29 @@ import {
import ExplorerOrderBy from 'container/ExplorerOrderBy';
import { QueryBuilder } from 'container/QueryBuilder';
import { OrderByFilterProps } from 'container/QueryBuilder/filters/OrderByFilter/OrderByFilter.interfaces';
+import QueryBuilderSearch from 'container/QueryBuilder/filters/QueryBuilderSearch';
import { QueryBuilderProps } from 'container/QueryBuilder/QueryBuilder.interfaces';
import { useGetPanelTypesQueryParam } from 'hooks/queryBuilder/useGetPanelTypesQueryParam';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
+import { useQueryOperations } from 'hooks/queryBuilder/useQueryBuilderOperations';
import { useShareBuilderUrl } from 'hooks/queryBuilder/useShareBuilderUrl';
-import { ButtonWrapperStyled } from 'pages/LogsExplorer/styles';
-import { prepareQueryWithDefaultTimestamp } from 'pages/LogsExplorer/utils';
+import {
+ prepareQueryWithDefaultTimestamp,
+ SELECTED_VIEWS,
+} from 'pages/LogsExplorer/utils';
import { memo, useCallback, useMemo } from 'react';
+import { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData';
import { DataSource } from 'types/common/queryBuilder';
-function LogExplorerQuerySection(): JSX.Element {
- const { handleRunQuery, updateAllQueriesOperators } = useQueryBuilder();
+function LogExplorerQuerySection({
+ selectedView,
+}: {
+ selectedView: SELECTED_VIEWS;
+}): JSX.Element {
+ const { currentQuery, updateAllQueriesOperators } = useQueryBuilder();
+
+ const query = currentQuery?.builder?.queryData[0] || null;
+
const panelTypes = useGetPanelTypesQueryParam(PANEL_TYPES.LIST);
const defaultValue = useMemo(() => {
const updatedQuery = updateAllQueriesOperators(
@@ -45,6 +58,12 @@ function LogExplorerQuerySection(): JSX.Element {
return config;
}, [panelTypes]);
+ const { handleChangeQueryData } = useQueryOperations({
+ index: 0,
+ query,
+ filterConfigs,
+ });
+
const renderOrderBy = useCallback(
({ query, onChange }: OrderByFilterProps): JSX.Element => (
<ExplorerOrderBy query={query} onChange={onChange} />
@@ -59,20 +78,34 @@ function LogExplorerQuerySection(): JSX.Element {
[panelTypes, renderOrderBy],
);
+ const handleChangeTagFilters = useCallback(
+ (value: IBuilderQuery['filters']) => {
+ handleChangeQueryData('filters', value);
+ },
+ [handleChangeQueryData],
+ );
+
return (
- <QueryBuilder
- panelType={panelTypes}
- config={{ initialDataSource: DataSource.LOGS, queryVariant: 'static' }}
- filterConfigs={filterConfigs}
- queryComponents={queryComponents}
- actions={
- <ButtonWrapperStyled>
- <Button type="primary" onClick={handleRunQuery}>
- Run Query
- </Button>
- </ButtonWrapperStyled>
- }
- />
+ <>
+ {selectedView === SELECTED_VIEWS.SEARCH && (
+ <div className="qb-search-view-container">
+ <QueryBuilderSearch
+ query={query}
+ onChange={handleChangeTagFilters}
+ whereClauseConfig={filterConfigs?.filters}
+ />
+ </div>
+ )}
+
+ {selectedView === SELECTED_VIEWS.QUERY_BUILDER && (
+ <QueryBuilder
+ panelType={panelTypes}
+ config={{ initialDataSource: DataSource.LOGS, queryVariant: 'static' }}
+ filterConfigs={filterConfigs}
+ queryComponents={queryComponents}
+ />
+ )}
+ </>
);
}
diff --git a/frontend/src/container/LogsContextList/LogsContextList.styles.scss b/frontend/src/container/LogsContextList/LogsContextList.styles.scss
new file mode 100644
index 0000000000..18bb285140
--- /dev/null
+++ b/frontend/src/container/LogsContextList/LogsContextList.styles.scss
@@ -0,0 +1,36 @@
+.context-logs-list {
+ position: relative;
+
+ .show-more-button {
+ position: absolute;
+ z-index: 1;
+ opacity: 1;
+
+ &.up {
+ top: 0;
+ }
+
+ &.down {
+ bottom: 0;
+ }
+ }
+
+ .virtuoso-list {
+ &::-webkit-scrollbar {
+ width: 0.1rem;
+ height: 0.1rem;
+ }
+ }
+
+ &.logs-context-list-asc {
+ .virtuoso-list {
+ padding-top: 16px;
+ }
+ }
+
+ &.logs-context-list-desc {
+ .virtuoso-list {
+ padding-bottom: 16px;
+ }
+ }
+}
diff --git a/frontend/src/container/LogsContextList/ShowButton.styles.scss b/frontend/src/container/LogsContextList/ShowButton.styles.scss
new file mode 100644
index 0000000000..ee765f5c08
--- /dev/null
+++ b/frontend/src/container/LogsContextList/ShowButton.styles.scss
@@ -0,0 +1,31 @@
+.show-more-button {
+ background-color: var(--bg-slate-400);
+ color: var(--bg-vanilla-100);
+ display: flex;
+ padding: 4px 8px;
+ align-items: center;
+ gap: 3px;
+ border: none;
+ margin: 0;
+}
+
+.show-more-button {
+ &.disabled {
+ background-color: var(--bg-slate-200);
+ color: var(--bg-vanilla-400);
+ }
+}
+
+.lightMode {
+ .show-more-button {
+ background-color: var(--bg-vanilla-300);
+ color: var(--bg-slate-400);
+ }
+
+ .show-more-button {
+ &.disabled {
+ background-color: var(--bg-vanilla-300);
+ color: var(--bg-vanilla-400);
+ }
+ }
+}
\ No newline at end of file
diff --git a/frontend/src/container/LogsContextList/ShowButton.tsx b/frontend/src/container/LogsContextList/ShowButton.tsx
index 7240800af7..e687a5610d 100644
--- a/frontend/src/container/LogsContextList/ShowButton.tsx
+++ b/frontend/src/container/LogsContextList/ShowButton.tsx
@@ -1,7 +1,10 @@
-import { Button, Typography } from 'antd';
-import { ORDERBY_FILTERS } from 'container/QueryBuilder/filters/OrderByFilter/config';
+import './ShowButton.styles.scss';
-import { ShowButtonWrapper } from './styles';
+import { Color } from '@signozhq/design-tokens';
+import { Button } from 'antd';
+import cx from 'classnames';
+import { ORDERBY_FILTERS } from 'container/QueryBuilder/filters/OrderByFilter/config';
+import { ArrowDown, ArrowUp, Ban } from 'lucide-react';
interface ShowButtonProps {
isLoading: boolean;
@@ -16,20 +19,35 @@ function ShowButton({
order,
onClick,
}: ShowButtonProps): JSX.Element {
+ const getIcons = (): JSX.Element => {
+ if (order === ORDERBY_FILTERS.ASC) {
+ return isDisabled ? (
+ <Ban size={14} style={{ color: Color.BG_VANILLA_400 }} />
+ ) : (
+ <ArrowUp size={14} />
+ );
+ }
+ return isDisabled ? (
+ <Ban size={14} style={{ color: Color.BG_VANILLA_400 }} />
+ ) : (
+ <ArrowDown size={14} />
+ );
+ };
+
return (
- <ShowButtonWrapper>
- <Typography>
- Showing 10 lines {order === ORDERBY_FILTERS.ASC ? 'after' : 'before'} match
- </Typography>
- <Button
- size="small"
- disabled={isLoading || isDisabled}
- loading={isLoading}
- onClick={onClick}
- >
- Show 10 more lines
- </Button>
- </ShowButtonWrapper>
+ <Button
+ disabled={isLoading || isDisabled}
+ loading={isLoading}
+ onClick={onClick}
+ icon={getIcons()}
+ className={cx(
+ 'show-more-button',
+ order === ORDERBY_FILTERS.ASC ? 'up' : 'down',
+ isDisabled && 'disabled',
+ )}
+ >
+ Load more
+ </Button>
);
}
diff --git a/frontend/src/container/LogsContextList/configs.ts b/frontend/src/container/LogsContextList/configs.ts
index 2fbb159b9d..baa3b39420 100644
--- a/frontend/src/container/LogsContextList/configs.ts
+++ b/frontend/src/container/LogsContextList/configs.ts
@@ -1,6 +1,6 @@
import { OrderByPayload } from 'types/api/queryBuilder/queryBuilderData';
-export const INITIAL_PAGE_SIZE = 5;
+export const INITIAL_PAGE_SIZE = 10;
export const LOGS_MORE_PAGE_SIZE = 10;
export const getOrderByTimestamp = (order: string): OrderByPayload => ({
diff --git a/frontend/src/container/LogsContextList/index.tsx b/frontend/src/container/LogsContextList/index.tsx
index d473ddb20a..5bb47d6ce5 100644
--- a/frontend/src/container/LogsContextList/index.tsx
+++ b/frontend/src/container/LogsContextList/index.tsx
@@ -1,3 +1,5 @@
+import './LogsContextList.styles.scss';
+
import RawLogView from 'components/Logs/RawLogView';
import Spinner from 'components/Spinner';
import { PANEL_TYPES } from 'constants/queryBuilder';
@@ -21,6 +23,7 @@ import { EmptyText, ListContainer } from './styles';
import { getRequestData } from './utils';
interface LogsContextListProps {
+ className?: string;
isEdit: boolean;
query: Query;
log: ILog;
@@ -29,6 +32,7 @@ interface LogsContextListProps {
}
function LogsContextList({
+ className,
isEdit,
query,
log,
@@ -166,7 +170,7 @@ function LogsContextList({
);
return (
- <>
+ <div className={`context-logs-list ${className}`}>
{order === ORDERBY_FILTERS.ASC && (
<ShowButton
isLoading={isFetching}
@@ -183,6 +187,7 @@ function LogsContextList({
{isFetching && <Spinner size="large" height="10rem" />}
<Virtuoso
+ className="virtuoso-list"
initialTopMostItemIndex={0}
data={logs}
itemContent={getItemContent}
@@ -198,8 +203,12 @@ function LogsContextList({
onClick={handleShowNextLines}
/>
)}
- </>
+ </div>
);
}
+LogsContextList.defaultProps = {
+ className: '',
+};
+
export default memo(LogsContextList);
diff --git a/frontend/src/container/LogsContextList/styles.ts b/frontend/src/container/LogsContextList/styles.ts
index 85cf3128f1..9d9d1379b6 100644
--- a/frontend/src/container/LogsContextList/styles.ts
+++ b/frontend/src/container/LogsContextList/styles.ts
@@ -1,19 +1,14 @@
-import { Space, Typography } from 'antd';
-import { themeColors } from 'constants/theme';
+import { Color } from '@signozhq/design-tokens';
+import { Typography } from 'antd';
import styled from 'styled-components';
export const ListContainer = styled.div<{ $isDarkMode: boolean }>`
position: relative;
- margin: 0 -1.5rem;
- height: 10rem;
- overflow-y: scroll;
+ height: 21rem;
+ overflow: hidden;
background-color: ${({ $isDarkMode }): string =>
- $isDarkMode ? themeColors.darkGrey : themeColors.lightgrey};
-`;
-
-export const ShowButtonWrapper = styled(Space)`
- margin: 0.625rem 0;
+ $isDarkMode ? Color.BG_INK_400 : Color.BG_VANILLA_100};
`;
export const EmptyText = styled(Typography)`
diff --git a/frontend/src/container/LogsError/LogsError.styles.scss b/frontend/src/container/LogsError/LogsError.styles.scss
new file mode 100644
index 0000000000..789357122f
--- /dev/null
+++ b/frontend/src/container/LogsError/LogsError.styles.scss
@@ -0,0 +1,42 @@
+.logs-error-container {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ height: 240px;
+
+ .logs-error-content {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+
+ color: var(--text-vanilla-400);
+ font-family: Inter;
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 18px; /* 128.571% */
+ letter-spacing: -0.07px;
+
+ .aww-snap {
+ font-weight: 600;
+ }
+
+ .error-state-svg {
+ height: 50px;
+ width: 50px;
+ }
+
+ .contact-support {
+ display: flex;
+ align-items: center;
+ margin-top: 8px;
+ gap: 4px;
+
+ .text {
+ color: var(--text-robin-400);
+ font-weight: 500;
+ }
+ }
+ }
+}
diff --git a/frontend/src/container/LogsError/LogsError.tsx b/frontend/src/container/LogsError/LogsError.tsx
new file mode 100644
index 0000000000..0b3c9f501d
--- /dev/null
+++ b/frontend/src/container/LogsError/LogsError.tsx
@@ -0,0 +1,26 @@
+import './LogsError.styles.scss';
+
+import { Typography } from 'antd';
+import { ArrowRight } from 'lucide-react';
+
+export default function LogsError(): JSX.Element {
+ return (
+ <div className="logs-error-container">
+ <div className="logs-error-content">
+ <img
+ src="/Icons/awwSnap.svg"
+ alt="error-emoji"
+ className="error-state-svg"
+ />
+ <Typography.Text>
+ <span className="aww-snap">Aw snap :/ </span> Something went wrong. Please
+ try again or contact support.
+ </Typography.Text>
+ <section className="contact-support">
+ <Typography.Link className="text">Contact Support </Typography.Link>
+ <ArrowRight size={14} />
+ </section>
+ </div>
+ </div>
+ );
+}
diff --git a/frontend/src/container/LogsExplorerChart/LogsExplorerChart.styled.ts b/frontend/src/container/LogsExplorerChart/LogsExplorerChart.styled.ts
index 6fbe2d2e23..fec5dc1f0c 100644
--- a/frontend/src/container/LogsExplorerChart/LogsExplorerChart.styled.ts
+++ b/frontend/src/container/LogsExplorerChart/LogsExplorerChart.styled.ts
@@ -2,10 +2,13 @@ import { Card } from 'antd';
import styled from 'styled-components';
export const CardStyled = styled(Card)`
+ border: none !important;
position: relative;
- margin: 0.5rem 0 3.1rem 0;
+ margin-bottom: 16px;
.ant-card-body {
- height: 20vh;
+ height: 200px;
min-height: 200px;
+ padding: 0 16px 16px 16px;
+ font-family: 'Space Mono', monospace;
}
`;
diff --git a/frontend/src/container/LogsExplorerChart/index.tsx b/frontend/src/container/LogsExplorerChart/index.tsx
index ec329907f3..40566da52a 100644
--- a/frontend/src/container/LogsExplorerChart/index.tsx
+++ b/frontend/src/container/LogsExplorerChart/index.tsx
@@ -46,13 +46,7 @@ function LogsExplorerChart({
{isLoading ? (
<Spinner size="default" height="100%" />
) : (
- <Graph
- name="logsExplorerChart"
- data={graphData.data}
- type="bar"
- containerHeight="100%"
- animate
- />
+ <Graph name="logsExplorerChart" data={graphData.data} type="bar" animate />
)}
</CardStyled>
);
diff --git a/frontend/src/container/LogsExplorerContext/index.tsx b/frontend/src/container/LogsExplorerContext/index.tsx
index 31c7202a8d..d62cdb274b 100644
--- a/frontend/src/container/LogsExplorerContext/index.tsx
+++ b/frontend/src/container/LogsExplorerContext/index.tsx
@@ -1,6 +1,5 @@
import { EditFilled } from '@ant-design/icons';
-import { Typography } from 'antd';
-import Modal from 'antd/es/modal/Modal';
+import { Modal, Typography } from 'antd';
import RawLogView from 'components/Logs/RawLogView';
import LogsContextList from 'container/LogsContextList';
import { ORDERBY_FILTERS } from 'container/QueryBuilder/filters/OrderByFilter/config';
diff --git a/frontend/src/container/LogsExplorerContext/types.ts b/frontend/src/container/LogsExplorerContext/types.ts
index 343171a740..bb5c26769f 100644
--- a/frontend/src/container/LogsExplorerContext/types.ts
+++ b/frontend/src/container/LogsExplorerContext/types.ts
@@ -1,6 +1,7 @@
+import { MouseEventHandler } from 'react';
import { ILog } from 'types/api/logs/log';
export interface LogsExplorerContextProps {
log: ILog;
- onClose: VoidFunction;
+ onClose: MouseEventHandler<HTMLElement>;
}
diff --git a/frontend/src/container/LogsExplorerList/InfinityTableView/TableRow.styles.scss b/frontend/src/container/LogsExplorerList/InfinityTableView/TableRow.styles.scss
new file mode 100644
index 0000000000..6b0593def3
--- /dev/null
+++ b/frontend/src/container/LogsExplorerList/InfinityTableView/TableRow.styles.scss
@@ -0,0 +1,4 @@
+.logs-table-row {
+ cursor: pointer;
+ position: relative;
+}
diff --git a/frontend/src/container/LogsExplorerList/InfinityTableView/TableRow.tsx b/frontend/src/container/LogsExplorerList/InfinityTableView/TableRow.tsx
new file mode 100644
index 0000000000..de28412078
--- /dev/null
+++ b/frontend/src/container/LogsExplorerList/InfinityTableView/TableRow.tsx
@@ -0,0 +1,95 @@
+import './TableRow.styles.scss';
+
+import { ColumnsType } from 'antd/es/table';
+import LogLinesActionButtons from 'components/Logs/LogLinesActionButtons/LogLinesActionButtons';
+import { ColumnTypeRender } from 'components/Logs/TableView/types';
+import { useCopyLogLink } from 'hooks/logs/useCopyLogLink';
+import { useIsDarkMode } from 'hooks/useDarkMode';
+import {
+ cloneElement,
+ MouseEventHandler,
+ ReactElement,
+ ReactNode,
+ useCallback,
+ useMemo,
+} from 'react';
+import { ILog } from 'types/api/logs/log';
+
+import { TableCellStyled } from './styles';
+
+interface TableRowProps {
+ tableColumns: ColumnsType<Record<string, unknown>>;
+ index: number;
+ log: Record<string, unknown>;
+ handleSetActiveContextLog: (log: ILog) => void;
+ logs: ILog[];
+ hasActions: boolean;
+}
+
+export default function TableRow({
+ tableColumns,
+ index,
+ log,
+ handleSetActiveContextLog,
+ logs,
+ hasActions,
+}: TableRowProps): JSX.Element {
+ const isDarkMode = useIsDarkMode();
+
+ const currentLog = useMemo(() => logs.find(({ id }) => id === log.id), [
+ logs,
+ log.id,
+ ]);
+
+ const { onLogCopy, isLogsExplorerPage } = useCopyLogLink(currentLog?.id);
+
+ const handleShowContext: MouseEventHandler<HTMLElement> = useCallback(
+ (event) => {
+ event.preventDefault();
+ event.stopPropagation();
+ if (!handleSetActiveContextLog || !currentLog) return;
+
+ handleSetActiveContextLog(currentLog);
+ },
+ [currentLog, handleSetActiveContextLog],
+ );
+
+ return (
+ <>
+ {tableColumns.map((column) => {
+ if (!column.render) return <td>Empty</td>;
+
+ const element: ColumnTypeRender<Record<string, unknown>> = column.render(
+ log[column.key as keyof Record<string, unknown>],
+ log,
+ index,
+ );
+
+ const elementWithChildren = element as Exclude<
+ ColumnTypeRender<Record<string, unknown>>,
+ ReactNode
+ >;
+
+ const children = elementWithChildren.children as ReactElement;
+ const props = elementWithChildren.props as Record<string, unknown>;
+
+ return (
+ <TableCellStyled
+ $isDragColumn={false}
+ $isDarkMode={isDarkMode}
+ key={column.key}
+ >
+ {cloneElement(children, props)}
+ </TableCellStyled>
+ );
+ })}
+ {hasActions && isLogsExplorerPage && (
+ <LogLinesActionButtons
+ handleShowContext={handleShowContext}
+ onLogCopy={onLogCopy}
+ customClassName="table-view-log-actions"
+ />
+ )}
+ </>
+ );
+}
diff --git a/frontend/src/container/LogsExplorerList/InfinityTableView/config.ts b/frontend/src/container/LogsExplorerList/InfinityTableView/config.ts
index 3478cd149e..ec16ba1024 100644
--- a/frontend/src/container/LogsExplorerList/InfinityTableView/config.ts
+++ b/frontend/src/container/LogsExplorerList/InfinityTableView/config.ts
@@ -3,4 +3,5 @@ import { CSSProperties } from 'react';
export const infinityDefaultStyles: CSSProperties = {
width: '100%',
overflowX: 'scroll',
+ marginTop: '15px',
};
diff --git a/frontend/src/container/LogsExplorerList/InfinityTableView/index.tsx b/frontend/src/container/LogsExplorerList/InfinityTableView/index.tsx
index 3db6fdb408..e1e7ca514d 100644
--- a/frontend/src/container/LogsExplorerList/InfinityTableView/index.tsx
+++ b/frontend/src/container/LogsExplorerList/InfinityTableView/index.tsx
@@ -1,22 +1,13 @@
import LogDetail from 'components/LogDetail';
-import { ColumnTypeRender } from 'components/Logs/TableView/types';
+import { VIEW_TYPES } from 'components/LogDetail/constants';
import { useTableView } from 'components/Logs/TableView/useTableView';
import { LOCALSTORAGE } from 'constants/localStorage';
-import LogsExplorerContext from 'container/LogsExplorerContext';
import { useActiveLog } from 'hooks/logs/useActiveLog';
import { useCopyLogLink } from 'hooks/logs/useCopyLogLink';
import { useIsDarkMode } from 'hooks/useDarkMode';
import useDragColumns from 'hooks/useDragColumns';
import { getDraggedColumns } from 'hooks/useDragColumns/utils';
-import {
- cloneElement,
- forwardRef,
- memo,
- ReactElement,
- ReactNode,
- useCallback,
- useMemo,
-} from 'react';
+import { forwardRef, memo, useCallback, useMemo } from 'react';
import {
TableComponents,
TableVirtuoso,
@@ -26,11 +17,8 @@ import { ILog } from 'types/api/logs/log';
import { infinityDefaultStyles } from './config';
import { LogsCustomTable } from './LogsCustomTable';
-import {
- TableCellStyled,
- TableHeaderCellStyled,
- TableRowStyled,
-} from './styles';
+import { TableHeaderCellStyled, TableRowStyled } from './styles';
+import TableRow from './TableRow';
import { InfinityTableProps } from './types';
// eslint-disable-next-line react/function-component-definition
@@ -64,6 +52,7 @@ const InfinityTable = forwardRef<TableVirtuosoHandle, InfinityTableProps>(
activeLog: activeContextLog,
onSetActiveLog: handleSetActiveContextLog,
onClearActiveLog: handleClearActiveContextLog,
+ onAddToQuery: handleAddToQuery,
} = useActiveLog();
const {
activeLog,
@@ -76,6 +65,8 @@ const InfinityTable = forwardRef<TableVirtuosoHandle, InfinityTableProps>(
...tableViewProps,
onClickExpand: onSetActiveLog,
onOpenLogsContext: handleSetActiveContextLog,
+ activeLog,
+ activeContextLog,
});
const { draggedColumns, onDragColumns } = useDragColumns<
Record<string, unknown>
@@ -96,37 +87,16 @@ const InfinityTable = forwardRef<TableVirtuosoHandle, InfinityTableProps>(
const itemContent = useCallback(
(index: number, log: Record<string, unknown>): JSX.Element => (
- <>
- {tableColumns.map((column) => {
- if (!column.render) return <td>Empty</td>;
-
- const element: ColumnTypeRender<Record<string, unknown>> = column.render(
- log[column.key as keyof Record<string, unknown>],
- log,
- index,
- );
-
- const elementWithChildren = element as Exclude<
- ColumnTypeRender<Record<string, unknown>>,
- ReactNode
- >;
-
- const children = elementWithChildren.children as ReactElement;
- const props = elementWithChildren.props as Record<string, unknown>;
-
- return (
- <TableCellStyled
- $isDragColumn={false}
- $isDarkMode={isDarkMode}
- key={column.key}
- >
- {cloneElement(children, props)}
- </TableCellStyled>
- );
- })}
- </>
+ <TableRow
+ tableColumns={tableColumns}
+ index={index}
+ log={log}
+ handleSetActiveContextLog={handleSetActiveContextLog}
+ logs={tableViewProps.logs}
+ hasActions
+ />
),
- [tableColumns, isDarkMode],
+ [handleSetActiveContextLog, tableColumns, tableViewProps.logs],
);
const tableHeader = useCallback(
@@ -137,13 +107,14 @@ const InfinityTable = forwardRef<TableVirtuosoHandle, InfinityTableProps>(
return (
<TableHeaderCellStyled
+ $isTimestamp={column.key === 'timestamp'}
$isDarkMode={isDarkMode}
$isDragColumn={isDragColumn}
key={column.key}
// eslint-disable-next-line react/jsx-props-no-spreading
{...(isDragColumn && { className: 'dragHandler' })}
>
- {column.title as string}
+ {(column.title as string).replace(/^\w/, (c) => c.toUpperCase())}
</TableHeaderCellStyled>
);
})}
@@ -152,6 +123,12 @@ const InfinityTable = forwardRef<TableVirtuosoHandle, InfinityTableProps>(
[tableColumns, isDarkMode],
);
+ const handleClickExpand = (index: number): void => {
+ if (!onSetActiveLog) return;
+
+ onSetActiveLog(tableViewProps.logs[index]);
+ };
+
return (
<>
<TableVirtuoso
@@ -173,15 +150,21 @@ const InfinityTable = forwardRef<TableVirtuosoHandle, InfinityTableProps>(
{...(infitiyTableProps?.onEndReached
? { endReached: infitiyTableProps.onEndReached }
: {})}
+ onClick={(event: any): void => {
+ handleClickExpand(event.target.parentElement.parentElement.dataset.index);
+ }}
/>
{activeContextLog && (
- <LogsExplorerContext
+ <LogDetail
log={activeContextLog}
onClose={handleClearActiveContextLog}
+ onAddToQuery={handleAddToQuery}
+ selectedTab={VIEW_TYPES.CONTEXT}
/>
)}
<LogDetail
+ selectedTab={VIEW_TYPES.OVERVIEW}
log={activeLog}
onClose={onClearActiveLog}
onAddToQuery={onAddToQuery}
diff --git a/frontend/src/container/LogsExplorerList/InfinityTableView/styles.ts b/frontend/src/container/LogsExplorerList/InfinityTableView/styles.ts
index 321135df7c..cffbbc27af 100644
--- a/frontend/src/container/LogsExplorerList/InfinityTableView/styles.ts
+++ b/frontend/src/container/LogsExplorerList/InfinityTableView/styles.ts
@@ -5,29 +5,23 @@ import { getActiveLogBackground } from 'utils/logs';
interface TableHeaderCellStyledProps {
$isDragColumn: boolean;
$isDarkMode: boolean;
+ $isTimestamp?: boolean;
}
export const TableStyled = styled.table`
width: 100%;
- border-top: 1px solid rgba(253, 253, 253, 0.12);
- border-radius: 2px 2px 0 0;
- border-collapse: separate;
- border-spacing: 0;
- border-inline-start: 1px solid rgba(253, 253, 253, 0.12);
- border-inline-end: 1px solid rgba(253, 253, 253, 0.12);
`;
export const TableCellStyled = styled.td<TableHeaderCellStyledProps>`
padding: 0.5rem;
- border-inline-end: 1px solid rgba(253, 253, 253, 0.12);
- border-top: 1px solid rgba(253, 253, 253, 0.12);
background-color: ${(props): string =>
- props.$isDarkMode ? themeColors.black : themeColors.whiteCream};
+ props.$isDarkMode ? 'inherit' : themeColors.whiteCream};
color: ${(props): string =>
props.$isDarkMode ? themeColors.white : themeColors.bckgGrey};
`;
+// handle the light theme here
export const TableRowStyled = styled.tr<{
$isActiveLog: boolean;
$isDarkMode: boolean;
@@ -36,34 +30,39 @@ export const TableRowStyled = styled.tr<{
${({ $isActiveLog }): string => getActiveLogBackground($isActiveLog)}
}
+ cursor: pointer;
+ position: relative;
+
+ .log-line-action-buttons {
+ display: none;
+ }
+
&:hover {
${TableCellStyled} {
${({ $isActiveLog, $isDarkMode }): string =>
$isActiveLog
? getActiveLogBackground()
: `background-color: ${
- !$isDarkMode ? themeColors.lightgrey : themeColors.bckgGrey
- };`}
+ !$isDarkMode ? 'var(--bg-vanilla-200)' : 'rgba(171, 189, 255, 0.04)'
+ }`}
+ }
+ .log-line-action-buttons {
+ display: flex;
}
}
`;
export const TableHeaderCellStyled = styled.th<TableHeaderCellStyledProps>`
padding: 0.5rem;
- border-inline-end: 1px solid rgba(253, 253, 253, 0.12);
- background-color: ${(props): string =>
- !props.$isDarkMode ? themeColors.whiteCream : themeColors.bckgGrey};
-
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 18px;
+ letter-spacing: -0.07px;
+ background: ${(props): string => (props.$isDarkMode ? '#0b0c0d' : '#fdfdfd')};
+ ${({ $isTimestamp }): string => ($isTimestamp ? 'padding-left: 24px;' : '')}
${({ $isDragColumn }): string => ($isDragColumn ? 'cursor: col-resize;' : '')}
color: ${(props): string =>
- props.$isDarkMode ? themeColors.white : themeColors.bckgGrey};
-
- &:first-child {
- border-start-start-radius: 2px;
- }
- &:last-child {
- border-start-end-radius: 2px;
- border-inline-end: none;
- }
+ props.$isDarkMode ? 'var(--bg-vanilla-100, #fff)' : themeColors.bckgGrey};
`;
diff --git a/frontend/src/container/LogsExplorerList/LogsExplorerList.interfaces.ts b/frontend/src/container/LogsExplorerList/LogsExplorerList.interfaces.ts
index ba68c67eb8..e0e9c57353 100644
--- a/frontend/src/container/LogsExplorerList/LogsExplorerList.interfaces.ts
+++ b/frontend/src/container/LogsExplorerList/LogsExplorerList.interfaces.ts
@@ -3,7 +3,10 @@ import { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData';
export type LogsExplorerListProps = {
isLoading: boolean;
+ isFetching: boolean;
currentStagedQueryData: IBuilderQuery | null;
logs: ILog[];
onEndReached: (index: number) => void;
+ isError: boolean;
+ isFilterApplied: boolean;
};
diff --git a/frontend/src/container/LogsExplorerList/LogsExplorerList.style.scss b/frontend/src/container/LogsExplorerList/LogsExplorerList.style.scss
new file mode 100644
index 0000000000..a6033da1ff
--- /dev/null
+++ b/frontend/src/container/LogsExplorerList/LogsExplorerList.style.scss
@@ -0,0 +1,8 @@
+.logs-list-view-container {
+ font-family: 'Space Mono', monospace;
+ font-size: 14px;
+ font-weight: 400;
+ line-height: 18px;
+ letter-spacing: -0.005em;
+ text-align: left;
+}
diff --git a/frontend/src/container/LogsExplorerList/index.tsx b/frontend/src/container/LogsExplorerList/index.tsx
index 361f3a49b6..c864aa355a 100644
--- a/frontend/src/container/LogsExplorerList/index.tsx
+++ b/frontend/src/container/LogsExplorerList/index.tsx
@@ -1,24 +1,28 @@
-import { Card, Typography } from 'antd';
+import './LogsExplorerList.style.scss';
+
+import { Card } from 'antd';
import LogDetail from 'components/LogDetail';
+import { VIEW_TYPES } from 'components/LogDetail/constants';
// components
import ListLogView from 'components/Logs/ListLogView';
import RawLogView from 'components/Logs/RawLogView';
import Spinner from 'components/Spinner';
import { CARD_BODY_STYLE } from 'constants/card';
import { LOCALSTORAGE } from 'constants/localStorage';
-import ExplorerControlPanel from 'container/ExplorerControlPanel';
-import { Heading } from 'container/LogsTable/styles';
+import EmptyLogsSearch from 'container/EmptyLogsSearch/EmptyLogsSearch';
+import LogsError from 'container/LogsError/LogsError';
+import { LogsLoading } from 'container/LogsLoading/LogsLoading';
import { useOptionsMenu } from 'container/OptionsMenu';
import { useActiveLog } from 'hooks/logs/useActiveLog';
import { useCopyLogLink } from 'hooks/logs/useCopyLogLink';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
-import useFontFaceObserver from 'hooks/useFontObserver';
import { memo, useCallback, useEffect, useMemo, useRef } from 'react';
import { Virtuoso, VirtuosoHandle } from 'react-virtuoso';
// interfaces
import { ILog } from 'types/api/logs/log';
import { DataSource, StringOperators } from 'types/common/queryBuilder';
+import NoLogs from '../NoLogs/NoLogs';
import InfinityTableView from './InfinityTableView';
import { LogsExplorerListProps } from './LogsExplorerList.interfaces';
import { InfinityWrapperStyled } from './styles';
@@ -27,12 +31,14 @@ import { convertKeysToColumnFields } from './utils';
function Footer(): JSX.Element {
return <Spinner height={20} tip="Getting Logs" />;
}
-
function LogsExplorerList({
isLoading,
+ isFetching,
currentStagedQueryData,
logs,
onEndReached,
+ isError,
+ isFilterApplied,
}: LogsExplorerListProps): JSX.Element {
const ref = useRef<VirtuosoHandle>(null);
const { initialDataSource } = useQueryBuilder();
@@ -46,7 +52,7 @@ function LogsExplorerList({
onSetActiveLog,
} = useActiveLog();
- const { options, config } = useOptionsMenu({
+ const { options } = useOptionsMenu({
storageKey: LOCALSTORAGE.LOGS_LIST_OPTIONS,
dataSource: initialDataSource || DataSource.METRICS,
aggregateOperator:
@@ -58,19 +64,6 @@ function LogsExplorerList({
[logs, activeLogId],
);
- useFontFaceObserver(
- [
- {
- family: 'Fira Code',
- weight: '300',
- },
- ],
- options.format === 'raw',
- {
- timeout: 5000,
- },
- );
-
const selectedFields = useMemo(
() => convertKeysToColumnFields(options.selectColumns),
[options],
@@ -96,10 +89,12 @@ function LogsExplorerList({
selectedFields={selectedFields}
onAddToQuery={onAddToQuery}
onSetActiveLog={onSetActiveLog}
+ activeLog={activeLog}
/>
);
},
[
+ activeLog,
onAddToQuery,
onSetActiveLog,
options.format,
@@ -142,7 +137,10 @@ function LogsExplorerList({
}
return (
- <Card style={{ width: '100%' }} bodyStyle={CARD_BODY_STYLE}>
+ <Card
+ style={{ width: '100%', marginTop: '20px' }}
+ bodyStyle={CARD_BODY_STYLE}
+ >
<Virtuoso
ref={ref}
data={logs}
@@ -156,33 +154,37 @@ function LogsExplorerList({
}, [isLoading, options, logs, onEndReached, getItemContent, selectedFields]);
return (
- <>
- <ExplorerControlPanel
- selectedOptionFormat={options.format}
- isLoading={isLoading}
- isShowPageSize={false}
- optionsMenuConfig={config}
- />
-
- {options.format !== 'table' && (
- <Heading>
- <Typography.Text>Event</Typography.Text>
- </Heading>
- )}
-
- {!isLoading && logs.length === 0 && (
- <Typography>No logs lines found</Typography>
+ <div className="logs-list-view-container">
+ {(isLoading || (isFetching && logs.length === 0)) && <LogsLoading />}
+
+ {!isLoading &&
+ !isFetching &&
+ !isError &&
+ !isFilterApplied &&
+ logs.length === 0 && <NoLogs />}
+
+ {!isLoading &&
+ !isFetching &&
+ logs.length === 0 &&
+ !isError &&
+ isFilterApplied && <EmptyLogsSearch />}
+
+ {isError && !isLoading && !isFetching && <LogsError />}
+
+ {!isLoading && !isError && logs.length > 0 && (
+ <>
+ <InfinityWrapperStyled>{renderContent}</InfinityWrapperStyled>
+
+ <LogDetail
+ selectedTab={VIEW_TYPES.OVERVIEW}
+ log={activeLog}
+ onClose={onClearActiveLog}
+ onAddToQuery={onAddToQuery}
+ onClickActionItem={onAddToQuery}
+ />
+ </>
)}
-
- <InfinityWrapperStyled>{renderContent}</InfinityWrapperStyled>
-
- <LogDetail
- log={activeLog}
- onClose={onClearActiveLog}
- onAddToQuery={onAddToQuery}
- onClickActionItem={onAddToQuery}
- />
- </>
+ </div>
);
}
diff --git a/frontend/src/container/LogsExplorerTable/LogsExplorerTable.interfaces.ts b/frontend/src/container/LogsExplorerTable/LogsExplorerTable.interfaces.ts
index f2e4c3e7d6..22c1dfc00d 100644
--- a/frontend/src/container/LogsExplorerTable/LogsExplorerTable.interfaces.ts
+++ b/frontend/src/container/LogsExplorerTable/LogsExplorerTable.interfaces.ts
@@ -3,4 +3,5 @@ import { QueryDataV3 } from 'types/api/widgets/getQuery';
export type LogsExplorerTableProps = {
data: QueryDataV3[];
isLoading: boolean;
+ isError: boolean;
};
diff --git a/frontend/src/container/LogsExplorerTable/LogsExplorerTable.styles.scss b/frontend/src/container/LogsExplorerTable/LogsExplorerTable.styles.scss
new file mode 100644
index 0000000000..3f1781502c
--- /dev/null
+++ b/frontend/src/container/LogsExplorerTable/LogsExplorerTable.styles.scss
@@ -0,0 +1,58 @@
+.logs-table {
+ .ant-table {
+ background: unset;
+ border: none;
+ }
+
+ .ant-table-thead {
+ .ant-table-cell {
+ background: unset !important;
+ border-bottom: unset !important;
+ color: var(--bg-vanilla-400) !important;
+ font-family: Inter;
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 500;
+ line-height: 20px;
+ letter-spacing: -0.07px;
+ }
+
+ .ant-table-cell::before {
+ background-color: unset !important;
+ }
+ }
+
+ .ant-table-row {
+ color: var(--bg-vanilla-400) !important;
+ font-family: Inter;
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400 !important;
+ line-height: 20px;
+ letter-spacing: -0.07px;
+
+ .ant-table-cell-row-hover {
+ background: rgba(171, 189, 255, 0.04) !important;
+ }
+ }
+}
+
+.lightMode {
+ .ant-table {
+ color: var(--bg-slate-400) !important;
+ }
+
+ .ant-table-thead {
+ .ant-table-cell {
+ color: var(--bg-slate-400) !important;
+ }
+ }
+
+ .ant-table-row {
+ color: var(--bg-slate-400) !important;
+
+ .ant-table-cell-row-hover {
+ background: var(--bg-vanilla-300) !important;
+ }
+ }
+}
diff --git a/frontend/src/container/LogsExplorerTable/index.tsx b/frontend/src/container/LogsExplorerTable/index.tsx
index bbcb2aa99b..13883d3a62 100644
--- a/frontend/src/container/LogsExplorerTable/index.tsx
+++ b/frontend/src/container/LogsExplorerTable/index.tsx
@@ -1,4 +1,8 @@
+import './LogsExplorerTable.styles.scss';
+
import { initialQueriesMap } from 'constants/queryBuilder';
+import LogsError from 'container/LogsError/LogsError';
+import { LogsLoading } from 'container/LogsLoading/LogsLoading';
import { QueryTable } from 'container/QueryTable';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import { memo } from 'react';
@@ -8,14 +12,24 @@ import { LogsExplorerTableProps } from './LogsExplorerTable.interfaces';
function LogsExplorerTable({
data,
isLoading,
+ isError,
}: LogsExplorerTableProps): JSX.Element {
const { stagedQuery } = useQueryBuilder();
+ if (isLoading) {
+ return <LogsLoading />;
+ }
+
+ if (isError) {
+ return <LogsError />;
+ }
+
return (
<QueryTable
query={stagedQuery || initialQueriesMap.metrics}
queryTableData={data}
loading={isLoading}
+ rootClassName="logs-table"
/>
);
}
diff --git a/frontend/src/container/LogsExplorerViews/LogsExplorerViews.styles.scss b/frontend/src/container/LogsExplorerViews/LogsExplorerViews.styles.scss
new file mode 100644
index 0000000000..501ae4d0d3
--- /dev/null
+++ b/frontend/src/container/LogsExplorerViews/LogsExplorerViews.styles.scss
@@ -0,0 +1,141 @@
+.logs-explorer-views-container {
+ margin-bottom: 24px;
+
+ .logs-explorer-views-types {
+ .views-tabs-container {
+ padding: 8px 16px;
+ border: 1px solid var(--text-slate-400);
+ border-left: none;
+ border-right: none;
+
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+
+ .views-tabs {
+ color: var(--text-vanilla-400);
+
+ .view-title {
+ display: flex;
+ gap: var(--margin-2);
+ align-items: center;
+ justify-content: center;
+ font-size: var(--font-size-xs);
+ font-style: normal;
+ font-weight: var(--font-weight-normal);
+ }
+
+ .ant-btn {
+ box-shadow: none;
+ }
+
+ .tab {
+ border: 1px solid var(--bg-slate-400);
+ width: 114px;
+ }
+
+ .tab::before {
+ background: var(--bg-slate-400);
+ }
+
+ .selected_view {
+ background: var(--bg-slate-300);
+ color: var(--text-vanilla-100);
+ border: 1px solid var(--bg-slate-400);
+ }
+
+ .selected_view::before {
+ background: var(--bg-slate-400);
+ }
+
+ .ant-radio-button-wrapper {
+ min-width: 120px;
+ text-align: center;
+
+ font-style: normal;
+ font-weight: 400;
+ font-size: 12px;
+ }
+ }
+
+ .tab-options {
+ display: flex;
+ gap: 8px;
+ align-items: center;
+
+ .ant-btn {
+ border: 1px solid var(--bg-slate-400);
+ }
+
+ .format-options-container {
+ position: relative;
+ }
+ }
+ }
+
+ .logs-actions-container {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: 8px;
+
+ .ant-btn {
+ border: none;
+ }
+ }
+
+ .logs-explorer-views-type-content {
+ .ant-card {
+ border: none !important;
+ }
+
+ .query-table {
+ .ant-table {
+ table {
+ min-width: 99% !important;
+ }
+ }
+ }
+ }
+ }
+
+ .ant-card-body {
+ background-color: var(--bg-ink-500);
+ }
+
+ .logs-histogram {
+ margin-bottom: 0px;
+ }
+}
+
+.lightMode {
+ .logs-explorer-views-container {
+ .ant-card-body {
+ background-color: var(--bg-vanilla-100);
+ }
+
+ .views-tabs-container {
+ border: 1px solid var(--text-vanilla-300);
+
+ .views-tabs {
+ .tab {
+ border: 1px solid var(--bg-vanilla-300);
+ }
+
+ .tab::before {
+ background: var(--bg-vanilla-300);
+ }
+
+ .selected_view {
+ background: white;
+ color: var(--text-robin-400);
+ border: 1px solid var(--bg-robin-400);
+ }
+
+ .selected_view::before {
+ background: var(--bg-robin-400);
+ }
+ }
+ }
+ }
+}
diff --git a/frontend/src/container/LogsExplorerViews/index.tsx b/frontend/src/container/LogsExplorerViews/index.tsx
index bcc67ddd6a..c37e621108 100644
--- a/frontend/src/container/LogsExplorerViews/index.tsx
+++ b/frontend/src/container/LogsExplorerViews/index.tsx
@@ -1,5 +1,9 @@
-import { Tabs, TabsProps } from 'antd';
-import TabLabel from 'components/TabLabel';
+/* eslint-disable sonarjs/cognitive-complexity */
+import './LogsExplorerViews.styles.scss';
+
+import { Button } from 'antd';
+import LogsFormatOptionsMenu from 'components/LogsFormatOptionsMenu/LogsFormatOptionsMenu';
+import { LOCALSTORAGE } from 'constants/localStorage';
import { AVAILABLE_EXPORT_PANEL_TYPES } from 'constants/panelTypes';
import { QueryParams } from 'constants/query';
import {
@@ -9,23 +13,29 @@ import {
PANEL_TYPES,
} from 'constants/queryBuilder';
import { DEFAULT_PER_PAGE_VALUE } from 'container/Controls/config';
-import ExportPanel from 'container/ExportPanel';
+import ExplorerOptions from 'container/ExplorerOptions/ExplorerOptions';
import GoToTop from 'container/GoToTop';
import LogsExplorerChart from 'container/LogsExplorerChart';
import LogsExplorerList from 'container/LogsExplorerList';
import LogsExplorerTable from 'container/LogsExplorerTable';
+import { useOptionsMenu } from 'container/OptionsMenu';
import TimeSeriesView from 'container/TimeSeriesView/TimeSeriesView';
import { useUpdateDashboard } from 'hooks/dashboard/useUpdateDashboard';
import { addEmptyWidgetInDashboardJSONWithQuery } from 'hooks/dashboard/utils';
import { LogTimeRange } from 'hooks/logs/types';
import { useCopyLogLink } from 'hooks/logs/useCopyLogLink';
import { useGetExplorerQueryRange } from 'hooks/queryBuilder/useGetExplorerQueryRange';
+import { useGetPanelTypesQueryParam } from 'hooks/queryBuilder/useGetPanelTypesQueryParam';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import useAxiosError from 'hooks/useAxiosError';
+import useClickOutside from 'hooks/useClickOutside';
import { useHandleExplorerTabChange } from 'hooks/useHandleExplorerTabChange';
import { useNotifications } from 'hooks/useNotifications';
import useUrlQueryData from 'hooks/useUrlQueryData';
import { getPaginationQueryData } from 'lib/newQueryBuilder/getPaginationQueryData';
+import { defaultTo, isEmpty } from 'lodash-es';
+import { Sliders } from 'lucide-react';
+import { SELECTED_VIEWS } from 'pages/LogsExplorer/utils';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useSelector } from 'react-redux';
import { useHistory } from 'react-router-dom';
@@ -38,18 +48,30 @@ import {
Query,
TagFilter,
} from 'types/api/queryBuilder/queryBuilderData';
-import { DataSource, LogsAggregatorOperator } from 'types/common/queryBuilder';
+import {
+ DataSource,
+ LogsAggregatorOperator,
+ StringOperators,
+} from 'types/common/queryBuilder';
import { GlobalReducer } from 'types/reducer/globalTime';
import { generateExportToDashboardLink } from 'utils/dashboard/generateExportToDashboardLink';
import { v4 } from 'uuid';
-import { ActionsWrapper } from './LogsExplorerViews.styled';
-
-function LogsExplorerViews(): JSX.Element {
+function LogsExplorerViews({
+ selectedView,
+ showHistogram,
+}: {
+ selectedView: SELECTED_VIEWS;
+ showHistogram: boolean;
+}): JSX.Element {
const { notifications } = useNotifications();
const history = useHistory();
+ // this is to respect the panel type present in the URL rather than defaulting it to list always.
+ const panelTypes = useGetPanelTypesQueryParam(PANEL_TYPES.LIST);
+
const { activeLogId, timeRange, onTimeRangeChange } = useCopyLogLink();
+
const { queryData: pageSize } = useUrlQueryData(
QueryParams.pageSize,
DEFAULT_PER_PAGE_VALUE,
@@ -63,18 +85,25 @@ function LogsExplorerViews(): JSX.Element {
// Context
const {
+ initialDataSource,
currentQuery,
stagedQuery,
panelType,
updateAllQueriesOperators,
+ handleSetConfig,
} = useQueryBuilder();
+ const [selectedPanelType, setSelectedPanelType] = useState<PANEL_TYPES>(
+ panelType || PANEL_TYPES.LIST,
+ );
+
const { handleExplorerTabChange } = useHandleExplorerTabChange();
// State
const [page, setPage] = useState<number>(1);
const [logs, setLogs] = useState<ILog[]>([]);
const [requestData, setRequestData] = useState<Query | null>(null);
+ const [showFormatMenuItems, setShowFormatMenuItems] = useState(false);
const handleAxisError = useAxiosError();
@@ -147,6 +176,15 @@ function LogsExplorerViews(): JSX.Element {
[currentQuery, updateAllQueriesOperators],
);
+ const handleModeChange = (panelType: PANEL_TYPES): void => {
+ if (selectedView === SELECTED_VIEWS.SEARCH) {
+ handleSetConfig(panelType, DataSource.LOGS);
+ }
+
+ setShowFormatMenuItems(false);
+ handleExplorerTabChange(panelType);
+ };
+
const {
data: listChartData,
isFetching: isFetchingListChartData,
@@ -155,7 +193,7 @@ function LogsExplorerViews(): JSX.Element {
enabled: !!listChartQuery && panelType === PANEL_TYPES.LIST,
});
- const { data, isFetching, isError } = useGetExplorerQueryRange(
+ const { data, isLoading, isFetching, isError } = useGetExplorerQueryRange(
requestData,
panelType,
{
@@ -327,12 +365,37 @@ function LogsExplorerViews(): JSX.Element {
);
useEffect(() => {
- const shouldChangeView = isMultipleQueries || isGroupByExist;
+ const shouldChangeView =
+ (isMultipleQueries || isGroupByExist) &&
+ selectedView !== SELECTED_VIEWS.SEARCH;
- if (panelType === PANEL_TYPES.LIST && shouldChangeView) {
+ if (selectedPanelType === PANEL_TYPES.LIST && shouldChangeView) {
handleExplorerTabChange(PANEL_TYPES.TIME_SERIES);
+ setSelectedPanelType(PANEL_TYPES.TIME_SERIES);
}
- }, [panelType, isMultipleQueries, isGroupByExist, handleExplorerTabChange]);
+
+ if (panelType) {
+ setSelectedPanelType(panelType);
+ }
+ }, [
+ isMultipleQueries,
+ isGroupByExist,
+ selectedPanelType,
+ selectedView,
+ handleExplorerTabChange,
+ panelType,
+ ]);
+
+ useEffect(() => {
+ if (
+ selectedView &&
+ selectedView === SELECTED_VIEWS.SEARCH &&
+ handleSetConfig
+ ) {
+ handleSetConfig(defaultTo(panelTypes, PANEL_TYPES.LIST), DataSource.LOGS);
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
useEffect(() => {
const currentParams = data?.params as Omit<LogTimeRange, 'pageSize'>;
@@ -372,10 +435,6 @@ function LogsExplorerViews(): JSX.Element {
setPage(1);
setRequestData(newRequestData);
currentMinTimeRef.current = minTime;
-
- if (!activeLogId) {
- onTimeRangeChange(null);
- }
}
}, [
stagedQuery,
@@ -388,58 +447,14 @@ function LogsExplorerViews(): JSX.Element {
activeLogId,
onTimeRangeChange,
panelType,
+ selectedView,
]);
- const tabsItems: TabsProps['items'] = useMemo(
- () => [
- {
- label: (
- <TabLabel
- label="List View"
- tooltipText="Please remove attributes from Group By filter to switch to List View tab"
- isDisabled={isMultipleQueries || isGroupByExist}
- />
- ),
- key: PANEL_TYPES.LIST,
- disabled: isMultipleQueries || isGroupByExist,
- children: (
- <LogsExplorerList
- isLoading={isFetching}
- currentStagedQueryData={listQuery}
- logs={logs}
- onEndReached={handleEndReached}
- />
- ),
- },
- {
- label: <TabLabel label="Time Series" isDisabled={false} />,
- key: PANEL_TYPES.TIME_SERIES,
- children: (
- <TimeSeriesView isLoading={isFetching} data={data} isError={isError} />
- ),
- },
- {
- label: 'Table',
- key: PANEL_TYPES.TABLE,
- children: (
- <LogsExplorerTable
- data={data?.payload.data.newResult.data.result || []}
- isLoading={isFetching}
- />
- ),
- },
- ],
- [
- isMultipleQueries,
- isGroupByExist,
- isFetching,
- listQuery,
- logs,
- handleEndReached,
- data,
- isError,
- ],
- );
+ const { options, config } = useOptionsMenu({
+ storageKey: LOCALSTORAGE.LOGS_LIST_OPTIONS,
+ dataSource: initialDataSource || DataSource.METRICS,
+ aggregateOperator: listQuery?.aggregateOperator || StringOperators.NOOP,
+ });
const chartData = useMemo(() => {
if (!stagedQuery) return [];
@@ -466,31 +481,156 @@ function LogsExplorerViews(): JSX.Element {
return isGroupByExist ? data.payload.data.result : firstPayloadQueryArray;
}, [stagedQuery, panelType, data, listChartData, listQuery]);
+ const formatItems = [
+ {
+ key: 'raw',
+ label: 'Raw',
+ data: {
+ title: 'max lines per row',
+ },
+ },
+ {
+ key: 'list',
+ label: 'Default',
+ },
+ {
+ key: 'table',
+ label: 'Column',
+ data: {
+ title: 'columns',
+ },
+ },
+ ];
+
+ const handleToggleShowFormatOptions = (): void =>
+ setShowFormatMenuItems(!showFormatMenuItems);
+
+ const menuRef = useRef<HTMLDivElement>(null);
+
+ useClickOutside({
+ ref: menuRef,
+ onClickOutside: () => {
+ if (showFormatMenuItems) {
+ setShowFormatMenuItems(false);
+ }
+ },
+ });
+
return (
- <>
- <LogsExplorerChart
- isLoading={isFetchingListChartData || isLoadingListChartData}
- data={chartData}
- />
- {stagedQuery && (
- <ActionsWrapper>
- <ExportPanel
- query={exportDefaultQuery}
- isLoading={isUpdateDashboardLoading}
- onExport={handleExport}
- />
- </ActionsWrapper>
+ <div className="logs-explorer-views-container">
+ {showHistogram && (
+ <LogsExplorerChart
+ className="logs-histogram"
+ isLoading={isFetchingListChartData || isLoadingListChartData}
+ data={chartData}
+ />
)}
- <Tabs
- items={tabsItems}
- defaultActiveKey={panelType || PANEL_TYPES.LIST}
- activeKey={panelType || PANEL_TYPES.LIST}
- onChange={handleExplorerTabChange}
- destroyInactiveTabPane
- />
+
+ <div className="logs-explorer-views-types">
+ <div className="views-tabs-container">
+ <Button.Group className="views-tabs">
+ <Button
+ value={PANEL_TYPES.LIST}
+ className={
+ // eslint-disable-next-line sonarjs/no-duplicate-string
+ selectedPanelType === PANEL_TYPES.LIST ? 'selected_view tab' : 'tab'
+ }
+ disabled={
+ (isMultipleQueries || isGroupByExist) && selectedView !== 'search'
+ }
+ onClick={(): void => handleModeChange(PANEL_TYPES.LIST)}
+ >
+ List view
+ </Button>
+ <Button
+ value={PANEL_TYPES.TIME_SERIES}
+ className={
+ // eslint-disable-next-line sonarjs/no-duplicate-string
+ selectedPanelType === PANEL_TYPES.TIME_SERIES
+ ? 'selected_view tab'
+ : 'tab'
+ }
+ onClick={(): void => handleModeChange(PANEL_TYPES.TIME_SERIES)}
+ >
+ Time series
+ </Button>
+ <Button
+ value={PANEL_TYPES.TABLE}
+ className={
+ // eslint-disable-next-line sonarjs/no-duplicate-string
+ selectedPanelType === PANEL_TYPES.TABLE ? 'selected_view tab' : 'tab'
+ }
+ onClick={(): void => handleModeChange(PANEL_TYPES.TABLE)}
+ >
+ Table
+ </Button>
+ </Button.Group>
+ <div className="logs-actions-container">
+ {selectedPanelType === PANEL_TYPES.LIST && (
+ <div className="tab-options">
+ <div className="format-options-container" ref={menuRef}>
+ <Button
+ className="periscope-btn"
+ onClick={handleToggleShowFormatOptions}
+ icon={<Sliders size={14} />}
+ />
+
+ {showFormatMenuItems && (
+ <LogsFormatOptionsMenu
+ title="FORMAT"
+ items={formatItems}
+ selectedOptionFormat={options.format}
+ config={config}
+ />
+ )}
+ </div>
+ </div>
+ )}
+ </div>
+ </div>
+
+ <div className="logs-explorer-views-type-content">
+ {selectedPanelType === PANEL_TYPES.LIST && (
+ <LogsExplorerList
+ isLoading={isLoading}
+ isFetching={isFetching}
+ currentStagedQueryData={listQuery}
+ logs={logs}
+ onEndReached={handleEndReached}
+ isError={isError}
+ isFilterApplied={!isEmpty(listQuery?.filters.items)}
+ />
+ )}
+
+ {selectedPanelType === PANEL_TYPES.TIME_SERIES && (
+ <TimeSeriesView
+ isLoading={isLoading || isFetching}
+ data={data}
+ isError={isError}
+ isFilterApplied={!isEmpty(listQuery?.filters.items)}
+ />
+ )}
+
+ {selectedPanelType === PANEL_TYPES.TABLE && (
+ <LogsExplorerTable
+ data={data?.payload.data.newResult.data.result || []}
+ isLoading={isLoading || isFetching}
+ isError={isError}
+ />
+ )}
+ </div>
+ </div>
<GoToTop />
- </>
+
+ <ExplorerOptions
+ disabled={!stagedQuery}
+ query={exportDefaultQuery}
+ isLoading={isUpdateDashboardLoading}
+ onExport={handleExport}
+ sourcepage={DataSource.LOGS}
+ />
+ </div>
);
}
diff --git a/frontend/src/container/LogsLoading/LogsLoading.styles.scss b/frontend/src/container/LogsLoading/LogsLoading.styles.scss
new file mode 100644
index 0000000000..43ac407006
--- /dev/null
+++ b/frontend/src/container/LogsLoading/LogsLoading.styles.scss
@@ -0,0 +1,19 @@
+.loading-logs {
+ padding: 24px 0;
+ height: 240px;
+
+ display: flex;
+ justify-content: center;
+ align-items: flex-start;
+
+ .loading-logs-content {
+ display: flex;
+ align-items: flex-start;
+ flex-direction: column;
+
+ .loading-gif {
+ height: 72px;
+ margin-left: -24px;
+ }
+ }
+}
diff --git a/frontend/src/container/LogsLoading/LogsLoading.tsx b/frontend/src/container/LogsLoading/LogsLoading.tsx
new file mode 100644
index 0000000000..1710cd9f57
--- /dev/null
+++ b/frontend/src/container/LogsLoading/LogsLoading.tsx
@@ -0,0 +1,22 @@
+import './LogsLoading.styles.scss';
+
+import { Typography } from 'antd';
+
+export function LogsLoading(): JSX.Element {
+ return (
+ <div className="loading-logs">
+ <div className="loading-logs-content">
+ <img
+ className="loading-gif"
+ src="/Icons/loading-plane.gif"
+ alt="wait-icon"
+ />
+
+ <Typography>
+ Just a bit of patience, just a little bit’s enough ⎯ we’re getting your
+ logs!
+ </Typography>
+ </div>
+ </div>
+ );
+}
diff --git a/frontend/src/container/LogsSearchFilter/utils.ts b/frontend/src/container/LogsSearchFilter/utils.ts
index 71c0011289..390a3c14b0 100644
--- a/frontend/src/container/LogsSearchFilter/utils.ts
+++ b/frontend/src/container/LogsSearchFilter/utils.ts
@@ -1,8 +1,9 @@
import { Time } from 'container/TopNav/DateTimeSelection/config';
+import { Time as TimeV2 } from 'container/TopNav/DateTimeSelectionV2/config';
import { GetMinMaxPayload } from 'lib/getMinMax';
export const getGlobalTime = (
- selectedTime: Time,
+ selectedTime: Time | TimeV2,
globalTime: GetMinMaxPayload,
): GetMinMaxPayload | undefined => {
if (selectedTime === 'custom') {
diff --git a/frontend/src/container/LogsTable/index.tsx b/frontend/src/container/LogsTable/index.tsx
index 73ad2c7eb9..c87d4232f6 100644
--- a/frontend/src/container/LogsTable/index.tsx
+++ b/frontend/src/container/LogsTable/index.tsx
@@ -2,6 +2,7 @@ import './logsTable.styles.scss';
import { Card, Typography } from 'antd';
import LogDetail from 'components/LogDetail';
+import { VIEW_TYPES } from 'components/LogDetail/constants';
// components
import ListLogView from 'components/Logs/ListLogView';
import RawLogView from 'components/Logs/RawLogView';
@@ -9,7 +10,6 @@ import LogsTableView from 'components/Logs/TableView';
import Spinner from 'components/Spinner';
import { CARD_BODY_STYLE } from 'constants/card';
import { useActiveLog } from 'hooks/logs/useActiveLog';
-import useFontFaceObserver from 'hooks/useFontObserver';
import { memo, useCallback, useMemo } from 'react';
import { useSelector } from 'react-redux';
import { Virtuoso } from 'react-virtuoso';
@@ -37,19 +37,6 @@ function LogsTable(props: LogsTableProps): JSX.Element {
onSetActiveLog,
} = useActiveLog();
- useFontFaceObserver(
- [
- {
- family: 'Fira Code',
- weight: '300',
- },
- ],
- viewMode === 'raw',
- {
- timeout: 5000,
- },
- );
-
const {
logs,
fields: { selected },
@@ -132,6 +119,7 @@ function LogsTable(props: LogsTableProps): JSX.Element {
{renderContent}
<LogDetail
+ selectedTab={VIEW_TYPES.OVERVIEW}
log={activeLog}
onClose={onClearActiveLog}
onAddToQuery={onAddToQuery}
diff --git a/frontend/src/container/LogsTable/logsTable.styles.scss b/frontend/src/container/LogsTable/logsTable.styles.scss
index ba6b436ad9..1da056bb72 100644
--- a/frontend/src/container/LogsTable/logsTable.styles.scss
+++ b/frontend/src/container/LogsTable/logsTable.styles.scss
@@ -1,3 +1,3 @@
.logs-card {
- flex: 1;
-}
\ No newline at end of file
+ flex: 1;
+}
diff --git a/frontend/src/container/MySettings/MySettings.styles.scss b/frontend/src/container/MySettings/MySettings.styles.scss
index c936bcb20a..68621b9f78 100644
--- a/frontend/src/container/MySettings/MySettings.styles.scss
+++ b/frontend/src/container/MySettings/MySettings.styles.scss
@@ -3,3 +3,9 @@
align-items: center;
gap: 8px;
}
+
+.theme-option {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
diff --git a/frontend/src/container/MySettings/UserInfo/index.tsx b/frontend/src/container/MySettings/UserInfo/index.tsx
index 23187a9bf4..01118b152b 100644
--- a/frontend/src/container/MySettings/UserInfo/index.tsx
+++ b/frontend/src/container/MySettings/UserInfo/index.tsx
@@ -4,7 +4,7 @@ import './UserInfo.styles.scss';
import { Button, Card, Flex, Input, Space, Typography } from 'antd';
import editUser from 'api/user/editUser';
import { useNotifications } from 'hooks/useNotifications';
-import { PencilIcon, UserSquare } from 'lucide-react';
+import { PencilIcon } from 'lucide-react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
@@ -79,7 +79,6 @@ function UserInfo(): JSX.Element {
<Card>
<Space direction="vertical" size="middle">
<Flex gap={8}>
- <UserSquare />{' '}
<Typography.Title level={4} style={{ marginTop: 0 }}>
User Details
</Typography.Title>
diff --git a/frontend/src/container/MySettings/index.tsx b/frontend/src/container/MySettings/index.tsx
index e3945c4d12..4bc3ffdb3a 100644
--- a/frontend/src/container/MySettings/index.tsx
+++ b/frontend/src/container/MySettings/index.tsx
@@ -1,13 +1,44 @@
import './MySettings.styles.scss';
-import { Button, Space } from 'antd';
+import { Button, Radio, RadioChangeEvent, Space, Typography } from 'antd';
import { Logout } from 'api/utils';
-import { LogOut } from 'lucide-react';
+import useThemeMode, { useIsDarkMode } from 'hooks/useDarkMode';
+import { LogOut, Moon, Sun } from 'lucide-react';
+import { useState } from 'react';
import Password from './Password';
import UserInfo from './UserInfo';
function MySettings(): JSX.Element {
+ const isDarkMode = useIsDarkMode();
+ const { toggleTheme } = useThemeMode();
+
+ const themeOptions = [
+ {
+ label: (
+ <div className="theme-option">
+ <Moon size={12} /> Dark{' '}
+ </div>
+ ),
+ value: 'dark',
+ },
+ {
+ label: (
+ <div className="theme-option">
+ <Sun size={12} /> Light{' '}
+ </div>
+ ),
+ value: 'light',
+ },
+ ];
+
+ const [theme, setTheme] = useState(isDarkMode ? 'dark' : 'light');
+
+ const handleThemeChange = ({ target: { value } }: RadioChangeEvent): void => {
+ setTheme(value);
+ toggleTheme();
+ };
+
return (
<Space
direction="vertical"
@@ -16,9 +47,32 @@ function MySettings(): JSX.Element {
margin: '16px 0',
}}
>
- <UserInfo />
+ <div className="theme-selector">
+ <Typography.Title
+ level={5}
+ style={{
+ margin: '0 0 16px 0',
+ }}
+ >
+ {' '}
+ Theme{' '}
+ </Typography.Title>
+ <Radio.Group
+ options={themeOptions}
+ onChange={handleThemeChange}
+ value={theme}
+ optionType="button"
+ buttonStyle="solid"
+ />
+ </div>
+
+ <div className="user-info-container">
+ <UserInfo />
+ </div>
- <Password />
+ <div className="password-reset-container">
+ <Password />
+ </div>
<Button className="flexBtn" onClick={(): void => Logout()} type="primary">
<LogOut size={12} /> Logout
diff --git a/frontend/src/container/NewDashboard/DashboardDescription/index.tsx b/frontend/src/container/NewDashboard/DashboardDescription/index.tsx
index beef29497e..fffff61f88 100644
--- a/frontend/src/container/NewDashboard/DashboardDescription/index.tsx
+++ b/frontend/src/container/NewDashboard/DashboardDescription/index.tsx
@@ -48,7 +48,7 @@ function DashboardDescription(): JSX.Element {
};
return (
- <Card>
+ <Card style={{ marginTop: '1rem' }}>
<Row gutter={16}>
<Col flex={1} span={9}>
<Typography.Title
diff --git a/frontend/src/container/NewExplorerCTA/config.ts b/frontend/src/container/NewExplorerCTA/config.ts
index 886f044e57..e5ccc110d3 100644
--- a/frontend/src/container/NewExplorerCTA/config.ts
+++ b/frontend/src/container/NewExplorerCTA/config.ts
@@ -4,7 +4,7 @@ export const RIBBON_STYLES = {
top: '-0.75rem',
};
-export const buttonText = {
+export const buttonText: Record<string, string> = {
[ROUTES.LOGS_EXPLORER]: 'Switch to Old Logs Explorer',
[ROUTES.TRACE]: 'Try new Traces Explorer',
[ROUTES.OLD_LOGS_EXPLORER]: 'Switch to New Logs Explorer',
diff --git a/frontend/src/container/NewExplorerCTA/index.tsx b/frontend/src/container/NewExplorerCTA/index.tsx
index 5b6d4532e2..5b6e485193 100644
--- a/frontend/src/container/NewExplorerCTA/index.tsx
+++ b/frontend/src/container/NewExplorerCTA/index.tsx
@@ -36,7 +36,6 @@ function NewExplorerCTA(): JSX.Element | null {
danger
data-testid="newExplorerCTA"
type="primary"
- size="small"
>
{buttonText[location.pathname]}
</Button>
diff --git a/frontend/src/container/NewWidget/LeftContainer/QuerySection/QueryBuilder/QueryHeader.styles.scss b/frontend/src/container/NewWidget/LeftContainer/QuerySection/QueryBuilder/QueryHeader.styles.scss
new file mode 100644
index 0000000000..019344bbe0
--- /dev/null
+++ b/frontend/src/container/NewWidget/LeftContainer/QuerySection/QueryBuilder/QueryHeader.styles.scss
@@ -0,0 +1,7 @@
+.query-header-container {
+ .action-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+}
diff --git a/frontend/src/container/NewWidget/LeftContainer/QuerySection/QueryBuilder/QueryHeader.tsx b/frontend/src/container/NewWidget/LeftContainer/QuerySection/QueryBuilder/QueryHeader.tsx
index b56b53694a..9725446c7f 100644
--- a/frontend/src/container/NewWidget/LeftContainer/QuerySection/QueryBuilder/QueryHeader.tsx
+++ b/frontend/src/container/NewWidget/LeftContainer/QuerySection/QueryBuilder/QueryHeader.tsx
@@ -1,3 +1,5 @@
+import './QueryHeader.styles.scss';
+
import {
DeleteOutlined,
DownOutlined,
@@ -29,13 +31,14 @@ function QueryHeader({
}: IQueryHeaderProps): JSX.Element {
const [collapse, setCollapse] = useState(false);
return (
- <QueryWrapper>
- <Row style={{ justifyContent: 'space-between', marginBottom: '1rem' }}>
+ <QueryWrapper className="query-header-container">
+ <Row style={{ justifyContent: 'space-between', marginBottom: '0.4rem' }}>
<Row>
<Button
type="default"
icon={disabled ? <EyeInvisibleFilled /> : <EyeFilled />}
onClick={onDisable}
+ className="action-btn"
>
{name}
</Button>
@@ -43,6 +46,7 @@ function QueryHeader({
type="default"
icon={collapse ? <RightOutlined /> : <DownOutlined />}
onClick={(): void => setCollapse(!collapse)}
+ className="action-btn"
/>
</Row>
@@ -52,6 +56,7 @@ function QueryHeader({
danger
icon={<DeleteOutlined />}
onClick={onDelete}
+ className="action-btn"
/>
)}
</Row>
diff --git a/frontend/src/container/NewWidget/LeftContainer/QuerySection/QueryBuilder/clickHouse/query.tsx b/frontend/src/container/NewWidget/LeftContainer/QuerySection/QueryBuilder/clickHouse/query.tsx
index 522b21c803..f12b150bd3 100644
--- a/frontend/src/container/NewWidget/LeftContainer/QuerySection/QueryBuilder/clickHouse/query.tsx
+++ b/frontend/src/container/NewWidget/LeftContainer/QuerySection/QueryBuilder/clickHouse/query.tsx
@@ -1,7 +1,9 @@
+import MEditor, { Monaco } from '@monaco-editor/react';
+import { Color } from '@signozhq/design-tokens';
import { Input } from 'antd';
-import MonacoEditor from 'components/Editor';
import { LEGEND } from 'constants/global';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
+import { useIsDarkMode } from 'hooks/useDarkMode';
import { ChangeEvent, useCallback } from 'react';
import { IClickHouseQuery } from 'types/api/queryBuilder/queryBuilderData';
import { EQueryType } from 'types/common/dashboard';
@@ -51,8 +53,10 @@ function ClickHouseQueryBuilder({
}, [handleSetQueryItemData, queryData, queryIndex]);
const handleUpdateEditor = useCallback(
- (value: string) => {
- handleUpdateQuery('query', value);
+ (value: string | undefined) => {
+ if (value !== undefined) {
+ handleUpdateQuery('query', value);
+ }
},
[handleUpdateQuery],
);
@@ -69,6 +73,28 @@ function ClickHouseQueryBuilder({
[handleUpdateQuery],
);
+ const isDarkMode = useIsDarkMode();
+
+ function setEditorTheme(monaco: Monaco): void {
+ monaco.editor.defineTheme('my-theme', {
+ base: 'vs-dark',
+ inherit: true,
+ rules: [
+ { token: 'string.key.json', foreground: Color.BG_VANILLA_400 },
+ { token: 'string.value.json', foreground: Color.BG_ROBIN_400 },
+ ],
+ colors: {
+ 'editor.background': Color.BG_INK_300,
+ },
+ // fontFamily: 'SF Mono',
+ fontFamily: 'Space Mono',
+ fontSize: 20,
+ fontWeight: 'normal',
+ lineHeight: 18,
+ letterSpacing: -0.06,
+ });
+ }
+
return (
<QueryHeader
name={queryData.name}
@@ -77,7 +103,7 @@ function ClickHouseQueryBuilder({
onDelete={handleRemoveQuery}
deletable={deletable}
>
- <MonacoEditor
+ <MEditor
language="sql"
height="200px"
onChange={handleUpdateEditor}
@@ -89,7 +115,12 @@ function ClickHouseQueryBuilder({
minimap: {
enabled: false,
},
+ fontSize: 14,
+ fontFamily: 'Space Mono',
}}
+ theme={isDarkMode ? 'my-theme' : 'light'}
+ // eslint-disable-next-line react/jsx-no-bind
+ beforeMount={setEditorTheme}
/>
<Input
onChange={handleUpdateInput}
diff --git a/frontend/src/container/NewWidget/LeftContainer/QuerySection/QuerySection.styles.scss b/frontend/src/container/NewWidget/LeftContainer/QuerySection/QuerySection.styles.scss
new file mode 100644
index 0000000000..968da1459a
--- /dev/null
+++ b/frontend/src/container/NewWidget/LeftContainer/QuerySection/QuerySection.styles.scss
@@ -0,0 +1,60 @@
+.dashboard-navigation {
+ .ant-tabs-tab {
+ border: none !important;
+ margin-left: 0px !important;
+ padding: 0px !important;
+
+ .nav-btns {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ .prom-ql-icon {
+ height: 14px;
+ width: 14px;
+ }
+ }
+ .ant-btn-default {
+ border-color: transparent;
+ }
+ }
+ .ant-tabs-tab-active {
+ .nav-btns {
+ background: var(--bg-slate-400) !important;
+ }
+ }
+
+ .ant-tabs-nav {
+ margin: 0px;
+ margin-bottom: 0.5rem;
+ }
+ .ant-tabs-nav::before {
+ border-bottom: none !important;
+ }
+ .ant-tabs-nav-list {
+ border: 1px solid var(--bg-slate-200);
+ }
+ .ant-tabs-tab + .ant-tabs-tab {
+ border-left: 1px solid var(--bg-slate-200) !important;
+ }
+ .stage-run-query {
+ display: flex;
+ align-items: center;
+ }
+}
+
+.lightMode {
+ .dashboard-navigation {
+ .ant-tabs-nav-list {
+ border: 1px solid var(--bg-vanilla-300);
+ }
+ .ant-tabs-tab + .ant-tabs-tab {
+ border-left: 1px solid var(--bg-vanilla-200) !important;
+ }
+ .ant-tabs-tab-active {
+ .nav-btns {
+ background: var(--bg-vanilla-300) !important;
+ }
+ }
+ }
+}
diff --git a/frontend/src/container/NewWidget/LeftContainer/QuerySection/index.tsx b/frontend/src/container/NewWidget/LeftContainer/QuerySection/index.tsx
index 7042e46f3e..9fe20bd8bc 100644
--- a/frontend/src/container/NewWidget/LeftContainer/QuerySection/index.tsx
+++ b/frontend/src/container/NewWidget/LeftContainer/QuerySection/index.tsx
@@ -1,4 +1,6 @@
-import { Button, Tabs, Typography } from 'antd';
+import './QuerySection.styles.scss';
+
+import { Button, Tabs, Tooltip, Typography } from 'antd';
import TextToolTip from 'components/TextToolTip';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { WidgetGraphProps } from 'container/NewWidget/types';
@@ -9,13 +11,14 @@ import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import { useShareBuilderUrl } from 'hooks/queryBuilder/useShareBuilderUrl';
import { updateStepInterval } from 'hooks/queryBuilder/useStepInterval';
import useUrlQuery from 'hooks/useUrlQuery';
+import { Atom, Play, Terminal } from 'lucide-react';
import { useDashboard } from 'providers/Dashboard/Dashboard';
import {
getNextWidgets,
getPreviousWidgets,
getSelectedWidgetIndex,
} from 'providers/Dashboard/util';
-import { useCallback, useMemo } from 'react';
+import { useCallback, useMemo, useState } from 'react';
import { useSelector } from 'react-redux';
import { AppState } from 'store/reducers';
import { Widgets } from 'types/api/dashboard/getAll';
@@ -32,6 +35,7 @@ function QuerySection({
selectedTime,
}: QueryProps): JSX.Element {
const { currentQuery, redirectWithQueryBuilderData } = useQueryBuilder();
+ const [currentTab, setCurrentTab] = useState(currentQuery.queryType);
const urlQuery = useUrlQuery();
const { minTime, maxTime } = useSelector<AppState, GlobalReducer>(
@@ -111,6 +115,7 @@ function QuerySection({
const handleQueryCategoryChange = (qCategory: string): void => {
const currentQueryType = qCategory as EQueryType;
+ setCurrentTab(qCategory as EQueryType);
featureResponse.refetch().then(() => {
handleStageQuery({ ...currentQuery, queryType: currentQueryType });
@@ -132,7 +137,13 @@ function QuerySection({
const items = [
{
key: EQueryType.QUERY_BUILDER,
- label: 'Query Builder',
+ label: (
+ <Tooltip title="Query Builder">
+ <Button className="nav-btns">
+ <Atom size={14} />
+ </Button>
+ </Tooltip>
+ ),
tab: <Typography>Query Builder</Typography>,
children: (
<QueryBuilder panelType={selectedGraph} filterConfigs={filterConfigs} />
@@ -140,39 +151,55 @@ function QuerySection({
},
{
key: EQueryType.CLICKHOUSE,
- label: 'ClickHouse Query',
+ label: (
+ <Tooltip title="ClickHouse">
+ <Button className="nav-btns">
+ <Terminal size={14} />
+ </Button>
+ </Tooltip>
+ ),
tab: <Typography>ClickHouse Query</Typography>,
children: <ClickHouseQueryContainer />,
},
{
key: EQueryType.PROM,
- label: 'PromQL',
+ label: (
+ <Tooltip title="PromQL">
+ <Button className="nav-btns">
+ <img src="/Icons/promQL.svg" alt="Prom Ql" className="prom-ql-icon" />
+ </Button>
+ </Tooltip>
+ ),
tab: <Typography>PromQL</Typography>,
children: <PromQLQueryContainer />,
},
];
return (
- <Tabs
- type="card"
- style={{ width: '100%' }}
- defaultActiveKey={currentQuery.queryType}
- activeKey={currentQuery.queryType}
- onChange={handleQueryCategoryChange}
- tabBarExtraContent={
- <span style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
- <TextToolTip text="This will temporarily save the current query and graph state. This will persist across tab change" />
- <Button
- loading={getWidgetQueryRange.isFetching}
- type="primary"
- onClick={handleRunQuery}
- >
- Stage & Run Query
- </Button>
- </span>
- }
- items={items}
- />
+ <div className="dashboard-navigation">
+ <Tabs
+ type="card"
+ style={{ width: '100%' }}
+ defaultActiveKey={currentTab}
+ activeKey={currentTab}
+ onChange={handleQueryCategoryChange}
+ tabBarExtraContent={
+ <span style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
+ <TextToolTip text="This will temporarily save the current query and graph state. This will persist across tab change" />
+ <Button
+ loading={getWidgetQueryRange.isFetching}
+ type="primary"
+ onClick={handleRunQuery}
+ className="stage-run-query"
+ icon={<Play size={14} />}
+ >
+ Stage & Run Query
+ </Button>
+ </span>
+ }
+ items={items}
+ />
+ </div>
);
}
diff --git a/frontend/src/container/NewWidget/LeftContainer/QuerySection/styles.ts b/frontend/src/container/NewWidget/LeftContainer/QuerySection/styles.ts
index 3a0d73e1ab..3d97d169d8 100644
--- a/frontend/src/container/NewWidget/LeftContainer/QuerySection/styles.ts
+++ b/frontend/src/container/NewWidget/LeftContainer/QuerySection/styles.ts
@@ -20,8 +20,8 @@ export const QueryButton = styled(Button)`
export const QueryWrapper = styled.div`
width: 100%;
- margin: 1rem 0;
- padding: 1rem 0.5rem;
+ margin: 0;
+ padding: 0.5rem 0;
display: flex;
flex-direction: column;
`;
diff --git a/frontend/src/container/NewWidget/LeftContainer/styles.ts b/frontend/src/container/NewWidget/LeftContainer/styles.ts
index 4d1988a4e1..c6dc1ba756 100644
--- a/frontend/src/container/NewWidget/LeftContainer/styles.ts
+++ b/frontend/src/container/NewWidget/LeftContainer/styles.ts
@@ -6,4 +6,8 @@ export const QueryContainer = styled(Card)`
margin-top: 1rem;
min-height: 23.5%;
}
+
+ .ant-card-body {
+ padding: 12px;
+ }
`;
diff --git a/frontend/src/container/NoLogs/NoLogs.styles.scss b/frontend/src/container/NoLogs/NoLogs.styles.scss
new file mode 100644
index 0000000000..32d7309b28
--- /dev/null
+++ b/frontend/src/container/NoLogs/NoLogs.styles.scss
@@ -0,0 +1,44 @@
+.no-logs-container {
+ height: 240px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+
+ // border: 1px solid #1d212d;
+ border-radius: 3px;
+
+ .no-logs-container-content {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+
+ .eyes-emoji {
+ height: 32px;
+ width: 32px;
+ }
+
+ .no-logs-text {
+ font-size: 14px;
+ font-weight: 500;
+
+ .sub-text {
+ font-weight: 400;
+ color: #c0c1c3;
+ }
+ }
+
+ .send-logs-link {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+
+ color: #7190f9;
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 500;
+ line-height: 18px; /* 128.571% */
+ letter-spacing: -0.07px;
+ }
+ }
+}
diff --git a/frontend/src/container/NoLogs/NoLogs.tsx b/frontend/src/container/NoLogs/NoLogs.tsx
new file mode 100644
index 0000000000..df934b7bcc
--- /dev/null
+++ b/frontend/src/container/NoLogs/NoLogs.tsx
@@ -0,0 +1,24 @@
+import './NoLogs.styles.scss';
+
+import { Typography } from 'antd';
+import { ArrowUpRight } from 'lucide-react';
+
+export default function NoLogs(): JSX.Element {
+ return (
+ <div className="no-logs-container">
+ <div className="no-logs-container-content">
+ <img className="eyes-emoji" src="/Images/eyesEmoji.svg" alt="eyes emoji" />
+ <Typography className="no-logs-text">
+ No logs yet.{' '}
+ <span className="sub-text">
+ When we receive logs, they would show up here
+ </span>
+ </Typography>
+
+ <Typography.Link className="send-logs-link">
+ Sending Logs to SigNoz <ArrowUpRight size={16} />
+ </Typography.Link>
+ </div>
+ </div>
+ );
+}
diff --git a/frontend/src/container/PipelinePage/PipelineListsView/Preview/components/LogsList/index.tsx b/frontend/src/container/PipelinePage/PipelineListsView/Preview/components/LogsList/index.tsx
index 19a60cb91f..f7d3af3a88 100644
--- a/frontend/src/container/PipelinePage/PipelineListsView/Preview/components/LogsList/index.tsx
+++ b/frontend/src/container/PipelinePage/PipelineListsView/Preview/components/LogsList/index.tsx
@@ -2,6 +2,7 @@ import './styles.scss';
import { ExpandAltOutlined } from '@ant-design/icons';
import LogDetail from 'components/LogDetail';
+import { VIEW_TYPES } from 'components/LogDetail/constants';
import dayjs from 'dayjs';
import { useActiveLog } from 'hooks/logs/useActiveLog';
import { ILog } from 'types/api/logs/log';
@@ -36,6 +37,7 @@ function LogsList({ logs }: LogsListProps): JSX.Element {
</div>
))}
<LogDetail
+ selectedTab={VIEW_TYPES.OVERVIEW}
log={activeLog}
onClose={onClearActiveLog}
onAddToQuery={onAddToQuery}
diff --git a/frontend/src/container/QueryBuilder/QueryBuilder.styles.scss b/frontend/src/container/QueryBuilder/QueryBuilder.styles.scss
new file mode 100644
index 0000000000..b23521ad68
--- /dev/null
+++ b/frontend/src/container/QueryBuilder/QueryBuilder.styles.scss
@@ -0,0 +1,220 @@
+.query-builder-container {
+ position: relative;
+ border-top: 1px solid var(--bg-slate-400);
+ border-bottom: 1px solid var(--bg-slate-400);
+ background: var(--bg-ink-400);
+
+ // height: 280px;
+ // overflow: hidden;
+
+ .query-builder-left-col {
+ // min-height: 280px;
+ // position: relative;
+
+ border-top: 1px solid var(--bg-slate-400);
+ border-right: 1px solid var(--bg-slate-400);
+ border-bottom: 1px solid var(--bg-slate-400);
+ border-left: 1px solid var(--bg-slate-400);
+ background: var(--bg-slate-500);
+ }
+
+ .new-query-formula-buttons-container {
+ position: absolute;
+ display: flex;
+ z-index: 10;
+ bottom: 10px;
+ left: 16px;
+
+ border-radius: 2px;
+ background: var(--bg-ink-200);
+ box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
+
+ .ant-btn {
+ border-radius: 0px;
+ border: 1px solid var(--bg-slate-200);
+ background: var(--bg-ink-200);
+ box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
+
+ padding: 2px 10px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+ }
+
+ .query-builder-mini-map {
+ border-left: 1px solid var(--bg-slate-400);
+ border-right: 1px solid var(--bg-slate-400);
+
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-start;
+ gap: 8px;
+ align-items: center;
+ padding: 8px;
+
+ // min-height: 280px;
+ // height: 100%;
+ // overflow-y: auto;
+
+ .ant-btn {
+ min-width: 32px;
+ padding: 4px 9px;
+
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ border-radius: 2px;
+
+ &.query-btn {
+ color: var(--bg-sakura-400);
+
+ border: 1px solid rgba(242, 71, 105, 0.2);
+ background: rgba(242, 71, 105, 0.1);
+
+ &:hover {
+ border: 1px solid rgba(242, 71, 105, 0.4);
+ color: var(--bg-sakura-400);
+ }
+ }
+
+ &.formula-btn {
+ color: var(--bg-sienna-400);
+
+ border: 1px solid rgba(189, 153, 121, 0.2);
+ background: rgba(189, 153, 121, 0.1);
+
+ &:hover {
+ border: 1px solid rgba(189, 153, 121, 0.4);
+ color: var(--bg-sienna-400);
+ }
+ }
+ }
+ }
+
+ .qb-entities-list {
+ // height: 280px;
+ // overflow-y: auto;
+ // height: 100%;
+
+ scroll-behavior: smooth;
+ }
+
+ .query-builder {
+ padding: 12px;
+
+ // height: 348px;
+ // overflow-y: auto;
+ // scroll-snap-align: start;
+
+ .query-builder-queries-formula-container {
+ display: flex;
+ gap: 16px;
+ // height: 100%;
+
+ scroll-snap-type: y mandatory;
+
+ .query,
+ .formula {
+ scroll-snap-align: start;
+ }
+ }
+
+ .ant-select-selector {
+ border-radius: 2px;
+ border: 1px solid var(--bg-slate-400);
+ background: var(--bg-ink-300);
+
+ input {
+ font-size: 12px;
+ }
+
+ .ant-tag .ant-typography {
+ font-size: 12px;
+ }
+ }
+
+ .ant-input-number {
+ border-radius: 2px;
+ border: 1px solid var(--bg-slate-400);
+ }
+
+ .divider {
+ margin: 12px -12px;
+
+ .ant-divider-horizontal {
+ width: calc(100% + 24px);
+ margin: 24px 0 12px;
+ border-block-start: 2px solid var(--bg-slate-400);
+ }
+ }
+ }
+
+ ::-webkit-scrollbar {
+ height: 1rem;
+ width: 0.2rem;
+ }
+}
+
+.lightMode {
+ .query-builder-container {
+ border-top-color: var(--bg-vanilla-300);
+ border-bottom-color: var(--bg-vanilla-300);
+ background: var(--bg-vanilla-100);
+
+ .query-builder-left-col {
+ border-top-color: var(--bg-vanilla-300);
+ border-right-color: var(--bg-vanilla-300);
+ border-bottom-color: var(--bg-vanilla-300);
+ border-left-color: var(--bg-vanilla-300);
+ background-color: var(--bg-vanilla-100);
+
+ .new-query-formula-buttons-container {
+ border-color: var(--bg-vanilla-200);
+ background: var(--bg-vanilla-200);
+
+ .ant-btn {
+ border-color: var(--bg-vanilla-300);
+ background: var(--bg-vanilla-100);
+ }
+ }
+ }
+
+ .new-query-formula-buttons-container {
+ border-color: var(--bg-vanilla-200);
+ background: var(--bg-vanilla-200);
+
+ .ant-btn {
+ border-color: var(--bg-vanilla-300);
+ background: var(--bg-vanilla-100);
+ }
+ }
+
+ .query-builder-mini-map {
+ border-left-color: var(--bg-vanilla-300);
+ border-right-color: var(--bg-vanilla-300);
+ }
+
+ .query-builder {
+ .divider {
+ .ant-divider-horizontal {
+ border-block-start: 2px solid var(--bg-vanilla-300);
+ }
+ }
+
+ .ant-select-selector {
+ border-color: var(--bg-vanilla-300);
+ background: var(--bg-vanilla-300);
+ }
+
+ .ant-input-number {
+ border-color: var(--bg-vanilla-300);
+ }
+
+ .anticon {
+ color: var(--bg-vanilla-400);
+ }
+ }
+ }
+}
diff --git a/frontend/src/container/QueryBuilder/QueryBuilder.tsx b/frontend/src/container/QueryBuilder/QueryBuilder.tsx
index e14264810f..39875a7c90 100644
--- a/frontend/src/container/QueryBuilder/QueryBuilder.tsx
+++ b/frontend/src/container/QueryBuilder/QueryBuilder.tsx
@@ -1,10 +1,12 @@
-import { PlusOutlined } from '@ant-design/icons';
-import { Button, Col, Row } from 'antd';
+import './QueryBuilder.styles.scss';
+
+import { Button, Col, Divider, Row, Tooltip } from 'antd';
import { MAX_FORMULAS, MAX_QUERIES } from 'constants/queryBuilder';
// ** Hooks
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
+import { DatabaseZap, Sigma } from 'lucide-react';
// ** Constants
-import { memo, useEffect, useMemo } from 'react';
+import { memo, useEffect, useMemo, useRef } from 'react';
import { DataSource } from 'types/common/queryBuilder';
// ** Components
@@ -15,7 +17,6 @@ import { QueryBuilderProps } from './QueryBuilder.interfaces';
export const QueryBuilder = memo(function QueryBuilder({
config,
panelType: newPanelType,
- actions,
filterConfigs = {},
queryComponents,
}: QueryBuilderProps): JSX.Element {
@@ -28,6 +29,8 @@ export const QueryBuilder = memo(function QueryBuilder({
initialDataSource,
} = useQueryBuilder();
+ const containerRef = useRef(null);
+
const currentDataSource = useMemo(
() =>
(config && config.queryVariant === 'static' && config.initialDataSource) ||
@@ -64,71 +67,133 @@ export const QueryBuilder = memo(function QueryBuilder({
[currentQuery],
);
+ const handleScrollIntoView = (
+ entityType: string,
+ entityName: string,
+ ): void => {
+ const selectedEntity = document.getElementById(
+ `qb-${entityType}-${entityName}`,
+ );
+
+ if (selectedEntity) {
+ selectedEntity.scrollIntoView({
+ behavior: 'smooth',
+ block: 'start',
+ inline: 'nearest',
+ });
+ }
+ };
+
return (
- <Row style={{ width: '100%' }} gutter={[0, 20]} justify="start">
- <Col span={24}>
- <Row gutter={[0, 50]}>
- {currentQuery.builder.queryData.map((query, index) => (
- <Col key={query.queryName} span={24}>
- <Query
- index={index}
- isAvailableToDisable={isAvailableToDisableQuery}
- queryVariant={config?.queryVariant || 'dropdown'}
- query={query}
- filterConfigs={filterConfigs}
- queryComponents={queryComponents}
- />
- </Col>
- ))}
- {currentQuery.builder.queryFormulas.map((formula, index) => {
- const isAllMetricDataSource = currentQuery.builder.queryData.every(
- (query) => query.dataSource === DataSource.METRICS,
- );
-
- const query =
- currentQuery.builder.queryData[index] ||
- currentQuery.builder.queryData[0];
-
- return (
- <Col key={formula.queryName} span={24}>
- <Formula
- filterConfigs={filterConfigs}
- query={query}
- isAdditionalFilterEnable={isAllMetricDataSource}
- formula={formula}
- index={index}
- />
- </Col>
- );
- })}
- </Row>
- </Col>
+ <Row
+ style={{ width: '100%' }}
+ gutter={[0, 20]}
+ justify="start"
+ className="query-builder-container"
+ >
+ <div className="new-query-formula-buttons-container">
+ <Button.Group>
+ <Tooltip title="Add Query">
+ <Button disabled={isDisabledQueryButton} onClick={addNewBuilderQuery}>
+ <DatabaseZap size={12} />
+ </Button>
+ </Tooltip>
- <Col span={24}>
- <Row gutter={[20, 0]}>
- <Col>
- <Button
- disabled={isDisabledQueryButton}
- type="primary"
- icon={<PlusOutlined />}
- onClick={addNewBuilderQuery}
- >
- Query
+ <Tooltip title="Add Formula">
+ <Button disabled={isDisabledFormulaButton} onClick={addNewFormula}>
+ <Sigma size={12} />
</Button>
+ </Tooltip>
+ </Button.Group>
+ </div>
+
+ <Col span={23} className="qb-entities-list">
+ <Row>
+ <Col span={1} className="query-builder-left-col">
+ {' '}
</Col>
- <Col>
- <Button
- disabled={isDisabledFormulaButton}
- onClick={addNewFormula}
- type="primary"
- icon={<PlusOutlined />}
+
+ <Col span={23} className="query-builder">
+ <Row
+ gutter={[0, 16]}
+ className="query-builder-queries-formula-container"
+ ref={containerRef}
>
- Formula
- </Button>
+ {currentQuery.builder.queryData.map((query, index) => (
+ <Col
+ key={query.queryName}
+ span={24}
+ className="query"
+ id={`qb-query-${query.queryName}`}
+ >
+ <Query
+ index={index}
+ isAvailableToDisable={isAvailableToDisableQuery}
+ queryVariant={config?.queryVariant || 'dropdown'}
+ query={query}
+ filterConfigs={filterConfigs}
+ queryComponents={queryComponents}
+ />
+ </Col>
+ ))}
+ {currentQuery.builder.queryFormulas.map((formula, index) => {
+ const isAllMetricDataSource = currentQuery.builder.queryData.every(
+ (query) => query.dataSource === DataSource.METRICS,
+ );
+
+ const query =
+ currentQuery.builder.queryData[index] ||
+ currentQuery.builder.queryData[0];
+
+ return (
+ <Col
+ key={formula.queryName}
+ span={24}
+ className="formula"
+ id={`qb-formula-${formula.queryName}`}
+ >
+ <Formula
+ filterConfigs={filterConfigs}
+ query={query}
+ isAdditionalFilterEnable={isAllMetricDataSource}
+ formula={formula}
+ index={index}
+ />
+ </Col>
+ );
+ })}
+ </Row>
+
+ <Col span={24} className="divider">
+ <Divider />
+ </Col>
</Col>
- {actions}
</Row>
</Col>
+
+ <Col span={1} className="query-builder-mini-map">
+ {currentQuery.builder.queryData.map((query) => (
+ <Button
+ disabled={isDisabledQueryButton}
+ className="query-btn"
+ key={query.queryName}
+ onClick={(): void => handleScrollIntoView('query', query.queryName)}
+ >
+ {query.queryName}
+ </Button>
+ ))}
+
+ {currentQuery.builder.queryFormulas.map((formula) => (
+ <Button
+ disabled={isDisabledFormulaButton}
+ className="formula-btn"
+ key={formula.queryName}
+ onClick={(): void => handleScrollIntoView('formula', formula.queryName)}
+ >
+ {formula.queryName}
+ </Button>
+ ))}
+ </Col>
</Row>
);
});
diff --git a/frontend/src/container/QueryBuilder/components/AdditionalFiltersToggler/AdditionalFiltersToggler.styled.ts b/frontend/src/container/QueryBuilder/components/AdditionalFiltersToggler/AdditionalFiltersToggler.styled.ts
index 8f23dd0e3c..cbc5f16d56 100644
--- a/frontend/src/container/QueryBuilder/components/AdditionalFiltersToggler/AdditionalFiltersToggler.styled.ts
+++ b/frontend/src/container/QueryBuilder/components/AdditionalFiltersToggler/AdditionalFiltersToggler.styled.ts
@@ -1,4 +1,5 @@
import { MinusSquareOutlined, PlusSquareOutlined } from '@ant-design/icons';
+import { Color } from '@signozhq/design-tokens';
import { Col, Typography } from 'antd';
import styled, { css } from 'styled-components';
@@ -19,6 +20,7 @@ export const StyledInner = styled(Col)`
width: fit-content;
display: flex;
align-items: center;
+ gap: 8px;
margin-bottom: 0.875rem;
min-height: 1.375rem;
cursor: pointer;
@@ -31,4 +33,5 @@ export const StyledInner = styled(Col)`
export const StyledLink = styled(Typography.Link)`
pointer-events: none;
+ color: ${Color.BG_ROBIN_400} !important;
`;
diff --git a/frontend/src/container/QueryBuilder/components/AdditionalFiltersToggler/AdditionalFiltersToggler.styles.scss b/frontend/src/container/QueryBuilder/components/AdditionalFiltersToggler/AdditionalFiltersToggler.styles.scss
new file mode 100644
index 0000000000..e859e1900b
--- /dev/null
+++ b/frontend/src/container/QueryBuilder/components/AdditionalFiltersToggler/AdditionalFiltersToggler.styles.scss
@@ -0,0 +1,15 @@
+.filter-toggler {
+ margin-right: 8px;
+}
+
+.additinal-filters-container {
+ .action-btn {
+ background: #4E74F8;
+ width: 16px;
+ height: 16px;
+ border-radius: 3px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+}
\ No newline at end of file
diff --git a/frontend/src/container/QueryBuilder/components/AdditionalFiltersToggler/AdditionalFiltersToggler.tsx b/frontend/src/container/QueryBuilder/components/AdditionalFiltersToggler/AdditionalFiltersToggler.tsx
index 470a8b0726..086cabd94f 100644
--- a/frontend/src/container/QueryBuilder/components/AdditionalFiltersToggler/AdditionalFiltersToggler.tsx
+++ b/frontend/src/container/QueryBuilder/components/AdditionalFiltersToggler/AdditionalFiltersToggler.tsx
@@ -1,15 +1,14 @@
+import './AdditionalFiltersToggler.styles.scss';
+
+import { Color } from '@signozhq/design-tokens';
import { Col, Row, Typography } from 'antd';
+import { Minus, Plus } from 'lucide-react';
import { Fragment, memo, ReactNode, useState } from 'react';
// ** Types
import { AdditionalFiltersProps } from './AdditionalFiltersToggler.interfaces';
// ** Styles
-import {
- StyledIconClose,
- StyledIconOpen,
- StyledInner,
- StyledLink,
-} from './AdditionalFiltersToggler.styled';
+import { StyledInner, StyledLink } from './AdditionalFiltersToggler.styled';
export const AdditionalFiltersToggler = memo(function AdditionalFiltersToggler({
children,
@@ -42,10 +41,19 @@ export const AdditionalFiltersToggler = memo(function AdditionalFiltersToggler({
});
return (
- <Row>
+ <Row className="additinal-filters-container">
<Col span={24}>
- <StyledInner onClick={handleToggleOpenFilters}>
- {isOpenedFilters ? <StyledIconClose /> : <StyledIconOpen />}
+ <StyledInner onClick={handleToggleOpenFilters} style={{ marginBottom: 0 }}>
+ {isOpenedFilters ? (
+ <span className="action-btn">
+ <Minus size={14} color={Color.BG_INK_500} />
+ </span>
+ ) : (
+ <span className="action-btn">
+ <Plus size={14} color={Color.BG_INK_500} />
+ </span>
+ )}
+
{!isOpenedFilters && (
<Typography>Add conditions for {filtersTexts}</Typography>
)}
diff --git a/frontend/src/container/QueryBuilder/components/FilterLabel/FilterLabel.styled.ts b/frontend/src/container/QueryBuilder/components/FilterLabel/FilterLabel.styled.ts
index bcf0d2d04c..bc2975a5d3 100644
--- a/frontend/src/container/QueryBuilder/components/FilterLabel/FilterLabel.styled.ts
+++ b/frontend/src/container/QueryBuilder/components/FilterLabel/FilterLabel.styled.ts
@@ -1,4 +1,3 @@
-import { themeColors } from 'constants/theme';
import styled from 'styled-components';
interface Props {
@@ -12,8 +11,4 @@ export const StyledLabel = styled.div<Props>`
white-space: nowrap;
align-items: center;
border-radius: 0.125rem;
- border: ${({ isDarkMode }): string =>
- `1px solid ${
- isDarkMode ? themeColors.borderDarkGrey : themeColors.borderLightGrey
- }`};
`;
diff --git a/frontend/src/container/QueryBuilder/components/FilterLabel/FilterLabel.tsx b/frontend/src/container/QueryBuilder/components/FilterLabel/FilterLabel.tsx
index 9d1c17514d..57d09938d6 100644
--- a/frontend/src/container/QueryBuilder/components/FilterLabel/FilterLabel.tsx
+++ b/frontend/src/container/QueryBuilder/components/FilterLabel/FilterLabel.tsx
@@ -14,7 +14,13 @@ export const FilterLabel = memo(function FilterLabel({
return (
<StyledLabel isDarkMode={isDarkMode}>
- <Typography>{label}</Typography>
+ <Typography
+ style={{
+ color: '#c0c1c3',
+ }}
+ >
+ {label}
+ </Typography>
</StyledLabel>
);
});
diff --git a/frontend/src/container/QueryBuilder/components/Formula/Formula.styles.scss b/frontend/src/container/QueryBuilder/components/Formula/Formula.styles.scss
new file mode 100644
index 0000000000..f4f20148ec
--- /dev/null
+++ b/frontend/src/container/QueryBuilder/components/Formula/Formula.styles.scss
@@ -0,0 +1,4 @@
+.formula-container {
+ padding: 0 24px;
+ width: 100%;
+}
diff --git a/frontend/src/container/QueryBuilder/components/Formula/Formula.tsx b/frontend/src/container/QueryBuilder/components/Formula/Formula.tsx
index dd39a5b1af..4a5a50f241 100644
--- a/frontend/src/container/QueryBuilder/components/Formula/Formula.tsx
+++ b/frontend/src/container/QueryBuilder/components/Formula/Formula.tsx
@@ -1,22 +1,21 @@
+import './Formula.styles.scss';
+
import { Col, Input, Row } from 'antd';
import { LEGEND } from 'constants/global';
// ** Components
-import {
- FilterLabel,
- ListItemWrapper,
- ListMarker,
-} from 'container/QueryBuilder/components';
+import { FilterLabel } from 'container/QueryBuilder/components';
import HavingFilter from 'container/QueryBuilder/filters/Formula/Having/HavingFilter';
import LimitFilter from 'container/QueryBuilder/filters/Formula/Limit/Limit';
import OrderByFilter from 'container/QueryBuilder/filters/Formula/OrderBy/OrderByFilter';
// ** Hooks
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import { useQueryOperations } from 'hooks/queryBuilder/useQueryBuilderOperations';
-import { ChangeEvent, useCallback, useMemo } from 'react';
+import { ChangeEvent, useCallback, useMemo, useState } from 'react';
import { IBuilderFormula } from 'types/api/queryBuilder/queryBuilderData';
import { getFormatedLegend } from 'utils/getFormatedLegend';
import { AdditionalFiltersToggler } from '../AdditionalFiltersToggler';
+import QBEntityOptions from '../QBEntityOptions/QBEntityOptions';
// ** Types
import { FormulaProps } from './Formula.interfaces';
@@ -42,6 +41,8 @@ export function Formula({
formula,
});
+ const [isCollapse, setIsCollapsed] = useState(false);
+
const handleDelete = useCallback(() => {
removeQueryBuilderEntityByIndex('queryFormulas', index);
}, [index, removeQueryBuilderEntityByIndex]);
@@ -55,6 +56,10 @@ export function Formula({
handleSetFormulaData(index, newFormula);
}, [index, formula, handleSetFormulaData]);
+ const handleToggleCollapseFormula = (): void => {
+ setIsCollapsed(!isCollapse);
+ };
+
const handleChange = useCallback(
(e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
const { name, value } = e.target;
@@ -138,44 +143,49 @@ export function Formula({
);
return (
- <ListItemWrapper onDelete={handleDelete}>
- <Col span={24}>
- <ListMarker
- isDisabled={formula.disabled}
- onDisable={handleToggleDisableFormula}
- labelName={formula.queryName}
- index={index}
- />
- </Col>
- <Col span={24}>
- <Input.TextArea
- name="expression"
- onChange={handleChange}
- size="middle"
- value={formula.expression}
- rows={2}
- />
- </Col>
- <Col span={24}>
- <Input
- name="legend"
- onChange={handleChange}
- size="middle"
- value={formula.legend}
- addonBefore="Legend Format"
- />
- </Col>
- {isAdditionalFilterEnable && (
- <Col span={24}>
- <AdditionalFiltersToggler
- listOfAdditionalFilter={listOfAdditionalFormulaFilters}
- >
- <Row gutter={[0, 11]} justify="space-between">
- {renderAdditionalFilters}
- </Row>
- </AdditionalFiltersToggler>
- </Col>
+ <Row gutter={[0, 15]}>
+ <QBEntityOptions
+ isCollapsed={isCollapse}
+ entityType="formula"
+ entityData={formula}
+ onToggleVisibility={handleToggleDisableFormula}
+ onDelete={handleDelete}
+ onCollapseEntity={handleToggleCollapseFormula}
+ />
+
+ {!isCollapse && (
+ <Row gutter={[0, 15]} className="formula-container">
+ <Col span={24}>
+ <Input.TextArea
+ name="expression"
+ onChange={handleChange}
+ size="middle"
+ value={formula.expression}
+ rows={2}
+ />
+ </Col>
+ <Col span={24}>
+ <Input
+ name="legend"
+ onChange={handleChange}
+ size="middle"
+ value={formula.legend}
+ addonBefore="Legend Format"
+ />
+ </Col>
+ {isAdditionalFilterEnable && (
+ <Col span={24}>
+ <AdditionalFiltersToggler
+ listOfAdditionalFilter={listOfAdditionalFormulaFilters}
+ >
+ <Row gutter={[0, 11]} justify="space-between">
+ {renderAdditionalFilters}
+ </Row>
+ </AdditionalFiltersToggler>
+ </Col>
+ )}
+ </Row>
)}
- </ListItemWrapper>
+ </Row>
);
}
diff --git a/frontend/src/container/QueryBuilder/components/QBEntityOptions/QBEntityOptions.styles.scss b/frontend/src/container/QueryBuilder/components/QBEntityOptions/QBEntityOptions.styles.scss
new file mode 100644
index 0000000000..06fb0ae2fb
--- /dev/null
+++ b/frontend/src/container/QueryBuilder/components/QBEntityOptions/QBEntityOptions.styles.scss
@@ -0,0 +1,81 @@
+.qb-entity-options {
+ display: flex;
+ justify-content: space-between;
+ margin: 4px 0;
+
+ .left-col-items {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+
+ .title {
+ font-weight: 500;
+ font-style: italic;
+ .entityType {
+ text-transform: capitalize;
+ }
+ }
+ }
+
+ .options {
+ box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
+ border-radius: 2px;
+ margin-left: -51px;
+
+ border-radius: 2px;
+
+ .periscope-btn {
+ border: 1px solid var(--bg-slate-200);
+ background: var(--bg-ink-200);
+ min-width: 32px;
+ }
+
+ .query-name {
+ font-size: 12px;
+ font-style: normal;
+ font-weight: 400;
+ // line-height: 18px;
+
+ color: var(--bg-sakura-400) !important;
+
+ border: 1px solid rgba(242, 71, 105, 0.2) !important;
+ background: rgba(242, 71, 105, 0.1) !important;
+
+ &:hover {
+ border: 1px solid rgba(242, 71, 105, 0.4) !important;
+ color: var(--bg-sakura-400) !important;
+ }
+ }
+
+ .formula-name {
+ font-size: 12px;
+ font-style: normal;
+ font-weight: 400;
+ // line-height: 18px;
+
+ color: var(--bg-sienna-400) !important;
+
+ border: 1px solid rgba(189, 153, 121, 0.2) !important;
+ background: rgba(189, 153, 121, 0.1);
+
+ &:hover {
+ border: 1px solid rgba(189, 153, 121, 0.4) !important;
+ color: var(--bg-sienna-400) !important;
+ }
+ }
+ }
+}
+
+.lightMode {
+ .qb-entity-options {
+ .options {
+ border-color: var(--bg-vanilla-300);
+
+ .periscope-btn {
+ border-color: var(--bg-vanilla-300);
+ background: var(--bg-vanilla-100);
+ color: var(--bg-ink-200);
+ }
+ }
+ }
+}
diff --git a/frontend/src/container/QueryBuilder/components/QBEntityOptions/QBEntityOptions.tsx b/frontend/src/container/QueryBuilder/components/QBEntityOptions/QBEntityOptions.tsx
new file mode 100644
index 0000000000..28b59ed5b2
--- /dev/null
+++ b/frontend/src/container/QueryBuilder/components/QBEntityOptions/QBEntityOptions.tsx
@@ -0,0 +1,77 @@
+import './QBEntityOptions.styles.scss';
+
+import { Button, Col } from 'antd';
+import cx from 'classnames';
+import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
+import { ChevronDown, ChevronRight, Eye, EyeOff, Trash2 } from 'lucide-react';
+
+interface QBEntityOptionsProps {
+ isCollapsed: boolean;
+ entityType: string;
+ entityData: any;
+ onDelete: () => void;
+ onToggleVisibility: () => void;
+ onCollapseEntity: () => void;
+}
+
+export default function QBEntityOptions({
+ isCollapsed,
+ entityType,
+ entityData,
+ onDelete,
+ onToggleVisibility,
+ onCollapseEntity,
+}: QBEntityOptionsProps): JSX.Element {
+ const { currentQuery } = useQueryBuilder();
+
+ const showDeleteButton = currentQuery.builder.queryData.length > 1;
+
+ return (
+ <Col span={24}>
+ <div className="qb-entity-options">
+ <div className="left-col-items">
+ <div className="options periscope-btn-group">
+ <Button.Group>
+ <Button
+ value="search"
+ className="periscope-btn collapse"
+ onClick={onCollapseEntity}
+ >
+ {isCollapsed ? <ChevronRight size={16} /> : <ChevronDown size={16} />}
+ </Button>
+ <Button
+ value="query-builder"
+ className="periscope-btn visibility-toggle"
+ onClick={onToggleVisibility}
+ >
+ {entityData.disabled ? <EyeOff size={16} /> : <Eye size={16} />}
+ </Button>
+
+ <Button
+ className={cx(
+ 'periscope-btn',
+ entityType === 'query' ? 'query-name' : 'formula-name',
+ )}
+ >
+ {entityData.queryName}
+ </Button>
+ </Button.Group>
+ </div>
+
+ {isCollapsed && (
+ <div className="title">
+ <span className="entityType"> {entityType} </span> -{' '}
+ <span className="entityData"> {entityData.queryName} </span>
+ </div>
+ )}
+ </div>
+
+ {showDeleteButton && (
+ <Button className="periscope-btn ghost" onClick={onDelete}>
+ <Trash2 size={14} />
+ </Button>
+ )}
+ </div>
+ </Col>
+ );
+}
diff --git a/frontend/src/container/QueryBuilder/components/Query/Query.styles.scss b/frontend/src/container/QueryBuilder/components/Query/Query.styles.scss
new file mode 100644
index 0000000000..b7ddccbc52
--- /dev/null
+++ b/frontend/src/container/QueryBuilder/components/Query/Query.styles.scss
@@ -0,0 +1,8 @@
+.qb-search-container {
+ display: block;
+ position: relative;
+}
+
+.qb-container {
+ padding: 0 24px;
+}
diff --git a/frontend/src/container/QueryBuilder/components/Query/Query.tsx b/frontend/src/container/QueryBuilder/components/Query/Query.tsx
index 1c1196d85c..6daac8d475 100644
--- a/frontend/src/container/QueryBuilder/components/Query/Query.tsx
+++ b/frontend/src/container/QueryBuilder/components/Query/Query.tsx
@@ -1,13 +1,14 @@
+import './Query.styles.scss';
+
import { Col, Input, Row } from 'antd';
// ** Constants
import { PANEL_TYPES } from 'constants/queryBuilder';
+import ROUTES from 'constants/routes';
// ** Components
import {
AdditionalFiltersToggler,
DataSourceDropdown,
FilterLabel,
- ListItemWrapper,
- ListMarker,
} from 'container/QueryBuilder/components';
import {
AggregatorFilter,
@@ -23,30 +24,42 @@ import QueryBuilderSearch from 'container/QueryBuilder/filters/QueryBuilderSearc
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import { useQueryOperations } from 'hooks/queryBuilder/useQueryBuilderOperations';
// ** Hooks
-import { ChangeEvent, memo, ReactNode, useCallback } from 'react';
+import {
+ ChangeEvent,
+ memo,
+ ReactNode,
+ useCallback,
+ useMemo,
+ useState,
+} from 'react';
+import { useLocation } from 'react-use';
import { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData';
import { transformToUpperCase } from 'utils/transformToUpperCase';
+import QBEntityOptions from '../QBEntityOptions/QBEntityOptions';
// ** Types
import { QueryProps } from './Query.interfaces';
export const Query = memo(function Query({
index,
- isAvailableToDisable,
queryVariant,
query,
filterConfigs,
queryComponents,
}: QueryProps): JSX.Element {
const { panelType } = useQueryBuilder();
+ const { pathname } = useLocation();
+
+ const [isCollapse, setIsCollapsed] = useState(false);
+
const {
operators,
isMetricsDataSource,
isTracePanelType,
listOfAdditionalFilters,
handleChangeAggregatorAttribute,
- handleChangeDataSource,
handleChangeQueryData,
+ handleChangeDataSource,
handleChangeOperator,
handleDeleteQuery,
} = useQueryOperations({ index, query, filterConfigs });
@@ -111,6 +124,10 @@ export const Query = memo(function Query({
[handleChangeQueryData],
);
+ const handleToggleCollapsQuery = (): void => {
+ setIsCollapsed(!isCollapse);
+ };
+
const renderOrderByFilter = useCallback((): ReactNode => {
if (queryComponents?.renderOrderBy) {
return queryComponents.renderOrderBy({
@@ -146,6 +163,12 @@ export const Query = memo(function Query({
],
);
+ const isExplorerPage = useMemo(
+ () =>
+ pathname === ROUTES.LOGS_EXPLORER || pathname === ROUTES.TRACES_EXPLORER,
+ [pathname],
+ );
+
const renderAdditionalFilters = useCallback((): ReactNode => {
switch (panelType) {
case PANEL_TYPES.TIME_SERIES: {
@@ -257,31 +280,73 @@ export const Query = memo(function Query({
]);
return (
- <ListItemWrapper onDelete={handleDeleteQuery}>
- <Col span={24}>
- <Row align="middle" gutter={[5, 11]}>
- <Col>
- <ListMarker
- isDisabled={query.disabled}
- onDisable={handleToggleDisableQuery}
- labelName={query.queryName}
- index={index}
- isAvailableToDisable={isAvailableToDisable}
- />
- </Col>
- <Col>
- {queryVariant === 'dropdown' ? (
- <DataSourceDropdown
- onChange={handleChangeDataSource}
- value={query.dataSource}
- style={{ minWidth: '5.625rem' }}
- />
- ) : (
- <FilterLabel label={transformToUpperCase(query.dataSource)} />
- )}
+ <Row gutter={[0, 12]}>
+ <QBEntityOptions
+ isCollapsed={isCollapse}
+ entityType="query"
+ entityData={query}
+ onToggleVisibility={handleToggleDisableQuery}
+ onDelete={handleDeleteQuery}
+ onCollapseEntity={handleToggleCollapsQuery}
+ />
+
+ {!isCollapse && (
+ <Row gutter={[0, 12]} className="qb-container">
+ <Col span={24}>
+ <Row align="middle" gutter={[5, 11]}>
+ {!isExplorerPage && (
+ <Col>
+ {queryVariant === 'dropdown' ? (
+ <DataSourceDropdown
+ onChange={handleChangeDataSource}
+ value={query.dataSource}
+ style={{ minWidth: '5.625rem' }}
+ />
+ ) : (
+ <FilterLabel label={transformToUpperCase(query.dataSource)} />
+ )}
+ </Col>
+ )}
+
+ {isMetricsDataSource && (
+ <Col span={12}>
+ <Row gutter={[11, 5]}>
+ <Col flex="5.93rem">
+ <OperatorsSelect
+ value={query.aggregateOperator}
+ onChange={handleChangeOperator}
+ operators={operators}
+ />
+ </Col>
+ <Col flex="auto">
+ <AggregatorFilter
+ onChange={handleChangeAggregatorAttribute}
+ query={query}
+ />
+ </Col>
+ </Row>
+ </Col>
+ )}
+ <Col flex="1 1 20rem">
+ <Row gutter={[11, 5]}>
+ {isMetricsDataSource && (
+ <Col>
+ <FilterLabel label="WHERE" />
+ </Col>
+ )}
+ <Col flex="1" className="qb-search-container">
+ <QueryBuilderSearch
+ query={query}
+ onChange={handleChangeTagFilters}
+ whereClauseConfig={filterConfigs?.filters}
+ />
+ </Col>
+ </Row>
+ </Col>
+ </Row>
</Col>
- {isMetricsDataSource && (
- <Col span={12}>
+ {!isMetricsDataSource && (
+ <Col span={11}>
<Row gutter={[11, 5]}>
<Col flex="5.93rem">
<OperatorsSelect
@@ -292,92 +357,59 @@ export const Query = memo(function Query({
</Col>
<Col flex="1 1 12.5rem">
<AggregatorFilter
- onChange={handleChangeAggregatorAttribute}
query={query}
+ onChange={handleChangeAggregatorAttribute}
+ disabled={
+ panelType === PANEL_TYPES.LIST || panelType === PANEL_TYPES.TRACE
+ }
/>
</Col>
</Row>
</Col>
)}
- <Col flex="1 1 20rem">
+ <Col span={11} offset={isMetricsDataSource ? 0 : 2}>
<Row gutter={[11, 5]}>
- {isMetricsDataSource && (
- <Col>
- <FilterLabel label="WHERE" />
- </Col>
- )}
- <Col flex="1">
- <QueryBuilderSearch
- query={query}
- onChange={handleChangeTagFilters}
- whereClauseConfig={filterConfigs?.filters}
+ <Col flex="5.93rem">
+ <FilterLabel
+ label={panelType === PANEL_TYPES.VALUE ? 'Reduce to' : 'Group by'}
/>
</Col>
+ <Col flex="1 1 12.5rem">
+ {panelType === PANEL_TYPES.VALUE ? (
+ <ReduceToFilter query={query} onChange={handleChangeReduceTo} />
+ ) : (
+ <GroupByFilter
+ disabled={isMetricsDataSource && !query.aggregateAttribute.key}
+ query={query}
+ onChange={handleChangeGroupByKeys}
+ />
+ )}
+ </Col>
</Row>
</Col>
- </Row>
- </Col>
- {!isMetricsDataSource && (
- <Col span={11}>
- <Row gutter={[11, 5]}>
- <Col flex="5.93rem">
- <OperatorsSelect
- value={query.aggregateOperator}
- onChange={handleChangeOperator}
- operators={operators}
- />
- </Col>
- <Col flex="1 1 12.5rem">
- <AggregatorFilter
- query={query}
- onChange={handleChangeAggregatorAttribute}
- disabled={
- panelType === PANEL_TYPES.LIST || panelType === PANEL_TYPES.TRACE
- }
- />
+ {!isTracePanelType && (
+ <Col span={24}>
+ <AdditionalFiltersToggler
+ listOfAdditionalFilter={listOfAdditionalFilters}
+ >
+ <Row gutter={[0, 11]} justify="space-between">
+ {renderAdditionalFilters()}
+ </Row>
+ </AdditionalFiltersToggler>
</Col>
- </Row>
- </Col>
- )}
- <Col span={11} offset={isMetricsDataSource ? 0 : 2}>
- <Row gutter={[11, 5]}>
- <Col flex="5.93rem">
- <FilterLabel
- label={panelType === PANEL_TYPES.VALUE ? 'Reduce to' : 'Group by'}
- />
- </Col>
- <Col flex="1 1 12.5rem">
- {panelType === PANEL_TYPES.VALUE ? (
- <ReduceToFilter query={query} onChange={handleChangeReduceTo} />
- ) : (
- <GroupByFilter
- disabled={isMetricsDataSource && !query.aggregateAttribute.key}
- query={query}
- onChange={handleChangeGroupByKeys}
+ )}
+ {panelType !== PANEL_TYPES.LIST && panelType !== PANEL_TYPES.TRACE && (
+ <Row style={{ width: '100%' }}>
+ <Input
+ onChange={handleChangeQueryLegend}
+ size="middle"
+ value={query.legend}
+ addonBefore="Legend Format"
/>
- )}
- </Col>
- </Row>
- </Col>
- {!isTracePanelType && (
- <Col span={24}>
- <AdditionalFiltersToggler listOfAdditionalFilter={listOfAdditionalFilters}>
- <Row gutter={[0, 11]} justify="space-between">
- {renderAdditionalFilters()}
</Row>
- </AdditionalFiltersToggler>
- </Col>
- )}
- {panelType !== PANEL_TYPES.LIST && panelType !== PANEL_TYPES.TRACE && (
- <Row style={{ width: '100%' }}>
- <Input
- onChange={handleChangeQueryLegend}
- size="middle"
- value={query.legend}
- addonBefore="Legend Format"
- />
+ )}
</Row>
)}
- </ListItemWrapper>
+ </Row>
);
});
diff --git a/frontend/src/container/QueryBuilder/components/ToolbarActions/LeftToolbarActions.tsx b/frontend/src/container/QueryBuilder/components/ToolbarActions/LeftToolbarActions.tsx
new file mode 100644
index 0000000000..7485c47563
--- /dev/null
+++ b/frontend/src/container/QueryBuilder/components/ToolbarActions/LeftToolbarActions.tsx
@@ -0,0 +1,85 @@
+import './ToolbarActions.styles.scss';
+
+import { Button, Switch, Tooltip, Typography } from 'antd';
+import cx from 'classnames';
+import { Atom, MousePointerSquare, Terminal } from 'lucide-react';
+import { SELECTED_VIEWS } from 'pages/LogsExplorer/utils';
+
+interface LeftToolbarActionsProps {
+ items: any;
+ selectedView: string;
+ onToggleHistrogramVisibility: () => void;
+ onChangeSelectedView: (view: SELECTED_VIEWS) => void;
+ showHistogram: boolean;
+}
+
+const activeTab = 'active-tab';
+const actionBtn = 'action-btn';
+export const queryBuilder = 'query-builder';
+
+export default function LeftToolbarActions({
+ items,
+ selectedView,
+ onToggleHistrogramVisibility,
+ onChangeSelectedView,
+ showHistogram,
+}: LeftToolbarActionsProps): JSX.Element {
+ const { clickhouse, search, queryBuilder: QB } = items;
+
+ return (
+ <div className="left-toolbar">
+ <div className="left-toolbar-query-actions">
+ <Tooltip title="Search">
+ <Button
+ disabled={search.disabled}
+ className={cx(
+ 'search',
+ actionBtn,
+ selectedView === 'search' ? activeTab : '',
+ )}
+ onClick={(): void => onChangeSelectedView(SELECTED_VIEWS.SEARCH)}
+ >
+ <MousePointerSquare size={14} />
+ </Button>
+ </Tooltip>
+ <Tooltip title="Query Builder">
+ <Button
+ disabled={QB.disabled}
+ className={cx(
+ queryBuilder,
+ actionBtn,
+ selectedView === queryBuilder ? activeTab : '',
+ )}
+ onClick={(): void => onChangeSelectedView(SELECTED_VIEWS.QUERY_BUILDER)}
+ >
+ <Atom size={14} />
+ </Button>
+ </Tooltip>
+
+ {clickhouse?.show && (
+ <Button
+ disabled={clickhouse.disabled}
+ className={cx(
+ SELECTED_VIEWS.CLICKHOUSE,
+ actionBtn,
+ selectedView === SELECTED_VIEWS.CLICKHOUSE ? activeTab : '',
+ )}
+ onClick={(): void => onChangeSelectedView(SELECTED_VIEWS.CLICKHOUSE)}
+ >
+ <Terminal size={14} />
+ </Button>
+ )}
+ </div>
+
+ <div className="histogram-view-controller">
+ <Typography>Histogram</Typography>
+ <Switch
+ size="small"
+ checked={showHistogram}
+ defaultChecked
+ onChange={onToggleHistrogramVisibility}
+ />
+ </div>
+ </div>
+ );
+}
diff --git a/frontend/src/container/QueryBuilder/components/ToolbarActions/RightToolbarActions.tsx b/frontend/src/container/QueryBuilder/components/ToolbarActions/RightToolbarActions.tsx
new file mode 100644
index 0000000000..64cabf1615
--- /dev/null
+++ b/frontend/src/container/QueryBuilder/components/ToolbarActions/RightToolbarActions.tsx
@@ -0,0 +1,25 @@
+import './ToolbarActions.styles.scss';
+
+import { Button } from 'antd';
+import { Play } from 'lucide-react';
+
+interface RightToolbarActionsProps {
+ onStageRunQuery: () => void;
+}
+
+export default function RightToolbarActions({
+ onStageRunQuery,
+}: RightToolbarActionsProps): JSX.Element {
+ return (
+ <div>
+ <Button
+ type="primary"
+ className="right-toolbar"
+ onClick={onStageRunQuery}
+ icon={<Play size={14} />}
+ >
+ Stage & Run Query
+ </Button>
+ </div>
+ );
+}
diff --git a/frontend/src/container/QueryBuilder/components/ToolbarActions/ToolbarActions.styles.scss b/frontend/src/container/QueryBuilder/components/ToolbarActions/ToolbarActions.styles.scss
new file mode 100644
index 0000000000..a29f031e37
--- /dev/null
+++ b/frontend/src/container/QueryBuilder/components/ToolbarActions/ToolbarActions.styles.scss
@@ -0,0 +1,71 @@
+.left-toolbar {
+ display: flex;
+ align-items: center;
+
+ .left-toolbar-query-actions {
+ display: flex;
+ border-radius: 2px;
+ border: 1px solid var(--bg-slate-400, #1d212d);
+ background: var(--bg-ink-300, #16181d);
+ flex-direction: row;
+
+ .prom-ql-icon {
+ height: 14px;
+ width: 14px;
+ }
+
+ .ant-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: none;
+ padding: 9px;
+ box-shadow: none;
+ border-radius: 0;
+
+ &.active-tab {
+ background-color: #1d212d;
+ }
+
+ &:disabled {
+ background-color: #121317;
+ opacity: 0.6;
+ }
+ }
+ .action-btn + .action-btn {
+ border-left: 1px solid var(--bg-slate-400, #1d212d);
+ }
+ }
+
+ .histogram-view-controller {
+ display: flex;
+ align-items: center;
+ padding-left: 8px;
+ gap: 8px;
+ }
+}
+
+.right-toolbar {
+ display: flex;
+ align-items: center;
+ background-color: var(--bg-robin-600);
+}
+
+.lightMode {
+ .left-toolbar {
+ .left-toolbar-query-actions {
+ border-color: var(--bg-vanilla-300);
+ background: var(--bg-vanilla-100);
+
+ .ant-btn {
+ border-color: var(--bg-vanilla-300);
+ background: var(--bg-vanilla-100);
+ color: var(--bg-ink-200);
+
+ &.active-tab {
+ background-color: var(--bg-robin-100);
+ }
+ }
+ }
+ }
+}
diff --git a/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/QueryBuilderSearch.styles.scss b/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/QueryBuilderSearch.styles.scss
new file mode 100644
index 0000000000..8fd979fa8e
--- /dev/null
+++ b/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/QueryBuilderSearch.styles.scss
@@ -0,0 +1,11 @@
+.lightMode {
+ .query-builder-search {
+ .ant-select-dropdown {
+ box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
+ }
+
+ .ant-select-item-option-active {
+ background-color: var(--bg-vanilla-200) !important;
+ }
+ }
+}
diff --git a/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/index.tsx b/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/index.tsx
index 975c79a4a8..74c8ff1d23 100644
--- a/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/index.tsx
+++ b/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/index.tsx
@@ -1,3 +1,5 @@
+import './QueryBuilderSearch.styles.scss';
+
import { Select, Spin, Tag, Tooltip } from 'antd';
import { OPERATORS } from 'constants/queryBuilder';
import { getDataTypes } from 'container/LogDetailedView/utils';
@@ -44,6 +46,7 @@ function QueryBuilderSearch({
whereClauseConfig,
className,
placeholder,
+ suffixIcon,
}: QueryBuilderSearchProps): JSX.Element {
const {
updateTag,
@@ -183,38 +186,46 @@ function QueryBuilderSearch({
}, [sourceKeys]);
return (
- <Select
- getPopupContainer={popupContainer}
- virtual
- showSearch
- tagRender={onTagRender}
- filterOption={false}
- autoClearSearchValue={false}
- mode="multiple"
- placeholder={placeholder}
- value={queryTags}
- searchValue={searchValue}
- className={className}
- disabled={isMetricsDataSource && !query.aggregateAttribute.key}
- style={selectStyle}
- onSearch={handleSearch}
- onChange={onChangeHandler}
- onSelect={handleSelect}
- onDeselect={handleDeselect}
- onInputKeyDown={onInputKeyDownHandler}
- notFoundContent={isFetching ? <Spin size="small" /> : null}
+ <div
+ style={{
+ position: 'relative',
+ }}
>
- {options.map((option) => (
- <Select.Option key={option.label} value={option.value}>
- <OptionRenderer
- label={option.label}
- value={option.value}
- dataType={option.dataType || ''}
- />
- {option.selected && <StyledCheckOutlined />}
- </Select.Option>
- ))}
- </Select>
+ <Select
+ getPopupContainer={popupContainer}
+ virtual
+ showSearch
+ tagRender={onTagRender}
+ filterOption={false}
+ autoClearSearchValue={false}
+ mode="multiple"
+ placeholder={placeholder}
+ value={queryTags}
+ searchValue={searchValue}
+ className={className}
+ rootClassName="query-builder-search"
+ disabled={isMetricsDataSource && !query.aggregateAttribute.key}
+ style={selectStyle}
+ onSearch={handleSearch}
+ onChange={onChangeHandler}
+ onSelect={handleSelect}
+ onDeselect={handleDeselect}
+ onInputKeyDown={onInputKeyDownHandler}
+ notFoundContent={isFetching ? <Spin size="small" /> : null}
+ suffixIcon={suffixIcon}
+ >
+ {options.map((option) => (
+ <Select.Option key={option.label} value={option.value}>
+ <OptionRenderer
+ label={option.label}
+ value={option.value}
+ dataType={option.dataType || ''}
+ />
+ {option.selected && <StyledCheckOutlined />}
+ </Select.Option>
+ ))}
+ </Select>
+ </div>
);
}
@@ -224,12 +235,14 @@ interface QueryBuilderSearchProps {
whereClauseConfig?: WhereClauseConfig;
className?: string;
placeholder?: string;
+ suffixIcon?: React.ReactNode;
}
QueryBuilderSearch.defaultProps = {
whereClauseConfig: undefined,
className: '',
placeholder: PLACEHOLDER,
+ suffixIcon: undefined,
};
export interface CustomTagProps {
diff --git a/frontend/src/container/ServiceApplication/types.ts b/frontend/src/container/ServiceApplication/types.ts
index 6ff6b7c87a..0717538cb8 100644
--- a/frontend/src/container/ServiceApplication/types.ts
+++ b/frontend/src/container/ServiceApplication/types.ts
@@ -1,5 +1,6 @@
import { ServiceDataProps } from 'api/metrics/getTopLevelOperations';
import { Time } from 'container/TopNav/DateTimeSelection/config';
+import { Time as TimeV2 } from 'container/TopNav/DateTimeSelectionV2/config';
import { GetQueryResultsProps } from 'lib/dashboard/getQueryResults';
import { UseQueryResult } from 'react-query';
import { SuccessResponse } from 'types/api';
@@ -24,7 +25,7 @@ export interface GetQueryRangeRequestDataProps {
topLevelOperations: [keyof ServiceDataProps, string[]][];
maxTime: number;
minTime: number;
- globalSelectedInterval: Time;
+ globalSelectedInterval: Time | TimeV2;
}
export interface GetServiceListFromQueryProps {
diff --git a/frontend/src/container/SideNav/NavItem/NavItem.tsx b/frontend/src/container/SideNav/NavItem/NavItem.tsx
index 301acc402e..0ec6127da1 100644
--- a/frontend/src/container/SideNav/NavItem/NavItem.tsx
+++ b/frontend/src/container/SideNav/NavItem/NavItem.tsx
@@ -1,5 +1,8 @@
+/* eslint-disable jsx-a11y/no-static-element-interactions */
+/* eslint-disable jsx-a11y/click-events-have-key-events */
import './NavItem.styles.scss';
+import { Tooltip } from 'antd';
import cx from 'classnames';
import { SidebarItem } from '../sideNav.types';
@@ -18,14 +21,15 @@ export default function NavItem({
const { label, icon } = item;
return (
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
- <div className={cx('nav-item', isActive ? 'active' : '')} onClick={onClick}>
- <div className="nav-item-active-marker" />
- <div className="nav-item-data">
- <div className="nav-item-icon">{icon}</div>
+ <Tooltip title={isCollapsed ? label : ''} placement="right">
+ <div className={cx('nav-item', isActive ? 'active' : '')} onClick={onClick}>
+ <div className="nav-item-active-marker" />
+ <div className="nav-item-data">
+ <div className="nav-item-icon">{icon}</div>
- {!isCollapsed && <div className="nav-item-label">{label}</div>}
+ {!isCollapsed && <div className="nav-item-label">{label}</div>}
+ </div>
</div>
- </div>
+ </Tooltip>
);
}
diff --git a/frontend/src/container/SideNav/SideNav.styles.scss b/frontend/src/container/SideNav/SideNav.styles.scss
index 379a7bba93..2cc32e12f3 100644
--- a/frontend/src/container/SideNav/SideNav.styles.scss
+++ b/frontend/src/container/SideNav/SideNav.styles.scss
@@ -1,20 +1,19 @@
-@import '@signozhq/design-tokens';
-
.sideNav {
flex: 0 0 240px;
max-width: 240px;
min-width: 240px;
width: 240px;
- border-right: 1px solid $bg-slate-400;
+ border-right: 1px solid var(--bg-slate-400);
padding-bottom: 48px;
transition: all 0.3s, background 0s, border 0s;
position: relative;
+ z-index: 1;
.brand {
display: flex;
align-items: center;
gap: 12px;
- padding: $padding-4;
+ padding: var(--padding-4);
.brand-logo {
display: flex;
@@ -24,7 +23,7 @@
cursor: pointer;
img {
- height: $font-size-xl;
+ height: var(--font-size-xl);
}
.brand-logo-name {
@@ -45,13 +44,13 @@
padding: 0;
color: rgba(255, 255, 255, 0.85);
font-size: 8px;
- font-weight: $font-weight-medium;
+ font-weight: var(--font-weight-medium);
letter-spacing: 0.6px;
padding: 4px 8px;
text-transform: uppercase;
white-space: nowrap;
- background: $bg-slate-400;
- border: 1px solid $bg-slate-400;
+ background: var(--bg-slate-400);
+ border: 1px solid var(--bg-slate-400);
border-radius: 20px;
opacity: 1;
transition: all 0.2s;
@@ -73,7 +72,7 @@
width: 100%;
height: 36px;
- border: 1px solid $bg-slate-400;
+ border: 1px solid var(--bg-slate-400);
border-radius: 2px;
box-shadow: none !important;
@@ -81,7 +80,7 @@
}
.secondary-nav-items {
- border-top: 1px solid $bg-slate-400;
+ border-top: 1px solid var(--bg-slate-400);
padding: 8px 0;
max-width: 100%;
position: fixed;
@@ -105,8 +104,8 @@
transition: display 0.3s;
svg {
- fill: $bg-vanilla-300;
- color: $bg-slate-300;
+ fill: var(--bg-vanilla-400);
+ color: var(--bg-slate-300);
}
}
}
@@ -141,30 +140,30 @@
.lightMode {
.sideNav {
- background: $bg-vanilla-300;
- border-right: 1px solid $bg-vanilla-400;
+ background: var(--bg-vanilla-300);
+ border-right: 1px solid var(--bg-vanilla-400);
.get-started-nav-items {
.get-started-btn {
- border: 1px solid $bg-vanilla-400;
+ border: 1px solid var(--bg-vanilla-400);
}
}
.brand {
.brand-logo {
.brand-logo-name {
- color: $bg-slate-400;
+ color: var(--bg-slate-400);
}
}
}
.secondary-nav-items {
- border-top: 1px solid $bg-vanilla-400;
+ border-top: 1px solid var(--bg-vanilla-400);
.collapse-expand-handlers {
svg {
- color: $bg-slate-300;
- fill: $bg-vanilla-300;
+ color: var(--bg-slate-300);
+ fill: var(--bg-vanilla-400);
}
}
}
diff --git a/frontend/src/container/SideNav/SideNav.tsx b/frontend/src/container/SideNav/SideNav.tsx
index aaf516835e..0aebb53e2e 100644
--- a/frontend/src/container/SideNav/SideNav.tsx
+++ b/frontend/src/container/SideNav/SideNav.tsx
@@ -3,16 +3,12 @@
import './SideNav.styles.scss';
import { Button } from 'antd';
-import getLocalStorageKey from 'api/browser/localstorage/get';
import cx from 'classnames';
-import { IS_SIDEBAR_COLLAPSED } from 'constants/app';
import { FeatureKeys } from 'constants/features';
import ROUTES from 'constants/routes';
import { GlobalShortcuts } from 'constants/shortcuts/globalShortcuts';
-import { ToggleButton } from 'container/Header/styles';
import { useKeyboardHotkeys } from 'hooks/hotkeys/useKeyboardHotkeys';
import useComponentPermission from 'hooks/useComponentPermission';
-import useThemeMode, { useIsDarkMode } from 'hooks/useDarkMode';
import { LICENSE_PLAN_KEY, LICENSE_PLAN_STATUS } from 'hooks/useLicense';
import history from 'lib/history';
import {
@@ -23,17 +19,10 @@ import {
RocketIcon,
UserCircle,
} from 'lucide-react';
-import {
- useCallback,
- useEffect,
- useLayoutEffect,
- useMemo,
- useState,
-} from 'react';
+import { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { useDispatch, useSelector } from 'react-redux';
+import { useSelector } from 'react-redux';
import { useLocation } from 'react-router-dom';
-import { sideBarCollapse } from 'store/actions';
import { AppState } from 'store/reducers';
import { License } from 'types/api/licenses/def';
import AppReducer from 'types/reducer/app';
@@ -53,18 +42,24 @@ import NavItem from './NavItem/NavItem';
import { SecondaryMenuItemKey } from './sideNav.types';
import { getActiveMenuKeyFromPath } from './sideNav.utils';
+interface UserManagementMenuItems {
+ key: string;
+ label: string;
+ icon: JSX.Element;
+}
+
function SideNav({
licenseData,
isFetching,
+ onCollapse,
+ collapsed,
}: {
licenseData: any;
isFetching: boolean;
+ onCollapse: () => void;
+ collapsed: boolean;
}): JSX.Element {
- const dispatch = useDispatch();
const [menuItems, setMenuItems] = useState(defaultMenuItems);
- const [collapsed, setCollapsed] = useState<boolean>(
- getLocalStorageKey(IS_SIDEBAR_COLLAPSED) === 'true',
- );
const { pathname, search } = useLocation();
const {
@@ -84,9 +79,9 @@ function SideNav({
icon: <UserCircle size={16} />,
};
- const [userManagementMenuItems, setUserManagementMenuItems] = useState([
- manageLicenseMenuItem,
- ]);
+ const [userManagementMenuItems, setUserManagementMenuItems] = useState<
+ UserManagementMenuItems[]
+ >([manageLicenseMenuItem]);
const onClickSlackHandler = (): void => {
window.open('https://signoz.io/slack', '_blank');
@@ -152,14 +147,6 @@ function SideNav({
const { t } = useTranslation('');
- const onCollapse = useCallback(() => {
- setCollapsed((collapsed) => !collapsed);
- }, []);
-
- useLayoutEffect(() => {
- dispatch(sideBarCollapse(collapsed));
- }, [collapsed, dispatch]);
-
useEffect(() => {
registerShortcut(GlobalShortcuts.SidebarCollapse, onCollapse);
@@ -207,9 +194,6 @@ function SideNav({
pathname,
]);
- const isDarkMode = useIsDarkMode();
- const { toggleTheme } = useThemeMode();
-
const isCloudUserVal = isCloudUser();
useEffect(() => {
@@ -291,18 +275,8 @@ function SideNav({
{!collapsed && <span className="brand-logo-name"> SigNoz </span>}
</div>
- {!collapsed && (
- <>
- {!isFetching && <div className="license tag">{licenseTag}</div>}
-
- <ToggleButton
- checked={isDarkMode}
- onChange={toggleTheme}
- defaultChecked={isDarkMode}
- checkedChildren="🌜"
- unCheckedChildren="🌞"
- />
- </>
+ {!collapsed && licenseTag && (
+ <div className="license tag">{licenseTag}</div>
)}
</div>
diff --git a/frontend/src/container/SideNav/menuItems.tsx b/frontend/src/container/SideNav/menuItems.tsx
index 00ac98d259..6befaa9a22 100644
--- a/frontend/src/container/SideNav/menuItems.tsx
+++ b/frontend/src/container/SideNav/menuItems.tsx
@@ -110,7 +110,7 @@ const menuItems: SidebarItem[] = [
];
/** Mapping of some newly added routes and their corresponding active sidebar menu key */
-export const NEW_ROUTES_MENU_ITEM_KEY_MAP = {
+export const NEW_ROUTES_MENU_ITEM_KEY_MAP: Record<string, string> = {
[ROUTES.TRACES_EXPLORER]: ROUTES.TRACE,
[ROUTES.TRACE_EXPLORER]: ROUTES.TRACE,
[ROUTES.LOGS_BASE]: ROUTES.LOGS_EXPLORER,
diff --git a/frontend/src/container/SideNav/sideNav.utils.ts b/frontend/src/container/SideNav/sideNav.utils.ts
index 3c455ddab2..77aee24147 100644
--- a/frontend/src/container/SideNav/sideNav.utils.ts
+++ b/frontend/src/container/SideNav/sideNav.utils.ts
@@ -7,5 +7,5 @@ export const getActiveMenuKeyFromPath = (pathname: string): string => {
const baseRoute = `/${basePath}`;
- return NEW_ROUTES_MENU_ITEM_KEY_MAP[baseRoute] || baseRoute;
+ return (NEW_ROUTES_MENU_ITEM_KEY_MAP[baseRoute] as string) || baseRoute;
};
diff --git a/frontend/src/container/TimeSeriesView/TimeSeriesView.styles.scss b/frontend/src/container/TimeSeriesView/TimeSeriesView.styles.scss
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/frontend/src/container/TimeSeriesView/TimeSeriesView.tsx b/frontend/src/container/TimeSeriesView/TimeSeriesView.tsx
index 767bf16d34..8bac60b425 100644
--- a/frontend/src/container/TimeSeriesView/TimeSeriesView.tsx
+++ b/frontend/src/container/TimeSeriesView/TimeSeriesView.tsx
@@ -1,8 +1,14 @@
-import Spinner from 'components/Spinner';
+import './TimeSeriesView.styles.scss';
+
import Uplot from 'components/Uplot';
+import EmptyLogsSearch from 'container/EmptyLogsSearch/EmptyLogsSearch';
+import LogsError from 'container/LogsError/LogsError';
+import { LogsLoading } from 'container/LogsLoading/LogsLoading';
+import NoLogs from 'container/NoLogs/NoLogs';
import { useIsDarkMode } from 'hooks/useDarkMode';
import { getUPlotChartOptions } from 'lib/uPlotLib/getUplotChartOptions';
import { getUPlotChartData } from 'lib/uPlotLib/utils/getUplotChartData';
+import { isEmpty } from 'lodash-es';
import { useEffect, useMemo, useRef, useState } from 'react';
import { useSelector } from 'react-redux';
import { AppState } from 'store/reducers';
@@ -11,13 +17,14 @@ import { MetricRangePayloadProps } from 'types/api/metrics/getQueryRange';
import { GlobalReducer } from 'types/reducer/globalTime';
import { getTimeRange } from 'utils/getTimeRange';
-import { Container, ErrorText } from './styles';
+import { Container } from './styles';
function TimeSeriesView({
data,
isLoading,
isError,
yAxisUnit,
+ isFilterApplied,
}: TimeSeriesViewProps): JSX.Element {
const graphRef = useRef<HTMLDivElement>(null);
@@ -66,16 +73,33 @@ function TimeSeriesView({
return (
<Container>
- {isLoading && <Spinner height="50vh" size="small" tip="Loading..." />}
- {isError && <ErrorText>{data?.error || 'Something went wrong'}</ErrorText>}
+ {isError && <LogsError />}
<div
className="graph-container"
style={{ height: '100%', width: '100%' }}
ref={graphRef}
>
- {!isLoading && !isError && chartData && chartOptions && (
- <Uplot data={chartData} options={chartOptions} />
- )}
+ {isLoading && <LogsLoading />}
+
+ {chartData &&
+ chartData[0] &&
+ chartData[0]?.length === 0 &&
+ !isLoading &&
+ !isError &&
+ isFilterApplied && <EmptyLogsSearch />}
+
+ {chartData &&
+ chartData[0] &&
+ chartData[0]?.length === 0 &&
+ !isLoading &&
+ !isError &&
+ !isFilterApplied && <NoLogs />}
+
+ {!isLoading &&
+ !isError &&
+ chartData &&
+ !isEmpty(chartData?.[0]) &&
+ chartOptions && <Uplot data={chartData} options={chartOptions} />}
</div>
</Container>
);
@@ -86,6 +110,7 @@ interface TimeSeriesViewProps {
yAxisUnit?: string;
isLoading: boolean;
isError: boolean;
+ isFilterApplied: boolean;
}
TimeSeriesView.defaultProps = {
diff --git a/frontend/src/container/TimeSeriesView/index.tsx b/frontend/src/container/TimeSeriesView/index.tsx
index a0618b9960..b2c6b3f01f 100644
--- a/frontend/src/container/TimeSeriesView/index.tsx
+++ b/frontend/src/container/TimeSeriesView/index.tsx
@@ -68,6 +68,8 @@ function TimeSeriesViewContainer({
return (
<TimeSeriesView
+ // TODO handle this when revamping trace explorer
+ isFilterApplied={false}
isError={isError}
isLoading={isLoading}
data={responseData}
diff --git a/frontend/src/container/TimeSeriesView/styles.ts b/frontend/src/container/TimeSeriesView/styles.ts
index 9f002e047f..d73f11c38a 100644
--- a/frontend/src/container/TimeSeriesView/styles.ts
+++ b/frontend/src/container/TimeSeriesView/styles.ts
@@ -3,12 +3,10 @@ import Card from 'antd/es/card/Card';
import styled from 'styled-components';
export const Container = styled(Card)`
- position: relative;
- margin: 0.5rem 0 3.1rem 0;
-
.ant-card-body {
height: 50vh;
min-height: 350px;
+ padding: 0px 12px;
}
`;
diff --git a/frontend/src/container/Toolbar/Toolbar.styles.scss b/frontend/src/container/Toolbar/Toolbar.styles.scss
new file mode 100644
index 0000000000..472b1bd759
--- /dev/null
+++ b/frontend/src/container/Toolbar/Toolbar.styles.scss
@@ -0,0 +1,29 @@
+.toolbar {
+ display: grid;
+ grid-template-columns: 3fr auto auto;
+ padding: 8px 16px;
+ gap: 8px;
+
+ .timeRange {
+ display: flex;
+ padding-right: 8px;
+ align-items: center;
+ gap: 16px;
+ }
+}
+
+@media screen and (width <= 1300px) {
+ .toolbar {
+ grid-template-columns: repeat(1, 1fr);
+
+ .timeRange {
+ justify-content: flex-end;
+ padding-right: 0;
+ }
+
+ .rightActions {
+ display: flex;
+ justify-content: flex-end;
+ }
+ }
+}
diff --git a/frontend/src/container/Toolbar/Toolbar.tsx b/frontend/src/container/Toolbar/Toolbar.tsx
new file mode 100644
index 0000000000..38b37cb4f1
--- /dev/null
+++ b/frontend/src/container/Toolbar/Toolbar.tsx
@@ -0,0 +1,35 @@
+import './Toolbar.styles.scss';
+
+import NewExplorerCTA from 'container/NewExplorerCTA';
+import DateTimeSelectionV2 from 'container/TopNav/DateTimeSelectionV2';
+
+interface ToolbarProps {
+ showAutoRefresh: boolean;
+ leftActions?: JSX.Element;
+ rightActions?: JSX.Element;
+ showOldCTA?: boolean;
+}
+
+export default function Toolbar({
+ showAutoRefresh,
+ leftActions,
+ rightActions,
+ showOldCTA,
+}: ToolbarProps): JSX.Element {
+ return (
+ <div className="toolbar">
+ <div className="leftActions">{leftActions}</div>
+ <div className="timeRange">
+ {showOldCTA && <NewExplorerCTA />}
+ <DateTimeSelectionV2 showAutoRefresh={showAutoRefresh} />
+ </div>
+ <div className="rightActions">{rightActions}</div>
+ </div>
+ );
+}
+
+Toolbar.defaultProps = {
+ leftActions: <div />,
+ rightActions: <div />,
+ showOldCTA: false,
+};
diff --git a/frontend/src/container/TopNav/AutoRefresh/config.ts b/frontend/src/container/TopNav/AutoRefresh/config.ts
index dfd3134e0e..64aaca6c64 100644
--- a/frontend/src/container/TopNav/AutoRefresh/config.ts
+++ b/frontend/src/container/TopNav/AutoRefresh/config.ts
@@ -1,6 +1,7 @@
import GetMinMax, { GetMinMaxPayload } from 'lib/getMinMax';
import { Time } from '../DateTimeSelection/config';
+import { Time as TimeV2 } from '../DateTimeSelectionV2/config';
export const options: IOptions[] = [
{
@@ -67,7 +68,7 @@ export interface IOptions {
}
export const getMinMax = (
- selectedTime: Time,
+ selectedTime: Time | TimeV2,
minTime: number,
maxTime: number,
): GetMinMaxPayload =>
diff --git a/frontend/src/container/TopNav/AutoRefresh/index.tsx b/frontend/src/container/TopNav/AutoRefresh/index.tsx
index 11a22e700f..d11b2c248b 100644
--- a/frontend/src/container/TopNav/AutoRefresh/index.tsx
+++ b/frontend/src/container/TopNav/AutoRefresh/index.tsx
@@ -31,7 +31,10 @@ import { popupContainer } from 'utils/selectPopupContainer';
import { getMinMax, options } from './config';
import { ButtonContainer, Container } from './styles';
-function AutoRefresh({ disabled = false }: AutoRefreshProps): JSX.Element {
+function AutoRefresh({
+ disabled = false,
+ showAutoRefreshBtnPrimary = true,
+}: AutoRefreshProps): JSX.Element {
const globalTime = useSelector<AppState, GlobalReducer>(
(state) => state.globalTime,
);
@@ -176,7 +179,10 @@ function AutoRefresh({ disabled = false }: AutoRefreshProps): JSX.Element {
</Container>
}
>
- <ButtonContainer title="Set auto refresh" type="primary">
+ <ButtonContainer
+ title="Set auto refresh"
+ type={showAutoRefreshBtnPrimary ? 'primary' : 'default'}
+ >
<CaretDownFilled />
</ButtonContainer>
</Popover>
@@ -185,10 +191,12 @@ function AutoRefresh({ disabled = false }: AutoRefreshProps): JSX.Element {
interface AutoRefreshProps {
disabled?: boolean;
+ showAutoRefreshBtnPrimary?: boolean;
}
AutoRefresh.defaultProps = {
disabled: false,
+ showAutoRefreshBtnPrimary: true,
};
export default AutoRefresh;
diff --git a/frontend/src/container/TopNav/AutoRefreshV2/AutoRefreshV2.styles.scss b/frontend/src/container/TopNav/AutoRefreshV2/AutoRefreshV2.styles.scss
new file mode 100644
index 0000000000..4b0953a767
--- /dev/null
+++ b/frontend/src/container/TopNav/AutoRefreshV2/AutoRefreshV2.styles.scss
@@ -0,0 +1,79 @@
+.auto-refresh-root {
+ .ant-popover-inner {
+ min-width: 187px;
+ min-height: 386px;
+ border-radius: 4px;
+ border: 1px solid var(--bg-slate-400);
+ background: linear-gradient(
+ 139deg,
+ rgba(18, 19, 23, 0.8) 0%,
+ rgba(18, 19, 23, 0.9) 98.68%
+ );
+ box-shadow: 4px 10px 16px 2px rgba(0, 0, 0, 0.2);
+ backdrop-filter: blur(20px);
+ padding: 0;
+ }
+ .ant-popover-arrow {
+ display: none;
+ }
+}
+.auto-refresh-menu {
+ display: flex;
+ flex-direction: column;
+}
+
+.auto-refresh-checkbox {
+ padding: 12px 14px;
+ border-bottom: 1px solid var(--bg-slate-400);
+ color: #f9f9fa;
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 20px; /* 142.857% */
+ letter-spacing: -0.07px;
+}
+
+.refresh-interval-text {
+ padding: 12px 14px 8px 14px;
+ color: #52575c;
+ font-size: 11px;
+ font-style: normal;
+ font-weight: 500;
+ line-height: 18px; /* 163.636% */
+ letter-spacing: 0.88px;
+ text-transform: uppercase;
+ margin-bottom: 0px !important;
+}
+
+.refresh-interval-btns {
+ padding-left: 14px !important;
+ color: var(--text-vanilla-400);
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 20px; /* 142.857% */
+ letter-spacing: -0.07px;
+ justify-content: space-between;
+}
+
+.lightMode {
+ .auto-refresh-root {
+ .ant-popover-inner {
+ border: 1px solid var(--bg-vanilla-400);
+ background: var(--bg-vanilla-100);
+ }
+ }
+
+ .auto-refresh-checkbox {
+ border-bottom: 1px solid var(--bg-vanilla-400);
+ color: var(--bg-slate-400);
+ }
+
+ .refresh-interval-text {
+ color: var(--bg-vanilla-400);
+ }
+
+ .refresh-interval-btns {
+ color: var(--text-slate-400);
+ }
+}
diff --git a/frontend/src/container/TopNav/AutoRefreshV2/config.ts b/frontend/src/container/TopNav/AutoRefreshV2/config.ts
new file mode 100644
index 0000000000..a84f932fbc
--- /dev/null
+++ b/frontend/src/container/TopNav/AutoRefreshV2/config.ts
@@ -0,0 +1,77 @@
+import GetMinMax, { GetMinMaxPayload } from 'lib/getMinMax';
+
+import { Time } from '../DateTimeSelection/config';
+import { Time as TimeV2 } from '../DateTimeSelectionV2/config';
+
+export const options: IOptions[] = [
+ {
+ label: 'off',
+ key: 'off',
+ value: 0,
+ },
+ {
+ label: '5 seconds',
+ key: '5s',
+ value: 5000,
+ },
+ {
+ label: '10 seconds',
+ key: '10s',
+ value: 10000,
+ },
+ {
+ label: '30 seconds',
+ key: '30s',
+ value: 30000,
+ },
+ {
+ label: '1 minute',
+ key: '1m',
+ value: 60000,
+ },
+ {
+ label: '5 minutes',
+ key: '5m',
+ value: 300000,
+ },
+ {
+ label: '10 minutes',
+ key: '10m',
+ value: 600000,
+ },
+ {
+ label: '30 minutes',
+ key: '30m',
+ value: 1800000,
+ },
+ {
+ label: '1 hour',
+ key: '1h',
+ value: 3600000,
+ },
+ {
+ label: '2 hours',
+ key: '2h',
+ value: 7200000,
+ },
+ {
+ label: '1 day',
+ key: '1d',
+ value: 86400000,
+ },
+];
+
+export interface IOptions {
+ label: string;
+ key: string;
+ value: number;
+}
+
+export const getMinMax = (
+ selectedTime: Time | TimeV2,
+ minTime: number,
+ maxTime: number,
+): GetMinMaxPayload =>
+ selectedTime !== 'custom'
+ ? GetMinMax(selectedTime)
+ : GetMinMax(selectedTime, [minTime, maxTime]);
diff --git a/frontend/src/container/TopNav/AutoRefreshV2/index.tsx b/frontend/src/container/TopNav/AutoRefreshV2/index.tsx
new file mode 100644
index 0000000000..63652bff7a
--- /dev/null
+++ b/frontend/src/container/TopNav/AutoRefreshV2/index.tsx
@@ -0,0 +1,201 @@
+import './AutoRefreshV2.styles.scss';
+
+import { CaretDownFilled } from '@ant-design/icons';
+import { Button, Checkbox, Popover, Typography } from 'antd';
+import { CheckboxChangeEvent } from 'antd/lib/checkbox';
+import get from 'api/browser/localstorage/get';
+import set from 'api/browser/localstorage/set';
+import { DASHBOARD_TIME_IN_DURATION } from 'constants/app';
+import useUrlQuery from 'hooks/useUrlQuery';
+import _omit from 'lodash-es/omit';
+import { Check } from 'lucide-react';
+import { useCallback, useEffect, useMemo, useState } from 'react';
+import { useDispatch, useSelector } from 'react-redux';
+import { useLocation } from 'react-router-dom';
+import { useInterval } from 'react-use';
+import { Dispatch } from 'redux';
+import { AppState } from 'store/reducers';
+import AppActions from 'types/actions';
+import {
+ UPDATE_AUTO_REFRESH_INTERVAL,
+ UPDATE_TIME_INTERVAL,
+} from 'types/actions/globalTime';
+import { GlobalReducer } from 'types/reducer/globalTime';
+import { popupContainer } from 'utils/selectPopupContainer';
+
+import { getMinMax, options } from './config';
+import { ButtonContainer } from './styles';
+
+function AutoRefresh({
+ disabled = false,
+ showAutoRefreshBtnPrimary = true,
+}: AutoRefreshProps): JSX.Element {
+ const globalTime = useSelector<AppState, GlobalReducer>(
+ (state) => state.globalTime,
+ );
+ const { pathname } = useLocation();
+
+ const isDisabled = useMemo(
+ () =>
+ disabled ||
+ globalTime.isAutoRefreshDisabled ||
+ globalTime.selectedTime === 'custom',
+ [globalTime.isAutoRefreshDisabled, disabled, globalTime.selectedTime],
+ );
+
+ const localStorageData = JSON.parse(get(DASHBOARD_TIME_IN_DURATION) || '{}');
+
+ const localStorageValue = useMemo(() => localStorageData[pathname], [
+ pathname,
+ localStorageData,
+ ]);
+
+ const [isAutoRefreshEnabled, setIsAutoRefreshfreshEnabled] = useState<boolean>(
+ Boolean(localStorageValue),
+ );
+
+ const dispatch = useDispatch<Dispatch<AppActions>>();
+
+ useEffect(() => {
+ const isAutoRefreshEnabled = Boolean(localStorageValue);
+ dispatch({
+ type: UPDATE_AUTO_REFRESH_INTERVAL,
+ payload: localStorageValue,
+ });
+ setIsAutoRefreshfreshEnabled(isAutoRefreshEnabled);
+ }, [localStorageValue, dispatch]);
+
+ const params = useUrlQuery();
+
+ const [selectedOption, setSelectedOption] = useState<string>(
+ localStorageValue || options[0].key,
+ );
+
+ useEffect(() => {
+ setSelectedOption(localStorageValue || options[0].key);
+ }, [localStorageValue, params]);
+
+ const getOption = useMemo(
+ () => options.find((option) => option.key === selectedOption),
+ [selectedOption],
+ );
+
+ useInterval(() => {
+ const selectedValue = getOption?.value;
+
+ if (isDisabled || !isAutoRefreshEnabled) {
+ return;
+ }
+
+ if (selectedOption !== 'off' && selectedValue) {
+ const { maxTime, minTime } = getMinMax(
+ globalTime.selectedTime,
+ globalTime.minTime,
+ globalTime.maxTime,
+ );
+
+ dispatch({
+ type: UPDATE_TIME_INTERVAL,
+ payload: {
+ maxTime,
+ minTime,
+ selectedTime: globalTime.selectedTime,
+ },
+ });
+ }
+ }, getOption?.value || 0);
+
+ const onChangeHandler = useCallback(
+ (selectedValue: string) => {
+ setSelectedOption(selectedValue);
+ params.set(DASHBOARD_TIME_IN_DURATION, selectedValue);
+ set(
+ DASHBOARD_TIME_IN_DURATION,
+ JSON.stringify({ ...localStorageData, [pathname]: selectedValue }),
+ );
+ setIsAutoRefreshfreshEnabled(true);
+ },
+ [params, pathname, localStorageData],
+ );
+
+ const onChangeAutoRefreshHandler = useCallback(
+ (event: CheckboxChangeEvent) => {
+ const { checked } = event.target;
+ if (!checked) {
+ // remove the path from localstorage
+ set(
+ DASHBOARD_TIME_IN_DURATION,
+ JSON.stringify(_omit(localStorageData, pathname)),
+ );
+ }
+ setIsAutoRefreshfreshEnabled(checked);
+ },
+ [localStorageData, pathname],
+ );
+
+ if (globalTime.selectedTime === 'custom') {
+ // eslint-disable-next-line react/jsx-no-useless-fragment
+ return <></>;
+ }
+
+ return (
+ <Popover
+ getPopupContainer={popupContainer}
+ placement="bottomRight"
+ rootClassName="auto-refresh-root"
+ trigger={['click']}
+ content={
+ <div className="auto-refresh-menu">
+ <Checkbox
+ onChange={onChangeAutoRefreshHandler}
+ checked={isAutoRefreshEnabled}
+ disabled={isDisabled}
+ className="auto-refresh-checkbox"
+ >
+ Auto Refresh
+ </Checkbox>
+ <Typography.Paragraph
+ disabled={isDisabled}
+ className="refresh-interval-text"
+ >
+ Refresh Interval
+ </Typography.Paragraph>
+ {options
+ .filter((e) => e.label !== 'off')
+ .map((option) => (
+ <Button
+ type="text"
+ className="refresh-interval-btns"
+ key={option.label + option.value}
+ onClick={(): void => {
+ onChangeHandler(option.key);
+ }}
+ >
+ {option.label}
+ {option.key === selectedOption && <Check size={14} />}
+ </Button>
+ ))}
+ </div>
+ }
+ >
+ <ButtonContainer
+ title="Set auto refresh"
+ type={showAutoRefreshBtnPrimary ? 'primary' : 'default'}
+ >
+ <CaretDownFilled />
+ </ButtonContainer>
+ </Popover>
+ );
+}
+
+interface AutoRefreshProps {
+ disabled?: boolean;
+ showAutoRefreshBtnPrimary?: boolean;
+}
+
+AutoRefresh.defaultProps = {
+ disabled: false,
+ showAutoRefreshBtnPrimary: true,
+};
+
+export default AutoRefresh;
diff --git a/frontend/src/container/TopNav/AutoRefreshV2/styles.ts b/frontend/src/container/TopNav/AutoRefreshV2/styles.ts
new file mode 100644
index 0000000000..9672a346e7
--- /dev/null
+++ b/frontend/src/container/TopNav/AutoRefreshV2/styles.ts
@@ -0,0 +1,13 @@
+import { Button } from 'antd';
+import styled from 'styled-components';
+
+export const Container = styled.div`
+ min-width: 8rem;
+`;
+
+export const ButtonContainer = styled(Button)`
+ &&& {
+ padding-left: 0.5rem;
+ padding-right: 0.5rem;
+ }
+`;
diff --git a/frontend/src/container/TopNav/Breadcrumbs/index.tsx b/frontend/src/container/TopNav/Breadcrumbs/index.tsx
index d5e4941142..4ab1e945d4 100644
--- a/frontend/src/container/TopNav/Breadcrumbs/index.tsx
+++ b/frontend/src/container/TopNav/Breadcrumbs/index.tsx
@@ -2,7 +2,7 @@ import { Breadcrumb } from 'antd';
import ROUTES from 'constants/routes';
import { Link, RouteComponentProps, withRouter } from 'react-router-dom';
-const breadcrumbNameMap = {
+const breadcrumbNameMap: Record<string, string> = {
[ROUTES.APPLICATION]: 'Services',
[ROUTES.TRACE]: 'Traces',
[ROUTES.TRACES_EXPLORER]: 'Traces Explorer',
@@ -20,7 +20,6 @@ const breadcrumbNameMap = {
[ROUTES.ERROR_DETAIL]: 'Exceptions',
[ROUTES.LIST_ALL_ALERT]: 'Alerts',
[ROUTES.ALL_DASHBOARD]: 'Dashboard',
- [ROUTES.LOGS]: 'Logs',
[ROUTES.LOGS_EXPLORER]: 'Logs Explorer',
[ROUTES.OLD_LOGS_EXPLORER]: 'Old Logs Explorer',
[ROUTES.LIVE_LOGS]: 'Live View',
diff --git a/frontend/src/container/TopNav/CustomDateTimeModal/index.tsx b/frontend/src/container/TopNav/CustomDateTimeModal/index.tsx
index 904bcd5fd0..5c5292d3ac 100644
--- a/frontend/src/container/TopNav/CustomDateTimeModal/index.tsx
+++ b/frontend/src/container/TopNav/CustomDateTimeModal/index.tsx
@@ -44,7 +44,7 @@ function CustomDateTimeModal({
disabledDate={disabledDate}
allowClear
onOk={onModalOkHandler}
- showTime
+ onCalendarChange={onModalOkHandler}
/>
</Modal>
);
diff --git a/frontend/src/container/TopNav/DateTimeSelection/index.tsx b/frontend/src/container/TopNav/DateTimeSelection/index.tsx
index 12e47e9f73..cc01b389e4 100644
--- a/frontend/src/container/TopNav/DateTimeSelection/index.tsx
+++ b/frontend/src/container/TopNav/DateTimeSelection/index.tsx
@@ -28,6 +28,7 @@ import { GlobalReducer } from 'types/reducer/globalTime';
import AutoRefresh from '../AutoRefresh';
import CustomDateTimeModal, { DateTimeRangeType } from '../CustomDateTimeModal';
+import { Time as TimeV2 } from '../DateTimeSelectionV2/config';
import {
getDefaultOption,
getOptions,
@@ -46,6 +47,7 @@ function DateTimeSelection({
const [formSelector] = Form.useForm();
const [hasSelectedTimeError, setHasSelectedTimeError] = useState(false);
+ const [isOpen, setIsOpen] = useState<boolean>(false);
const urlQuery = useUrlQuery();
const searchStartTime = urlQuery.get('startTime');
@@ -120,7 +122,7 @@ function DateTimeSelection({
const getInputLabel = (
startTime?: Dayjs,
endTime?: Dayjs,
- timeInterval: Time = '15min',
+ timeInterval: Time | TimeV2 = '15min',
): string | Time => {
if (startTime && endTime && timeInterval === 'custom') {
const format = 'YYYY/MM/DD HH:mm';
@@ -168,7 +170,7 @@ function DateTimeSelection({
return defaultSelectedOption;
};
- const updateLocalStorageForRoutes = (value: Time | string): void => {
+ const updateLocalStorageForRoutes = (value: Time | TimeV2 | string): void => {
const preRoutes = getLocalStorageKey(LOCALSTORAGE.METRICS_TIME_IN_DURATION);
if (preRoutes !== null) {
const preRoutesObject = JSON.parse(preRoutes);
@@ -223,7 +225,7 @@ function DateTimeSelection({
[location.pathname],
);
- const onSelectHandler = (value: Time): void => {
+ const onSelectHandler = (value: Time | TimeV2): void => {
if (value !== 'custom') {
updateTimeInterval(value);
updateLocalStorageForRoutes(value);
@@ -256,6 +258,7 @@ function DateTimeSelection({
};
const onCustomDateHandler = (dateTimeRange: DateTimeRangeType): void => {
+ console.log('dateTimeRange', dateTimeRange);
if (dateTimeRange !== null) {
const [startTimeMoment, endTimeMoment] = dateTimeRange;
if (startTimeMoment && endTimeMoment) {
@@ -346,6 +349,8 @@ function DateTimeSelection({
>
<FormContainer>
<CustomTimePicker
+ open={isOpen}
+ setOpen={setIsOpen}
onSelect={(value: unknown): void => {
onSelectHandler(value as Time);
}}
@@ -402,7 +407,7 @@ function DateTimeSelection({
interface DispatchProps {
updateTimeInterval: (
- interval: Time,
+ interval: Time | TimeV2,
dateTimeRange?: [number, number],
) => (dispatch: Dispatch<AppActions>) => void;
globalTimeLoading: () => void;
diff --git a/frontend/src/container/TopNav/DateTimeSelectionV2/DateTimeSelectionV2.styles.scss b/frontend/src/container/TopNav/DateTimeSelectionV2/DateTimeSelectionV2.styles.scss
new file mode 100644
index 0000000000..73688ad109
--- /dev/null
+++ b/frontend/src/container/TopNav/DateTimeSelectionV2/DateTimeSelectionV2.styles.scss
@@ -0,0 +1,231 @@
+.date-time-selector {
+ display: flex;
+ align-items: center;
+
+ .date-time-input-element {
+ display: flex;
+ align-items: center;
+ border-radius: 2px;
+ border: 1px solid var(--bg-slate-400);
+ box-shadow: none !important;
+ background: var(--bg-ink-300);
+ display: flex;
+ min-width: 192px;
+ height: 34px;
+ padding: 6px 6px 6px 8px;
+ flex-shrink: 0;
+ text-align: start;
+ margin-right: 8px;
+ justify-content: space-between;
+ align-items: center;
+
+ .date-time-input-content {
+ display: flex;
+ align-items: center;
+ }
+ .time-btn {
+ margin-right: 8px;
+ }
+ .down-arrow {
+ margin-left: 6px;
+ }
+ }
+
+ .refresh-actions {
+ display: flex;
+ flex-direction: row;
+ border-radius: 2px;
+ border: 1px solid var(--bg-slate-400);
+ background: var(--bg-ink-300);
+ margin-left: 8px;
+
+ .refresh-btn {
+ border-right: 1px solid var(--bg-slate-400);
+ }
+ .ant-btn {
+ display: flex;
+ padding: 4px 8px;
+ align-items: center;
+ box-shadow: none;
+ border: none;
+
+ &.active-tab {
+ background-color: #1d212d;
+ }
+ }
+ }
+}
+
+.date-time-root {
+ .ant-popover-inner {
+ width: 532px;
+ min-height: 334px;
+ border-radius: 4px !important;
+ border: 1px solid var(--bg-slate-400);
+ box-shadow: 4px 10px 16px 2px rgba(0, 0, 0, 0.2) !important;
+ padding: 0px !important;
+ border-radius: 4px;
+ background: linear-gradient(
+ 139deg,
+ rgba(18, 19, 23, 0.8) 0%,
+ rgba(18, 19, 23, 0.9) 98.68%
+ ) !important;
+ backdrop-filter: blur(20px);
+ }
+ .ant-popover-arrow {
+ display: none;
+ }
+}
+
+.date-time-popover {
+ display: flex;
+
+ .date-time-options {
+ display: flex;
+ width: 224px;
+ flex-direction: column;
+ border-right: 1px solid #1d212d;
+
+ .data-time-live {
+ border-bottom: 1px solid #1d212d;
+ text-align: start;
+ padding: 13.5px 14px;
+ height: 44px;
+ color: var(--bg-vanilla-400, #c0c1c3);
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: normal;
+ letter-spacing: 0.14px;
+ border-bottom: 1px solid var(--bg-slate-400, #1d212d);
+ }
+
+ .active {
+ background-color: rgba(171, 189, 255, 0.04) !important;
+ }
+
+ .data-time-live:hover {
+ &.ant-btn-text {
+ background-color: rgba(171, 189, 255, 0.04) !important;
+ }
+ }
+
+ .date-time-options-btn {
+ text-align: start;
+ padding: 8px 13px;
+ height: 37px;
+ color: var(--bg-vanilla-400, #c0c1c3);
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: normal;
+ letter-spacing: 0.14px;
+ }
+ .date-time-options-btn:hover {
+ &.ant-btn-text {
+ background-color: rgba(171, 189, 255, 0.04) !important;
+ }
+ }
+ }
+
+ .relative-date-time {
+ width: 307px;
+ display: flex;
+ flex-direction: column;
+ gap: 35px;
+ padding: 13px 14px;
+
+ .relative-date-time-section {
+ display: flex;
+ gap: 6px;
+ flex-flow: wrap;
+ }
+ .time-heading {
+ text-align: left;
+ color: var(--bg-slate-200);
+ font-size: 11px;
+ font-style: normal;
+ font-weight: 500;
+ line-height: 18px;
+ letter-spacing: 0.88px;
+ padding-bottom: 8px;
+ }
+
+ .time-btns {
+ color: var(--bg-vanilla-400);
+ background-color: #23262e;
+ font-size: 14px;
+ line-height: 17px;
+ letter-spacing: 0.04em;
+ text-align: left;
+ border-radius: 2px;
+ padding: 4px 8px;
+ }
+ }
+}
+
+.lightMode {
+ .date-time-input-element {
+ border: 1px solid var(--bg-vanilla-300);
+ background: var(--bg-vanilla-100);
+ }
+
+ .refresh-actions {
+ border: 1px solid var(--bg-vanilla-300);
+ background: var(--bg-vanilla-100);
+
+ .refresh-btn {
+ border-right: 1px solid var(--bg-vanilla-300);
+ }
+ }
+
+ .date-time-root {
+ .ant-popover-inner {
+ border: 1px solid var(--bg-vanilla-400);
+ background: var(--bg-vanilla-100) !important;
+ }
+ }
+
+ .date-time-popover {
+ .date-time-options {
+ border-right: 1px solid var(--bg-vanilla-400);
+
+ .data-time-live {
+ border-bottom: 1px solid var(--bg-vanilla-400);
+ color: var(--bg-slate-400);
+ border-bottom: 1px solid var(--bg-vanilla-400);
+ }
+
+ .date-time-options-btn {
+ color: var(--bg-slate-400);
+ }
+
+ .active {
+ background-color: var(--bg-vanilla-300) !important;
+ }
+
+ .data-time-live:hover {
+ &.ant-btn-text {
+ background-color: var(--bg-vanilla-300) !important;
+ }
+ }
+
+ .date-time-options-btn:hover {
+ &.ant-btn-text {
+ background-color: var(--bg-vanilla-300) !important;
+ }
+ }
+ }
+
+ .relative-date-time {
+ .time-heading {
+ color: var(--bg-vanilla-400);
+ }
+
+ .time-btns {
+ background-color: var(--bg-vanilla-300);
+ color: var(--bg-slate-400);
+ }
+ }
+ }
+}
diff --git a/frontend/src/container/TopNav/DateTimeSelectionV2/Refresh.tsx b/frontend/src/container/TopNav/DateTimeSelectionV2/Refresh.tsx
new file mode 100644
index 0000000000..6e608b1189
--- /dev/null
+++ b/frontend/src/container/TopNav/DateTimeSelectionV2/Refresh.tsx
@@ -0,0 +1,36 @@
+import { useEffect, useState } from 'react';
+
+import { RefreshTextContainer, Typography } from './styles';
+
+function RefreshText({
+ onLastRefreshHandler,
+ refreshButtonHidden,
+}: RefreshTextProps): JSX.Element {
+ const [refreshText, setRefreshText] = useState<string>('');
+
+ // this is to update the refresh text
+ useEffect(() => {
+ const interval = setInterval(() => {
+ const text = onLastRefreshHandler();
+ if (refreshText !== text) {
+ setRefreshText(text);
+ }
+ }, 2000);
+ return (): void => {
+ clearInterval(interval);
+ };
+ }, [onLastRefreshHandler, refreshText]);
+
+ return (
+ <RefreshTextContainer refreshButtonHidden={refreshButtonHidden}>
+ <Typography>{refreshText}</Typography>
+ </RefreshTextContainer>
+ );
+}
+
+interface RefreshTextProps {
+ onLastRefreshHandler: () => string;
+ refreshButtonHidden: boolean;
+}
+
+export default RefreshText;
diff --git a/frontend/src/container/TopNav/DateTimeSelectionV2/config.ts b/frontend/src/container/TopNav/DateTimeSelectionV2/config.ts
new file mode 100644
index 0000000000..f1048f96ea
--- /dev/null
+++ b/frontend/src/container/TopNav/DateTimeSelectionV2/config.ts
@@ -0,0 +1,148 @@
+/* eslint-disable sonarjs/no-duplicate-string */
+import ROUTES from 'constants/routes';
+
+type FiveMin = '5min';
+type TenMin = '10min';
+type FifteenMin = '15min';
+type ThirtyMin = '30min';
+type FortyFiveMin = '45min';
+type OneMin = '1min';
+type ThreeHour = '3hr';
+type SixHour = '6hr';
+type OneHour = '1hr';
+type FourHour = '4hr';
+type TwelveHour = '12hr';
+type OneDay = '1day';
+type ThreeDay = '3days';
+type FourDay = '4days';
+type TenDay = '10days';
+type OneWeek = '1week';
+type TwoWeek = '2weeks';
+type SixWeek = '6weeks';
+type TwoMonths = '2months';
+type Custom = 'custom';
+
+export type Time =
+ | FiveMin
+ | TenMin
+ | FifteenMin
+ | ThirtyMin
+ | OneMin
+ | ThreeHour
+ | FourHour
+ | SixHour
+ | OneHour
+ | Custom
+ | OneWeek
+ | SixWeek
+ | OneDay
+ | FourDay
+ | ThreeDay
+ | FortyFiveMin
+ | TwelveHour
+ | TenDay
+ | TwoWeek
+ | TwoMonths;
+
+export const Options: Option[] = [
+ { value: '5min', label: 'Last 5 minutes' },
+ { value: '15min', label: 'Last 15 minutes' },
+ { value: '30min', label: 'Last 30 minutes' },
+ { value: '1hr', label: 'Last 1 hour' },
+ { value: '6hr', label: 'Last 6 hours' },
+ { value: '1day', label: 'Last 1 day' },
+ { value: '3days', label: 'Last 3 days' },
+ { value: '1week', label: 'Last 1 week' },
+ { value: 'custom', label: 'Custom...' },
+];
+
+export interface Option {
+ value: Time;
+ label: string;
+}
+
+export const RelativeDurationOptions: Option[] = [
+ { value: '5min', label: 'Last 5 minutes' },
+ { value: '15min', label: 'Last 15 minutes' },
+ { value: '30min', label: 'Last 30 minutes' },
+ { value: '1hr', label: 'Last 1 hour' },
+ { value: '6hr', label: 'Last 6 hour' },
+ { value: '1day', label: 'Last 1 day' },
+ { value: '3days', label: 'Last 3 days' },
+ { value: '1week', label: 'Last 1 week' },
+];
+
+export const RelativeDurationSuggestionOptions: Option[] = [
+ { value: '3hr', label: '3h' },
+ { value: '4days', label: '4d' },
+ { value: '6weeks', label: '6w' },
+ { value: '12hr', label: '12 hours' },
+ { value: '10days', label: '10d' },
+ { value: '2weeks', label: '2 weeks' },
+ { value: '2months', label: 'Last 2 months' },
+ { value: '1day', label: 'today' },
+];
+export const FixedDurationSuggestionOptions: Option[] = [
+ { value: '45min', label: '45m' },
+ { value: '12hr', label: '12 hours' },
+ { value: '10days', label: '10d' },
+ { value: '2weeks', label: '2 weeks' },
+ { value: '2months', label: 'Last 2 months' },
+ { value: '1day', label: 'today' },
+];
+
+export const getDefaultOption = (route: string): Time => {
+ if (route === ROUTES.SERVICE_MAP) {
+ return RelativeDurationOptions[2].value;
+ }
+ if (route === ROUTES.APPLICATION) {
+ return Options[2].value;
+ }
+ return Options[2].value;
+};
+
+export const getOptions = (routes: string): Option[] => {
+ if (routes === ROUTES.SERVICE_MAP) {
+ return RelativeDurationOptions;
+ }
+ return Options;
+};
+
+export const routesToHideBreadCrumbs = [ROUTES.SUPPORT, ROUTES.ALL_DASHBOARD];
+
+export const routesToSkip = [
+ ROUTES.SETTINGS,
+ ROUTES.LIST_ALL_ALERT,
+ ROUTES.TRACE_DETAIL,
+ ROUTES.ALL_CHANNELS,
+ ROUTES.USAGE_EXPLORER,
+ ROUTES.GET_STARTED,
+ ROUTES.VERSION,
+ ROUTES.ALL_DASHBOARD,
+ ROUTES.ORG_SETTINGS,
+ ROUTES.INGESTION_SETTINGS,
+ ROUTES.ERROR_DETAIL,
+ ROUTES.LOGS_PIPELINES,
+ ROUTES.BILLING,
+ ROUTES.SUPPORT,
+ ROUTES.WORKSPACE_LOCKED,
+ ROUTES.LOGS,
+ ROUTES.MY_SETTINGS,
+ ROUTES.LIST_LICENSES,
+ ROUTES.LOGS_SAVE_VIEWS,
+ ROUTES.LOGS_PIPELINES,
+ ROUTES.TRACES_EXPLORER,
+ ROUTES.TRACES_SAVE_VIEWS,
+];
+
+export const routesToDisable = [ROUTES.LOGS_EXPLORER, ROUTES.LIVE_LOGS];
+
+export interface LocalStorageTimeRange {
+ localstorageStartTime: string | null;
+ localstorageEndTime: string | null;
+}
+
+export interface TimeRange {
+ startTime: string;
+ endTime: string;
+}
diff --git a/frontend/src/container/TopNav/DateTimeSelectionV2/index.tsx b/frontend/src/container/TopNav/DateTimeSelectionV2/index.tsx
new file mode 100644
index 0000000000..342dc8299a
--- /dev/null
+++ b/frontend/src/container/TopNav/DateTimeSelectionV2/index.tsx
@@ -0,0 +1,469 @@
+import './DateTimeSelectionV2.styles.scss';
+
+import { SyncOutlined } from '@ant-design/icons';
+import { Button } from 'antd';
+import getLocalStorageKey from 'api/browser/localstorage/get';
+import setLocalStorageKey from 'api/browser/localstorage/set';
+import CustomTimePicker from 'components/CustomTimePicker/CustomTimePicker';
+import { LOCALSTORAGE } from 'constants/localStorage';
+import { QueryParams } from 'constants/query';
+import {
+ initialQueryBuilderFormValuesMap,
+ PANEL_TYPES,
+} from 'constants/queryBuilder';
+import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
+import ROUTES from 'constants/routes';
+import {
+ constructCompositeQuery,
+ defaultLiveQueryDataConfig,
+} from 'container/LiveLogs/constants';
+import { QueryHistoryState } from 'container/LiveLogs/types';
+import dayjs, { Dayjs } from 'dayjs';
+import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
+import { updateStepInterval } from 'hooks/queryBuilder/useStepInterval';
+import useUrlQuery from 'hooks/useUrlQuery';
+import GetMinMax from 'lib/getMinMax';
+import getTimeString from 'lib/getTimeString';
+import history from 'lib/history';
+import { isObject } from 'lodash-es';
+import { useCallback, useEffect, useMemo, useState } from 'react';
+import { useQueryClient } from 'react-query';
+import { connect, useSelector } from 'react-redux';
+import { RouteComponentProps, withRouter } from 'react-router-dom';
+import { bindActionCreators, Dispatch } from 'redux';
+import { ThunkDispatch } from 'redux-thunk';
+import { GlobalTimeLoading, UpdateTimeInterval } from 'store/actions';
+import { AppState } from 'store/reducers';
+import AppActions from 'types/actions';
+import { ErrorResponse, SuccessResponse } from 'types/api';
+import { MetricRangePayloadProps } from 'types/api/metrics/getQueryRange';
+import { GlobalReducer } from 'types/reducer/globalTime';
+
+import AutoRefresh from '../AutoRefreshV2';
+import { DateTimeRangeType } from '../CustomDateTimeModal';
+import {
+ getDefaultOption,
+ getOptions,
+ LocalStorageTimeRange,
+ Time,
+ TimeRange,
+} from './config';
+import RefreshText from './Refresh';
+import { Form, FormContainer, FormItem } from './styles';
+
+function DateTimeSelection({
+ showAutoRefresh,
+ location,
+ updateTimeInterval,
+ globalTimeLoading,
+}: Props): JSX.Element {
+ const [formSelector] = Form.useForm();
+
+ const [hasSelectedTimeError, setHasSelectedTimeError] = useState(false);
+ const [isOpen, setIsOpen] = useState<boolean>(false);
+
+ const urlQuery = useUrlQuery();
+ const searchStartTime = urlQuery.get('startTime');
+ const searchEndTime = urlQuery.get('endTime');
+ const queryClient = useQueryClient();
+
+ const {
+ localstorageStartTime,
+ localstorageEndTime,
+ } = ((): LocalStorageTimeRange => {
+ const routes = getLocalStorageKey(LOCALSTORAGE.METRICS_TIME_IN_DURATION);
+
+ if (routes !== null) {
+ const routesObject = JSON.parse(routes || '{}');
+ const selectedTime = routesObject[location.pathname];
+
+ if (selectedTime) {
+ let parsedSelectedTime: TimeRange;
+ try {
+ parsedSelectedTime = JSON.parse(selectedTime);
+ } catch {
+ parsedSelectedTime = selectedTime;
+ }
+
+ if (isObject(parsedSelectedTime)) {
+ return {
+ localstorageStartTime: parsedSelectedTime.startTime,
+ localstorageEndTime: parsedSelectedTime.endTime,
+ };
+ }
+ return { localstorageStartTime: null, localstorageEndTime: null };
+ }
+ }
+ return { localstorageStartTime: null, localstorageEndTime: null };
+ })();
+
+ const getTime = useCallback((): [number, number] | undefined => {
+ if (searchEndTime && searchStartTime) {
+ const startDate = dayjs(
+ new Date(parseInt(getTimeString(searchStartTime), 10)),
+ );
+ const endDate = dayjs(new Date(parseInt(getTimeString(searchEndTime), 10)));
+
+ return [startDate.toDate().getTime() || 0, endDate.toDate().getTime() || 0];
+ }
+ if (localstorageStartTime && localstorageEndTime) {
+ const startDate = dayjs(localstorageStartTime);
+ const endDate = dayjs(localstorageEndTime);
+
+ return [startDate.toDate().getTime() || 0, endDate.toDate().getTime() || 0];
+ }
+ return undefined;
+ }, [
+ localstorageEndTime,
+ localstorageStartTime,
+ searchEndTime,
+ searchStartTime,
+ ]);
+
+ const [options, setOptions] = useState(getOptions(location.pathname));
+ const [refreshButtonHidden, setRefreshButtonHidden] = useState<boolean>(false);
+ const [customDateTimeVisible, setCustomDTPickerVisible] = useState<boolean>(
+ false,
+ );
+
+ const { stagedQuery, initQueryBuilderData, panelType } = useQueryBuilder();
+
+ const handleGoLive = useCallback(() => {
+ if (!stagedQuery) return;
+
+ setIsOpen(false);
+ let queryHistoryState: QueryHistoryState | null = null;
+
+ const compositeQuery = constructCompositeQuery({
+ query: stagedQuery,
+ initialQueryData: initialQueryBuilderFormValuesMap.logs,
+ customQueryData: defaultLiveQueryDataConfig,
+ });
+
+ const isListView =
+ panelType === PANEL_TYPES.LIST && stagedQuery.builder.queryData[0];
+
+ if (isListView) {
+ const [graphQuery, listQuery] = queryClient.getQueriesData<
+ SuccessResponse<MetricRangePayloadProps> | ErrorResponse
+ >({
+ queryKey: REACT_QUERY_KEY.GET_QUERY_RANGE,
+ active: true,
+ });
+
+ queryHistoryState = {
+ graphQueryPayload:
+ graphQuery && graphQuery[1]
+ ? graphQuery[1].payload?.data.result || []
+ : [],
+ listQueryPayload:
+ listQuery && listQuery[1]
+ ? listQuery[1].payload?.data.newResult.data.result || []
+ : [],
+ };
+ }
+
+ const JSONCompositeQuery = encodeURIComponent(JSON.stringify(compositeQuery));
+
+ const path = `${ROUTES.LIVE_LOGS}?${QueryParams.compositeQuery}=${JSONCompositeQuery}`;
+
+ history.push(path, queryHistoryState);
+ }, [panelType, queryClient, stagedQuery]);
+
+ const { maxTime, minTime, selectedTime } = useSelector<
+ AppState,
+ GlobalReducer
+ >((state) => state.globalTime);
+
+ const getInputLabel = (
+ startTime?: Dayjs,
+ endTime?: Dayjs,
+ timeInterval: Time = '15min',
+ ): string | Time => {
+ if (startTime && endTime && timeInterval === 'custom') {
+ const format = 'DD/MM/YYYY HH:mm';
+
+ const startString = startTime.format(format);
+ const endString = endTime.format(format);
+
+ return `${startString} - ${endString}`;
+ }
+
+ return timeInterval;
+ };
+
+ useEffect(() => {
+ if (selectedTime === 'custom') {
+ setRefreshButtonHidden(true);
+ setCustomDTPickerVisible(true);
+ } else {
+ setRefreshButtonHidden(false);
+ setCustomDTPickerVisible(false);
+ }
+ }, [selectedTime]);
+
+ const getDefaultTime = (pathName: string): Time => {
+ const defaultSelectedOption = getDefaultOption(pathName);
+
+ const routes = getLocalStorageKey(LOCALSTORAGE.METRICS_TIME_IN_DURATION);
+
+ if (routes !== null) {
+ const routesObject = JSON.parse(routes || '{}');
+ const selectedTime = routesObject[pathName];
+
+ let parsedSelectedTime: TimeRange;
+ try {
+ parsedSelectedTime = JSON.parse(selectedTime);
+ } catch {
+ parsedSelectedTime = selectedTime;
+ }
+ if (isObject(parsedSelectedTime)) {
+ return 'custom';
+ }
+ }
+
+ return defaultSelectedOption;
+ };
+
+ const updateLocalStorageForRoutes = (value: Time | string): void => {
+ const preRoutes = getLocalStorageKey(LOCALSTORAGE.METRICS_TIME_IN_DURATION);
+ if (preRoutes !== null) {
+ const preRoutesObject = JSON.parse(preRoutes);
+
+ const preRoute = {
+ ...preRoutesObject,
+ };
+ preRoute[location.pathname] = value;
+
+ setLocalStorageKey(
+ LOCALSTORAGE.METRICS_TIME_IN_DURATION,
+ JSON.stringify(preRoute),
+ );
+ }
+ };
+
+ const onLastRefreshHandler = useCallback(() => {
+ const currentTime = dayjs();
+
+ const lastRefresh = dayjs(
+ selectedTime === 'custom' ? minTime / 1000000 : maxTime / 1000000,
+ );
+
+ const secondsDiff = currentTime.diff(lastRefresh, 'seconds');
+
+ const minutedDiff = currentTime.diff(lastRefresh, 'minutes');
+ const hoursDiff = currentTime.diff(lastRefresh, 'hours');
+ const daysDiff = currentTime.diff(lastRefresh, 'days');
+ const monthsDiff = currentTime.diff(lastRefresh, 'months');
+
+ if (monthsDiff > 0) {
+ return `Refreshed ${monthsDiff} months ago`;
+ }
+
+ if (daysDiff > 0) {
+ return `Refreshed ${daysDiff} days ago`;
+ }
+
+ if (hoursDiff > 0) {
+ return `Refreshed ${hoursDiff} hrs ago`;
+ }
+
+ if (minutedDiff > 0) {
+ return `Refreshed ${minutedDiff} mins ago`;
+ }
+
+ return `Refreshed ${secondsDiff} sec ago`;
+ }, [maxTime, minTime, selectedTime]);
+
+ const isLogsExplorerPage = useMemo(
+ () => location.pathname === ROUTES.LOGS_EXPLORER,
+ [location.pathname],
+ );
+
+ const onSelectHandler = (value: Time): void => {
+ if (value !== 'custom') {
+ setIsOpen(false);
+ updateTimeInterval(value);
+ updateLocalStorageForRoutes(value);
+ if (refreshButtonHidden) {
+ setRefreshButtonHidden(false);
+ }
+ } else {
+ setRefreshButtonHidden(true);
+ setCustomDTPickerVisible(true);
+ }
+
+ const { maxTime, minTime } = GetMinMax(value, getTime());
+
+ if (!isLogsExplorerPage) {
+ urlQuery.set(QueryParams.startTime, minTime.toString());
+ urlQuery.set(QueryParams.endTime, maxTime.toString());
+ const generatedUrl = `${location.pathname}?${urlQuery.toString()}`;
+ history.replace(generatedUrl);
+ }
+
+ if (!stagedQuery) {
+ return;
+ }
+ // the second boolean param directs the qb about the time change so to merge the query and retain the current state
+ initQueryBuilderData(updateStepInterval(stagedQuery, maxTime, minTime), true);
+ };
+
+ const onRefreshHandler = (): void => {
+ onSelectHandler(selectedTime);
+ onLastRefreshHandler();
+ };
+
+ const onCustomDateHandler = (dateTimeRange: DateTimeRangeType): void => {
+ if (dateTimeRange !== null) {
+ const [startTimeMoment, endTimeMoment] = dateTimeRange;
+ if (startTimeMoment && endTimeMoment) {
+ setCustomDTPickerVisible(false);
+ startTimeMoment.startOf('day').toString();
+ updateTimeInterval('custom', [
+ startTimeMoment.startOf('day').toDate().getTime(),
+ endTimeMoment.endOf('day').toDate().getTime(),
+ ]);
+ setLocalStorageKey('startTime', startTimeMoment.toString());
+ setLocalStorageKey('endTime', endTimeMoment.toString());
+ updateLocalStorageForRoutes(
+ JSON.stringify({ startTime: startTimeMoment, endTime: endTimeMoment }),
+ );
+
+ if (!isLogsExplorerPage) {
+ urlQuery.set(QueryParams.startTime, startTimeMoment.toString());
+ urlQuery.set(QueryParams.endTime, endTimeMoment.toString());
+ const generatedUrl = `${location.pathname}?${urlQuery.toString()}`;
+ history.replace(generatedUrl);
+ }
+ }
+ }
+ };
+
+ // this is triggred when we change the routes and based on that we are changing the default options
+ useEffect(() => {
+ const metricsTimeDuration = getLocalStorageKey(
+ LOCALSTORAGE.METRICS_TIME_IN_DURATION,
+ );
+
+ if (metricsTimeDuration === null) {
+ setLocalStorageKey(
+ LOCALSTORAGE.METRICS_TIME_IN_DURATION,
+ JSON.stringify({}),
+ );
+ }
+
+ const currentRoute = location.pathname;
+ const time = getDefaultTime(currentRoute);
+
+ const currentOptions = getOptions(currentRoute);
+ setOptions(currentOptions);
+
+ const getCustomOrIntervalTime = (time: Time): Time => {
+ if (searchEndTime !== null && searchStartTime !== null) {
+ return 'custom';
+ }
+ if (
+ (localstorageEndTime === null || localstorageStartTime === null) &&
+ time === 'custom'
+ ) {
+ return getDefaultOption(currentRoute);
+ }
+
+ return time;
+ };
+
+ const updatedTime = getCustomOrIntervalTime(time);
+
+ const [preStartTime = 0, preEndTime = 0] = getTime() || [];
+
+ setRefreshButtonHidden(updatedTime === 'custom');
+
+ updateTimeInterval(updatedTime, [preStartTime, preEndTime]);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [location.pathname, updateTimeInterval, globalTimeLoading]);
+
+ return (
+ <div className="date-time-selector">
+ {!hasSelectedTimeError && !refreshButtonHidden && (
+ <RefreshText
+ {...{
+ onLastRefreshHandler,
+ }}
+ refreshButtonHidden={refreshButtonHidden}
+ />
+ )}
+ <Form
+ form={formSelector}
+ layout="inline"
+ initialValues={{ interval: selectedTime }}
+ >
+ <FormContainer>
+ <CustomTimePicker
+ open={isOpen}
+ setOpen={setIsOpen}
+ onSelect={(value: unknown): void => {
+ onSelectHandler(value as Time);
+ }}
+ onError={(hasError: boolean): void => {
+ setHasSelectedTimeError(hasError);
+ }}
+ selectedTime={selectedTime}
+ onValidCustomDateChange={(dateTime): void =>
+ onCustomDateHandler(dateTime as DateTimeRangeType)
+ }
+ selectedValue={getInputLabel(
+ dayjs(minTime / 1000000),
+ dayjs(maxTime / 1000000),
+ selectedTime,
+ )}
+ data-testid="dropDown"
+ items={options}
+ newPopover
+ handleGoLive={handleGoLive}
+ onCustomDateHandler={onCustomDateHandler}
+ customDateTimeVisible={customDateTimeVisible}
+ setCustomDTPickerVisible={setCustomDTPickerVisible}
+ />
+
+ {showAutoRefresh && selectedTime !== 'custom' && (
+ <div className="refresh-actions">
+ <FormItem hidden={refreshButtonHidden} className="refresh-btn">
+ <Button icon={<SyncOutlined />} onClick={onRefreshHandler} />
+ </FormItem>
+
+ <FormItem>
+ <AutoRefresh
+ disabled={refreshButtonHidden}
+ showAutoRefreshBtnPrimary={false}
+ />
+ </FormItem>
+ </div>
+ )}
+ </FormContainer>
+ </Form>
+ </div>
+ );
+}
+
+interface DateTimeSelectionV2Props {
+ showAutoRefresh: boolean;
+}
+interface DispatchProps {
+ updateTimeInterval: (
+ interval: Time,
+ dateTimeRange?: [number, number],
+ ) => (dispatch: Dispatch<AppActions>) => void;
+ globalTimeLoading: () => void;
+}
+
+const mapDispatchToProps = (
+ dispatch: ThunkDispatch<unknown, unknown, AppActions>,
+): DispatchProps => ({
+ updateTimeInterval: bindActionCreators(UpdateTimeInterval, dispatch),
+ globalTimeLoading: bindActionCreators(GlobalTimeLoading, dispatch),
+});
+
+type Props = DateTimeSelectionV2Props & DispatchProps & RouteComponentProps;
+
+export default connect(null, mapDispatchToProps)(withRouter(DateTimeSelection));
diff --git a/frontend/src/container/TopNav/DateTimeSelectionV2/styles.ts b/frontend/src/container/TopNav/DateTimeSelectionV2/styles.ts
new file mode 100644
index 0000000000..d35d5e764d
--- /dev/null
+++ b/frontend/src/container/TopNav/DateTimeSelectionV2/styles.ts
@@ -0,0 +1,34 @@
+import { Form as FormComponent, Typography as TypographyComponent } from 'antd';
+import styled from 'styled-components';
+
+export const Form = styled(FormComponent)`
+ &&& {
+ justify-content: flex-end;
+ }
+`;
+
+export const Typography = styled(TypographyComponent)`
+ &&& {
+ text-align: right;
+ }
+`;
+
+export const FormItem = styled(Form.Item)`
+ &&& {
+ margin: 0;
+ }
+`;
+
+interface Props {
+ refreshButtonHidden: boolean;
+}
+
+export const RefreshTextContainer = styled.div<Props>`
+ padding-right: 8px;
+ visibility: ${({ refreshButtonHidden }): string =>
+ refreshButtonHidden ? 'hidden' : 'visible'};
+`;
+
+export const FormContainer = styled.div`
+ display: flex;
+`;
diff --git a/frontend/src/container/TopNav/index.tsx b/frontend/src/container/TopNav/index.tsx
index 3b2667eaf6..5277908240 100644
--- a/frontend/src/container/TopNav/index.tsx
+++ b/frontend/src/container/TopNav/index.tsx
@@ -4,8 +4,8 @@ import { useMemo } from 'react';
import { matchPath, useHistory } from 'react-router-dom';
import NewExplorerCTA from '../NewExplorerCTA';
-import DateTimeSelector from './DateTimeSelection';
-import { routesToDisable, routesToSkip } from './DateTimeSelection/config';
+import DateTimeSelector from './DateTimeSelectionV2';
+import { routesToDisable, routesToSkip } from './DateTimeSelectionV2/config';
function TopNav(): JSX.Element | null {
const { location } = useHistory();
@@ -31,26 +31,24 @@ function TopNav(): JSX.Element | null {
[location.pathname],
);
- if (isSignUpPage || isDisabled) {
+ if (isSignUpPage || isDisabled || isRouteToSkip) {
return null;
}
- return (
- <Row>
- {!isRouteToSkip && (
- <Col span={24} style={{ marginTop: '1rem' }}>
- <Row justify="end">
- <Space align="start" size={60} direction="horizontal">
- <NewExplorerCTA />
- <div>
- <DateTimeSelector />
- </div>
- </Space>
- </Row>
- </Col>
- )}
+ return !isRouteToSkip ? (
+ <Row style={{ marginBottom: '1rem' }}>
+ <Col span={24} style={{ marginTop: '1rem' }}>
+ <Row justify="end">
+ <Space align="center" size={16} direction="horizontal">
+ <NewExplorerCTA />
+ <div>
+ <DateTimeSelector showAutoRefresh />
+ </div>
+ </Space>
+ </Row>
+ </Col>
</Row>
- );
+ ) : null;
}
export default TopNav;
diff --git a/frontend/src/container/Trace/Search/styles.ts b/frontend/src/container/Trace/Search/styles.ts
index 5ade20596d..cfae21ceb2 100644
--- a/frontend/src/container/Trace/Search/styles.ts
+++ b/frontend/src/container/Trace/Search/styles.ts
@@ -7,6 +7,7 @@ export const Container = styled.div`
display: flex;
position: relative;
width: 100%;
+ margin-top: 1rem;
`;
export const SearchComponent = styled(Search)`
diff --git a/frontend/src/hooks/useClickOutside.tsx b/frontend/src/hooks/useClickOutside.tsx
new file mode 100644
index 0000000000..d53415dbb6
--- /dev/null
+++ b/frontend/src/hooks/useClickOutside.tsx
@@ -0,0 +1,28 @@
+import { useEffect } from 'react';
+
+type UseClickOutsideProps = {
+ ref: React.RefObject<HTMLElement>;
+ onClickOutside: () => void;
+};
+
+const useClickOutside = ({
+ ref,
+ onClickOutside,
+}: UseClickOutsideProps): void => {
+ const handleClickOutside = (event: MouseEvent): void => {
+ if (ref.current && !ref.current.contains(event.target as Node)) {
+ onClickOutside();
+ }
+ };
+
+ useEffect(() => {
+ document.addEventListener('click', handleClickOutside);
+
+ return (): void => {
+ document.removeEventListener('click', handleClickOutside);
+ };
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [ref, onClickOutside]);
+};
+
+export default useClickOutside;
diff --git a/frontend/src/hooks/useDarkMode/index.tsx b/frontend/src/hooks/useDarkMode/index.tsx
index baf0c21511..00df811704 100644
--- a/frontend/src/hooks/useDarkMode/index.tsx
+++ b/frontend/src/hooks/useDarkMode/index.tsx
@@ -82,6 +82,30 @@ export const useThemeConfig = (): ThemeConfig => {
colorLink: '#4E74F8',
colorPrimaryText: '#3F5ECC',
},
+ components: {
+ Dropdown: {
+ colorBgElevated: isDarkMode ? '#121317' : '#fff',
+ controlItemBgHover: isDarkMode ? '#1D212D' : '#fff',
+ colorText: isDarkMode ? '#C0C1C3' : '#121317',
+ fontSize: 12,
+ },
+ Select: {
+ colorBgElevated: isDarkMode ? '#121317' : '#fff',
+ controlItemBgHover: isDarkMode ? '#1D212D' : '#fff',
+ boxShadowSecondary: isDarkMode
+ ? '4px 10px 16px 2px rgba(0, 0, 0, 0.30)'
+ : '#fff',
+ colorText: isDarkMode ? '#C0C1C3' : '#121317',
+ fontSize: 12,
+ },
+ Button: {
+ paddingInline: 12,
+ fontSize: 12,
+ },
+ Input: {
+ colorBorder: isDarkMode ? '#1D212D' : '#E9E9E9',
+ },
+ },
};
};
diff --git a/frontend/src/hooks/useHandleExplorerTabChange.ts b/frontend/src/hooks/useHandleExplorerTabChange.ts
index 415c4807c8..f3b3000cfc 100644
--- a/frontend/src/hooks/useHandleExplorerTabChange.ts
+++ b/frontend/src/hooks/useHandleExplorerTabChange.ts
@@ -1,5 +1,6 @@
import { QueryParams } from 'constants/query';
import { initialAutocompleteData, PANEL_TYPES } from 'constants/queryBuilder';
+import ROUTES from 'constants/routes';
import { SIGNOZ_VALUE } from 'container/QueryBuilder/filters/OrderByFilter/constants';
import { useCallback } from 'react';
import { Query } from 'types/api/queryBuilder/queryBuilderData';
@@ -12,6 +13,7 @@ export const useHandleExplorerTabChange = (): {
handleExplorerTabChange: (
type: string,
querySearchParameters?: ICurrentQueryData,
+ redirectToUrl?: typeof ROUTES[keyof typeof ROUTES],
) => void;
} => {
const {
@@ -51,18 +53,34 @@ export const useHandleExplorerTabChange = (): {
);
const handleExplorerTabChange = useCallback(
- (type: string, currentQueryData?: ICurrentQueryData) => {
+ (
+ type: string,
+ currentQueryData?: ICurrentQueryData,
+ redirectToUrl?: typeof ROUTES[keyof typeof ROUTES],
+ ) => {
const newPanelType = type as PANEL_TYPES;
if (newPanelType === panelType && !currentQueryData) return;
const query = currentQueryData?.query || getUpdateQuery(newPanelType);
- redirectWithQueryBuilderData(query, {
- [QueryParams.panelTypes]: newPanelType,
- [QueryParams.viewName]: currentQueryData?.name || viewName,
- [QueryParams.viewKey]: currentQueryData?.uuid || viewKey,
- });
+ if (redirectToUrl) {
+ redirectWithQueryBuilderData(
+ query,
+ {
+ [QueryParams.panelTypes]: newPanelType,
+ [QueryParams.viewName]: currentQueryData?.name || viewName,
+ [QueryParams.viewKey]: currentQueryData?.uuid || viewKey,
+ },
+ redirectToUrl,
+ );
+ } else {
+ redirectWithQueryBuilderData(query, {
+ [QueryParams.panelTypes]: newPanelType,
+ [QueryParams.viewName]: currentQueryData?.name || viewName,
+ [QueryParams.viewKey]: currentQueryData?.uuid || viewKey,
+ });
+ }
},
[panelType, getUpdateQuery, redirectWithQueryBuilderData, viewName, viewKey],
);
diff --git a/frontend/src/hooks/useQueryService.ts b/frontend/src/hooks/useQueryService.ts
index 66460857a7..c13654c56b 100644
--- a/frontend/src/hooks/useQueryService.ts
+++ b/frontend/src/hooks/useQueryService.ts
@@ -1,6 +1,7 @@
import getService from 'api/metrics/getService';
import { AxiosError } from 'axios';
import { Time } from 'container/TopNav/DateTimeSelection/config';
+import { Time as TimeV2 } from 'container/TopNav/DateTimeSelectionV2/config';
import {
QueryKey,
useQuery,
@@ -26,7 +27,7 @@ export const useQueryService = ({
interface UseQueryServiceProps {
minTime: number;
maxTime: number;
- selectedTime: Time;
+ selectedTime: Time | TimeV2;
selectedTags: Tags[];
options?: UseQueryOptions<PayloadProps, AxiosError, PayloadProps, QueryKey>;
}
diff --git a/frontend/src/index.html.ejs b/frontend/src/index.html.ejs
index 8d756463cd..8a4e407ec5 100644
--- a/frontend/src/index.html.ejs
+++ b/frontend/src/index.html.ejs
@@ -67,7 +67,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
- href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&family=Work+Sans:wght@500&display=swap"
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&family=Work+Sans:wght@500&family=Space+Mono&display=swap"
rel="stylesheet"
/>
</head>
diff --git a/frontend/src/lib/dashboard/getQueryResults.ts b/frontend/src/lib/dashboard/getQueryResults.ts
index 89ba08f891..ac012ce3a7 100644
--- a/frontend/src/lib/dashboard/getQueryResults.ts
+++ b/frontend/src/lib/dashboard/getQueryResults.ts
@@ -6,6 +6,7 @@ import { getMetricsQueryRange } from 'api/metrics/getQueryRange';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { timePreferenceType } from 'container/NewWidget/RightContainer/timeItems';
import { Time } from 'container/TopNav/DateTimeSelection/config';
+import { Time as TimeV2 } from 'container/TopNav/DateTimeSelectionV2/config';
import { Pagination } from 'hooks/queryPagination';
import { convertNewDataToOld } from 'lib/newQueryBuilder/convertNewDataToOld';
import { isEmpty } from 'lodash-es';
@@ -61,7 +62,7 @@ export interface GetQueryResultsProps {
query: Query;
graphType: PANEL_TYPES;
selectedTime: timePreferenceType;
- globalSelectedInterval: Time;
+ globalSelectedInterval: Time | TimeV2;
variables?: Record<string, unknown>;
params?: Record<string, unknown>;
tableParams?: {
diff --git a/frontend/src/lib/getMinMax.ts b/frontend/src/lib/getMinMax.ts
index b10ac7a982..c52436063d 100644
--- a/frontend/src/lib/getMinMax.ts
+++ b/frontend/src/lib/getMinMax.ts
@@ -1,10 +1,11 @@
import { Time } from 'container/TopNav/DateTimeSelection/config';
+import { Time as TimeV2 } from 'container/TopNav/DateTimeSelectionV2/config';
import { GlobalReducer } from 'types/reducer/globalTime';
import getMinAgo from './getStartAndEndTime/getMinAgo';
const GetMinMax = (
- interval: Time,
+ interval: Time | TimeV2,
dateTimeRange?: [number, number],
// eslint-disable-next-line sonarjs/cognitive-complexity
): GetMinMaxPayload => {
@@ -26,6 +27,9 @@ const GetMinMax = (
} else if (interval === '30min') {
const minTimeAgo = getMinAgo({ minutes: 30 }).getTime();
minTime = minTimeAgo;
+ } else if (interval === '45min') {
+ const minTimeAgo = getMinAgo({ minutes: 45 }).getTime();
+ minTime = minTimeAgo;
} else if (interval === '5min') {
const minTimeAgo = getMinAgo({ minutes: 5 }).getTime();
minTime = minTimeAgo;
@@ -37,11 +41,31 @@ const GetMinMax = (
// three day = one day * 3
const minTimeAgo = getMinAgo({ minutes: 24 * 60 * 3 }).getTime();
minTime = minTimeAgo;
+ } else if (interval === '4days') {
+ // four day = one day * 4
+ const minTimeAgo = getMinAgo({ minutes: 24 * 60 * 4 }).getTime();
+ minTime = minTimeAgo;
+ } else if (interval === '10days') {
+ // ten day = one day * 10
+ const minTimeAgo = getMinAgo({ minutes: 24 * 60 * 10 }).getTime();
+ minTime = minTimeAgo;
} else if (interval === '1week') {
// one week = one day * 7
const minTimeAgo = getMinAgo({ minutes: 24 * 60 * 7 }).getTime();
minTime = minTimeAgo;
- } else if (['4hr', '6hr'].includes(interval)) {
+ } else if (interval === '2weeks') {
+ // two week = one day * 14
+ const minTimeAgo = getMinAgo({ minutes: 24 * 60 * 14 }).getTime();
+ minTime = minTimeAgo;
+ } else if (interval === '6weeks') {
+ // six week = one day * 42
+ const minTimeAgo = getMinAgo({ minutes: 24 * 60 * 42 }).getTime();
+ minTime = minTimeAgo;
+ } else if (interval === '2months') {
+ // two months = one day * 60
+ const minTimeAgo = getMinAgo({ minutes: 24 * 60 * 60 }).getTime();
+ minTime = minTimeAgo;
+ } else if (['3hr', '4hr', '6hr', '12hr'].includes(interval)) {
const h = parseInt(interval.replace('hr', ''), 10);
const minTimeAgo = getMinAgo({ minutes: h * 60 }).getTime();
minTime = minTimeAgo;
diff --git a/frontend/src/lib/getStartEndRangeTime.ts b/frontend/src/lib/getStartEndRangeTime.ts
index 13a2d40031..7fd087fd54 100644
--- a/frontend/src/lib/getStartEndRangeTime.ts
+++ b/frontend/src/lib/getStartEndRangeTime.ts
@@ -1,6 +1,7 @@
import { PANEL_TYPES } from 'constants/queryBuilder';
import { timePreferenceType } from 'container/NewWidget/RightContainer/timeItems';
import { Time } from 'container/TopNav/DateTimeSelection/config';
+import { Time as TimeV2 } from 'container/TopNav/DateTimeSelectionV2/config';
import store from 'store';
import getMaxMinTime from './getMaxMinTime';
@@ -37,7 +38,7 @@ const getStartEndRangeTime = ({
interface GetStartEndRangeTimesProps {
type?: timePreferenceType;
graphType?: PANEL_TYPES | null;
- interval?: Time;
+ interval?: Time | TimeV2;
}
interface GetStartEndRangeTimesPayload {
diff --git a/frontend/src/lib/query/createTableColumnsFromQuery.ts b/frontend/src/lib/query/createTableColumnsFromQuery.ts
index 3174c35125..d62e0a763f 100644
--- a/frontend/src/lib/query/createTableColumnsFromQuery.ts
+++ b/frontend/src/lib/query/createTableColumnsFromQuery.ts
@@ -7,6 +7,7 @@ import {
import { FORMULA_REGEXP } from 'constants/regExp';
import { QUERY_TABLE_CONFIG } from 'container/QueryTable/config';
import { QueryTableProps } from 'container/QueryTable/QueryTable.intefaces';
+import { isObject } from 'lodash-es';
import { ReactNode } from 'react';
import {
IBuilderFormula,
@@ -385,7 +386,11 @@ const fillDataFromList = (
Object.keys(listItem.data).forEach((label) => {
if (column.dataIndex === label) {
if (listItem.data[label as ListItemKey] !== '') {
- column.data.push(listItem.data[label as ListItemKey].toString());
+ if (isObject(listItem.data[label as ListItemKey])) {
+ column.data.push(JSON.stringify(listItem.data[label as ListItemKey]));
+ } else {
+ column.data.push(listItem.data[label as ListItemKey].toString());
+ }
} else {
column.data.push('N/A');
}
diff --git a/frontend/src/pages/LogsExplorer/index.tsx b/frontend/src/pages/LogsExplorer/index.tsx
index d18eee199b..8b91b955ea 100644
--- a/frontend/src/pages/LogsExplorer/index.tsx
+++ b/frontend/src/pages/LogsExplorer/index.tsx
@@ -2,26 +2,102 @@ import { Col, Row } from 'antd';
import ExplorerCard from 'components/ExplorerCard/ExplorerCard';
import LogExplorerQuerySection from 'container/LogExplorerQuerySection';
import LogsExplorerViews from 'container/LogsExplorerViews';
-import LogsTopNav from 'container/LogsTopNav';
+// import LogsTopNav from 'container/LogsTopNav';
+import LeftToolbarActions from 'container/QueryBuilder/components/ToolbarActions/LeftToolbarActions';
+import RightToolbarActions from 'container/QueryBuilder/components/ToolbarActions/RightToolbarActions';
+import Toolbar from 'container/Toolbar/Toolbar';
+import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import ErrorBoundaryFallback from 'pages/ErrorBoundaryFallback/ErrorBoundaryFallback';
+import { useEffect, useMemo, useState } from 'react';
import { ErrorBoundary } from 'react-error-boundary';
import { DataSource } from 'types/common/queryBuilder';
import { WrapperStyled } from './styles';
+import { SELECTED_VIEWS } from './utils';
function LogsExplorer(): JSX.Element {
+ const [showHistogram, setShowHistogram] = useState(true);
+ const [selectedView, setSelectedView] = useState<SELECTED_VIEWS>(
+ SELECTED_VIEWS.SEARCH,
+ );
+
+ const { handleRunQuery, currentQuery } = useQueryBuilder();
+
+ const handleToggleShowHistogram = (): void => {
+ setShowHistogram(!showHistogram);
+ };
+
+ const handleChangeSelectedView = (view: SELECTED_VIEWS): void => {
+ setSelectedView(view);
+ };
+
+ // Switch to query builder view if there are more than 1 queries
+ useEffect(() => {
+ if (currentQuery.builder.queryData.length > 1) {
+ handleChangeSelectedView(SELECTED_VIEWS.QUERY_BUILDER);
+ }
+ }, [currentQuery.builder.queryData.length]);
+
+ const isMultipleQueries = useMemo(
+ () =>
+ currentQuery.builder.queryData.length > 1 ||
+ currentQuery.builder.queryFormulas.length > 0,
+ [currentQuery],
+ );
+
+ const toolbarViews = useMemo(
+ () => ({
+ search: {
+ name: 'search',
+ label: 'Search',
+ disabled: isMultipleQueries,
+ show: true,
+ },
+ queryBuilder: {
+ name: 'query-builder',
+ label: 'Query Builder',
+ disabled: false,
+ show: true,
+ },
+ clickhouse: {
+ name: 'clickhouse',
+ label: 'Clickhouse',
+ disabled: false,
+ show: false,
+ },
+ }),
+ [isMultipleQueries],
+ );
+
return (
<ErrorBoundary FallbackComponent={ErrorBoundaryFallback}>
- <LogsTopNav />
+ <Toolbar
+ showAutoRefresh={false}
+ leftActions={
+ <LeftToolbarActions
+ items={toolbarViews}
+ selectedView={selectedView}
+ onChangeSelectedView={handleChangeSelectedView}
+ onToggleHistrogramVisibility={handleToggleShowHistogram}
+ showHistogram={showHistogram}
+ />
+ }
+ rightActions={<RightToolbarActions onStageRunQuery={handleRunQuery} />}
+ showOldCTA
+ />
+
<WrapperStyled>
- <Row gutter={[0, 16]}>
+ <Row gutter={[0, 0]}>
<Col xs={24}>
<ExplorerCard sourcepage={DataSource.LOGS}>
- <LogExplorerQuerySection />
+ <LogExplorerQuerySection selectedView={selectedView} />
</ExplorerCard>
</Col>
<Col xs={24}>
- <LogsExplorerViews />
+ <LogsExplorerViews
+ selectedView={selectedView}
+ showHistogram={showHistogram}
+ />
</Col>
</Row>
</WrapperStyled>
diff --git a/frontend/src/pages/LogsExplorer/utils.ts b/frontend/src/pages/LogsExplorer/utils.ts
index 13e8a29a4f..485aa22eef 100644
--- a/frontend/src/pages/LogsExplorer/utils.ts
+++ b/frontend/src/pages/LogsExplorer/utils.ts
@@ -10,3 +10,10 @@ export const prepareQueryWithDefaultTimestamp = (query: Query): Query => ({
})),
},
});
+
+// eslint-disable-next-line @typescript-eslint/naming-convention
+export enum SELECTED_VIEWS {
+ SEARCH = 'search',
+ QUERY_BUILDER = 'query-builder',
+ CLICKHOUSE = 'clickhouse',
+}
diff --git a/frontend/src/pages/LogsModulePage/LogsModulePage.styles.scss b/frontend/src/pages/LogsModulePage/LogsModulePage.styles.scss
new file mode 100644
index 0000000000..7dbb248f32
--- /dev/null
+++ b/frontend/src/pages/LogsModulePage/LogsModulePage.styles.scss
@@ -0,0 +1,23 @@
+.logs-module-container {
+ // margin: 0 -1rem; // as we have added a margin of 0 1rem components container, have to adjust the margin with negative to style the logs explorer as we want
+
+ // .ant-tabs-content-holder {
+ // margin: 0 -1rem;
+ // }
+
+ .ant-tabs-nav {
+ padding: 0 16px;
+ margin-bottom: 0px;
+
+ &::before {
+ border-bottom: 1px solid var(--bg-slate-400) !important;
+ }
+ }
+
+ .tab-item {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: 8px;
+ }
+}
diff --git a/frontend/src/pages/LogsModulePage/LogsModulePage.tsx b/frontend/src/pages/LogsModulePage/LogsModulePage.tsx
index ecd8d2dcfc..6802d436cf 100644
--- a/frontend/src/pages/LogsModulePage/LogsModulePage.tsx
+++ b/frontend/src/pages/LogsModulePage/LogsModulePage.tsx
@@ -1,28 +1,20 @@
+import './LogsModulePage.styles.scss';
+
import RouteTab from 'components/RouteTab';
-import ROUTES from 'constants/routes';
+import { TabRoutes } from 'components/RouteTab/types';
import history from 'lib/history';
-import LogsExplorer from 'pages/LogsExplorer';
-import Pipelines from 'pages/Pipelines';
import { useLocation } from 'react-use';
-export const logsExplorer = {
- Component: LogsExplorer,
- name: 'Explorer',
- route: ROUTES.LOGS,
- key: ROUTES.LOGS,
-};
-
-export const logsPipelines = {
- Component: Pipelines,
- name: 'Pipelines',
- route: ROUTES.LOGS_PIPELINES,
- key: ROUTES.LOGS_PIPELINES,
-};
+import { logSaveView, logsExplorer, logsPipelines } from './constants';
export default function LogsModulePage(): JSX.Element {
const { pathname } = useLocation();
- const routes = [logsExplorer, logsPipelines];
+ const routes: TabRoutes[] = [logsExplorer, logsPipelines, logSaveView];
- return <RouteTab routes={routes} activeKey={pathname} history={history} />;
+ return (
+ <div className="logs-module-container">
+ <RouteTab routes={routes} activeKey={pathname} history={history} />
+ </div>
+ );
}
diff --git a/frontend/src/pages/LogsModulePage/constants.tsx b/frontend/src/pages/LogsModulePage/constants.tsx
new file mode 100644
index 0000000000..1dbf667fd4
--- /dev/null
+++ b/frontend/src/pages/LogsModulePage/constants.tsx
@@ -0,0 +1,39 @@
+import { TabRoutes } from 'components/RouteTab/types';
+import ROUTES from 'constants/routes';
+import { Compass, TowerControl, Workflow } from 'lucide-react';
+import LogsExplorer from 'pages/LogsExplorer';
+import Pipelines from 'pages/Pipelines';
+import SaveView from 'pages/SaveView';
+
+export const logsExplorer: TabRoutes = {
+ Component: LogsExplorer,
+ name: (
+ <div className="tab-item">
+ <Compass size={16} /> Explorer
+ </div>
+ ),
+ route: ROUTES.LOGS,
+ key: ROUTES.LOGS,
+};
+
+export const logsPipelines: TabRoutes = {
+ Component: Pipelines,
+ name: (
+ <div className="tab-item">
+ <Workflow size={16} /> Pipelines
+ </div>
+ ),
+ route: ROUTES.LOGS_PIPELINES,
+ key: ROUTES.LOGS_PIPELINES,
+};
+
+export const logSaveView: TabRoutes = {
+ Component: SaveView,
+ name: (
+ <div className="tab-item">
+ <TowerControl size={16} /> Views
+ </div>
+ ),
+ route: ROUTES.LOGS_SAVE_VIEWS,
+ key: ROUTES.LOGS_SAVE_VIEWS,
+};
diff --git a/frontend/src/pages/LogsModulePage/utils.ts b/frontend/src/pages/LogsModulePage/utils.ts
new file mode 100644
index 0000000000..222c1c9ef6
--- /dev/null
+++ b/frontend/src/pages/LogsModulePage/utils.ts
@@ -0,0 +1,7 @@
+export const removeSourcePageFromPath = (path: string): string => {
+ const lastSlashIndex = path.lastIndexOf('/');
+ if (lastSlashIndex !== -1) {
+ return path.substring(0, lastSlashIndex);
+ }
+ return path;
+};
diff --git a/frontend/src/pages/Pipelines/Pipelines.styles.scss b/frontend/src/pages/Pipelines/Pipelines.styles.scss
new file mode 100644
index 0000000000..8521aab75e
--- /dev/null
+++ b/frontend/src/pages/Pipelines/Pipelines.styles.scss
@@ -0,0 +1,5 @@
+.pipeline-tabs {
+ .ant-tabs-content {
+ padding: 0 16px;
+ }
+}
diff --git a/frontend/src/pages/Pipelines/index.tsx b/frontend/src/pages/Pipelines/index.tsx
index d646390dda..81b3b503f9 100644
--- a/frontend/src/pages/Pipelines/index.tsx
+++ b/frontend/src/pages/Pipelines/index.tsx
@@ -1,3 +1,5 @@
+import './Pipelines.styles.scss';
+
import type { TabsProps } from 'antd';
import { Tabs } from 'antd';
import getPipeline from 'api/pipeline/get';
@@ -81,7 +83,11 @@ function Pipelines(): JSX.Element {
return (
<ErrorBoundary FallbackComponent={ErrorBoundaryFallback}>
- <Tabs defaultActiveKey="pipelines" items={tabItems} />
+ <Tabs
+ className="pipeline-tabs"
+ defaultActiveKey="pipelines"
+ items={tabItems}
+ />
</ErrorBoundary>
);
}
diff --git a/frontend/src/pages/SaveView/SaveView.styles.scss b/frontend/src/pages/SaveView/SaveView.styles.scss
new file mode 100644
index 0000000000..461914c1d0
--- /dev/null
+++ b/frontend/src/pages/SaveView/SaveView.styles.scss
@@ -0,0 +1,349 @@
+.save-view-container {
+ margin-top: 70px;
+ display: flex;
+ justify-content: center;
+ width: 100%;
+
+ .save-view-content {
+ width: calc(100% - 30px);
+ max-width: 736px;
+
+
+ .title {
+ color: var(--bg-vanilla-100);
+ font-size: var(--font-size-lg);
+ font-style: normal;
+ font-weight: var(--font-weight-normal);
+ line-height: 28px; /* 155.556% */
+ letter-spacing: -0.09px;
+ }
+
+ .subtitle {
+ color: var(---bg-vanilla-400);
+ font-size: var(--font-size-sm);
+ font-style: normal;
+ font-weight: var(--font-weight-normal);
+ line-height: 20px; /* 142.857% */
+ letter-spacing: -0.07px;
+ }
+
+ .ant-input-affix-wrapper {
+ margin-top: 16px;
+ margin-bottom: 8px;
+ }
+
+ .ant-table-row {
+ .ant-table-cell {
+ padding: 0;
+ border: none;
+ background: var(--bg-ink-500);
+
+ }
+ .column-render {
+ margin: 8px 0 !important;
+ padding: 16px;
+ border-radius: 6px;
+ border: 1px solid var(--bg-slate-500);
+ background: var(--bg-ink-400);
+
+ .title-with-action {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+ .save-view-title {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ .dot {
+ min-height: 6px;
+ min-width: 6px;
+ border-radius: 50%;
+ }
+ .ant-typography {
+ color: var(--bg-vanilla-400);
+ font-size: var(--font-size-sm);
+ font-style: normal;
+ font-weight: var(--font-weight-medium);
+ line-height: 20px;
+ letter-spacing: -0.07px;
+ }
+ }
+
+ .action-btn {
+ display: flex;
+ align-items: center;
+ gap: 20px;
+ cursor: pointer;
+ }
+
+ }
+ .view-details {
+ margin-top: 8px;
+ display: flex;
+ align-items: center;
+
+ .view-tag {
+ width: 14px;
+ height: 14px;
+ border-radius: 50px;
+ background: var(--bg-slate-300);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ .tag-text {
+ color: var(--bg-vanilla-400);
+ leading-trim: both;
+ text-edge: cap;
+ font-size: 10px;
+ font-style: normal;
+ font-weight: var(--font-weight-normal);
+ line-height: normal;
+ letter-spacing: -0.05px;
+ }
+ }
+
+ .view-created-by {
+ margin-left: 8px;
+ }
+
+ .view-created-at {
+ margin-left: 24px;
+ display: flex;
+ align-items: center;
+ .ant-typography {
+ margin-left: 6px;
+ color: var(--bg-vanilla-400);
+ font-size: var(--font-size-sm);
+ font-style: normal;
+ font-weight: var(--font-weight-normal);
+ line-height: 18px; /* 128.571% */
+ letter-spacing: -0.07px;
+ }
+ }
+ }
+ }
+ }
+
+ .ant-pagination-item {
+
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ > a {
+ color: var(--bg-vanilla-400);
+ font-variant-numeric: lining-nums tabular-nums slashed-zero;
+ font-feature-settings: 'dlig' on, 'salt' on, 'case' on, 'cpsp' on;
+ font-size: var(--font-size-sm);
+ font-style: normal;
+ font-weight: var(--font-weight-normal);
+ line-height: 20px; /* 142.857% */
+ }
+
+ }
+
+ .ant-pagination-item-active {
+ background-color: var(--bg-robin-500);
+ > a {
+ color: var(--bg-ink-500) !important;
+ font-size: var(--font-size-sm);
+ font-style: normal;
+ font-weight: var(--font-weight-medium);
+ line-height: 20px;
+ }
+ }
+ }
+}
+
+.delete-view-modal {
+ width: calc(100% - 30px) !important; /* Adjust the 20px as needed */
+ max-width: 384px;
+ .ant-modal-content {
+ padding: 0;
+ border-radius: 4px;
+ border: 1px solid var(--bg-slate-500);
+ background: var(--bg-ink-400);
+ box-shadow: 0px -4px 16px 2px rgba(0, 0, 0, 0.20);
+
+ .ant-modal-header {
+ padding: 16px;
+ background: var(--bg-ink-400);
+ }
+
+ .ant-modal-body {
+ padding: 0px 16px 28px 16px;
+
+ .ant-typography {
+ color: var(--bg-vanilla-400);
+ font-size: var(--font-size-sm);
+ font-style: normal;
+ font-weight: var(--font-weight-normal);
+ line-height: 20px;
+ letter-spacing: -0.07px;
+ }
+
+ .save-view-input {
+ margin-top: 8px;
+ display: flex;
+ gap: 8px;
+ }
+
+ .ant-color-picker-trigger {
+ padding: 6px;
+ border-radius: 2px;
+ border: 1px solid var(--bg-slate-400);
+ background: var(--bg-ink-300);
+ width: 32px;
+ height: 32px;
+
+ .ant-color-picker-color-block {
+ border-radius: 50px;
+ width: 16px;
+ height: 16px;
+ flex-shrink: 0;
+
+ .ant-color-picker-color-block-inner {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+ }
+ }
+
+ }
+
+ .ant-modal-footer {
+ display: flex;
+ justify-content: flex-end;
+ padding: 16px 16px;
+ margin: 0;
+
+ .cancel-btn {
+ display: flex;
+ align-items: center;
+ border: none;
+ border-radius: 2px;
+ background: var(--bg-slate-500);
+ }
+
+ .delete-btn {
+ display: flex;
+ align-items: center;
+ border: none;
+ border-radius: 2px;
+ background: var(--bg-cherry-500);
+ margin-left: 12px;
+ }
+
+ .delete-btn:hover {
+ color: var(--bg-vanilla-100);
+ background: var(--bg-cherry-600);
+ }
+ }
+ }
+ .title {
+ color: var(--bg-vanilla-100);
+ font-size: var(--font-size-sm);
+ font-style: normal;
+ font-weight: var(--font-weight-medium);
+ line-height: 20px; /* 142.857% */
+ }
+}
+
+.lightMode {
+ .save-view-container {
+ .save-view-content {
+
+ .title {
+ color: var(--bg-ink-500);
+ }
+
+ .ant-table-row {
+ .ant-table-cell {
+ background: var(--bg-vanilla-200);
+ }
+
+ &:hover {
+ .ant-table-cell {
+ background: var(--bg-vanilla-200) !important;
+ }
+ }
+
+ .column-render {
+ border: 1px solid var(--bg-vanilla-200);
+ background: var(--bg-vanilla-100);
+
+ .title-with-action {
+ .save-view-title {
+ .ant-typography {
+ color: var(--bg-ink-500);
+ }
+ }
+
+ .action-btn {
+ .ant-typography {
+ color: var(--bg-ink-500);
+ }
+ }
+ }
+
+ .view-details {
+ .view-tag {
+ background: var(--bg-vanilla-200);
+ .tag-text {
+ color: var(--bg-ink-500);
+ }
+ }
+
+ .view-created-by {
+ color: var(--bg-ink-500);
+ }
+
+ .view-created-at {
+ .ant-typography {
+ color: var(--bg-ink-500);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ .delete-view-modal {
+ .ant-modal-content {
+ border: 1px solid var(--bg-vanilla-200);
+ background: var(--bg-vanilla-100);
+
+ .ant-modal-header {
+ background: var(--bg-vanilla-100);
+
+ .title {
+ color: var(--bg-ink-500);
+ }
+ }
+
+ .ant-modal-body {
+ .ant-typography {
+ color: var(--bg-ink-500);
+ }
+
+ .save-view-input {
+ .ant-input {
+ background: var(--bg-vanilla-200);
+ color: var(--bg-ink-500);
+ }
+ }
+ }
+
+ .ant-modal-footer {
+ .cancel-btn {
+ background: var(--bg-vanilla-300);
+ color: var(--bg-ink-400);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/frontend/src/pages/SaveView/constants.ts b/frontend/src/pages/SaveView/constants.ts
new file mode 100644
index 0000000000..a6d55b1cb9
--- /dev/null
+++ b/frontend/src/pages/SaveView/constants.ts
@@ -0,0 +1,15 @@
+import ROUTES from 'constants/routes';
+
+export const SOURCEPAGE_VS_ROUTES: {
+ [key: string]: Partial<typeof ROUTES[keyof typeof ROUTES]>;
+} = {
+ logs: ROUTES.LOGS_EXPLORER,
+ traces: ROUTES.TRACES_EXPLORER,
+} as const;
+
+export const ROUTES_VS_SOURCEPAGE: {
+ [key: string]: string;
+} = {
+ [ROUTES.LOGS_SAVE_VIEWS]: 'logs',
+ [ROUTES.TRACES_SAVE_VIEWS]: 'traces',
+} as const;
diff --git a/frontend/src/pages/SaveView/index.tsx b/frontend/src/pages/SaveView/index.tsx
new file mode 100644
index 0000000000..afdf05686b
--- /dev/null
+++ b/frontend/src/pages/SaveView/index.tsx
@@ -0,0 +1,357 @@
+import './SaveView.styles.scss';
+
+import { Color } from '@signozhq/design-tokens';
+import {
+ Button,
+ ColorPicker,
+ Input,
+ Modal,
+ Table,
+ TableProps,
+ Typography,
+} from 'antd';
+import {
+ getViewDetailsUsingViewKey,
+ showErrorNotification,
+} from 'components/ExplorerCard/utils';
+import { getRandomColor } from 'container/ExplorerOptions/utils';
+import { useDeleteView } from 'hooks/saveViews/useDeleteView';
+import { useGetAllViews } from 'hooks/saveViews/useGetAllViews';
+import { useUpdateView } from 'hooks/saveViews/useUpdateView';
+import useErrorNotification from 'hooks/useErrorNotification';
+import { useHandleExplorerTabChange } from 'hooks/useHandleExplorerTabChange';
+import { useNotifications } from 'hooks/useNotifications';
+import {
+ CalendarClock,
+ Check,
+ Compass,
+ PenLine,
+ Search,
+ Trash2,
+ X,
+} from 'lucide-react';
+import { ChangeEvent, useEffect, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import { useLocation } from 'react-router-dom';
+import { ICompositeMetricQuery } from 'types/api/alerts/compositeQuery';
+import { ViewProps } from 'types/api/saveViews/types';
+import { DataSource } from 'types/common/queryBuilder';
+
+import { ROUTES_VS_SOURCEPAGE, SOURCEPAGE_VS_ROUTES } from './constants';
+import { deleteViewHandler } from './utils';
+
+function SaveView(): JSX.Element {
+ const { pathname } = useLocation();
+ const sourcepage = ROUTES_VS_SOURCEPAGE[pathname];
+ const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
+ const [activeViewKey, setActiveViewKey] = useState<string>('');
+ const [newViewName, setNewViewName] = useState<string>('');
+ const [color, setColor] = useState(Color.BG_SIENNA_500);
+ const [isEditModalOpen, setIsEditModalOpen] = useState(false);
+ const [activeViewName, setActiveViewName] = useState<string>('');
+ const [
+ activeCompositeQuery,
+ setActiveCompositeQuery,
+ ] = useState<ICompositeMetricQuery | null>(null);
+ const [searchValue, setSearchValue] = useState<string>('');
+ const [dataSource, setDataSource] = useState<ViewProps[]>([]);
+ const { t } = useTranslation(['explorer']);
+
+ const hideDeleteViewModal = (): void => {
+ setIsDeleteModalOpen(false);
+ };
+
+ const handleDeleteModelOpen = (uuid: string, name: string): void => {
+ setActiveViewKey(uuid);
+ setActiveViewName(name);
+ setIsDeleteModalOpen(true);
+ };
+
+ const hideEditViewModal = (): void => {
+ setIsEditModalOpen(false);
+ };
+
+ const handleEditModelOpen = (view: ViewProps, color: string): void => {
+ setActiveViewKey(view.uuid);
+ setColor(color);
+ setActiveViewName(view.name);
+ setNewViewName(view.name);
+ setActiveCompositeQuery(view.compositeQuery);
+ setIsEditModalOpen(true);
+ };
+
+ const { notifications } = useNotifications();
+
+ const {
+ data: viewsData,
+ isLoading,
+ error,
+ isRefetching,
+ refetch: refetchAllView,
+ } = useGetAllViews(sourcepage as DataSource);
+
+ useEffect(() => {
+ setDataSource(viewsData?.data.data || []);
+ }, [viewsData?.data.data]);
+
+ useErrorNotification(error);
+
+ const handleSearch = (e: ChangeEvent<HTMLInputElement>): void => {
+ setSearchValue(e.target.value);
+ const filteredData = viewsData?.data.data.filter((view) =>
+ view.name.toLowerCase().includes(e.target.value.toLowerCase()),
+ );
+ setDataSource(filteredData || []);
+ };
+
+ const clearSearch = (): void => {
+ setSearchValue('');
+ };
+
+ const {
+ mutateAsync: deleteViewAsync,
+ isLoading: isDeleteLoading,
+ } = useDeleteView(activeViewKey);
+
+ const onDeleteHandler = (): void => {
+ deleteViewHandler({
+ deleteViewAsync,
+ notifications,
+ refetchAllView,
+ viewId: activeViewKey,
+ hideDeleteViewModal,
+ clearSearch,
+ });
+ };
+
+ const {
+ mutateAsync: updateViewAsync,
+ isLoading: isViewUpdating,
+ } = useUpdateView({
+ compositeQuery: activeCompositeQuery || ({} as ICompositeMetricQuery),
+ viewKey: activeViewKey,
+ extraData: JSON.stringify({ color }),
+ sourcePage: sourcepage || DataSource.LOGS,
+ viewName: newViewName,
+ });
+
+ const onUpdateQueryHandler = (): void => {
+ updateViewAsync(
+ {
+ compositeQuery: activeCompositeQuery || ({} as ICompositeMetricQuery),
+ viewKey: activeViewKey,
+ extraData: JSON.stringify({ color }),
+ sourcePage: sourcepage,
+ viewName: activeViewName,
+ },
+ {
+ onSuccess: () => {
+ notifications.success({
+ message: 'View Updated Successfully',
+ });
+ hideEditViewModal();
+ refetchAllView();
+ },
+ onError: (err) => {
+ showErrorNotification(notifications, err);
+ },
+ },
+ );
+ };
+
+ const { handleExplorerTabChange } = useHandleExplorerTabChange();
+
+ const handleRedirectQuery = (view: ViewProps): void => {
+ const currentViewDetails = getViewDetailsUsingViewKey(
+ view.uuid,
+ viewsData?.data.data,
+ );
+ if (!currentViewDetails) return;
+ const { query, name, uuid, panelType: currentPanelType } = currentViewDetails;
+
+ if (sourcepage) {
+ handleExplorerTabChange(
+ currentPanelType,
+ {
+ query,
+ name,
+ uuid,
+ },
+ SOURCEPAGE_VS_ROUTES[sourcepage],
+ );
+ }
+ };
+
+ const columns: TableProps<ViewProps>['columns'] = [
+ {
+ title: 'Save View',
+ key: 'view',
+ render: (view: ViewProps): JSX.Element => {
+ const extraData = view.extraData !== '' ? JSON.parse(view.extraData) : '';
+ let bgColor = getRandomColor();
+ if (extraData !== '') {
+ bgColor = extraData.color;
+ }
+
+ const timeOptions: Intl.DateTimeFormatOptions = {
+ hour: '2-digit',
+ minute: '2-digit',
+ second: '2-digit',
+ hour12: false,
+ };
+ const formattedTime = new Date(view.createdAt).toLocaleTimeString(
+ 'en-US',
+ timeOptions,
+ );
+
+ const dateOptions: Intl.DateTimeFormatOptions = {
+ month: 'short',
+ day: 'numeric',
+ year: 'numeric',
+ };
+
+ const formattedDate = new Date(view.createdAt).toLocaleDateString(
+ 'en-US',
+ dateOptions,
+ );
+
+ // Combine time and date
+ const formattedDateAndTime = `${formattedTime} ⎯ ${formattedDate}`;
+ return (
+ <div className="column-render">
+ <div className="title-with-action">
+ <div className="save-view-title">
+ <span
+ className="dot"
+ style={{
+ background: bgColor,
+ boxShadow: `0px 0px 6px 0px ${bgColor}`,
+ }}
+ />{' '}
+ <Typography.Text>{view.name}</Typography.Text>
+ </div>
+
+ <div className="action-btn">
+ <PenLine
+ size={14}
+ onClick={(): void => handleEditModelOpen(view, bgColor)}
+ />
+ <Compass size={14} onClick={(): void => handleRedirectQuery(view)} />
+ <Trash2
+ size={14}
+ color={Color.BG_CHERRY_500}
+ onClick={(): void => handleDeleteModelOpen(view.uuid, view.name)}
+ />
+ </div>
+ </div>
+ <div className="view-details">
+ <div className="view-tag">
+ <Typography.Text className="tag-text">
+ {view.createdBy.substring(0, 1).toUpperCase()}
+ </Typography.Text>
+ </div>
+ <Typography.Text className="view-created-by">
+ {view.createdBy}
+ </Typography.Text>
+ <div className="view-created-at">
+ <CalendarClock size={14} />
+ <Typography.Text>{formattedDateAndTime}</Typography.Text>
+ </div>
+ </div>
+ </div>
+ );
+ },
+ },
+ ];
+
+ return (
+ <div className="save-view-container">
+ <div className="save-view-content">
+ <Typography.Title className="title">Views</Typography.Title>
+ <Typography.Text className="subtitle">
+ Manage your saved views for logs.
+ </Typography.Text>
+ <Input
+ placeholder="Search for views..."
+ prefix={<Search size={12} color={Color.BG_VANILLA_400} />}
+ value={searchValue}
+ onChange={handleSearch}
+ />
+
+ <Table
+ columns={columns}
+ dataSource={dataSource}
+ loading={isLoading || isRefetching}
+ showHeader={false}
+ pagination={{ pageSize: 5 }}
+ />
+ </div>
+
+ <Modal
+ className="delete-view-modal"
+ title={<span className="title">Delete view</span>}
+ open={isDeleteModalOpen}
+ closable={false}
+ onCancel={hideDeleteViewModal}
+ footer={[
+ <Button
+ key="cancel"
+ onClick={hideDeleteViewModal}
+ className="cancel-btn"
+ icon={<X size={16} />}
+ >
+ Cancel
+ </Button>,
+ <Button
+ key="submit"
+ icon={<Trash2 size={16} />}
+ onClick={onDeleteHandler}
+ className="delete-btn"
+ disabled={isDeleteLoading}
+ >
+ Delete view
+ </Button>,
+ ]}
+ >
+ <Typography.Text className="delete-text">
+ {t('delete_confirm_message', {
+ viewName: activeViewName,
+ })}
+ </Typography.Text>
+ </Modal>
+
+ <Modal
+ className="save-view-modal"
+ title={<span className="title">Edit view details</span>}
+ open={isEditModalOpen}
+ closable={false}
+ onCancel={hideEditViewModal}
+ footer={[
+ <Button
+ key="submit"
+ icon={<Check size={16} color={Color.BG_VANILLA_100} />}
+ onClick={onUpdateQueryHandler}
+ disabled={isViewUpdating}
+ >
+ Save changes
+ </Button>,
+ ]}
+ >
+ <Typography.Text>Label</Typography.Text>
+ <div className="save-view-input">
+ <ColorPicker
+ value={color}
+ onChange={(value, hex): void => setColor(hex)}
+ />
+ <Input
+ placeholder="e.g. Crash landing view"
+ value={newViewName}
+ onChange={(e): void => setNewViewName(e.target.value)}
+ />
+ </div>
+ </Modal>
+ </div>
+ );
+}
+
+export default SaveView;
diff --git a/frontend/src/pages/SaveView/utils.ts b/frontend/src/pages/SaveView/utils.ts
new file mode 100644
index 0000000000..fff54a6ceb
--- /dev/null
+++ b/frontend/src/pages/SaveView/utils.ts
@@ -0,0 +1,37 @@
+import { NotificationInstance } from 'antd/es/notification/interface';
+import { MenuItemLabelGeneratorProps } from 'components/ExplorerCard/types';
+import { showErrorNotification } from 'components/ExplorerCard/utils';
+import { UseMutateAsyncFunction } from 'react-query';
+import { DeleteViewPayloadProps } from 'types/api/saveViews/types';
+
+type DeleteViewProps = {
+ deleteViewAsync: UseMutateAsyncFunction<DeleteViewPayloadProps, Error, string>;
+ refetchAllView: MenuItemLabelGeneratorProps['refetchAllView'];
+ notifications: NotificationInstance;
+ viewId: string;
+ hideDeleteViewModal: () => void;
+ clearSearch: () => void;
+};
+
+export const deleteViewHandler = ({
+ deleteViewAsync,
+ refetchAllView,
+ notifications,
+ viewId,
+ hideDeleteViewModal,
+ clearSearch,
+}: DeleteViewProps): void => {
+ deleteViewAsync(viewId, {
+ onSuccess: () => {
+ hideDeleteViewModal();
+ clearSearch();
+ notifications.success({
+ message: 'View Deleted Successfully',
+ });
+ refetchAllView();
+ },
+ onError: (err) => {
+ showErrorNotification(notifications, err);
+ },
+ });
+};
diff --git a/frontend/src/pages/TracesExplorer/TracesExplorer.styles.scss b/frontend/src/pages/TracesExplorer/TracesExplorer.styles.scss
new file mode 100644
index 0000000000..ae985deb74
--- /dev/null
+++ b/frontend/src/pages/TracesExplorer/TracesExplorer.styles.scss
@@ -0,0 +1,7 @@
+.trace-explorer-run-query {
+ display: flex;
+ flex-direction: row-reverse;
+ align-items: center;
+ margin: 1rem 0 0.5rem 0;
+ gap: 8px;
+}
diff --git a/frontend/src/pages/TracesExplorer/index.tsx b/frontend/src/pages/TracesExplorer/index.tsx
index 3fbdca1a83..22d4b71d2e 100644
--- a/frontend/src/pages/TracesExplorer/index.tsx
+++ b/frontend/src/pages/TracesExplorer/index.tsx
@@ -1,9 +1,14 @@
+import './TracesExplorer.styles.scss';
+
import { Tabs } from 'antd';
import axios from 'axios';
import ExplorerCard from 'components/ExplorerCard/ExplorerCard';
import { AVAILABLE_EXPORT_PANEL_TYPES } from 'constants/panelTypes';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
+import ExplorerOptions from 'container/ExplorerOptions/ExplorerOptions';
import ExportPanel from 'container/ExportPanel';
+import RightToolbarActions from 'container/QueryBuilder/components/ToolbarActions/RightToolbarActions';
+import DateTimeSelector from 'container/TopNav/DateTimeSelectionV2';
import QuerySection from 'container/TracesExplorer/QuerySection';
import { useUpdateDashboard } from 'hooks/dashboard/useUpdateDashboard';
import { addEmptyWidgetInDashboardJSONWithQuery } from 'hooks/dashboard/utils';
@@ -31,6 +36,8 @@ function TracesExplorer(): JSX.Element {
currentQuery,
panelType,
updateAllQueriesOperators,
+ handleRunQuery,
+ stagedQuery,
} = useQueryBuilder();
const currentPanelType = useGetPanelTypesQueryParam();
@@ -177,6 +184,10 @@ function TracesExplorer(): JSX.Element {
return (
<ErrorBoundary FallbackComponent={ErrorBoundaryFallback}>
<>
+ <div className="trace-explorer-run-query">
+ <RightToolbarActions onStageRunQuery={handleRunQuery} />
+ <DateTimeSelector showAutoRefresh />
+ </div>
<ExplorerCard sourcepage={DataSource.TRACES}>
<QuerySection />
</ExplorerCard>
@@ -197,6 +208,13 @@ function TracesExplorer(): JSX.Element {
onChange={handleExplorerTabChange}
/>
</Container>
+ <ExplorerOptions
+ disabled={!stagedQuery}
+ query={exportDefaultQuery}
+ isLoading={isLoading}
+ onExport={handleExport}
+ sourcepage={DataSource.TRACES}
+ />
</>
</ErrorBoundary>
);
diff --git a/frontend/src/pages/TracesModulePage/TracesModulePage.styles.scss b/frontend/src/pages/TracesModulePage/TracesModulePage.styles.scss
new file mode 100644
index 0000000000..1808fabecd
--- /dev/null
+++ b/frontend/src/pages/TracesModulePage/TracesModulePage.styles.scss
@@ -0,0 +1,17 @@
+.traces-module-container {
+ .ant-tabs-nav {
+ padding: 0 16px;
+ margin-bottom: 0px;
+
+ &::before {
+ border-bottom: none !important;
+ }
+ }
+
+ .tab-item {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: 8px;
+ }
+}
diff --git a/frontend/src/pages/TracesModulePage/TracesModulePage.tsx b/frontend/src/pages/TracesModulePage/TracesModulePage.tsx
new file mode 100644
index 0000000000..f04b090311
--- /dev/null
+++ b/frontend/src/pages/TracesModulePage/TracesModulePage.tsx
@@ -0,0 +1,22 @@
+import './TracesModulePage.styles.scss';
+
+import RouteTab from 'components/RouteTab';
+import { TabRoutes } from 'components/RouteTab/types';
+import history from 'lib/history';
+import { useLocation } from 'react-router-dom';
+
+import { tracesExplorer, tracesSaveView } from './constants';
+
+function TracesModulePage(): JSX.Element {
+ const { pathname } = useLocation();
+
+ const routes: TabRoutes[] = [tracesExplorer, tracesSaveView];
+
+ return (
+ <div className="traces-module-container">
+ <RouteTab routes={routes} activeKey={pathname} history={history} />;
+ </div>
+ );
+}
+
+export default TracesModulePage;
diff --git a/frontend/src/pages/TracesModulePage/constants.tsx b/frontend/src/pages/TracesModulePage/constants.tsx
new file mode 100644
index 0000000000..24d2047d01
--- /dev/null
+++ b/frontend/src/pages/TracesModulePage/constants.tsx
@@ -0,0 +1,27 @@
+import { TabRoutes } from 'components/RouteTab/types';
+import ROUTES from 'constants/routes';
+import { Compass, TowerControl } from 'lucide-react';
+import SaveView from 'pages/SaveView';
+import TracesExplorer from 'pages/TracesExplorer';
+
+export const tracesExplorer: TabRoutes = {
+ Component: TracesExplorer,
+ name: (
+ <div className="tab-item">
+ <Compass size={16} /> Explorer
+ </div>
+ ),
+ route: ROUTES.TRACES_EXPLORER,
+ key: ROUTES.TRACES_EXPLORER,
+};
+
+export const tracesSaveView: TabRoutes = {
+ Component: SaveView,
+ name: (
+ <div className="tab-item">
+ <TowerControl size={16} /> Views
+ </div>
+ ),
+ route: ROUTES.TRACES_SAVE_VIEWS,
+ key: ROUTES.TRACES_SAVE_VIEWS,
+};
diff --git a/frontend/src/pages/TracesModulePage/index.tsx b/frontend/src/pages/TracesModulePage/index.tsx
new file mode 100644
index 0000000000..5b2064dd0a
--- /dev/null
+++ b/frontend/src/pages/TracesModulePage/index.tsx
@@ -0,0 +1,3 @@
+import TracesModulePage from './TracesModulePage';
+
+export default TracesModulePage;
diff --git a/frontend/src/periscope.scss b/frontend/src/periscope.scss
new file mode 100644
index 0000000000..026301e2f4
--- /dev/null
+++ b/frontend/src/periscope.scss
@@ -0,0 +1,35 @@
+.periscope-btn-group {
+ display: inline-flex;
+
+ .ant-btn {
+ border-radius: 0;
+ }
+}
+
+.periscope-btn {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ padding: 6px;
+
+ border: 1px solid var(--bg-slate-400, #1d212d);
+ background: var(--bg-ink-400, #121317);
+ box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
+ color: var(--bg-vanilla-400, #c0c1c3);
+
+ &.ghost {
+ box-shadow: none;
+ border: none;
+ }
+
+ cursor: pointer;
+}
+
+.lightMode {
+ .periscope-btn {
+ border-color: var(--bg-vanilla-300);
+ background: var(--bg-vanilla-100);
+ color: var(--bg-ink-200);
+ }
+}
diff --git a/frontend/src/providers/QueryBuilder.tsx b/frontend/src/providers/QueryBuilder.tsx
index bc0521fcbd..e7177a0536 100644
--- a/frontend/src/providers/QueryBuilder.tsx
+++ b/frontend/src/providers/QueryBuilder.tsx
@@ -15,6 +15,7 @@ import {
MAX_QUERIES,
PANEL_TYPES,
} from 'constants/queryBuilder';
+import ROUTES from 'constants/routes';
import { useGetCompositeQueryParam } from 'hooks/queryBuilder/useGetCompositeQueryParam';
import { updateStepInterval } from 'hooks/queryBuilder/useStepInterval';
import useUrlQuery from 'hooks/useUrlQuery';
@@ -22,6 +23,7 @@ import { createIdFromObjectFields } from 'lib/createIdFromObjectFields';
import { createNewBuilderItemName } from 'lib/newQueryBuilder/createNewBuilderItemName';
import { getOperatorsBySourceAndPanelType } from 'lib/newQueryBuilder/getOperatorsBySourceAndPanelType';
import { replaceIncorrectObjectFields } from 'lib/replaceIncorrectObjectFields';
+import { merge } from 'lodash-es';
import {
createContext,
PropsWithChildren,
@@ -195,7 +197,7 @@ export function QueryBuilderProvider({
);
const initQueryBuilderData = useCallback(
- (query: Query): void => {
+ (query: Query, timeUpdated?: boolean): void => {
const { queryType: newQueryType, ...queryState } = prepareQueryBuilderData(
query,
);
@@ -210,10 +212,12 @@ export function QueryBuilderProvider({
const nextQuery: Query = { ...newQueryState, queryType: type };
setStagedQuery(nextQuery);
- setCurrentQuery(newQueryState);
+ setCurrentQuery(
+ timeUpdated ? merge(currentQuery, newQueryState) : newQueryState,
+ );
setQueryType(type);
},
- [prepareQueryBuilderData],
+ [prepareQueryBuilderData, currentQuery],
);
const updateAllQueriesOperators = useCallback(
@@ -464,7 +468,11 @@ export function QueryBuilderProvider({
);
const redirectWithQueryBuilderData = useCallback(
- (query: Partial<Query>, searchParams?: Record<string, unknown>) => {
+ (
+ query: Partial<Query>,
+ searchParams?: Record<string, unknown>,
+ redirectingUrl?: typeof ROUTES[keyof typeof ROUTES],
+ ) => {
const queryType =
!query.queryType || !Object.values(EQueryType).includes(query.queryType)
? EQueryType.QUERY_BUILDER
@@ -519,7 +527,9 @@ export function QueryBuilderProvider({
);
}
- const generatedUrl = `${location.pathname}?${urlQuery}`;
+ const generatedUrl = redirectingUrl
+ ? `${redirectingUrl}?${urlQuery}`
+ : `${location.pathname}?${urlQuery}`;
history.replace(generatedUrl);
},
diff --git a/frontend/src/store/actions/global.ts b/frontend/src/store/actions/global.ts
index ab04490f94..19c3be2b7b 100644
--- a/frontend/src/store/actions/global.ts
+++ b/frontend/src/store/actions/global.ts
@@ -1,11 +1,12 @@
import { Time } from 'container/TopNav/DateTimeSelection/config';
+import { Time as TimeV2 } from 'container/TopNav/DateTimeSelectionV2/config';
import GetMinMax from 'lib/getMinMax';
import { Dispatch } from 'redux';
import AppActions from 'types/actions';
import { UPDATE_TIME_INTERVAL } from 'types/actions/globalTime';
export const UpdateTimeInterval = (
- interval: Time,
+ interval: Time | TimeV2,
dateTimeRange: [number, number] = [0, 0],
): ((dispatch: Dispatch<AppActions>) => void) => (
dispatch: Dispatch<AppActions>,
diff --git a/frontend/src/styles.scss b/frontend/src/styles.scss
index 71ce16d17d..d896659753 100644
--- a/frontend/src/styles.scss
+++ b/frontend/src/styles.scss
@@ -1,4 +1,6 @@
-@import '@signozhq/design-tokens';
+@import '@signozhq/design-tokens/dist/style.css';
+
+@import './periscope.scss';
#root,
html,
@@ -136,3 +138,83 @@ body {
align-items: center;
gap: 8px;
}
+
+// =================================================================
+// AntD style overrides
+.ant-dropdown-menu {
+ margin-top: 2px !important;
+ min-width: 160px;
+
+ border-radius: 4px;
+ padding: 16px;
+ border: 1px solid var(--bg-slate-400, #1d212d);
+ background: linear-gradient(
+ 139deg,
+ rgba(18, 19, 23, 0.8) 0%,
+ rgba(18, 19, 23, 0.9) 98.68%
+ );
+ box-shadow: 4px 10px 16px 2px rgba(0, 0, 0, 0.2);
+ backdrop-filter: blur(20px);
+
+ .ant-dropdown-menu-item-group-title {
+ font-size: 11px;
+ font-weight: 500;
+ line-height: 18px;
+ letter-spacing: 0.08em;
+ text-align: left;
+ }
+
+ .ant-dropdown-menu-item-group {
+ .ant-dropdown-menu-item-group-list {
+ margin: 0 !important;
+
+ .ant-dropdown-menu-item {
+ font-size: 13px;
+ font-weight: 400;
+ line-height: 17px;
+ letter-spacing: 0.01em;
+ text-align: left;
+ }
+ }
+ }
+}
+
+// https://github.com/ant-design/ant-design/issues/41307
+.ant-picker-panels > *:first-child button.ant-picker-header-next-btn {
+ visibility: visible !important;
+}
+
+.ant-picker-panels > *:first-child button.ant-picker-header-super-next-btn {
+ visibility: visible !important;
+}
+
+.ant-picker-panels > *:last-child:not(:only-child) {
+ display: none !important;
+}
+
+.ant-picker-panel-container,
+.ant-picker-footer-extra > div {
+ flex-wrap: wrap !important;
+}
+
+.ant-picker-range-arrow {
+ display: none !important;
+}
+
+.ant-picker-panel-container {
+ background: none !important;
+ box-shadow: none !important;
+}
+
+.ant-tooltip {
+ --antd-arrow-background-color: var(--bg-slate-400, #1d212d);
+
+ .ant-tooltip-inner {
+ background-color: var(--bg-slate-400, #1d212d);
+ }
+ .flexBtn {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ }
+}
diff --git a/frontend/src/types/actions/globalTime.ts b/frontend/src/types/actions/globalTime.ts
index 4a3b5a730c..858a7c78a0 100644
--- a/frontend/src/types/actions/globalTime.ts
+++ b/frontend/src/types/actions/globalTime.ts
@@ -1,4 +1,5 @@
import { Time } from 'container/TopNav/DateTimeSelection/config';
+import { Time as TimeV2 } from 'container/TopNav/DateTimeSelectionV2/config';
import { ResetIdStartAndEnd, SetSearchQueryString } from './logs';
@@ -13,7 +14,7 @@ export type GlobalTime = {
};
interface UpdateTime extends GlobalTime {
- selectedTime: Time;
+ selectedTime: Time | TimeV2;
}
interface UpdateTimeInterval {
diff --git a/frontend/src/types/common/queryBuilder.ts b/frontend/src/types/common/queryBuilder.ts
index 6916d7fed2..e8dad50083 100644
--- a/frontend/src/types/common/queryBuilder.ts
+++ b/frontend/src/types/common/queryBuilder.ts
@@ -1,4 +1,5 @@
import { PANEL_TYPES } from 'constants/queryBuilder';
+import ROUTES from 'constants/routes';
import { Format } from 'container/NewWidget/RightContainer/types';
import {
IBuilderFormula,
@@ -187,6 +188,7 @@ export type QueryBuilderContextType = {
redirectWithQueryBuilderData: (
query: Query,
searchParams?: Record<string, unknown>,
+ redirectToUrl?: typeof ROUTES[keyof typeof ROUTES],
) => void;
handleRunQuery: () => void;
resetQuery: (newCurrentQuery?: QueryState) => void;
@@ -204,7 +206,7 @@ export type QueryBuilderContextType = {
index: number,
) => QueryBuilderData[T][number],
) => Query;
- initQueryBuilderData: (query: Query) => void;
+ initQueryBuilderData: (query: Query, timeUpdated?: boolean) => void;
isStagedQueryUpdated: (
viewData: ViewProps[] | undefined,
viewKey: string,
diff --git a/frontend/src/types/reducer/globalTime.ts b/frontend/src/types/reducer/globalTime.ts
index 94bb17eb73..cd7fac1ea8 100644
--- a/frontend/src/types/reducer/globalTime.ts
+++ b/frontend/src/types/reducer/globalTime.ts
@@ -1,11 +1,12 @@
import { Time } from 'container/TopNav/DateTimeSelection/config';
+import { Time as TimeV2 } from 'container/TopNav/DateTimeSelectionV2/config';
import { GlobalTime } from 'types/actions/globalTime';
export interface GlobalReducer {
maxTime: GlobalTime['maxTime'];
minTime: GlobalTime['minTime'];
loading: boolean;
- selectedTime: Time;
+ selectedTime: Time | TimeV2;
isAutoRefreshDisabled: boolean;
selectedAutoRefreshInterval: string;
}
diff --git a/frontend/src/utils/app.ts b/frontend/src/utils/app.ts
index 0ab9e6fca7..d0b859d108 100644
--- a/frontend/src/utils/app.ts
+++ b/frontend/src/utils/app.ts
@@ -15,6 +15,8 @@ export function extractDomain(email: string): string {
export const isCloudUser = (): boolean => {
const { hostname } = window.location;
+ return true;
+
return hostname?.endsWith('signoz.cloud');
};
diff --git a/frontend/src/utils/logs.ts b/frontend/src/utils/logs.ts
index bfe79a3177..10f6625f31 100644
--- a/frontend/src/utils/logs.ts
+++ b/frontend/src/utils/logs.ts
@@ -1,22 +1,31 @@
import { orange } from '@ant-design/colors';
-import { themeColors } from 'constants/theme';
-import getAlphaColor from 'utils/getAlphaColor';
+import { Color } from '@signozhq/design-tokens';
export const getDefaultLogBackground = (
isReadOnly?: boolean,
isDarkMode?: boolean,
): string => {
if (isReadOnly) return '';
+ // TODO handle the light mode here
return `&:hover {
background-color: ${
- isDarkMode
- ? getAlphaColor(themeColors.white)[10]
- : getAlphaColor(themeColors.black)[10]
+ isDarkMode ? 'rgba(171, 189, 255, 0.04)' : 'var(--bg-vanilla-200)'
};
}`;
};
-export const getActiveLogBackground = (isActiveLog = true): string => {
- if (!isActiveLog) return '';
+export const getActiveLogBackground = (
+ isActiveLog = true,
+ isDarkMode = true,
+): string => {
+ if (!isActiveLog) return ``;
+ if (isDarkMode) return `background-color: ${Color.BG_SLATE_200};`;
+ return `background-color: ${Color.BG_VANILLA_300}; color: ${Color.TEXT_SLATE_400}`;
+};
+
+export const getHightLightedLogBackground = (
+ isHighlightedLog = true,
+): string => {
+ if (!isHighlightedLog) return '';
return `background-color: ${orange[3]};`;
};
diff --git a/frontend/src/utils/permission/index.ts b/frontend/src/utils/permission/index.ts
index 91372d237b..873ed63c32 100644
--- a/frontend/src/utils/permission/index.ts
+++ b/frontend/src/utils/permission/index.ts
@@ -86,6 +86,8 @@ export const routePermission: Record<keyof typeof ROUTES, ROLES[]> = {
BILLING: ['ADMIN', 'EDITOR', 'VIEWER'],
SUPPORT: ['ADMIN', 'EDITOR', 'VIEWER'],
SOMETHING_WENT_WRONG: ['ADMIN', 'EDITOR', 'VIEWER'],
+ LOGS_SAVE_VIEWS: ['ADMIN', 'EDITOR', 'VIEWER'],
+ TRACES_SAVE_VIEWS: ['ADMIN', 'EDITOR', 'VIEWER'],
LOGS_BASE: [],
OLD_LOGS_EXPLORER: [],
};
diff --git a/frontend/yarn.lock b/frontend/yarn.lock
index fe33785fb5..80ef34ec02 100644
--- a/frontend/yarn.lock
+++ b/frontend/yarn.lock
@@ -748,6 +748,11 @@
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719"
integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==
+"@babel/parser@^7.23.6":
+ version "7.23.6"
+ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b"
+ integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==
+
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6":
version "7.18.6"
resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz"
@@ -2062,6 +2067,13 @@
dependencies:
regenerator-runtime "^0.13.11"
+"@babel/runtime@^7.13.10":
+ version "7.23.6"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.6.tgz#c05e610dc228855dc92ef1b53d07389ed8ab521d"
+ integrity sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ==
+ dependencies:
+ regenerator-runtime "^0.14.0"
+
"@babel/runtime@^7.14.6":
version "7.22.15"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.15.tgz#38f46494ccf6cf020bd4eed7124b425e83e523b8"
@@ -2434,6 +2446,33 @@
minimatch "^3.0.4"
strip-json-comments "^3.1.1"
+"@floating-ui/core@^1.4.2":
+ version "1.5.2"
+ resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.5.2.tgz#53a0f7a98c550e63134d504f26804f6b83dbc071"
+ integrity sha512-Ii3MrfY/GAIN3OhXNzpCKaLxHQfJF9qvwq/kEJYdqDxeIHa01K8sldugal6TmeeXl+WMvhv9cnVzUTaFFJF09A==
+ dependencies:
+ "@floating-ui/utils" "^0.1.3"
+
+"@floating-ui/dom@^1.5.1":
+ version "1.5.3"
+ resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.5.3.tgz#54e50efcb432c06c23cd33de2b575102005436fa"
+ integrity sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==
+ dependencies:
+ "@floating-ui/core" "^1.4.2"
+ "@floating-ui/utils" "^0.1.3"
+
+"@floating-ui/react-dom@^2.0.0":
+ version "2.0.4"
+ resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-2.0.4.tgz#b076fafbdfeb881e1d86ae748b7ff95150e9f3ec"
+ integrity sha512-CF8k2rgKeh/49UrnIBs4BdxPUV6vize/Db1d/YbCLyp9GiVZ0BEwf5AiDSxJRCr6yOkGqTFHtmrULxkEfYZ7dQ==
+ dependencies:
+ "@floating-ui/dom" "^1.5.1"
+
+"@floating-ui/utils@^0.1.3":
+ version "0.1.6"
+ resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.1.6.tgz#22958c042e10b67463997bd6ea7115fe28cbcaf9"
+ integrity sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==
+
"@grafana/data@^9.5.2":
version "9.5.7"
resolved "https://registry.yarnpkg.com/@grafana/data/-/data-9.5.7.tgz#99df8c3917caf1f12a7f42258579b73b99f1aaa9"
@@ -2893,6 +2932,48 @@
"@types/mdx" "^2.0.0"
"@types/react" ">=16"
+"@microsoft/[email protected]":
+ version "7.28.3"
+ resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.28.3.tgz#f6a213e41a2274d5195366b646954daee39e8493"
+ integrity sha512-wT/kB2oDbdZXITyDh2SQLzaWwTOFbV326fP0pUwNW00WeliARs0qjmXBWmGWardEzp2U3/axkO3Lboqun6vrig==
+ dependencies:
+ "@microsoft/tsdoc" "0.14.2"
+ "@microsoft/tsdoc-config" "~0.16.1"
+ "@rushstack/node-core-library" "3.62.0"
+
+"@microsoft/[email protected]":
+ version "7.39.0"
+ resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.39.0.tgz#41c25f7f522e8b9376debda07364ff234e602eff"
+ integrity sha512-PuXxzadgnvp+wdeZFPonssRAj/EW4Gm4s75TXzPk09h3wJ8RS3x7typf95B4vwZRrPTQBGopdUl+/vHvlPdAcg==
+ dependencies:
+ "@microsoft/api-extractor-model" "7.28.3"
+ "@microsoft/tsdoc" "0.14.2"
+ "@microsoft/tsdoc-config" "~0.16.1"
+ "@rushstack/node-core-library" "3.62.0"
+ "@rushstack/rig-package" "0.5.1"
+ "@rushstack/ts-command-line" "4.17.1"
+ colors "~1.2.1"
+ lodash "~4.17.15"
+ resolve "~1.22.1"
+ semver "~7.5.4"
+ source-map "~0.6.1"
+ typescript "5.3.3"
+
+"@microsoft/tsdoc-config@~0.16.1":
+ version "0.16.2"
+ resolved "https://registry.yarnpkg.com/@microsoft/tsdoc-config/-/tsdoc-config-0.16.2.tgz#b786bb4ead00d54f53839a458ce626c8548d3adf"
+ integrity sha512-OGiIzzoBLgWWR0UdRJX98oYO+XKGf7tiK4Zk6tQ/E4IJqGCe7dvkTvgDZV5cFJUzLGDOjeAXrnZoA6QkVySuxw==
+ dependencies:
+ "@microsoft/tsdoc" "0.14.2"
+ ajv "~6.12.6"
+ jju "~1.4.0"
+ resolve "~1.19.0"
+
+"@microsoft/[email protected]":
+ version "0.14.2"
+ resolved "https://registry.yarnpkg.com/@microsoft/tsdoc/-/tsdoc-0.14.2.tgz#c3ec604a0b54b9a9b87e9735dfc59e1a5da6a5fb"
+ integrity sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==
+
"@monaco-editor/loader@^1.3.3":
version "1.3.3"
resolved "https://registry.npmjs.org/@monaco-editor/loader/-/loader-1.3.3.tgz"
@@ -2975,6 +3056,234 @@
resolved "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.21.tgz"
integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/primitive/-/primitive-1.0.1.tgz#e46f9958b35d10e9f6dc71c497305c22e3e55dbd"
+ integrity sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+
+"@radix-ui/[email protected]":
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-arrow/-/react-arrow-1.0.3.tgz#c24f7968996ed934d57fe6cde5d6ec7266e1d25d"
+ integrity sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-primitive" "1.0.3"
+
+"@radix-ui/[email protected]":
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-collection/-/react-collection-1.0.3.tgz#9595a66e09026187524a36c6e7e9c7d286469159"
+ integrity sha512-3SzW+0PW7yBBoQlT8wNcGtaxaD0XSu0uLUFgrtHY08Acx05TaHaOmVLR73c0j/cqpDy53KBMO7s0dx2wmOIDIA==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-compose-refs" "1.0.1"
+ "@radix-ui/react-context" "1.0.1"
+ "@radix-ui/react-primitive" "1.0.3"
+ "@radix-ui/react-slot" "1.0.2"
+
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.1.tgz#7ed868b66946aa6030e580b1ffca386dd4d21989"
+ integrity sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-context/-/react-context-1.0.1.tgz#fe46e67c96b240de59187dcb7a1a50ce3e2ec00c"
+ integrity sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-direction/-/react-direction-1.0.1.tgz#9cb61bf2ccf568f3421422d182637b7f47596c9b"
+ integrity sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+
+"@radix-ui/[email protected]":
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.5.tgz#3f98425b82b9068dfbab5db5fff3df6ebf48b9d4"
+ integrity sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/primitive" "1.0.1"
+ "@radix-ui/react-compose-refs" "1.0.1"
+ "@radix-ui/react-primitive" "1.0.3"
+ "@radix-ui/react-use-callback-ref" "1.0.1"
+ "@radix-ui/react-use-escape-keydown" "1.0.3"
+
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-id/-/react-id-1.0.1.tgz#73cdc181f650e4df24f0b6a5b7aa426b912c88c0"
+ integrity sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-use-layout-effect" "1.0.1"
+
+"@radix-ui/[email protected]":
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-popper/-/react-popper-1.1.3.tgz#24c03f527e7ac348fabf18c89795d85d21b00b42"
+ integrity sha512-cKpopj/5RHZWjrbF2846jBNacjQVwkP068DfmgrNJXpvVWrOvlAmE9xSiy5OqeE+Gi8D9fP+oDhUnPqNMY8/5w==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@floating-ui/react-dom" "^2.0.0"
+ "@radix-ui/react-arrow" "1.0.3"
+ "@radix-ui/react-compose-refs" "1.0.1"
+ "@radix-ui/react-context" "1.0.1"
+ "@radix-ui/react-primitive" "1.0.3"
+ "@radix-ui/react-use-callback-ref" "1.0.1"
+ "@radix-ui/react-use-layout-effect" "1.0.1"
+ "@radix-ui/react-use-rect" "1.0.1"
+ "@radix-ui/react-use-size" "1.0.1"
+ "@radix-ui/rect" "1.0.1"
+
+"@radix-ui/[email protected]":
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-portal/-/react-portal-1.0.4.tgz#df4bfd353db3b1e84e639e9c63a5f2565fb00e15"
+ integrity sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-primitive" "1.0.3"
+
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-presence/-/react-presence-1.0.1.tgz#491990ba913b8e2a5db1b06b203cb24b5cdef9ba"
+ integrity sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-compose-refs" "1.0.1"
+ "@radix-ui/react-use-layout-effect" "1.0.1"
+
+"@radix-ui/[email protected]":
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-primitive/-/react-primitive-1.0.3.tgz#d49ea0f3f0b2fe3ab1cb5667eb03e8b843b914d0"
+ integrity sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-slot" "1.0.2"
+
+"@radix-ui/[email protected]":
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-roving-focus/-/react-roving-focus-1.0.4.tgz#e90c4a6a5f6ac09d3b8c1f5b5e81aab2f0db1974"
+ integrity sha512-2mUg5Mgcu001VkGy+FfzZyzbmuUWzgWkj3rvv4yu+mLw03+mTzbxZHvfcGyFp2b8EkQeMkpRQ5FiA2Vr2O6TeQ==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/primitive" "1.0.1"
+ "@radix-ui/react-collection" "1.0.3"
+ "@radix-ui/react-compose-refs" "1.0.1"
+ "@radix-ui/react-context" "1.0.1"
+ "@radix-ui/react-direction" "1.0.1"
+ "@radix-ui/react-id" "1.0.1"
+ "@radix-ui/react-primitive" "1.0.3"
+ "@radix-ui/react-use-callback-ref" "1.0.1"
+ "@radix-ui/react-use-controllable-state" "1.0.1"
+
+"@radix-ui/[email protected]":
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-slot/-/react-slot-1.0.2.tgz#a9ff4423eade67f501ffb32ec22064bc9d3099ab"
+ integrity sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-compose-refs" "1.0.1"
+
+"@radix-ui/[email protected]":
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-tabs/-/react-tabs-1.0.4.tgz#993608eec55a5d1deddd446fa9978d2bc1053da2"
+ integrity sha512-egZfYY/+wRNCflXNHx+dePvnz9FbmssDTJBtgRfDY7e8SE5oIo3Py2eCB1ckAbh1Q7cQ/6yJZThJ++sgbxibog==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/primitive" "1.0.1"
+ "@radix-ui/react-context" "1.0.1"
+ "@radix-ui/react-direction" "1.0.1"
+ "@radix-ui/react-id" "1.0.1"
+ "@radix-ui/react-presence" "1.0.1"
+ "@radix-ui/react-primitive" "1.0.3"
+ "@radix-ui/react-roving-focus" "1.0.4"
+ "@radix-ui/react-use-controllable-state" "1.0.1"
+
+"@radix-ui/[email protected]":
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-tooltip/-/react-tooltip-1.0.7.tgz#8f55070f852e7e7450cc1d9210b793d2e5a7686e"
+ integrity sha512-lPh5iKNFVQ/jav/j6ZrWq3blfDJ0OH9R6FlNUHPMqdLuQ9vwDgFsRxvl8b7Asuy5c8xmoojHUxKHQSOAvMHxyw==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/primitive" "1.0.1"
+ "@radix-ui/react-compose-refs" "1.0.1"
+ "@radix-ui/react-context" "1.0.1"
+ "@radix-ui/react-dismissable-layer" "1.0.5"
+ "@radix-ui/react-id" "1.0.1"
+ "@radix-ui/react-popper" "1.1.3"
+ "@radix-ui/react-portal" "1.0.4"
+ "@radix-ui/react-presence" "1.0.1"
+ "@radix-ui/react-primitive" "1.0.3"
+ "@radix-ui/react-slot" "1.0.2"
+ "@radix-ui/react-use-controllable-state" "1.0.1"
+ "@radix-ui/react-visually-hidden" "1.0.3"
+
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.0.1.tgz#f4bb1f27f2023c984e6534317ebc411fc181107a"
+ integrity sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.0.1.tgz#ecd2ced34e6330caf89a82854aa2f77e07440286"
+ integrity sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-use-callback-ref" "1.0.1"
+
+"@radix-ui/[email protected]":
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.0.3.tgz#217b840c250541609c66f67ed7bab2b733620755"
+ integrity sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-use-callback-ref" "1.0.1"
+
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.0.1.tgz#be8c7bc809b0c8934acf6657b577daf948a75399"
+ integrity sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-use-rect/-/react-use-rect-1.0.1.tgz#fde50b3bb9fd08f4a1cd204572e5943c244fcec2"
+ integrity sha512-Cq5DLuSiuYVKNU8orzJMbl15TXilTnJKUCltMVQg53BQOF1/C5toAaGrowkgksdBQ9H+SRL23g0HDmg9tvmxXw==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/rect" "1.0.1"
+
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-use-size/-/react-use-size-1.0.1.tgz#1c5f5fea940a7d7ade77694bb98116fb49f870b2"
+ integrity sha512-ibay+VqrgcaI6veAojjofPATwledXiSmX+C0KrBk/xgpX9rBzPV3OsfwlhQdUOFbh+LKQorLYT+xTXW9V8yd0g==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-use-layout-effect" "1.0.1"
+
+"@radix-ui/[email protected]":
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.0.3.tgz#51aed9dd0fe5abcad7dee2a234ad36106a6984ac"
+ integrity sha512-D4w41yN5YRKtu464TLnByKzMDG/JlMPHtfZgQAu9v6mNakUqGUI9vUrfQKz8NK41VMm/xbZbh76NUTVtIYqOMA==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-primitive" "1.0.3"
+
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/rect/-/rect-1.0.1.tgz#bf8e7d947671996da2e30f4904ece343bc4a883f"
+ integrity sha512-fyrgCaedtvMg9NK3en0pnOYJdtfwxUcNolezkNPUsoX57X8oQk+NkqcvzHXD2uKNij6GXmWU9NDru2IWjrO4BQ==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+
"@rc-component/color-picker@~1.4.1":
version "1.4.1"
resolved "https://registry.yarnpkg.com/@rc-component/color-picker/-/color-picker-1.4.1.tgz#dcab0b660e9c4ed63a7582db68ed4a77c862cb93"
@@ -3065,6 +3374,46 @@
resolved "https://registry.yarnpkg.com/@react-dnd/shallowequal/-/shallowequal-4.0.2.tgz#d1b4befa423f692fa4abf1c79209702e7d8ae4b4"
integrity sha512-/RVXdLvJxLg4QKvMoM5WlwNR9ViO9z8B/qPcc+C0Sa/teJY7QG7kJ441DwzOjMYEY7GmU4dj5EcGHIkKZiQZCA==
+"@rollup/pluginutils@^5.1.0":
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.1.0.tgz#7e53eddc8c7f483a4ad0b94afb1f7f5fd3c771e0"
+ integrity sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==
+ dependencies:
+ "@types/estree" "^1.0.0"
+ estree-walker "^2.0.2"
+ picomatch "^2.3.1"
+
+"@rushstack/[email protected]":
+ version "3.62.0"
+ resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.62.0.tgz#a30a44a740b522944165f0faa6644134eb95be1d"
+ integrity sha512-88aJn2h8UpSvdwuDXBv1/v1heM6GnBf3RjEy6ZPP7UnzHNCqOHA2Ut+ScYUbXcqIdfew9JlTAe3g+cnX9xQ/Aw==
+ dependencies:
+ colors "~1.2.1"
+ fs-extra "~7.0.1"
+ import-lazy "~4.0.0"
+ jju "~1.4.0"
+ resolve "~1.22.1"
+ semver "~7.5.4"
+ z-schema "~5.0.2"
+
+"@rushstack/[email protected]":
+ version "0.5.1"
+ resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.5.1.tgz#6c9c283cc96b5bb1eae9875946d974ac5429bb21"
+ integrity sha512-pXRYSe29TjRw7rqxD4WS3HN/sRSbfr+tJs4a9uuaSIBAITbUggygdhuG0VrO0EO+QqH91GhYMN4S6KRtOEmGVA==
+ dependencies:
+ resolve "~1.22.1"
+ strip-json-comments "~3.1.1"
+
+"@rushstack/[email protected]":
+ version "4.17.1"
+ resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.17.1.tgz#c78db928ce5b93f2e98fd9e14c24f3f3876e57f1"
+ integrity sha512-2jweO1O57BYP5qdBGl6apJLB+aRIn5ccIRTPDyULh0KMwVzFqWtw6IZWt1qtUoZD/pD2RNkIOosH6Cq45rIYeg==
+ dependencies:
+ "@types/argparse" "1.0.38"
+ argparse "~1.0.9"
+ colors "~1.2.1"
+ string-argv "~0.3.1"
+
"@sideway/address@^4.1.3":
version "4.1.4"
resolved "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz"
@@ -3082,12 +3431,13 @@
resolved "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz"
integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==
-"@signozhq/[email protected]":
- version "0.0.6"
- resolved "https://registry.yarnpkg.com/@signozhq/design-tokens/-/design-tokens-0.0.6.tgz#42449052dca644c4d52448f9c2c521d39e535720"
- integrity sha512-i+aG0YCuYL2KVUtRFj3qgAVDU6GbKmTdFXpqCqLUQp8diKMWH5Svzzxj4B14Q6+yE79+wbm1iZ0Nr6nYgkBA8Q==
+"@signozhq/[email protected]":
+ version "0.0.8"
+ resolved "https://registry.yarnpkg.com/@signozhq/design-tokens/-/design-tokens-0.0.8.tgz#368dc92cfe01d0cd893df140445c5d9dfd944a88"
+ integrity sha512-YUxQw6w7iyUMTBxj82nFZQNRsg7Boej3YM6K5bYfDMQg0MqvWQCWsP7EkyLHu/TiyOZwZWb++vzXG6m+YJX9bw==
dependencies:
style-dictionary "3.8.0"
+ vite-plugin-dts "^3.6.4"
"@sinclair/typebox@^0.25.16":
version "0.25.24"
@@ -3207,6 +3557,11 @@
dependencies:
"@types/estree" "*"
+ version "1.0.38"
+ resolved "https://registry.yarnpkg.com/@types/argparse/-/argparse-1.0.38.tgz#a81fd8606d481f873a3800c6ebae4f1d768a56a9"
+ integrity sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==
+
"@types/aria-query@^5.0.1":
version "5.0.1"
resolved "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.1.tgz"
@@ -4019,6 +4374,67 @@
resolved "https://registry.npmjs.org/@ungap/custom-elements/-/custom-elements-1.2.0.tgz"
integrity sha512-zdSuu79stAwVUtzkQU9B5jhGh2LavtkeX4kxd2jtMJmZt7QqRJ1KJW5bukt/vUOaUs3z674GHd+nqYm0bu0Gyg==
+"@volar/[email protected]", "@volar/language-core@~1.11.1":
+ version "1.11.1"
+ resolved "https://registry.yarnpkg.com/@volar/language-core/-/language-core-1.11.1.tgz#ecdf12ea8dc35fb8549e517991abcbf449a5ad4f"
+ integrity sha512-dOcNn3i9GgZAcJt43wuaEykSluAuOkQgzni1cuxLxTV0nJKanQztp7FxyswdRILaKH+P2XZMPRp2S4MV/pElCw==
+ dependencies:
+ "@volar/source-map" "1.11.1"
+
+"@volar/[email protected]", "@volar/source-map@~1.11.1":
+ version "1.11.1"
+ resolved "https://registry.yarnpkg.com/@volar/source-map/-/source-map-1.11.1.tgz#535b0328d9e2b7a91dff846cab4058e191f4452f"
+ integrity sha512-hJnOnwZ4+WT5iupLRnuzbULZ42L7BWWPMmruzwtLhJfpDVoZLjNBxHDi2sY2bgZXCKlpU5XcsMFoYrsQmPhfZg==
+ dependencies:
+ muggle-string "^0.3.1"
+
+"@volar/typescript@~1.11.1":
+ version "1.11.1"
+ resolved "https://registry.yarnpkg.com/@volar/typescript/-/typescript-1.11.1.tgz#ba86c6f326d88e249c7f5cfe4b765be3946fd627"
+ integrity sha512-iU+t2mas/4lYierSnoFOeRFQUhAEMgsFuQxoxvwn5EdQopw43j+J27a4lt9LMInx1gLJBC6qL14WYGlgymaSMQ==
+ dependencies:
+ "@volar/language-core" "1.11.1"
+ path-browserify "^1.0.1"
+
+ version "3.4.4"
+ resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.4.4.tgz#ba1ca008e95f118449cab79bdab3f7506bab2892"
+ integrity sha512-U5AdCN+6skzh2bSJrkMj2KZsVkUpgK8/XlxjSRYQZhNPcvt9/kmgIMpFEiTyK+Dz5E1J+8o8//BEIX+bakgVSw==
+ dependencies:
+ "@babel/parser" "^7.23.6"
+ "@vue/shared" "3.4.4"
+ entities "^4.5.0"
+ estree-walker "^2.0.2"
+ source-map-js "^1.0.2"
+
+"@vue/compiler-dom@^3.3.0":
+ version "3.4.4"
+ resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.4.4.tgz#a11bba8af691b58700c479ce893b02bf71bb089a"
+ integrity sha512-iSwkdDULCN+Vr8z6uwdlL044GJ/nUmECxP9vu7MzEs4Qma0FwDLYvnvRcyO0ZITuu3Os4FptGUDnhi1kOLSaGw==
+ dependencies:
+ "@vue/compiler-core" "3.4.4"
+ "@vue/shared" "3.4.4"
+
+"@vue/[email protected]", "@vue/language-core@^1.8.26":
+ version "1.8.27"
+ resolved "https://registry.yarnpkg.com/@vue/language-core/-/language-core-1.8.27.tgz#2ca6892cb524e024a44e554e4c55d7a23e72263f"
+ integrity sha512-L8Kc27VdQserNaCUNiSFdDl9LWT24ly8Hpwf1ECy3aFb9m6bDhBGQYOujDm21N7EW3moKIOKEanQwe1q5BK+mA==
+ dependencies:
+ "@volar/language-core" "~1.11.1"
+ "@volar/source-map" "~1.11.1"
+ "@vue/compiler-dom" "^3.3.0"
+ "@vue/shared" "^3.3.0"
+ computeds "^0.0.1"
+ minimatch "^9.0.3"
+ muggle-string "^0.3.1"
+ path-browserify "^1.0.1"
+ vue-template-compiler "^2.7.14"
+
+"@vue/[email protected]", "@vue/shared@^3.3.0":
+ version "3.4.4"
+ resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.4.4.tgz#26e4e62a5fbfb39c25e9e54d21eeb852f1c83a7a"
+ integrity sha512-abSgiVRhfjfl3JALR/cSuBl74hGJ3SePgf1mKzodf1eMWLwHZbfEGxT2cNJSsNiw44jEgrO7bNkhchaWA7RwNw==
+
"@webassemblyjs/[email protected]", "@webassemblyjs/ast@^1.11.5":
version "1.11.5"
resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.5.tgz"
@@ -4332,7 +4748,7 @@ ajv-keywords@^5.1.0:
dependencies:
fast-deep-equal "^3.1.3"
-ajv@^6.10.0, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.12.6:
+ajv@^6.10.0, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.12.6, ajv@~6.12.6:
version "6.12.6"
resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz"
integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
@@ -4503,7 +4919,7 @@ arg@^4.1.0:
resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz"
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
-argparse@^1.0.7:
+argparse@^1.0.7, argparse@~1.0.9:
version "1.0.10"
resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz"
integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
@@ -5246,6 +5662,13 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0"
concat-map "0.0.1"
+brace-expansion@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae"
+ integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==
+ dependencies:
+ balanced-match "^1.0.0"
+
braces@^3.0.2, braces@~3.0.2:
version "3.0.2"
resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz"
@@ -5755,6 +6178,11 @@ colorette@^2.0.10, colorette@^2.0.14, colorette@^2.0.16:
resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz"
integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==
+colors@~1.2.1:
+ version "1.2.5"
+ resolved "https://registry.yarnpkg.com/colors/-/colors-1.2.5.tgz#89c7ad9a374bc030df8013241f68136ed8835afc"
+ integrity sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==
+
combined-stream@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
@@ -5772,6 +6200,11 @@ comma-separated-tokens@^2.0.0:
resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee"
integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==
+commander@^10.0.0:
+ version "10.0.1"
+ resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06"
+ integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==
+
commander@^2.20.0, commander@^2.20.3:
version "2.20.3"
resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz"
@@ -5861,6 +6294,11 @@ compute-scroll-into-view@^3.0.2:
resolved "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-3.0.3.tgz"
integrity sha512-nadqwNxghAGTamwIqQSG433W6OADZx2vCo3UXHNrzTRHK/htu+7+L0zhjEoaeaQVNAi3YgqWDv8+tzf0hRfR+A==
+computeds@^0.0.1:
+ version "0.0.1"
+ resolved "https://registry.yarnpkg.com/computeds/-/computeds-0.0.1.tgz#215b08a4ba3e08a11ff6eee5d6d8d7166a97ce2e"
+ integrity sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==
+
version "0.0.1"
resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
@@ -6462,6 +6900,11 @@ dayjs@^1.10.7, dayjs@^1.11.1:
resolved "https://registry.npmjs.org/dayjs/-/dayjs-1.11.7.tgz"
integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==
+de-indent@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
+ integrity sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==
+
[email protected], debug@4, [email protected], debug@^3.2.6, debug@^3.2.7, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@ngokevin/debug#noTimestamp:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
@@ -6895,7 +7338,7 @@ entities@^2.0.0, entities@^2.2.0:
resolved "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz"
integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==
-entities@^4.2.0:
+entities@^4.2.0, entities@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48"
integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==
@@ -7434,6 +7877,11 @@ estree-util-visit@^1.0.0:
"@types/estree-jsx" "^1.0.0"
"@types/unist" "^2.0.0"
+estree-walker@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
+ integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
+
estree-walker@^3.0.0:
version "3.0.3"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-3.0.3.tgz#67c3e549ec402a487b4fc193d1953a524752340d"
@@ -7898,6 +8346,15 @@ fs-extra@^10.0.0:
jsonfile "^6.0.1"
universalify "^2.0.0"
+fs-extra@~7.0.1:
+ version "7.0.1"
+ resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
+ integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==
+ dependencies:
+ graceful-fs "^4.1.2"
+ jsonfile "^4.0.0"
+ universalify "^0.1.0"
+
fs-monkey@^1.0.3:
version "1.0.3"
resolved "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.3.tgz"
@@ -7923,6 +8380,11 @@ function-bind@^1.1.1:
resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
+function-bind@^1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c"
+ integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==
+
function.prototype.name@^1.1.5:
version "1.1.5"
resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz"
@@ -8200,6 +8662,13 @@ hasha@^5.0.0:
is-stream "^2.0.0"
type-fest "^0.8.0"
+hasown@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c"
+ integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==
+ dependencies:
+ function-bind "^1.1.2"
+
hast-util-from-parse5@^7.0.0:
version "7.1.2"
resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-7.1.2.tgz#aecfef73e3ceafdfa4550716443e4eb7b02e22b0"
@@ -8662,6 +9131,11 @@ import-fresh@^3.0.0, import-fresh@^3.2.1:
parent-module "^1.0.0"
resolve-from "^4.0.0"
+import-lazy@~4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-4.0.0.tgz#e8eb627483a0a43da3c03f3e35548be5cb0cc153"
+ integrity sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==
+
import-local@^3.0.2:
version "3.1.0"
resolved "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz"
@@ -8875,6 +9349,13 @@ is-ci@^3.0.1:
dependencies:
ci-info "^3.2.0"
+is-core-module@^2.1.0:
+ version "2.13.1"
+ resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384"
+ integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==
+ dependencies:
+ hasown "^2.0.0"
+
is-core-module@^2.11.0, is-core-module@^2.5.0, is-core-module@^2.9.0:
version "2.12.0"
resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz"
@@ -9791,6 +10272,11 @@ jest@^27.5.1:
import-local "^3.0.2"
jest-cli "^27.5.1"
+jju@~1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/jju/-/jju-1.4.0.tgz#a3abe2718af241a2b2904f84a625970f389ae32a"
+ integrity sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==
+
joi@^17.3.0:
version "17.9.2"
resolved "https://registry.npmjs.org/joi/-/joi-17.9.2.tgz"
@@ -9927,6 +10413,13 @@ jsonc-parser@^3.0.0:
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76"
integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==
+jsonfile@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
+ integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==
+ optionalDependencies:
+ graceful-fs "^4.1.6"
+
jsonfile@^6.0.1:
version "6.1.0"
resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz"
@@ -9986,6 +10479,11 @@ klona@^2.0.4:
resolved "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz"
integrity sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==
+kolorist@^1.8.0:
+ version "1.8.0"
+ resolved "https://registry.yarnpkg.com/kolorist/-/kolorist-1.8.0.tgz#edddbbbc7894bc13302cdf740af6374d4a04743c"
+ integrity sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==
+
language-subtag-registry@~0.3.2:
version "0.3.22"
resolved "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz"
@@ -10207,7 +10705,12 @@ lodash.flattendeep@^4.4.0:
resolved "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz"
integrity sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==
-lodash.isequal@^4.0.0:
+lodash.get@^4.4.2:
+ version "4.4.2"
+ resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
+ integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==
+
+lodash.isequal@^4.0.0, lodash.isequal@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==
@@ -10237,7 +10740,7 @@ lodash.uniq@^4.5.0:
resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz"
integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==
[email protected], lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.7.0:
[email protected], lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.7.0, lodash@~4.17.15:
version "4.17.21"
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
@@ -11086,6 +11589,13 @@ minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2:
dependencies:
brace-expansion "^1.1.7"
+minimatch@^9.0.3:
+ version "9.0.3"
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825"
+ integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==
+ dependencies:
+ brace-expansion "^2.0.1"
+
version "4.1.0"
resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz"
@@ -11164,6 +11674,11 @@ [email protected]:
type-fest "^2.19.0"
yargs "^17.3.1"
+muggle-string@^0.3.1:
+ version "0.3.1"
+ resolved "https://registry.yarnpkg.com/muggle-string/-/muggle-string-0.3.1.tgz#e524312eb1728c63dd0b2ac49e3282e6ed85963a"
+ integrity sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==
+
multicast-dns@^7.2.5:
version "7.2.5"
resolved "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz"
@@ -11845,6 +12360,11 @@ pascal-case@^3.1.2:
no-case "^3.0.4"
tslib "^2.0.3"
+path-browserify@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd"
+ integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==
+
path-case@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/path-case/-/path-case-3.0.4.tgz#9168645334eb942658375c56f80b4c0cb5f82c6f"
@@ -11873,7 +12393,7 @@ path-key@^3.0.0, path-key@^3.1.0:
resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz"
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
-path-parse@^1.0.7:
+path-parse@^1.0.6, path-parse@^1.0.7:
version "1.0.7"
resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
@@ -13657,6 +14177,23 @@ resolve@^2.0.0-next.4:
path-parse "^1.0.7"
supports-preserve-symlinks-flag "^1.0.0"
+resolve@~1.19.0:
+ version "1.19.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c"
+ integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==
+ dependencies:
+ is-core-module "^2.1.0"
+ path-parse "^1.0.6"
+
+resolve@~1.22.1:
+ version "1.22.8"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d"
+ integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==
+ dependencies:
+ is-core-module "^2.13.0"
+ path-parse "^1.0.7"
+ supports-preserve-symlinks-flag "^1.0.0"
+
restore-cursor@^3.1.0:
version "3.1.0"
resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz"
@@ -13879,7 +14416,7 @@ selfsigned@^2.1.1:
dependencies:
node-forge "^1"
-"semver@2 || 3 || 4 || 5", [email protected], [email protected], [email protected], semver@^5.6.0, semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7:
+"semver@2 || 3 || 4 || 5", [email protected], [email protected], [email protected], semver@^5.6.0, semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.4, semver@~7.5.4:
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
@@ -14343,6 +14880,11 @@ string-argv@^0.3.1:
resolved "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz"
integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==
+string-argv@~0.3.1:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6"
+ integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==
+
string-convert@^0.2.0:
version "0.2.1"
resolved "https://registry.npmjs.org/string-convert/-/string-convert-0.2.1.tgz"
@@ -14473,7 +15015,7 @@ strip-indent@^3.0.0:
dependencies:
min-indent "^1.0.0"
-strip-json-comments@^3.1.0, strip-json-comments@^3.1.1:
+strip-json-comments@^3.1.0, strip-json-comments@^3.1.1, strip-json-comments@~3.1.1:
version "3.1.1"
resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz"
integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
@@ -15093,6 +15635,11 @@ [email protected]:
stylus "^0.59.0"
tsconfig-paths "^4.1.2"
+ version "5.3.3"
+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37"
+ integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==
+
typescript@^4.0.5, typescript@^4.4.3:
version "4.9.5"
resolved "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz"
@@ -15211,6 +15758,11 @@ unist-util-visit@^4.0.0, unist-util-visit@^4.1.0, unist-util-visit@^4.1.2, unist
unist-util-is "^5.0.0"
unist-util-visit-parents "^5.1.1"
+universalify@^0.1.0:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
+ integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
+
universalify@^0.2.0:
version "0.2.0"
resolved "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz"
@@ -15364,6 +15916,11 @@ validate-npm-package-license@^3.0.1:
spdx-correct "^3.0.0"
spdx-expression-parse "^3.0.0"
+validator@^13.7.0:
+ version "13.11.0"
+ resolved "https://registry.yarnpkg.com/validator/-/validator-13.11.0.tgz#23ab3fd59290c61248364eabf4067f04955fbb1b"
+ integrity sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==
+
value-equal@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz"
@@ -15400,11 +15957,40 @@ vfile@^5.0.0:
unist-util-stringify-position "^3.0.0"
vfile-message "^3.0.0"
+vite-plugin-dts@^3.6.4:
+ version "3.7.0"
+ resolved "https://registry.yarnpkg.com/vite-plugin-dts/-/vite-plugin-dts-3.7.0.tgz#654ee7c38c0cdd4589b9bc198a264f34172bd870"
+ integrity sha512-np1uPaYzu98AtPReB8zkMnbjwcNHOABsLhqVOf81b3ol9b5M2wPcAVs8oqPnOpr6Us+7yDXVauwkxsk5+ldmRA==
+ dependencies:
+ "@microsoft/api-extractor" "7.39.0"
+ "@rollup/pluginutils" "^5.1.0"
+ "@vue/language-core" "^1.8.26"
+ debug "^4.3.4"
+ kolorist "^1.8.0"
+ vue-tsc "^1.8.26"
+
version "3.1.0"
resolved "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz"
integrity sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==
+vue-template-compiler@^2.7.14:
+ version "2.7.16"
+ resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.7.16.tgz#c81b2d47753264c77ac03b9966a46637482bb03b"
+ integrity sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==
+ dependencies:
+ de-indent "^1.0.2"
+ he "^1.2.0"
+
+vue-tsc@^1.8.26:
+ version "1.8.27"
+ resolved "https://registry.yarnpkg.com/vue-tsc/-/vue-tsc-1.8.27.tgz#feb2bb1eef9be28017bb9e95e2bbd1ebdd48481c"
+ integrity sha512-WesKCAZCRAbmmhuGl3+VrdWItEvfoFIPXOvUJkjULi+x+6G/Dy69yO3TBRJDr9eUlmsNAwVmxsNZxvHKzbkKdg==
+ dependencies:
+ "@volar/typescript" "~1.11.1"
+ "@vue/language-core" "1.8.27"
+ semver "^7.5.4"
+
w3c-hr-time@^1.0.2:
version "1.0.2"
resolved "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz"
@@ -16073,6 +16659,17 @@ yocto-queue@^1.0.0:
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251"
integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==
+z-schema@~5.0.2:
+ version "5.0.6"
+ resolved "https://registry.yarnpkg.com/z-schema/-/z-schema-5.0.6.tgz#46d6a687b15e4a4369e18d6cb1c7b8618fc256c5"
+ integrity sha512-+XR1GhnWklYdfr8YaZv/iu+vY+ux7V5DS5zH1DQf6bO5ufrt/5cgNhVO5qyhsjFXvsqQb/f08DWE9b6uPscyAg==
+ dependencies:
+ lodash.get "^4.4.2"
+ lodash.isequal "^4.5.0"
+ validator "^13.7.0"
+ optionalDependencies:
+ commander "^10.0.0"
+
zwitch@^2.0.0, zwitch@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.4.tgz#c827d4b0acb76fc3e685a4c6ec2902d51070e9d7"