Skip to content

Commit

Permalink
perf: File management fine adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoJiSen committed Nov 15, 2024
1 parent ba45b8f commit a7a8928
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 5 deletions.
1 change: 1 addition & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@xterm/xterm": "^5.5.0",
"alova": "^3.0.2",
"clipboard-polyfill": "^4.1.0",
"dayjs": "^1.11.13",
"loglevel": "^1.9.1",
"mitt": "^3.0.1",
"naive-ui": "^2.39.0",
Expand Down
48 changes: 43 additions & 5 deletions ui/src/components/pamFileList/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@
</template>

<script setup lang="ts">
import dayjs from 'dayjs';
import mittBus from '@/utils/mittBus.ts';
import { Delete, CloudDownload } from '@vicons/carbon';
import { NButton, NIcon, NTag, NText } from 'naive-ui';
import { NButton, NFlex, NIcon, NTag, NText } from 'naive-ui';
import { Folder, Folders, Settings } from '@vicons/tabler';
import { ArrowBackIosFilled, ArrowForwardIosFilled } from '@vicons/material';
Expand Down Expand Up @@ -222,7 +223,31 @@ const createColumns = (): DataTableColumns<RowData> => {
title: t('Name'),
key: 'name',
resizable: true,
align: 'center'
align: 'center',
render(row) {
return h(
NFlex,
{
align: 'center'
},
{
default: () => [
h(NIcon, {
size: '16',
component: Folder
}),
h(
NText,
{
depth: 1,
strong: true
},
{ default: () => row.name }
)
]
}
);
}
},
{
title: t('Date Modified'),
Expand All @@ -232,14 +257,27 @@ const createColumns = (): DataTableColumns<RowData> => {
width: 220,
ellipsis: {
tooltip: true
},
render(row: RowData) {
return h(
NTag,
{
style: {
marginRight: '6px'
},
type: 'info',
bordered: false
},
{ default: () => dayjs(Number(row.mod_time) * 1000).format('YYYY-MM-DD HH:mm:ss') }
);
}
},
{
title: t('Size'),
key: 'size',
resizable: true,
align: 'center',
render(row) {
render(row: RowData) {
return h(
NText,
{
Expand All @@ -257,7 +295,7 @@ const createColumns = (): DataTableColumns<RowData> => {
key: 'type',
resizable: true,
align: 'center',
render(row) {
render(row: RowData) {
return h(
NTag,
{
Expand All @@ -278,7 +316,7 @@ const createColumns = (): DataTableColumns<RowData> => {
key: 'actions',
resizable: true,
align: 'center',
render(row) {
render(row: RowData) {
return actionItem.map(item => {
return h(
NButton,
Expand Down
5 changes: 5 additions & 0 deletions ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,11 @@ date-fns@^2.30.0:
dependencies:
"@babel/runtime" "^7.21.0"

dayjs@^1.11.13:
version "1.11.13"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.13.tgz#92430b0139055c3ebb60150aa13e860a4b5a366c"
integrity sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==

de-indent@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
Expand Down

0 comments on commit a7a8928

Please sign in to comment.