1
1
import { format } from "date-fns/esm" ;
2
+ import { Space , Tooltip } from "@humansignal/ui" ;
2
3
import { Button } from "../../../components" ;
3
4
import { DescriptionList } from "../../../components/DescriptionList/DescriptionList" ;
4
- import { Tooltip } from "@humansignal/ui" ;
5
5
import { modal } from "../../../components/Modal/Modal" ;
6
6
import { Oneof } from "../../../components/Oneof/Oneof" ;
7
7
import { getLastTraceback } from "../../../utils/helpers" ;
@@ -21,9 +21,10 @@ export const StorageSummary = ({ target, storage, className, storageTypes = [] }
21
21
22
22
// help text for tasks and annotations
23
23
const tasks_added_help = `${ last_sync_count } new tasks added during the last sync.` ;
24
- const tasks_total_help = `${ tasks_existed } tasks that have been found and already synced will not be added to the project again.\n${
25
- tasks_existed + last_sync_count
26
- } tasks have been added in total for this storage.`;
24
+ const tasks_total_help = [
25
+ `${ tasks_existed } tasks that have been found and already synced will not be added to the project again.` ,
26
+ `${ tasks_existed + last_sync_count } tasks have been added in total for this storage.` ,
27
+ ] . join ( "\n" ) ;
27
28
const annotations_help = `${ last_sync_count } annotations successfully saved during the last sync.` ;
28
29
const total_annotations_help =
29
30
typeof storage . meta ?. total_annotations !== "undefined"
@@ -36,39 +37,32 @@ export const StorageSummary = ({ target, storage, className, storageTypes = [] }
36
37
`storage ${ storage . id } in project ${ storage . project } and job ${ storage . last_sync_job } :\n\n` +
37
38
`${ getLastTraceback ( storage . traceback ) } \n\n` +
38
39
`meta = ${ JSON . stringify ( storage . meta ) } \n` ;
40
+ const targetType = target === "export" ? "Target" : "Source" ;
39
41
40
42
modal ( {
41
43
title : "Storage error logs" ,
42
44
body : (
43
45
< >
44
- < pre style = { { background : "#eee" , borderRadius : 5 , padding : 10 } } > { msg } </ pre >
45
- < Button
46
- size = "compact"
47
- onClick = { ( ) => {
48
- navigator . clipboard . writeText ( msg ) ;
49
- } }
50
- >
51
- Copy
52
- </ Button >
53
- { target === "export" ? (
54
- < a
55
- style = { { float : "right" } }
56
- target = "_blank"
57
- href = "https://labelstud.io/guide/storage.html#Target-storage-permissions"
58
- rel = "noreferrer"
46
+ < pre className = "bg-neutral-surface-inset text-neutral-content-subtler p-base mb-base rounded-md text-xs overflow-scroll" >
47
+ { msg }
48
+ </ pre >
49
+ < Space spread >
50
+ < Button
51
+ size = "compact"
52
+ onClick = { ( ) => {
53
+ navigator . clipboard . writeText ( msg ) ;
54
+ } }
59
55
>
60
- Check Target Storage documentation
61
- </ a >
62
- ) : (
56
+ Copy
57
+ </ Button >
63
58
< a
64
- style = { { float : "right" } }
65
59
target = "_blank"
66
- href = "https://labelstud.io/guide/storage.html#Source-storage-permissions"
67
60
rel = "noreferrer"
61
+ href = { `https://labelstud.io/guide/storage.html#${ targetType } -storage-permissions` }
68
62
>
69
- Check Source Storage documentation
63
+ Check { targetType } Storage documentation
70
64
</ a >
71
- ) }
65
+ </ Space >
72
66
</ >
73
67
) ,
74
68
style : { width : "700px" } ,
0 commit comments