Commit Graph

40 Commits

Author SHA1 Message Date
Kevin Grüneberg
be2271b9c2 feat: break down log drain egress (#33763) 2025-02-21 10:23:03 +00:00
Kamil Ogórek
1a7c01770b feat: Add supavisor connections to infra report (#33682) 2025-02-20 15:57:41 +08:00
Joshen Lim
8b4fb55b54 Add IS_PLATFORM checks for some unnecessary queries and UI for local (#33557)
* Add IS_PLATFORM checks for some unnecessary queries and UI for local

* Revert changes for analytics/endpoint/[name]

* Smol

* Smol

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
2025-02-17 15:09:36 +08:00
Ziinc
45f7561d30 fix: show database charts at 1h resolution (#32962)
* fix: drop default interval

* fix: add datepicker override

* chore: remove comments
2025-01-22 14:26:29 +08:00
Joshen Lim
3440dc9c95 Feat/reports v2/standardize block design (#32936)
* Standardize block designs

* Clean up

* Add warning threshold colors for infra-monitoring stats

* Address all other comments

* Swap create custom report to use PUT
2025-01-21 20:56:13 +08:00
Alaister Young
9d534c9f5a fix: response error codes (#30581)
* fix: response error codes

* upgrade docs

* remove request url modification middleware

* move api routes for self-hosted to platform folder

* remove some lib/common/fetch usage

* docs: use middleware for openapi-fetch (#30600)

Get rid of the unauthedAllowedPost function (I don't think there's any harm in letting any requests that require authentication to just 403, they should be disabled at the React Query level and if not they will fail gracefully enough...)

* fix local count query

* add default values for clone mutation

* fix ts and codegen

* add missing lodash dep to playwright tests

* Fix the playwright tests to match the new folder structure for selfhosted variant.

* remove unused import

* Remove unused state

* remove unused sql debug mutation

* remove unused export

* fix notifications query

* fix jwt updating status

* fix typescript

* save sql snippet after renaming

* update codegen & fix ts error

* override array querySerializer

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-01-20 11:27:38 +08:00
Alaister Young
c26a1a7e63 chore(studio): remove unused files (#32623) 2025-01-08 12:39:00 +08:00
Chris Gwilliams
2f63366b44 remove swap usage from DB report (#30877) 2024-12-18 15:00:35 +02:00
Jordi Enric
f5b998983a remove warehouse settings page (#30919)
* rm links and page

* add some comments w context
2024-12-06 10:21:46 +00:00
Alaister Young
12cc4e5fbc chore: use service versions endpoint (#30352)
* chore: use service versions endpoint

* update types

* fix types

* fallback postgres version for unknown images
2024-11-08 11:17:16 +08:00
Alaister Young
c59be649a3 chore: prefetch project homepage (#30317) 2024-11-07 16:29:07 +08:00
Jordi Enric
b6647d445c store selected logs to url (#29802)
* add selected logs to url

* Add mocks for nuqs package.

* fix layout issues n remove magic numbers for height

* fix chart height issue

* fix bug where logs not in first page wouldnt load correctly

* fix spacing between charts and header

* fix postgtres_logs issues, improve size in log detail

* fix borders

* fix default renderer

* fix detail width

* rm maxheight references

* fix tests

* fix typeerrs

* fix stories typerr

* improve colelctions empty state

* move state UP for logs and warehouse tables

* cleanup

* rm params

* rm params

* rm params

* fix log explorer selection

* fix tests types

* cleanup divs

* fix selected log delay

* use isEq for comparison in rows

* fix selection stuck open

* fix btnlink combo

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-10-25 12:40:14 +02:00
Thomas
9f9b083ba5 fix: item description and unit price of Billing Breakdown (#29996) 2024-10-20 12:29:53 +08:00
Jordi Enric
f4ed44fc13 update collection form (#29791)
* add component for collection form

* use new comp in create collection

* update updatecollection query

* add comp to update collection dialog

* add missing ttype
2024-10-14 11:46:47 +02:00
Joshen Lim
9aabe4a40f Add number of database connections charts in database reports (#29637)
* Add number of database connections charts in database reports

* Fix type issue

* Fix more type issues

* Remove UI for requires_manual_intervention

* Update apps/studio/data/projects/project-upgrade-mutation.ts

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-10-04 16:55:01 +08:00
Jordi Enric
f3b4f658a0 feat: add collection retention days (#29469)
* add create collection retention input

* improve spacing between inputs, add 'days' suffix to input

* add dynamic input description clarifying days and max days for retention

* add admonition and upgrade plan link

* only show admonition on free tier

* update desc

* undo
2024-09-27 15:32:10 +02:00
Ivan Vasilov
df52ea7ee0 feat: Replace all toasts with sonner (#28250)
* Update the design of the sonner toasts. Add the close button by default.

* Migrate studio and www apps to use the SonnerToaster.

* Migrate all toasts from studio.

* Migrate all leftover toasts in studio.

* Add a new toast component with progress. Use it in studio.

* Migrate the design-system app.

* Refactor the consent toast to use sonner.

* Switch docs to use the new sonner toasts.

* Remove toast examples from the design-system app.

* Remove all toast-related components and old code.

* Fix the progress bar in the toast progress component. Also make the bottom components vertically centered.

* Fix the width of the toast progress.

* Use text-foreground-lighter instead of muted for ToastProgress text

* Rename ToastProgress to SonnerProgress.

* Shorten the text in sonner progress.

* Use the correct classes for the close button. Add a const var for the default toast duration. Remove the custom width class from sonner.

* Set the position for all progress toasts to bottom right. Set the duration for all toasts to the default (when reusing a toast id from loading/progress toast, the duration is set to infinity).

* Fix the playwright tests.

* Refactor imports to use ui instead of @ui.

* Change all imports of react-hot-toast with sonner. These components were merged since the last commit to this branch.

* Remove react-hot-toast lib.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2024-08-31 07:50:51 +08:00
Kevin Grüneberg
2db6bca58d feat: support for new billable metrics (#28399) 2024-08-06 15:43:04 +08:00
Kevin Grüneberg
9de6ee58b1 feat(orb): support new usage stats (#28208)
- Add new metric Disk Size GB-Hrs (only exposed to paid plans on Orb)
- Adjusted some texts as preparation of new billing plans
- Fixed some visual bugs with the usage summary grid
- Project allocations in tooltips are now sorted by usage (descending)
- Project allocations with too little usage (<0.01) now display "<0.01" instead of just "0"
- Usage formatter supports usage that is broken down to hours
- Stop showing percentages when the usage is 0 (previously showed "<1%"

This change is backwards compatible and can be merged. Note that there will be full overhaul in the feature of the entire usage page, this is just the least invasive change to make the transition work.
2024-07-30 14:37:54 +08:00
Kevin Grüneberg
9d4d1369aa chore: adjust billing for edge function count (#28019)
Co-authored-by: Thomas Eckl <31189692+ecktoteckto@users.noreply.github.com>
2024-07-18 17:12:49 +08:00
Joshen Lim
914901e779 Swap warehouse endpoints to /platform (#27957) 2024-07-15 11:28:05 +08:00
Joshen Lim
2a818ffc7b Swap all warehouse endpoints to v0 (#27955)
* Swap all warehouse endpoints to v0

* Fix

* Update api.type
2024-07-12 20:34:40 +08:00
Jordi Enric
003cfd6425 feat: warehouse explorer (#27611)
* add basic feature

* rename to datasource

* rename elements in left sidebar

* update copy in titles in left sidebar

* Add optional 'enabled' parameter in useLogsQuery hook

* Update warehouse query state and components

* add template selector for warehouse query builder

* update deprecated input compo

* fix create token and console warnings

* fix type errors

* fix dupped import

* update endpoints and add missing permissions

* update queries with new api path

* fix type errors

* undo last commit

* undo missing file

* fix imports in logs page

* import fixes

* add settings link like in storage menu

* sort imports, fix form submit

* rename access tokens settings section

* align dropdwn

* add overflow to templates dropdown

* add name as defaultvalue to udpate form

* update rm collection dialog

* capitalize

* Update apps/studio/pages/project/[ref]/logs/explorer/index.tsx

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>

* fix typo

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-07-11 12:05:44 +02:00
Alaister Young
70da0f1d1d chore: cleanup packages (#27770)
* chore: cleanup packages

- Avoid circular imports
- Export API-types as types
- pg-format without depending on Node internal Buffer (not browser-compatible)
- Avoid importing from barrel files in ui dir

* chore: avoid barrel file imports in studio (#27771)

* chore: avoid barrel file imports

- Removes some unused imports
- Avoids barrel file import for faster builds + less memory

* add eslint rule

* type fixes

* delete layouts barrel

* delete components/grid barrel file

* delete components/grid/utils barrel file

* delete components/grid/components/common barrel file

* delete components/grid/components/editor barrel file

* delete components/grid/components/formatter barrel file

* delete components/grid/components/grid barrel file

* delete components/grid/components/header/filter barrel file

* remote components/grid/store barrel file

* remove components/interfaces/Auth/Policies barrel file

* delete components/interfaces/Settings/Logs barrel file

* delete components/ui/CodeEditor barrel file

* delete components/ui/Forms barrel file

* delete components/ui/Shimmers barrel file

* delete data/analytics barrel file

* delete hooks barrel file

* cleanup lib/common/fetch barrel file

* final * barral files cleanup

* global react-data-grid styles

* remove console.log

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>

* fix build

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2024-07-04 14:48:10 +08:00
Joshen Lim
1127c4ba88 Project Level Permissions (#27347)
* fix: update Permission params

* fix: upgrade check permission hook to support project level role

* fix: usePermissionsLoaded

* fix: Permission params can be undefined

* Scaffold new access management UI

* Add validation

* Update roles view

* Add tooltip

* Add button to apply role to all projects

* Update UI to select projects first instead of roles

* Merge master update UI

* Midway trying to implementation project level perms API

* First pass implementating updating project level permissions

* Add client side validation for assigning/removing roles

* Midway implementing new invites

* Integrate most of the project level permissions functionality

* fix: filter out org-level permissions before checking

* Add relevant UI guards in org level pages for project role POV

* Minor refactors

* Small refactors

* More fixes

* Moar refactors

* More fixes

* More fixes

* Refactor update role logic and smack some test cases on it

* Fixes

* Fix type issue

* Fix type

* more fixes, refactors, adding checks...

* MORE fixes

* Add perms checking for replicas

* Add ButtonTooltip component and use them to prevent repetition of pointer events auto for buttons with tooltips

* Convert all buttons with tooltips to use ButtonTooltip

* refactor

* PRettier

* Small fix

* Remove commented out code in organization-invitation-accept-mutation

* fix: switch to use the platform oauth authorizations routes

* Add perms checking for org audit logs and org oauth apps

* PRettier

* Fix incorrect URL for oauth app flow

* Fix incorrect URL for oauth app flow

* Fix

* Add perms checking for warehouse related UI

* Update roles helper icon

* remove unused lib

* Update package lock... again

* Update package lock... again

* Smalllll update

* Update some checks

* Add gate for project level permissions

* Last fix

* update codegen

* Update warehouse endpoint routes

* Fix

---------

Co-authored-by: phamhieu <phamhieu1998@gmail.com>
Co-authored-by: Alaister Young <a@alaisteryoung.com>
2024-07-01 17:59:54 +08:00
Kevin Grüneberg
bcda19a3bc chore: text adjustments for upcoming invoice section (#27419)
Co-authored-by: Thomas <31189692+ecktoteckto@users.noreply.github.com>
2024-06-21 17:26:57 +08:00
Jordi Enric
aa84f7f60b fix warehouse rows & update UI for event detail (#26891)
* ui fixes, rendering data in warehouse table fixed

* reduce padding in header

* rm test of copy button since it was moved elsewhere
2024-05-31 20:59:28 +02:00
Jordi Enric
483492564d disable warehouse tenant query when ff is disabled (#26873)
* disable warehouse tenant query when ff is disabled

* rm unecessary check

* disable warehouse queries when warehouse flag is off or not in warehouse querytype

* fix useeffect forcing query to refetch when disabled
2024-05-30 01:30:43 +02:00
Jordi Enric
9fd85e76fb feature: warehouse (#23714)
* add event collection ui, queries, routing

* fix alignment issue

* renaming

* wip

* feat: initial data hooks and integration with feature flagging

* update with naming, correct mocks, etc

* feat: add source crud integration

* mock data, fix form, add motion to drawer

* feat: optimize warehouse fetch behaviour

* feat: add in valid query

* chore: ermove collection mocks

* feat: optimize tenant fetching

* cleanup + update openapi client + fix fetch calls

* cleanup imporst

* on delete success, redirect to main logs page

* fix dropdown event propagating to link and opening page

* Refactor code to use useParams and useRouter in CreateWarehouseCollection.tsx, WarehouseCollectionDetail.tsx, and LogsLayout.tsx

* clean warehouse query

* warehouse access tokens create, list

* add warehouse access token revokal

* fix access tokens table, fix access tokens revoke feature

* format date in access tokens table

* fix some state issues and warnings in access tokens forms

* warehouse/feat: introduction when creating event collections (#23244)

feat: add introduction for event collections

* warehouse/feat: rename headers and nav items (#23243)

* feat: rename headers

* feat: use feature flag for navigation bar

* move header name flag to component

* fix typeerror in create collection query

---------

Co-authored-by: Jordi Enric <jordi.err@gmail.com>

* ui fixes, rm deprecated icons

* render table with events

* fix typeerror results arr

* add pagination

* some ui fixes

* fix loading states, format dates, test connection dialog

* patch type errors

* Fix access token selection in TestCollectionDialog and update column name in WarehouseAccessTokens

* rm unused querytype

* rm unused querytype in logtable

* patch type errors in warhouse collection mutations

* rm unused component

* mr unused import

* show connection dialog in staging

* fix Run btn now showing up

* fix undef argument

* show pagination only when there are results

* fix issues in connection dialog, improve ux

* Update apps/studio/components/interfaces/DataWarehouse/CreateWarehouseAccessToken.tsx

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>

* Update apps/studio/components/interfaces/DataWarehouse/CreateWarehouseAccessToken.tsx

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>

* fix infinite render loop, adapt component to render log metadata on log selection

* rm unused import, prevent ui from breaking when some data may be missing from an event

* update WAT create mutation to use template

* follow mutation template in delete access token mutation

* refactor naming, improve code in some areas

* rm unused mocks for msw

* skip tests - this will get fixed on the vitest PR

* Update apps/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>

* fix loading compo

* rm unused import

* use correct alert title

* rm unnecessary div

* fix layout in projectpaused alert

* fix type err, refactor to new method

* rm observer

* rm observer

* refactor warehouse collections update

* use correct get method, comment out so it doesnt err

* use correct method

* fix formatting issues

* ref imports

* ref imports

* clean up imports

* clean imports

* clean imports

* rename props

* destructure props

* cleanup imports

* Update apps/studio/components/interfaces/DataWarehouse/CreateWarehouseCollection.tsx

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>

* ref scale class

* cleanup divs

* Update apps/studio/components/interfaces/DataWarehouse/TestCollectionDialog.tsx

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>

* refactor to rhf

* reuse types, cleanup, refactor to react query hooks instead of el events

* refactor table component to handle empty state

* Update TestCollectionDialog to use unique keys for SelectItem components

* Update TestCollectionDialog to use unique keys for SelectItem components

* Update TestCollectionDialog to use unique keys for SelectItem components

* fix empty state ui

* use destructured queries

* rename query types

* Update apps/studio/components/interfaces/DataWarehouse/WarehouseAccessTokens.tsx

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>

* chore: Refactor WarehouseCollectionDetail component

* rm unused imports

* rename loadolder

* rm typcast

* rhf in create token

* improve err handling

* refactor to rhf, refactor queries, use cn utils, cleanup

* fix loading logselection

* add correct type to warehouse access tokens query

* use correct types in err & clean unused types

* toggle token in curl exampel

* use product empty state component in warehouse

* add client side validation of collection name, temp fix

* add New badge

* update testcolldialog

* cleanup unnecessary div and rm double border

* code style fixes

* handle err

* code style fix

* add correct type

* add correct err type

* fix type error

* fix type err

* fix missing type

---------

Co-authored-by: TzeYiing <ty@tzeyiing.com>
Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-05-29 10:32:46 +02:00
Joshen Lim
163263c3c5 First round of wrapping RQ errors with handleError (#26384)
* First round of wrapping RQ errors with handleError

* Remove the throw before the handleError usage.

* Make the handling of an API error more versatile. Add logging in Sentry if the error is of unknown type.

* Remove throwing of the handleError function.

* Add return type to the handleError function to be never so that we're sure it always throws.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-05-17 16:30:55 +08:00
Joshen Lim
1afaae6447 Chore/reports read replicas filter (#23711)
* Scaffold for API reports

* Add support for filtering database reports by replicas

* midway adding read replica support for custom reports

* Refactor reports page to use react query and deprecate project content mobxstore

* Reports add chart labels if metric is read replica specific

* Give an easier way to remove charts from reports

* make reports layout non-blocking

* Update apps/studio/components/interfaces/Reports/Reports.tsx

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-05-07 16:44:23 +08:00
Kevin Grüneberg
9be160a51f feat: add supavisor egress breakdown (#22375) 2024-04-02 22:12:28 +08:00
Kevin Grüneberg
e197f3f8be feat: breakdown for function egress (#22231) 2024-04-01 08:20:25 +00:00
Kevin Grüneberg
f9a55935f5 chore: use type imports for types/interfaces (#21738) 2024-03-04 20:48:22 +08:00
Kevin Grüneberg
c3976cf73e chore: align naming for micro instance (#20656) 2024-01-23 15:25:25 +08:00
Lakshan Perera
661d8c0668 chore: do not feature flag usage metrics for edge functions (#20226) 2024-01-08 11:33:54 +08:00
Kevin Grüneberg
771948c1a6 feat: daily stats for compute (#19414) 2023-12-05 13:13:14 +01:00
Kevin Grüneberg
598c1ef866 chore: remove unused billing page/queries (#19412) 2023-12-04 15:54:57 +01:00
Lakshan Perera
ca8007ec80 feat: Show resource usage in function metrics (#18956)
* feat: show resource usage charts in function metrics

* fix: show highlighted value in StackedBarChart

* fix: PR feedback updates
2023-11-16 07:10:18 +11:00
Ivan Vasilov
436bdb10ae chore: Move the studio app to apps/studio (#18915)
* Move all studio files from /studio to /apps/studio.

* Move studio specific prettier ignores.

* Fix the ui references from studio.

* Fix the css imports.

* Fix all package.json issues.

* Fix the prettier setup for the studio app.

* Add .turbo folder to prettierignore.

* Fix the github workflows.
2023-11-15 12:38:55 +01:00