Skip to content
This repository was archived by the owner on Oct 19, 2026. It is now read-only.

Commit 2fcf70d

Browse files
committed
fix eslint
1 parent 0cd7182 commit 2fcf70d

6 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎moon/apps/web/components/OrionClient/DeleteOrionImageDialog.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type { OrionVmImage } from '@/hooks/OrionClient/useGetOrionImages'
99
function shortDigest(digest?: string | null) {
1010
if (!digest) return '—'
1111
const hex = digest.replace(/^sha256:/, '').replace(/^sha512:/, '')
12+
1213
return hex.length > 12 ? `${hex.slice(0, 12)}…` : hex
1314
}
1415

‎moon/apps/web/components/OrionClient/OrionImagesTable.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ import type { OrionVmImage } from '@/hooks/OrionClient/useGetOrionImages'
1010
function shortDigest(digest?: string | null) {
1111
if (!digest) return '—'
1212
const hex = digest.replace(/^sha256:/, '').replace(/^sha512:/, '')
13+
1314
return hex.length > 12 ? `${hex.slice(0, 12)}…` : hex
1415
}
1516

1617
function formatBytes(n?: number | null) {
1718
if (n == null || n <= 0) return '—'
1819
const gb = n / (1024 * 1024 * 1024)
20+
1921
if (gb >= 1) return `${gb.toFixed(1)} GiB`
2022
const mb = n / (1024 * 1024)
23+
2124
return `${mb.toFixed(0)} MiB`
2225
}
2326

‎moon/apps/web/components/OrionClient/UploadOrionImageDialog.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ interface UploadOrionImageDialogProps {
3636

3737
function defaultImageName(fileName: string) {
3838
const base = fileName.replace(/\.qcow2$/i, '').trim()
39+
3940
return base || 'debian-13-buck2'
4041
}
4142

4243
function phaseLabel(phase: UploadPhase, progress: number): string {
4344
const pct = Math.round(progress * 100)
45+
4446
switch (phase) {
4547
case 'hashing':
4648
return `Hashing image… ${pct}%`
@@ -91,6 +93,7 @@ export function UploadOrionImageDialog({ open, onOpenChange }: UploadOrionImageD
9193
const resolvedName = imageName.trim() || defaultImageName(qcow2File.name)
9294

9395
let infoMeta: ImageInfoSidecar = {}
96+
9497
if (infoFile) {
9598
try {
9699
infoMeta = JSON.parse(await infoFile.text()) as ImageInfoSidecar
@@ -147,6 +150,7 @@ export function UploadOrionImageDialog({ open, onOpenChange }: UploadOrionImageD
147150
onOpenChange(false)
148151
} catch (error) {
149152
const message = error instanceof Error ? error.message : 'Upload failed'
153+
150154
toast.error(message)
151155
setPhase('idle')
152156
setProgress(0)
@@ -182,6 +186,7 @@ export function UploadOrionImageDialog({ open, onOpenChange }: UploadOrionImageD
182186
disabled={busy}
183187
onChange={(e) => {
184188
const file = e.target.files?.[0] ?? null
189+
185190
setQcow2File(file)
186191
if (file && !imageName.trim()) {
187192
setImageName(defaultImageName(file.name))

‎moon/apps/web/hooks/OrionClient/orionImageUpload.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export async function sha256HexOfFile(
66
onProgress?: (ratio: number) => void
77
): Promise<string> {
88
const hasher = await createSHA256()
9+
910
hasher.init()
1011
const total = file.size || 1
1112
let done = 0
@@ -15,6 +16,7 @@ export async function sha256HexOfFile(
1516

1617
for (;;) {
1718
const { done: eof, value } = await reader.read()
19+
1820
if (eof) break
1921
if (value) {
2022
hasher.update(value)
@@ -41,6 +43,7 @@ export function putWithProgress(
4143

4244
return new Promise((resolve, reject) => {
4345
const xhr = new XMLHttpRequest()
46+
4447
xhr.open('PUT', url)
4548
xhr.withCredentials = withCredentials
4649
if (contentType) {
@@ -59,6 +62,7 @@ export function putWithProgress(
5962
return
6063
}
6164
const detail = (xhr.responseText || '').trim().slice(0, 240)
65+
6266
reject(
6367
new Error(
6468
`Upload failed (HTTP ${xhr.status})${detail ? `: ${detail}` : ''}`
@@ -87,5 +91,6 @@ export function resolveMonoUploadUrl(putUrlOrPath: string, monoApiBase: string):
8791
}
8892
const base = monoApiBase.replace(/\/$/, '')
8993
const path = putUrlOrPath.startsWith('/') ? putUrlOrPath : `/${putUrlOrPath}`
94+
9095
return `${base}${path}`
9196
}

‎moon/apps/web/hooks/OrionClient/usePresignOrionImage.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export function usePresignOrionImage() {
3434
})
3535
const text = await res.text()
3636
let json: Envelope | null = null
37+
3738
try {
3839
json = text ? (JSON.parse(text) as Envelope) : null
3940
} catch {

‎moon/apps/web/hooks/OrionClient/useRunnerLogsSSE.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ function mergeLogChunk(prev: string, chunk: string): string {
6666

6767
for (const raw of incoming) {
6868
const line = raw
69+
6970
if (line === '' && incoming.length === 1) {
7071
continue
7172
}
7273
if (isProvisionProgressLine(line)) {
7374
const lastIdx = lines.length - 1
75+
7476
if (lastIdx >= 0 && isProvisionProgressLine(lines[lastIdx])) {
7577
lines[lastIdx] = line
7678
} else {
@@ -82,6 +84,7 @@ function mergeLogChunk(prev: string, chunk: string): string {
8284
}
8385

8486
let next = lines.join('\n')
87+
8588
if (chunk.endsWith('\n') && !next.endsWith('\n')) {
8689
next += '\n'
8790
}
@@ -139,6 +142,7 @@ export function useRunnerLogsSSE(streamKey: string | null) {
139142
// Real guest/system logs arrived — clear the transient-wait gate so a later
140143
// reprovision can announce waiting again if needed. Progress lines keep the gate.
141144
const trimmed = chunk.trim()
145+
142146
if (
143147
!TRANSIENT_NO_VM_RE.test(trimmed) &&
144148
!isProvisionProgressLine(trimmed) &&

0 commit comments

Comments
 (0)