Skip to content

Commit c24f57c

Browse files
committed
fix: i18n keys & remove new prefix button.
1 parent 7a021a2 commit c24f57c

3 files changed

Lines changed: 35 additions & 82 deletions

File tree

‎components/object/list.vue‎

Lines changed: 24 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,15 @@
55
<template #actions>
66
<object-upload-stats />
77
<object-delete-stats />
8-
<Button variant="outline" @click="() => handleNewObject(true)">
8+
<!-- <Button variant="outline" @click="() => handleNewObject(true)">
99
<Icon name="ri:add-line" class="size-4" />
1010
<span>{{ t('New Folder') }}</span>
11-
</Button>
11+
</Button> -->
1212
<Button variant="outline" @click="() => (uploadPickerVisible = true)">
1313
<Icon name="ri:file-add-line" class="size-4" />
1414
<span>{{ t('Upload File') }}/{{ t('Folder') }}</span>
1515
</Button>
16-
<Button
17-
variant="outline"
18-
class="text-destructive border-destructive"
19-
:disabled="!checkedKeys.length"
20-
v-show="checkedKeys.length"
21-
@click="handleBatchDelete"
22-
>
16+
<Button variant="outline" class="text-destructive border-destructive" :disabled="!checkedKeys.length" v-show="checkedKeys.length" @click="handleBatchDelete">
2317
<Icon name="ri:delete-bin-5-line" class="size-4" />
2418
<span>{{ t('Delete Selected') }}</span>
2519
</Button>
@@ -34,12 +28,7 @@
3428
</template>
3529
</page-header>
3630

37-
<DataTable
38-
:table="table"
39-
:is-loading="loading"
40-
:empty-title="t('No Objects')"
41-
:empty-description="t('Upload files or create folders to populate this bucket.')"
42-
/>
31+
<DataTable :table="table" :is-loading="loading" :empty-title="t('No Objects')" :empty-description="t('Upload files or create folders to populate this bucket.')" />
4332

4433
<div class="flex justify-end gap-2">
4534
<Button variant="outline" :disabled="!continuationToken" @click="goToPreviousPage">
@@ -53,29 +42,18 @@
5342
</div>
5443
</div>
5544

56-
<object-upload-picker
57-
:show="uploadPickerVisible"
58-
:bucketName="bucketName"
59-
:prefix="prefix"
60-
@update:show="
61-
val => {
62-
uploadPickerVisible = val
63-
refresh()
64-
}
65-
"
66-
/>
67-
<object-new-form
68-
:show="newObjectFormVisible"
69-
:bucketName="bucketName"
70-
:prefix="prefix"
71-
:asPrefix="newObjectAsPrefix"
72-
@update:show="
73-
val => {
74-
newObjectFormVisible = val
75-
refresh()
76-
}
77-
"
78-
/>
45+
<object-upload-picker :show="uploadPickerVisible" :bucketName="bucketName" :prefix="prefix" @update:show="
46+
val => {
47+
uploadPickerVisible = val
48+
refresh()
49+
}
50+
" />
51+
<object-new-form :show="newObjectFormVisible" :bucketName="bucketName" :prefix="prefix" :asPrefix="newObjectAsPrefix" @update:show="
52+
val => {
53+
newObjectFormVisible = val
54+
refresh()
55+
}
56+
" />
7957
<object-info ref="infoRef" :bucket-name="bucketName" @refresh-parent="handleObjectDeleted" />
8058
</template>
8159

@@ -285,14 +263,14 @@ const columns = computed<ColumnDef<ObjectRow, any>[]>(() => {
285263
h('div', { class: 'flex items-center gap-2' }, [
286264
row.original.type === 'object'
287265
? h(
288-
Button,
289-
{
290-
variant: 'outline',
291-
size: 'sm',
292-
onClick: () => downloadFile(row.original.Key),
293-
},
294-
() => [h(Icon, { name: 'ri:download-cloud-2-line', class: 'size-4' }), h('span', t('Download'))]
295-
)
266+
Button,
267+
{
268+
variant: 'outline',
269+
size: 'sm',
270+
onClick: () => downloadFile(row.original.Key),
271+
},
272+
() => [h(Icon, { name: 'ri:download-cloud-2-line', class: 'size-4' }), h('span', t('Download'))]
273+
)
296274
: null,
297275
h(
298276
Button,

‎components/object/upload/picker.vue‎

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="flex flex-wrap items-center justify-between gap-3">
88
<div class="space-y-1">
99
<p class="text-sm font-medium text-muted-foreground">{{ t('Target Bucket') }}: {{ bucketName }}</p>
10-
<p class="text-xs text-muted-foreground">{{ t('Current Prefix') }}: {{ prefix || '/' }}</p>
10+
<p class="text-xs text-muted-foreground">{{ t('Current Prefix') }}: <span class="text-blue-500">{{ prefix || '/' }}</span></p>
1111
</div>
1212

1313
<ActionBar>
@@ -28,10 +28,7 @@
2828
</AlertDescription>
2929
</Alert>
3030

31-
<Alert
32-
v-if="isMemoryWarning"
33-
class="border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-100"
34-
>
31+
<Alert v-if="isMemoryWarning" class="border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-100">
3532
<AlertDescription>
3633
{{ t('Large File Count Warning', { count: totalFileCount.toLocaleString(), max: MAX_FILES_LIMIT }) }}
3734
</AlertDescription>
@@ -44,30 +41,16 @@
4441
<p v-if="totalFileCount > 0">{{ t('Total Files') }}: {{ totalFileCount.toLocaleString() }}</p>
4542
<p v-if="totalFileCount > 0">{{ t('Memory Usage') }}: {{ getMemoryUsageLevel() }}</p>
4643
</div>
47-
<Button
48-
variant="outline"
49-
size="sm"
50-
:disabled="!hasFiles || isFolderLoading || isAdding"
51-
@click="clearAllFiles"
52-
>
44+
<Button variant="outline" size="sm" :disabled="!hasFiles || isFolderLoading || isAdding" @click="clearAllFiles">
5345
<Icon name="ri:delete-bin-line" class="size-4" />
5446
{{ t('Clear All') }}
5547
</Button>
5648
</div>
5749

5850
<!-- objects list / drag area -->
59-
<div
60-
class="rounded-md border-t transition"
61-
:class="isDragOver ? 'border-primary bg-primary/5' : ''"
62-
@dragenter.prevent="handleDragEnter"
63-
@dragover.prevent="handleDragOver"
64-
@dragleave.prevent="handleDragLeave"
65-
@drop.prevent="handleDrop"
66-
>
67-
<div
68-
v-if="!selectedItems.length"
69-
class="flex h-[40vh] flex-col items-center justify-center gap-4 p-6 text-center"
70-
>
51+
<div class="rounded-md border-t transition" :class="isDragOver ? 'border-primary bg-primary/5' : ''" @dragenter.prevent="handleDragEnter" @dragover.prevent="handleDragOver"
52+
@dragleave.prevent="handleDragLeave" @drop.prevent="handleDrop">
53+
<div v-if="!selectedItems.length" class="flex h-[40vh] flex-col items-center justify-center gap-4 p-6 text-center">
7154
<Icon name="ri:cloud-upload-line" class="size-10 text-muted-foreground" />
7255
<p class="text-base font-medium text-muted-foreground">{{ t('No Selection') }}</p>
7356
<p class="max-w-[320px] text-sm text-muted-foreground">
@@ -94,10 +77,7 @@
9477
<tr v-for="(item, index) in selectedItems" :key="item.uid" class="border-b last:border-b-0">
9578
<td class="px-3 py-2">
9679
<div class="flex items-start gap-2">
97-
<Icon
98-
:name="item.type === 'folder' ? 'ri:folder-3-line' : 'ri:file-line'"
99-
class="mt-0.5 size-4 text-muted-foreground"
100-
/>
80+
<Icon :name="item.type === 'folder' ? 'ri:folder-3-line' : 'ri:file-line'" class="mt-0.5 size-4 text-muted-foreground" />
10181
<div>
10282
<div class="font-medium text-foreground truncate max-w-md">
10383
{{ item.name }}<span v-if="item.type === 'folder'">/</span>
@@ -144,12 +124,7 @@
144124
<Button variant="outline" :disabled="!hasFiles || isAdding || isFolderLoading">
145125
{{ t('Configure') }}
146126
</Button>
147-
<Button
148-
variant="default"
149-
:disabled="!hasFiles || isAdding || isFolderLoading"
150-
:loading="isAdding"
151-
@click="handleUpload"
152-
>
127+
<Button variant="default" :disabled="!hasFiles || isAdding || isFolderLoading" :loading="isAdding" @click="handleUpload">
153128
{{ t('Start Upload') }}
154129
</Button>
155130
</div>
@@ -238,7 +213,7 @@ const clearAllFiles = () => {
238213
239214
if (typeof window !== 'undefined' && 'gc' in window && typeof (window as any).gc === 'function') {
240215
try {
241-
;(window as any).gc()
216+
; (window as any).gc()
242217
} catch {
243218
// ignore
244219
}

‎i18n/locales/zh-CN.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@
667667
"Set Policy": "设置策略",
668668
"Set Retention": "设置保留",
669669
"Set Tag": "设置标签",
670-
"Set Tags": "设置tag",
670+
"Set Tags": "设置标签",
671671
"Set the prefix for the rule": "设置规则的前缀",
672672
"Set the time cycle for the rule": "设置规则的时间周期",
673673
"Settings": "设置",
@@ -782,7 +782,7 @@
782782
"Version 2.0, January 2004": "Version 2.0, January 2004",
783783
"Version Control": "版本控制",
784784
"VersionId": "版本ID",
785-
"Versions": "版本",
785+
"Versions": "版本历史",
786786
"View Documentation": "查看文档",
787787
"Virtualization Platform Support": "虚拟化平台支持",
788788
"Visit website": "访问官网",

0 commit comments

Comments
 (0)