|
30 | 30 | </template> |
31 | 31 |
|
32 | 32 | <template v-slot:cell(details)="row"> |
33 | | - <b-button size="sm" @click="row.toggleDetails" class="mr-2"> |
| 33 | + <b-button size="sm" @click="toggleDetails(row.item.id, row.item._showDetails)" class="mr-2"> |
34 | 34 | {{ row.detailsShowing ? 'Hide' : 'Show'}} |
35 | 35 | </b-button> |
36 | 36 | </template> |
|
71 | 71 | </div> |
72 | 72 | </b-col> |
73 | 73 | </b-row> |
| 74 | + |
| 75 | + <!-- Display error if recieved from message --> |
| 76 | + <b-row class="mb-2" v-if="row.item.error"> |
| 77 | + <b-col sm="2" class="text-sm-right"><b>Error:</b></b-col> |
| 78 | + <b-col> |
| 79 | + <div class="code"> |
| 80 | + <b-form-textarea |
| 81 | + rows="3" |
| 82 | + max-rows="3" |
| 83 | + :value="JSON.stringify(row.item.error)" |
| 84 | + ></b-form-textarea> |
| 85 | + </div> |
| 86 | + </b-col> |
| 87 | + </b-row> |
| 88 | + |
74 | 89 | </template> |
75 | 90 | </b-table> |
76 | 91 | <h2 class="text-center" v-if="items.length === 0">No Jobs Found</h2> |
@@ -126,11 +141,18 @@ export default { |
126 | 141 | this.percent = data.percent; |
127 | 142 | this.speed = data.speed; |
128 | 143 | this.fps = data.fps; |
| 144 | + this.err = data.err; |
129 | 145 |
|
130 | 146 | if (this.percent === 100) { |
131 | 147 | this.setJobStatus(this.job.id, Status.COMPLETED); |
132 | 148 | store.setIsEncoding(false); |
133 | 149 | } |
| 150 | +
|
| 151 | + if (this.err) { |
| 152 | + this.setJobStatus(this.job.id, Status.ERROR); |
| 153 | + store.setIsEncoding(false); |
| 154 | + storage.set('queue', this.job.id, 'error', this.err); |
| 155 | + } |
134 | 156 | }; |
135 | 157 | this.$ws.conn.onerror = () => { |
136 | 158 | if (this.job.status !== Status.COMPLETED) { |
@@ -164,12 +186,6 @@ export default { |
164 | 186 | }, |
165 | 187 | getQueue() { |
166 | 188 | this.items = storage.getAll('queue'); |
167 | | - this.items.forEach((o) => { |
168 | | - if (o.status === Status.ENCODING) { |
169 | | - // eslint-disable-next-line no-param-reassign |
170 | | - o._showDetails = true; // eslint-disable-line no-underscore-dangle |
171 | | - } |
172 | | - }); |
173 | 189 | }, |
174 | 190 | getNextJob() { |
175 | 191 | const filtered = this.items.filter( |
@@ -204,6 +220,11 @@ export default { |
204 | 220 | this.setJobStatus(id, Status.QUEUED); |
205 | 221 | this.getQueue(); |
206 | 222 | }, |
| 223 | + toggleDetails(id, enabled) { |
| 224 | + // eslint-disable-next-line no-underscore-dangle |
| 225 | + storage.toggleDetails('queue', id, !enabled); |
| 226 | + this.getQueue(); |
| 227 | + }, |
207 | 228 | }, |
208 | 229 | }; |
209 | 230 | </script> |
|
0 commit comments