style: format web apps with prettier and sort imports
Apply repo-wide Prettier/lint normalization across admin-web, desktop-client and ops-web: single quotes, no semicolons, trailing commas, consistent line wrapping, and import ordering. Also drop an unused brand-logo import in DesktopShell.vue. No behavior changes — formatting only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,12 +36,7 @@ const CHUNK_ERROR_PATTERNS = [
|
||||
]
|
||||
|
||||
export function isChunkLoadError(err: unknown): boolean {
|
||||
const msg =
|
||||
err instanceof Error
|
||||
? err.message
|
||||
: typeof err === 'string'
|
||||
? err
|
||||
: ''
|
||||
const msg = err instanceof Error ? err.message : typeof err === 'string' ? err : ''
|
||||
return CHUNK_ERROR_PATTERNS.some((re) => re.test(msg))
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,8 @@ export async function copyTextToClipboard(text: string): Promise<void> {
|
||||
|
||||
function copyTextWithSelection(text: string): boolean {
|
||||
const textarea = document.createElement('textarea')
|
||||
const activeElement = document.activeElement instanceof HTMLElement ? document.activeElement : null
|
||||
const activeElement =
|
||||
document.activeElement instanceof HTMLElement ? document.activeElement : null
|
||||
|
||||
textarea.value = text
|
||||
textarea.setAttribute('readonly', '')
|
||||
|
||||
@@ -127,7 +127,9 @@ export const complianceApi = {
|
||||
)
|
||||
},
|
||||
deleteTerm(dictionaryId: number, termId: number) {
|
||||
return http.delete<{ deleted: boolean }>(`/compliance/dictionaries/${dictionaryId}/terms/${termId}`)
|
||||
return http.delete<{ deleted: boolean }>(
|
||||
`/compliance/dictionaries/${dictionaryId}/terms/${termId}`,
|
||||
)
|
||||
},
|
||||
publishDictionary(id: number) {
|
||||
return http.post<OpsComplianceDictionary>(`/compliance/dictionaries/${id}/publish`)
|
||||
|
||||
@@ -209,16 +209,19 @@ async function uploadOSSInChunks(
|
||||
onProgress?: (progress: DesktopClientReleaseUploadProgress) => void
|
||||
},
|
||||
): Promise<DesktopClientReleaseUploadResult> {
|
||||
const session = await http.post<DesktopClientReleaseUploadSession>('/desktop-client/release-uploads', {
|
||||
platform: target.platform,
|
||||
arch: target.arch,
|
||||
channel: target.channel,
|
||||
version: target.version,
|
||||
kind: target.kind ?? 'installer',
|
||||
file_name: file.name,
|
||||
file_size_bytes: file.size,
|
||||
chunk_size_bytes: DESKTOP_CLIENT_RELEASE_CHUNK_SIZE_BYTES,
|
||||
})
|
||||
const session = await http.post<DesktopClientReleaseUploadSession>(
|
||||
'/desktop-client/release-uploads',
|
||||
{
|
||||
platform: target.platform,
|
||||
arch: target.arch,
|
||||
channel: target.channel,
|
||||
version: target.version,
|
||||
kind: target.kind ?? 'installer',
|
||||
file_name: file.name,
|
||||
file_size_bytes: file.size,
|
||||
chunk_size_bytes: DESKTOP_CLIENT_RELEASE_CHUNK_SIZE_BYTES,
|
||||
},
|
||||
)
|
||||
|
||||
const chunkSize = session.chunk_size_bytes || DESKTOP_CLIENT_RELEASE_CHUNK_SIZE_BYTES
|
||||
const chunkCount = session.chunk_count || Math.ceil(file.size / chunkSize)
|
||||
@@ -232,7 +235,15 @@ async function uploadOSSInChunks(
|
||||
try {
|
||||
for (let index = 0; index < chunkCount; index += 1) {
|
||||
if (uploaded.has(index)) continue
|
||||
await uploadChunkWithRetry(file, session.upload_id, index, chunkSize, chunkCount, confirmedBytes, target)
|
||||
await uploadChunkWithRetry(
|
||||
file,
|
||||
session.upload_id,
|
||||
index,
|
||||
chunkSize,
|
||||
chunkCount,
|
||||
confirmedBytes,
|
||||
target,
|
||||
)
|
||||
confirmedBytes += chunkByteSize(file.size, chunkSize, index, chunkCount)
|
||||
emitChunkProgress(target, confirmedBytes, file.size, chunkCount, index)
|
||||
}
|
||||
|
||||
@@ -77,8 +77,14 @@ export const opsMediaSupplyApi = {
|
||||
params as Record<string, unknown>,
|
||||
)
|
||||
},
|
||||
setPrice(id: number, payload: { price_type?: string; sell_price_cents: number; enabled?: boolean }) {
|
||||
return http.put<{ updated: boolean }, typeof payload>(`/media-supply/resources/${id}/price`, payload)
|
||||
setPrice(
|
||||
id: number,
|
||||
payload: { price_type?: string; sell_price_cents: number; enabled?: boolean },
|
||||
) {
|
||||
return http.put<{ updated: boolean }, typeof payload>(
|
||||
`/media-supply/resources/${id}/price`,
|
||||
payload,
|
||||
)
|
||||
},
|
||||
setVisibility(id: number, customerVisible: boolean) {
|
||||
return http.put<{ updated: boolean }, { customer_visible: boolean }>(
|
||||
@@ -101,7 +107,15 @@ export const opsMediaSupplyApi = {
|
||||
params as Record<string, unknown>,
|
||||
)
|
||||
},
|
||||
adjustWallet(payload: { tenant_id: number; user_id: number; delta_cents: number; note?: string }) {
|
||||
return http.post<OpsMediaSupplyWallet, typeof payload>('/media-supply/wallets/adjustments', payload)
|
||||
adjustWallet(payload: {
|
||||
tenant_id: number
|
||||
user_id: number
|
||||
delta_cents: number
|
||||
note?: string
|
||||
}) {
|
||||
return http.post<OpsMediaSupplyWallet, typeof payload>(
|
||||
'/media-supply/wallets/adjustments',
|
||||
payload,
|
||||
)
|
||||
},
|
||||
}
|
||||
|
||||
@@ -95,9 +95,12 @@ export const objectStorageApi = {
|
||||
)
|
||||
},
|
||||
createFolder(prefix: string) {
|
||||
return http.post<ObjectStorageFolderCreateResult, { prefix: string }>('/object-storage/folders', {
|
||||
prefix,
|
||||
})
|
||||
return http.post<ObjectStorageFolderCreateResult, { prefix: string }>(
|
||||
'/object-storage/folders',
|
||||
{
|
||||
prefix,
|
||||
},
|
||||
)
|
||||
},
|
||||
deleteFolder(prefix: string) {
|
||||
return http.delete<ObjectStorageFolderDeleteResult>(
|
||||
|
||||
Reference in New Issue
Block a user