diff --git a/webapp/src/components/labThingsComponents/actionLogDisplay.vue b/webapp/src/components/labThingsComponents/actionLogDisplay.vue index 38b842aa..9709de9a 100644 --- a/webapp/src/components/labThingsComponents/actionLogDisplay.vue +++ b/webapp/src/components/labThingsComponents/actionLogDisplay.vue @@ -1,25 +1,55 @@ @@ -36,15 +66,28 @@ export default { type: Array, required: true, }, + collapsedByDefault: { + type: Boolean, + default: true, + }, }, data() { return { userIsHovering: false, + isCollapsed: this.collapsedByDefault, }; }, computed: { + latestMessage() { + if (!this.log.length) { + return ""; + } + + return this.log[this.log.length - 1].message; + }, + errorMessage() { let logLength = this.log.length; var defaultMessage = "Unexpected error, please check the logs"; @@ -62,18 +105,33 @@ export default { watch: { log: { handler() { - this.scrollToBottom(); + if (!this.isCollapsed) { + this.scrollToBottom(); + } }, deep: true, }, - taskStatus: { - handler() { + + taskStatus() { + if (!this.isCollapsed) { this.scrollToBottom(); - }, + } + }, + + collapsedByDefault(newValue) { + this.isCollapsed = newValue; }, }, methods: { + toggleLog() { + this.isCollapsed = !this.isCollapsed; + + if (!this.isCollapsed) { + this.scrollToBottom(); + } + }, + onMouseEnter() { this.userIsHovering = true; }, @@ -95,16 +153,34 @@ export default { diff --git a/webapp/src/components/tabContentComponents/actionTab.vue b/webapp/src/components/tabContentComponents/actionTab.vue index 4555c1ee..36570daf 100644 --- a/webapp/src/components/tabContentComponents/actionTab.vue +++ b/webapp/src/components/tabContentComponents/actionTab.vue @@ -219,8 +219,4 @@ export default { .control-component { width: 33%; } - -#log-display { - height: 20em; -}