Skip to content

Commit 75919e3

Browse files
committed
Migrate diagnostics app
1 parent cca782b commit 75919e3

File tree

6 files changed

+17
-14
lines changed

6 files changed

+17
-14
lines changed

tools/diagnostics-app/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM node:22.5 AS builder
1+
FROM node:24.11 AS builder
22
WORKDIR /app
33

4-
RUN npm i -g pnpm@9
4+
RUN corepack enable
55

66
COPY . /app
77

tools/diagnostics-app/src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default function EntryPage() {
3636

3737
return (
3838
<S.MainGrid container>
39-
<S.CenteredGrid item xs={12} md={6} lg={5}>
39+
<S.CenteredGrid size={{ xs: 12, md: 6, lg: 5 }}>
4040
<CircularProgress />
4141
</S.CenteredGrid>
4242
</S.MainGrid>

tools/diagnostics-app/src/app/views/client-params.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function ClientParamsPage() {
119119
<form onSubmit={onSubmit}>
120120
{params.map(({ key, value, type, error }, idx: number) => (
121121
<S.CenteredGrid container key={idx}>
122-
<S.CenteredGrid item xs={12} md={10}>
122+
<S.CenteredGrid size={{ xs: 12, md: 10 }}>
123123
<TextField
124124
label="Key"
125125
value={key}

tools/diagnostics-app/src/app/views/sql-console.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { NavigationPage } from '@/components/navigation/NavigationPage';
77
const DEFAULT_QUERY = `SELECT name FROM ps_buckets`;
88

99
export default function SQLConsolePage() {
10-
const inputRef = React.useRef<HTMLInputElement>();
10+
const inputRef = React.useRef<HTMLInputElement>(null);
1111
const [query, setQuery] = React.useState(DEFAULT_QUERY);
1212
const { data: querySQLResult, isLoading, error } = useQuery(query);
1313

@@ -31,7 +31,7 @@ export default function SQLConsolePage() {
3131
<NavigationPage title="SQL Console">
3232
<S.MainContainer>
3333
<S.CenteredGrid container>
34-
<S.CenteredGrid item xs={12} md={10}>
34+
<S.CenteredGrid size={{ xs: 12, md: 10 }}>
3535
<TextField
3636
inputRef={inputRef}
3737
fullWidth
@@ -47,7 +47,7 @@ export default function SQLConsolePage() {
4747
helperText={errorMessage}
4848
/>
4949
</S.CenteredGrid>
50-
<S.CenteredGrid item xs={12} md={2}>
50+
<S.CenteredGrid size={{ xs: 12, md: 2 }}>
5151
<Button
5252
sx={{ margin: '10px' }}
5353
variant="contained"

tools/diagnostics-app/src/app/views/sync-diagnostics.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export default function SyncDiagnosticsPage() {
128128

129129
const columns: GridColDef[] = [
130130
{ field: 'name', headerName: 'Name', flex: 2 },
131-
{ field: 'tables', headerName: 'Table(s)', flex: 1, type: 'text' },
131+
{ field: 'tables', headerName: 'Table(s)', flex: 1, type: 'string' },
132132
{ field: 'row_count', headerName: 'Row Count', flex: 1, type: 'number' },
133133
{ field: 'downloaded_operations', headerName: 'Downloaded Operations', flex: 1, type: 'number' },
134134
{ field: 'total_operations', headerName: 'Total Operations', flex: 1, type: 'number' },
@@ -137,27 +137,27 @@ export default function SyncDiagnosticsPage() {
137137
headerName: 'Data Size',
138138
flex: 1,
139139
type: 'number',
140-
valueFormatter: (v) => formatBytes(v.value)
140+
valueFormatter: formatBytes
141141
},
142142
{
143143
field: 'metadata_size',
144144
headerName: 'Metadata Size',
145145
flex: 1,
146146
type: 'number',
147-
valueFormatter: (v) => formatBytes(v.value)
147+
valueFormatter: formatBytes
148148
},
149149
{
150150
field: 'download_size',
151151
headerName: 'Downloaded Size',
152152
flex: 1,
153153
type: 'number',
154-
valueFormatter: (v) => formatBytes(v.value)
154+
valueFormatter: formatBytes
155155
},
156156
{
157157
field: 'status',
158158
headerName: 'Status',
159159
flex: 1,
160-
type: 'text'
160+
type: 'string'
161161
}
162162
];
163163

@@ -194,7 +194,7 @@ export default function SyncDiagnosticsPage() {
194194
headerName: 'Data Size',
195195
flex: 1,
196196
type: 'number',
197-
valueFormatter: (v) => formatBytes(v.value)
197+
valueFormatter: formatBytes
198198
}
199199
];
200200

@@ -325,7 +325,7 @@ function StreamsState() {
325325
function StreamsGrid(props: { streams: SyncStreamStatus[] }) {
326326
const columns: GridColDef[] = [
327327
{ field: 'name', headerName: 'Stream name', flex: 2 },
328-
{ field: 'parameters', headerName: 'Parameters', flex: 3, type: 'text' },
328+
{ field: 'parameters', headerName: 'Parameters', flex: 3, type: 'string' },
329329
{ field: 'default', headerName: 'Default', flex: 1, type: 'boolean' },
330330
{ field: 'active', headerName: 'Active', flex: 1, type: 'boolean' },
331331
{ field: 'has_explicit_subscription', headerName: 'Explicit', flex: 1, type: 'boolean' },

tools/diagnostics-app/vite.config.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ export default defineConfig({
3434
VitePWA({
3535
registerType: 'autoUpdate',
3636
includeAssets: ['powersync-logo.svg', 'supabase-logo.png', 'favicon.ico'],
37+
workbox: {
38+
maximumFileSizeToCacheInBytes: 3000000
39+
},
3740
manifest: {
3841
theme_color: '#c44eff',
3942
background_color: '#c44eff',

0 commit comments

Comments
 (0)