Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a8955a435f | |||
| 80f25eb1a2 |
Generated
+7436
-3216
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -9,7 +9,7 @@
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@speckle/objectloader": "^2.1.1",
|
||||
"@speckle/objectloader": "^2.3.0",
|
||||
"aws-sdk": "^2.981.0",
|
||||
"core-js": "^3.6.5",
|
||||
"debounce": "^1.2.1",
|
||||
|
||||
@@ -148,8 +148,8 @@
|
||||
</v-tooltip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<transition name="expand">
|
||||
<v-card-text v-if="hover && !$apollo.loading" class="mt-0 pt-0">
|
||||
<transition-group name="expand">
|
||||
<v-card-text v-if="hover && !$apollo.loading" key="commit-message-field" class="mt-0 pt-0">
|
||||
<transition name="fade">
|
||||
<v-text-field
|
||||
v-model="commitMessage"
|
||||
@@ -164,12 +164,13 @@
|
||||
</v-card-text>
|
||||
<v-progress-linear
|
||||
v-if="(loadingSend || loadingReceive) && loadingStage"
|
||||
key="progress-bar"
|
||||
height="14"
|
||||
indeterminate
|
||||
>
|
||||
<div class="text-caption">{{ loadingStage }}</div>
|
||||
</v-progress-linear>
|
||||
</transition>
|
||||
</transition-group>
|
||||
</v-card>
|
||||
</v-hover>
|
||||
</template>
|
||||
@@ -398,7 +399,7 @@ export default {
|
||||
let batchesSent = 0
|
||||
for (const batch of batches) {
|
||||
let res = await this.sendBatch(batch)
|
||||
if (res.status !== 201) throw `Upload request failed: ${res}`
|
||||
if (res.status !== 201) throw `Upload request failed: ${res.status}`
|
||||
batchesSent++
|
||||
this.loadingStage = `uploading: ${Math.round((batchesSent / totBatches) * 100)}%`
|
||||
}
|
||||
@@ -433,7 +434,7 @@ export default {
|
||||
},
|
||||
async sendBatch(batch) {
|
||||
let formData = new FormData()
|
||||
formData.append(`batch-1`, new Blob([JSON.stringify(batch)], { type: 'application/json' }))
|
||||
formData.append(`batch-1`, new Blob([batch], { type: 'application/json' }))
|
||||
let token = localStorage.getItem('SpeckleSketchup.AuthToken')
|
||||
let res = await fetch(`${localStorage.getItem('serverUrl')}/objects/${this.streamId}`, {
|
||||
method: 'POST',
|
||||
|
||||
@@ -170,21 +170,21 @@ export class BaseObjectSerializer {
|
||||
batchObjects(maxBatchSizeMb = 1) {
|
||||
const maxSize = maxBatchSizeMb * 1000 * 1000
|
||||
let batches = []
|
||||
let batch = []
|
||||
let batch = '['
|
||||
let batchSize = 0
|
||||
let objects = Object.values(this.objects)
|
||||
objects.forEach((obj) => {
|
||||
let objString = JSON.stringify(obj)
|
||||
if (batchSize + objString.length < maxSize) {
|
||||
batch.push(obj)
|
||||
batch += objString + ','
|
||||
batchSize += objString.length
|
||||
} else {
|
||||
batches.push(batch)
|
||||
batch = [obj]
|
||||
batches.push(batch.slice(0, -1) + ']')
|
||||
batch = '[' + objString + ','
|
||||
batchSize = objString.length
|
||||
}
|
||||
})
|
||||
batches.push(batch)
|
||||
batches.push(batch.slice(0, -1) + ']')
|
||||
|
||||
return batches
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user