@live-change/upload-frontend 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front/src/UploadView.vue +32 -10
- package/package.json +8 -8
package/front/src/UploadView.vue
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<!-- <pre>{{ JSON.stringify(
|
|
3
|
-
<div class="surface-card" v-if="
|
|
4
|
-
<ProgressBar :value="
|
|
5
|
-
<div v-if="
|
|
2
|
+
<!-- <pre>{{ JSON.stringify(uploadProgress, null, ' ') }}</pre>-->
|
|
3
|
+
<div class="surface-card" v-if="uploadProgress">
|
|
4
|
+
<ProgressBar :value="uploadProgress.percentage.toFixed()" />
|
|
5
|
+
<div v-if="uploadProgress.state != 'done'" class="flex mt-2">
|
|
6
|
+
{{ uploadProgress.state}}
|
|
6
7
|
<div class="flex-grow-1">
|
|
7
|
-
{{ prettyBytes(
|
|
8
|
+
{{ prettyBytes(uploadProgress.transferred) }}
|
|
8
9
|
/
|
|
9
|
-
{{ prettyBytes(
|
|
10
|
+
{{ prettyBytes(uploadProgress.length) }}
|
|
10
11
|
</div>
|
|
11
|
-
<div class="text-right ml-2" v-if="
|
|
12
|
-
eta: {{ Duration.fromMillis(
|
|
12
|
+
<div class="text-right ml-2" v-if="uploadProgress.eta">
|
|
13
|
+
eta: {{ Duration.fromMillis(uploadProgress.eta).toHuman({ unitDisplay: "short" }) }}
|
|
13
14
|
</div>
|
|
14
15
|
</div>
|
|
15
16
|
<div v-else class="text-center">
|
|
16
|
-
Uploaded {{ prettyBytes(
|
|
17
|
+
Uploaded {{ prettyBytes(uploadProgress.length) }}
|
|
17
18
|
</div>
|
|
18
19
|
</div>
|
|
19
20
|
</template>
|
|
@@ -22,9 +23,11 @@
|
|
|
22
23
|
|
|
23
24
|
import ProgressBar from "primevue/progressbar"
|
|
24
25
|
import { toRefs } from "@vueuse/core"
|
|
25
|
-
import prettyBytes from 'pretty-bytes'
|
|
26
|
+
import prettyBytes from 'pretty-bytes'
|
|
26
27
|
import { Duration } from 'luxon'
|
|
27
28
|
|
|
29
|
+
import { computed } from 'vue'
|
|
30
|
+
|
|
28
31
|
const props = defineProps({
|
|
29
32
|
upload: {
|
|
30
33
|
type: Object,
|
|
@@ -38,6 +41,25 @@
|
|
|
38
41
|
|
|
39
42
|
const { upload, cancelable } = toRefs(props)
|
|
40
43
|
|
|
44
|
+
const uploadProgress = computed(() => {
|
|
45
|
+
const serverUpload = upload.value.serverUpload
|
|
46
|
+
//console.log("serverUpload", JSON.stringify(serverUpload, null, ' '))
|
|
47
|
+
if (serverUpload && serverUpload.progress) {
|
|
48
|
+
return {
|
|
49
|
+
...serverUpload.progress,
|
|
50
|
+
state: serverUpload.state
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
return {
|
|
54
|
+
percentage: 0,
|
|
55
|
+
state: 'starting',
|
|
56
|
+
transferred: 0,
|
|
57
|
+
length: 0,
|
|
58
|
+
eta: null,
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
|
|
41
63
|
</script>
|
|
42
64
|
|
|
43
65
|
<style scoped>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/upload-frontend",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"memDev": "lcli memDev --enableSessions --initScript ./init.js --dbAccess",
|
|
6
6
|
"localDevInit": "rm tmp.db; lcli localDev --enableSessions --initScript ./init.js",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"@live-change/dao-vue3": "0.6.0",
|
|
28
28
|
"@live-change/dao-websocket": "0.6.0",
|
|
29
29
|
"@live-change/framework": "0.8.0",
|
|
30
|
-
"@live-change/password-authentication-service": "0.4.
|
|
31
|
-
"@live-change/secret-code-service": "0.4.
|
|
32
|
-
"@live-change/secret-link-service": "0.4.
|
|
33
|
-
"@live-change/security-frontend": "^0.4.
|
|
34
|
-
"@live-change/session-service": "0.4.
|
|
35
|
-
"@live-change/user-service": "0.4.
|
|
30
|
+
"@live-change/password-authentication-service": "0.4.2",
|
|
31
|
+
"@live-change/secret-code-service": "0.4.2",
|
|
32
|
+
"@live-change/secret-link-service": "0.4.2",
|
|
33
|
+
"@live-change/security-frontend": "^0.4.2",
|
|
34
|
+
"@live-change/session-service": "0.4.2",
|
|
35
|
+
"@live-change/user-service": "0.4.2",
|
|
36
36
|
"@live-change/vue3-components": "0.2.34",
|
|
37
37
|
"@live-change/vue3-ssr": "0.2.34",
|
|
38
38
|
"@vueuse/core": "^10.7.2",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"author": "",
|
|
66
66
|
"license": "BSD-3-Clause",
|
|
67
67
|
"description": "",
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "88cb941500beb4ba8e1cfa7d7f832d36c1f531f6"
|
|
69
69
|
}
|