Merge branch 'action-modal-w-stream' into 'v3'
CSM modal shows stream Closes #678 See merge request openflexure/openflexure-microscope-server!483
This commit is contained in:
commit
41c9c58f42
5 changed files with 31 additions and 1 deletions
|
|
@ -40,6 +40,13 @@ class ActionButton(BaseModel):
|
||||||
modal_progress: bool = False
|
modal_progress: bool = False
|
||||||
"""Specify whether to show a progress modal."""
|
"""Specify whether to show a progress modal."""
|
||||||
|
|
||||||
|
stream_with_modal: bool = False
|
||||||
|
"""Specify whether to show a mini stream preview in the progress modal.
|
||||||
|
|
||||||
|
This option only has an effect if `modal_progress` is True.
|
||||||
|
If `modal_progress` is False, no modal (and therefore no stream preview) is shown.
|
||||||
|
"""
|
||||||
|
|
||||||
notify_on_success: bool = False
|
notify_on_success: bool = False
|
||||||
"""Specify whether to a notification on successful completion."""
|
"""Specify whether to a notification on successful completion."""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
:task-running="taskRunning"
|
:task-running="taskRunning"
|
||||||
:task-started="taskStarted"
|
:task-started="taskStarted"
|
||||||
:task-status="taskStatus"
|
:task-status="taskStatus"
|
||||||
|
:display-stream="modalProgress && streamWithModal"
|
||||||
@terminate-task="terminateTask"
|
@terminate-task="terminateTask"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -99,6 +100,11 @@ export default {
|
||||||
required: false,
|
required: false,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
streamWithModal: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
emits: [
|
emits: [
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
<div ref="modal" class="" uk-modal="bg-close: false; esc-close: false; stack: true;">
|
<div ref="modal" class="" uk-modal="bg-close: false; esc-close: false; stack: true;">
|
||||||
<div id="status-modal" class="uk-modal-dialog uk-modal-body uk-margin-auto-vertical">
|
<div id="status-modal" class="uk-modal-dialog uk-modal-body uk-margin-auto-vertical">
|
||||||
<h2>{{ title }}</h2>
|
<h2>{{ title }}</h2>
|
||||||
|
<mini-stream-display
|
||||||
|
v-if="displayStream"
|
||||||
|
class="uk-margin-small-bottom"
|
||||||
|
/>
|
||||||
<action-log-display :log="log" :task-status="taskStatus" />
|
<action-log-display :log="log" :task-status="taskStatus" />
|
||||||
<div id="progress-and-cancel-row">
|
<div id="progress-and-cancel-row">
|
||||||
<div class="stretchy">
|
<div class="stretchy">
|
||||||
|
|
@ -29,12 +33,14 @@ import UIkit from "uikit";
|
||||||
import ActionProgressBar from "./actionProgressBar.vue";
|
import ActionProgressBar from "./actionProgressBar.vue";
|
||||||
import ActionLogDisplay from "./actionLogDisplay.vue";
|
import ActionLogDisplay from "./actionLogDisplay.vue";
|
||||||
import { eventBus } from "../../eventBus.js";
|
import { eventBus } from "../../eventBus.js";
|
||||||
|
import miniStreamDisplay from "../genericComponents/miniStreamDisplay.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ActionStatusModal",
|
name: "ActionStatusModal",
|
||||||
components: {
|
components: {
|
||||||
ActionProgressBar,
|
ActionProgressBar,
|
||||||
ActionLogDisplay,
|
ActionLogDisplay,
|
||||||
|
miniStreamDisplay,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -67,6 +73,11 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
displayStream: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
emits: ["terminateTask"],
|
emits: ["terminateTask"],
|
||||||
|
|
@ -104,7 +115,11 @@ export default {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
#status-modal {
|
||||||
|
max-height: 90vh; // never exceed 90% of viewport height
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
#status-modal .log-container {
|
#status-modal .log-container {
|
||||||
height: 10em;
|
height: 10em;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
:confirmation-message="actionData.confirmation_message"
|
:confirmation-message="actionData.confirmation_message"
|
||||||
:button-primary="actionData.button_primary"
|
:button-primary="actionData.button_primary"
|
||||||
:modal-progress="actionData.modal_progress"
|
:modal-progress="actionData.modal_progress"
|
||||||
|
:stream-with-modal="actionData.stream_with_modal"
|
||||||
@response="actionResponse"
|
@response="actionResponse"
|
||||||
@error="modalError"
|
@error="modalError"
|
||||||
@finished="actionFinished"
|
@finished="actionFinished"
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
:modal-progress="true"
|
:modal-progress="true"
|
||||||
@response="onRecalibrateResponse"
|
@response="onRecalibrateResponse"
|
||||||
@error="modalError"
|
@error="modalError"
|
||||||
|
:streamWithModal="true"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue