Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Merge branch 'master' into feat/logs-timestamp-from-customization

TzeYiingb1413a099aec
diff --cc studio/components/interfaces/Settings/Logs/LogPanel.tsx
index d5e471bc158,6d89e2f0b92..0f3cecdebb6
--- a/studio/components/interfaces/Settings/Logs/LogPanel.tsx
+++ b/studio/components/interfaces/Settings/Logs/LogPanel.tsx
@@@ -114,84 -99,44 +114,85 @@@ const LogPanel: FC<Props> = (
</div>
</div>
<div className="flex items-center gap-x-4">
+ <div>
+ <Dropdown
+ side="bottom"
+ align="end"
+ overlay={
+ <Dropdown.Misc>
+ <Input
+ label="From"
+ labelOptional="UTC"
+ size="tiny"
+ value={from.value === '' ? defaultTimestamp : from.value}
+ onChange={handleFromChange}
+ actions={[
+ search && (
+ <IconX
+ key="reset-from"
+ size="tiny"
+ className="cursor-pointer mx-1"
+ title="Reset input"
+ onClick={handleFromReset}
+ />
+ ),
+ <Button
+ key="set"
+ size="tiny"
+ title="Set"
+ type="secondary"
+ onClick={() => onSearch(search)}
+ >
+ Set
+ </Button>,
+ ]}
+ />
+ </Dropdown.Misc>
+ }
+ >
+ <Button type="outline" icon={<IconClock size="tiny" />}>
+ {from.value ? 'Custom' : 'Now'}
+ </Button>
+ </Dropdown>
+ </div>
{/* wrap with form so that if user presses enter, the search value will submit automatically */}
- <form
- id="log-panel-search"
- onSubmit={(e) => {
- // prevent redirection
- e.preventDefault()
- onSearch(search)
- }}
- >
- <Input
- size="tiny"
- icon={<IconSearch size={16} />}
- placeholder="Search events"
- onChange={(e) => setSearch(e.target.value)}
- value={search}
- actions={[
- search && (
- <IconX
- key="clear-search"
+ {!isCustomQuery && (
+ <form
+ id="log-panel-search"
+ onSubmit={(e) => {
+ // prevent redirection
+ e.preventDefault()
+ onSearch(search)
+ }}
+ >
+ <Input
+ placeholder="Search events"
+ onChange={(e) => setSearch(e.target.value)}
+ value={search}
+ actions={[
+ search && (
+ <IconX
+ key="clear-search"
+ size="tiny"
+ className="cursor-pointer mx-1"
+ title="Clear search"
+ onClick={() => setSearch('')}
+ />
+ ),
+
+ <Button
+ key="go"
size="tiny"
- className="cursor-pointer mx-1"
- title="Clear search"
- onClick={() => setSearch('')}
- />
- ),
- <Button
- key="go"
- size="tiny"
- title="Go"
- type="secondary"
- onClick={() => onSearch(search)}
- >
- Go
- </Button>,
- ]}
- />
- </form>
+ title="Go"
+ type="secondary"
+ onClick={() => onSearch(search)}
+ >
+ <IconSearch size={16} />
+ </Button>,
+ ]}
+ />
+ </form>
+ )}
</div>
</div>
</div>