aboutsummaryrefslogtreecommitdiff
path: root/front-end/src/views/Blog/components/Content/ContentTable.vue
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-06-07 15:45:56 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-06-07 15:45:56 -0400
commitf77ff50150e6ff5d1f2b03c4f465846d5bb49a96 (patch)
tree1096bba241834211a25f7895db21e1a8d581ea17 /front-end/src/views/Blog/components/Content/ContentTable.vue
parentf9e2109c27af5ece546261c018d4b2781860ff1c (diff)
Squashed commit of the following:v0.1.5-alpha
commit 8ed4663e539d9c2ea58aaad02a1fc2896956f6b6 Author: vnugent <public@vaughnnugent.com> Date: Fri Jun 7 15:43:48 2024 -0400 fix: invalid chars in status cookie name commit 9d1df65d99732a68b4fe96dcc75273442cbd322f Author: vnugent <public@vaughnnugent.com> Date: Thu Jun 6 21:31:30 2024 -0400 fix: Some container fixes and compatability commit 5ecd6b39cccdc9500540b10685605b5fcba61f69 Author: vnugent <public@vaughnnugent.com> Date: Thu Jun 6 17:19:48 2024 -0400 Update and expose storage config for container commit 3a62bafd210a2e00d23d3df773e47011e09eba6e Author: vnugent <public@vaughnnugent.com> Date: Thu Jun 6 16:18:36 2024 -0400 ci: build admin lib before building front-end commit 35920ad6c8596fc14bcfed66303511e8c249be8d Author: vnugent <public@vaughnnugent.com> Date: Thu Jun 6 15:56:36 2024 -0400 ci: Local vite config, force set lib versions commit 3c228b3cc5172fae398af8de72b64bd780ace20c Author: vnugent <public@vaughnnugent.com> Date: Wed Jun 5 19:55:39 2024 -0400 ci: Update packages and add container build commit 21d2719701f851d4a555c363b141f289f14a5192 Author: vnugent <public@vaughnnugent.com> Date: Wed Jun 5 15:58:07 2024 -0400 fix: #1 new channel page when hitting new button commit eefba88ac4e2c70517aa71c79ed94c346f9de554 Author: vnugent <public@vaughnnugent.com> Date: Wed Jun 5 15:26:15 2024 -0400 chore: Package updates commit 9eed4022a79f2cba139c9f8a359bfc8c1f9c31c5 Author: vnugent <public@vaughnnugent.com> Date: Wed Jun 5 14:44:08 2024 -0400 ci: Stage blocking changes
Diffstat (limited to 'front-end/src/views/Blog/components/Content/ContentTable.vue')
-rw-r--r--front-end/src/views/Blog/components/Content/ContentTable.vue90
1 files changed, 45 insertions, 45 deletions
diff --git a/front-end/src/views/Blog/components/Content/ContentTable.vue b/front-end/src/views/Blog/components/Content/ContentTable.vue
index 98a76a4..dab63bd 100644
--- a/front-end/src/views/Blog/components/Content/ContentTable.vue
+++ b/front-end/src/views/Blog/components/Content/ContentTable.vue
@@ -1,3 +1,48 @@
+<script setup lang="ts">
+import { defineAsyncComponent, ref } from 'vue';
+import { filter as _filter, defaultTo, includes, truncate } from 'lodash-es';
+import { useClipboard } from '@vueuse/core';
+import { useWait } from '@vnuge/vnlib.browser';
+import { ContentMeta } from '@vnuge/cmnext-admin';
+const ImgPreviewDialog = defineAsyncComponent(() => import('../image-preview-dialog.vue'))
+
+const emit = defineEmits(['open-edit', 'copy-link', 'delete', 'download'])
+defineProps<{ items: ContentMeta[] }>()
+
+const { waiting } = useWait()
+const { copy } = useClipboard()
+
+const previewItem = ref<ContentMeta | undefined>()
+
+const getDateString = (time?: number) => new Date((time || 0) * 1000).toLocaleString();
+const getItemLength = (item: ContentMeta) : string =>{
+ const length = item.length || 0;
+ return length > 1024 ? `${(length / 1024).toFixed(2)} KB` : `${length} B`
+}
+const getItemId = (item: ContentMeta) => truncate(item.id || '', { length: 20 })
+const getItemName = (item : ContentMeta) => truncate(item.name || '', { length: 30 })
+
+const getContentIconType = (item: ContentMeta) => {
+ const type = defaultTo(item.content_type, '')
+ if (includes(type, 'image')) return 'image'
+ if (includes(type, 'video')) return 'video'
+ if (includes(type, 'audio')) return 'headphones'
+ if (includes(type, 'html')) return 'code'
+ if (includes(type, 'zip')) return 'file-zipper'
+ return 'file'
+}
+
+const isImage = (item: ContentMeta) => includes(item.content_type, 'image')
+const openEdit = async (item: ContentMeta) => emit('open-edit', item)
+const copyLink = (item : ContentMeta) => emit('copy-link', item)
+const deleteItem = (item : ContentMeta) => emit('delete', item)
+const download = (item : ContentMeta) => emit('download', item)
+
+const onShowPreview = (item: ContentMeta) => previewItem.value = item
+const onClosePreview = () => previewItem.value = undefined
+
+</script>
+
<template>
<thead>
<tr>
@@ -63,48 +108,3 @@
<!-- Image preview dialog -->
<ImgPreviewDialog :item="previewItem" @close="onClosePreview()" />
</template>
-
-<script setup lang="ts">
-import { defineAsyncComponent, ref } from 'vue';
-import { filter as _filter, defaultTo, includes, truncate } from 'lodash-es';
-import { useClipboard } from '@vueuse/core';
-import { useWait } from '@vnuge/vnlib.browser';
-import { ContentMeta } from '@vnuge/cmnext-admin';
-const ImgPreviewDialog = defineAsyncComponent(() => import('../image-preview-dialog.vue'))
-
-const emit = defineEmits(['open-edit', 'copy-link', 'delete', 'download'])
-defineProps<{ items: ContentMeta[] }>()
-
-const { waiting } = useWait()
-const { copy } = useClipboard()
-
-const previewItem = ref<ContentMeta | undefined>()
-
-const getDateString = (time?: number) => new Date((time || 0) * 1000).toLocaleString();
-const getItemLength = (item: ContentMeta) : string =>{
- const length = item.length || 0;
- return length > 1024 ? `${(length / 1024).toFixed(2)} KB` : `${length} B`
-}
-const getItemId = (item: ContentMeta) => truncate(item.id || '', { length: 20 })
-const getItemName = (item : ContentMeta) => truncate(item.name || '', { length: 30 })
-
-const getContentIconType = (item: ContentMeta) => {
- const type = defaultTo(item.content_type, '')
- if (includes(type, 'image')) return 'image'
- if (includes(type, 'video')) return 'video'
- if (includes(type, 'audio')) return 'headphones'
- if (includes(type, 'html')) return 'code'
- if (includes(type, 'zip')) return 'file-zipper'
- return 'file'
-}
-
-const isImage = (item: ContentMeta) => includes(item.content_type, 'image')
-const openEdit = async (item: ContentMeta) => emit('open-edit', item)
-const copyLink = (item : ContentMeta) => emit('copy-link', item)
-const deleteItem = (item : ContentMeta) => emit('delete', item)
-const download = (item : ContentMeta) => emit('download', item)
-
-const onShowPreview = (item: ContentMeta) => previewItem.value = item
-const onClosePreview = () => previewItem.value = undefined
-
-</script>