ScanList gets scans from GalleryThing, no ongoing scans shown.
This commit is contained in:
parent
4583151345
commit
a16d47ed61
5 changed files with 52 additions and 63 deletions
|
|
@ -13,8 +13,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<h3 class="uk-card-title scan-card-title">{{ scanData.name }}</h3>
|
||||
<h4 v-if="ongoing" class="ongoing-msg">Scan in progress</h4>
|
||||
<div v-if="!ongoing" class="button-container">
|
||||
<div class="button-container">
|
||||
<div class="uk-button-group scan-card-buttons">
|
||||
<action-button
|
||||
class="uk-width-1-2"
|
||||
|
|
@ -59,10 +58,9 @@
|
|||
<ul>
|
||||
<li>{{ scanData.number_of_images }} images</li>
|
||||
<li>Created: {{ formatDate(scanData.created) }}</li>
|
||||
<li v-if="!ongoing">Duration: {{ formatDuration(scanData.duration) }}</li>
|
||||
<li v-if="ongoing">Duration: <i>Ongoing</i></li>
|
||||
<li>Duration: {{ formatDuration(scanData.duration) }}</li>
|
||||
</ul>
|
||||
<ul v-if="!ongoing">
|
||||
<ul>
|
||||
<li v-if="scanData.number_of_images < 3" class="warning-msg">
|
||||
Not enough images to stitch
|
||||
</li>
|
||||
|
|
@ -102,10 +100,6 @@ export default {
|
|||
type: String,
|
||||
required: true,
|
||||
},
|
||||
ongoing: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
emits: ["viewer-requested", "update-requested"],
|
||||
|
|
@ -148,9 +142,7 @@ export default {
|
|||
},
|
||||
requestViewer() {
|
||||
// Notify parent that thumbnail was clicked
|
||||
if (!this.ongoing) {
|
||||
this.$emit("viewer-requested", this.scanData);
|
||||
}
|
||||
this.$emit("viewer-requested", this.scanData);
|
||||
},
|
||||
async deleteScan() {
|
||||
try {
|
||||
|
|
@ -204,9 +196,4 @@ ul {
|
|||
.scan-card-title {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ongoing-msg {
|
||||
text-align: center;
|
||||
padding: 2rem 0;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@
|
|||
<scan-card
|
||||
:scan-data="scanData"
|
||||
:scans-uri="scansUri"
|
||||
:ongoing="isOngoing(scanData.name)"
|
||||
@viewer-requested="showScan"
|
||||
@update-requested="updateScans"
|
||||
/>
|
||||
|
|
@ -97,7 +96,6 @@ export default {
|
|||
data: function () {
|
||||
return {
|
||||
scans: [],
|
||||
ongoing: null,
|
||||
selectedScan: null,
|
||||
osdViewer: null,
|
||||
currentPage: 1,
|
||||
|
|
@ -108,7 +106,9 @@ export default {
|
|||
computed: {
|
||||
...mapState(useSettingsStore, ["baseUri", "ready"]),
|
||||
scansUri() {
|
||||
return this.thingPropertyUrl("smart_scan", "scans");
|
||||
// The scans URI is currently used for creating endpoint URIs.
|
||||
// The actual property does not exist. So allowUndefined=true
|
||||
return this.thingPropertyUrl("smart_scan", "scans", true);
|
||||
},
|
||||
scansEmpty() {
|
||||
return this.scans.length == 0;
|
||||
|
|
@ -179,9 +179,7 @@ export default {
|
|||
},
|
||||
async updateScans() {
|
||||
try {
|
||||
let scans_information = await this.readThingProperty("smart_scan", "scans");
|
||||
let scans = scans_information.scans;
|
||||
this.ongoing = scans_information.ongoing;
|
||||
let scans = await this.readThingProperty("gallery", "list_data");
|
||||
if (!scans | (scans.length == 0)) {
|
||||
this.scans = scans;
|
||||
}
|
||||
|
|
@ -198,9 +196,6 @@ export default {
|
|||
this.scans = [];
|
||||
}
|
||||
},
|
||||
isOngoing(name) {
|
||||
return name === this.ongoing;
|
||||
},
|
||||
async deleteAllScans() {
|
||||
try {
|
||||
await this.modalConfirm(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue