Commit 0820c04 1 parent b335a99 commit 0820c04 Copy full SHA for 0820c04
File tree 5 files changed +151
-0
lines changed
5 files changed +151
-0
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div id =" torrent-created-by" class =" flex flex-col gap-6" >
3
+ <div class =" flex flex-row items-center justify-between" >
4
+ <h2 class =" mr-1 text-2xl font-medium text-left text-neutral-content/50" >
5
+ Created by
6
+ </h2 >
7
+ <button
8
+ class =" flex flex-col items-center justify-center w-10 h-10 duration-200 bg-transparent text-base-content/50 hover:text-base-content rounded-xl"
9
+ @click =" collapsed = !collapsed"
10
+ >
11
+ <ChevronDownIcon class =" w-6" :class =" { 'rotate-90': collapsed }" />
12
+ </button >
13
+ </div >
14
+ <template v-if =" ! collapsed " >
15
+ <div class =" flex flex-col w-full h-full p-6 grow bg-base-100 rounded-2xl" >
16
+ <template v-if =" torrent .created_by " >
17
+ <Markdown :source =" torrent.created_by" />
18
+ </template >
19
+ <template v-else >
20
+ <span class =" italic text-neutral-content" >No created by field provided.</span >
21
+ </template >
22
+ </div >
23
+ </template >
24
+ </div >
25
+ </template >
26
+
27
+ <script setup lang="ts">
28
+ import { ChevronDownIcon } from " @heroicons/vue/24/solid" ;
29
+ import { TorrentResponse } from " torrust-index-types-lib" ;
30
+ import { PropType } from " vue" ;
31
+ import { ref } from " #imports" ;
32
+ import Markdown from " ~/components/Markdown.vue" ;
33
+
34
+ const collapsed = ref (false );
35
+
36
+ const props = defineProps ({
37
+ torrent: {
38
+ type: Object as PropType <TorrentResponse >,
39
+ required: true
40
+ }
41
+ });
42
+ </script >
43
+
44
+ <style scoped>
45
+
46
+ </style >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div id =" torrent-creation-date" class =" flex flex-col gap-6" >
3
+ <div class =" flex flex-row items-center justify-between" >
4
+ <h2 class =" mr-1 text-2xl font-medium text-left text-neutral-content/50" >
5
+ Creation Date
6
+ </h2 >
7
+ <button
8
+ class =" flex flex-col items-center justify-center w-10 h-10 duration-200 bg-transparent text-base-content/50 hover:text-base-content rounded-xl"
9
+ @click =" collapsed = !collapsed"
10
+ >
11
+ <ChevronDownIcon class =" w-6" :class =" { 'rotate-90': collapsed }" />
12
+ </button >
13
+ </div >
14
+ <template v-if =" ! collapsed " >
15
+ <div class =" flex flex-col w-full h-full p-6 grow bg-base-100 rounded-2xl" >
16
+ <template v-if =" torrent .creation_date " >
17
+ <!-- <Markdown :source="torrent.name" />-->
18
+ {{ convertedDate }}
19
+ </template >
20
+ <template v-else >
21
+ <span class =" italic text-neutral-content" >No creation date provided.</span >
22
+ </template >
23
+ </div >
24
+ </template >
25
+ </div >
26
+ </template >
27
+
28
+ <script setup lang="ts">
29
+ import { ChevronDownIcon } from " @heroicons/vue/24/solid" ;
30
+ import { TorrentResponse } from " torrust-index-types-lib" ;
31
+ import { PropType } from " vue" ;
32
+ import { ref } from " #imports" ;
33
+ import Markdown from " ~/components/Markdown.vue" ;
34
+ import { epochToUtc } from " ~/src/helpers/DateConverter" ;
35
+
36
+ const collapsed = ref (false );
37
+
38
+ const props = defineProps ({
39
+ torrent: {
40
+ type: Object as PropType <TorrentResponse >,
41
+ required: true
42
+ }
43
+ });
44
+
45
+ // Takes the date in milliseconds/Epoch Time and converts it to human readable format
46
+ const convertedDate = epochToUtc (props .torrent .creation_date );
47
+
48
+ </script >
49
+
50
+ <style scoped>
51
+
52
+ </style >
Original file line number Diff line number Diff line change 17
17
<div v-if =" torrent" class =" flex flex-col flex-auto w-full gap-6" >
18
18
<TorrentDescriptionTab :torrent =" torrent" @updated =" reloadTorrent" />
19
19
<TorrentCommentTab :torrent =" torrent" @updated =" reloadTorrent" />
20
+ <TorrentCreationDateTab :torrent =" torrent" @updated =" reloadTorrent" />
21
+ <TorrentCreatedByTab :torrent =" torrent" @updated =" reloadTorrent" />
22
+ <TorrentEncodingTab :torrent =" torrent" @updated =" reloadTorrent" />
20
23
<TorrentFilesTab :torrent =" torrent" @updated =" reloadTorrent" />
21
24
<TorrentTrackersTab :torrent =" torrent" @updated =" reloadTorrent" />
22
25
</div >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div id =" torrent-encoding" class =" flex flex-col gap-6" >
3
+ <div class =" flex flex-row items-center justify-between" >
4
+ <h2 class =" mr-1 text-2xl font-medium text-left text-neutral-content/50" >
5
+ Encoding
6
+ </h2 >
7
+ <button
8
+ class =" flex flex-col items-center justify-center w-10 h-10 duration-200 bg-transparent text-base-content/50 hover:text-base-content rounded-xl"
9
+ @click =" collapsed = !collapsed"
10
+ >
11
+ <ChevronDownIcon class =" w-6" :class =" { 'rotate-90': collapsed }" />
12
+ </button >
13
+ </div >
14
+ <template v-if =" ! collapsed " >
15
+ <div class =" flex flex-col w-full h-full p-6 grow bg-base-100 rounded-2xl" >
16
+ <template v-if =" torrent .encoding " >
17
+ <Markdown :source =" torrent.encoding" />
18
+ </template >
19
+ <template v-else >
20
+ <span class =" italic text-neutral-content" >No encoding provided.</span >
21
+ </template >
22
+ </div >
23
+ </template >
24
+ </div >
25
+ </template >
26
+
27
+ <script setup lang="ts">
28
+ import { ChevronDownIcon } from " @heroicons/vue/24/solid" ;
29
+ import { TorrentResponse } from " torrust-index-types-lib" ;
30
+ import { PropType } from " vue" ;
31
+ import { ref } from " #imports" ;
32
+ import Markdown from " ~/components/Markdown.vue" ;
33
+
34
+ const collapsed = ref (false );
35
+
36
+ const props = defineProps ({
37
+ torrent: {
38
+ type: Object as PropType <TorrentResponse >,
39
+ required: true
40
+ }
41
+ });
42
+ </script >
43
+
44
+ <style scoped>
45
+
46
+ </style >
Original file line number Diff line number Diff line change
1
+ export function epochToUtc ( date : number ) {
2
+ const convertedDate = new Date ( date * 1000 ) ;
3
+ return convertedDate . toDateString ( ) ;
4
+ }
You can’t perform that action at this time.
0 commit comments