Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error log to upload service #9436

Merged
merged 6 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Enhancement: Add error log to upload dialog

We've added a error log to the upload dialog, so if an upload fails the user can copy the log and might hand
it over to their admin.

https://github.com/owncloud/web/pull/9436
https://github.com/owncloud/web/pull/9426
https://github.com/owncloud/web/issues/9430

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<oc-icon :name="showErrorLog ? 'arrow-up-s' : 'arrow-down-s'" />
</oc-button>
</div>
<oc-error-log v-if="showErrorLog" class="oc-mt-l" :content="errorLogContent" />
<oc-error-log v-if="showErrorLog" class="oc-mt-m" :content="errorLogContent" />
</div>
</div>
</div>
Expand Down
33 changes: 31 additions & 2 deletions packages/web-runtime/src/components/UploadInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,19 @@
</oc-button>
</div>
</div>
<div v-if="runningUploads" class="upload-info-progress oc-mx-m oc-pb-m oc-mt-s">
<div v-if="runningUploads" class="upload-info-progress oc-mx-m oc-pb-m oc-mt-s oc-text">
<oc-progress
:value="totalProgress"
:max="100"
size="small"
:indeterminate="!filesInProgressCount"
/>
</div>
<div v-if="infoExpanded" class="upload-info-items oc-px-m oc-pb-m">
<div
v-if="infoExpanded"
class="upload-info-items oc-px-m oc-pb-m"
:class="{ 'has-errors': showErrorLog }"
>
<ul class="oc-list">
<li
v-for="(item, idx) in uploads"
Expand Down Expand Up @@ -141,6 +145,11 @@
</li>
</ul>
</div>
<oc-error-log
v-if="showErrorLog"
class="upload-info-error-log oc-pt-m oc-pb-m oc-px-m"
:content="uploadErrorLogContent"
/>
</div>
</template>

Expand Down Expand Up @@ -252,6 +261,22 @@ export default defineComponent({
},
uploadsPausable() {
return this.$uppyService.tusActive()
},
showErrorLog() {
return this.infoExpanded && this.uploadErrorLogContent
},
uploadErrorLogContent() {
const requestIds = Object.values(this.errors).reduce((acc: Array<string>, error: any) => {
const requestId = error.originalRequest?._headers?.['X-Request-ID']

if (requestId) {
acc.push(requestId)
}

return acc
}, []) as Array<any>

return requestIds.map((item) => `X-Request-Id: ${item}`).join('\r\n')
}
},
created() {
Expand Down Expand Up @@ -657,6 +682,10 @@ export default defineComponent({
overflow-y: auto;
}

.upload-info-items.has-errors {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep height consistent

max-height: calc(50vh - 100px) !important;
}

.upload-info-danger {
color: var(--oc-color-swatch-danger-default);
}
Expand Down