From c1efc80017ec5f3d6e492749cb19c947c57fd7c0 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Thu, 28 Feb 2019 00:26:16 +0000 Subject: [webapp/ipxe] Add scroll to bottom feature, fix multiline bug and fix cancel --- webapp/src/components/IpxeBuilderModuleConfig.vue | 105 +++++++++++++++------- 1 file changed, 72 insertions(+), 33 deletions(-) (limited to 'webapp') diff --git a/webapp/src/components/IpxeBuilderModuleConfig.vue b/webapp/src/components/IpxeBuilderModuleConfig.vue index 709a04b..aaeb197 100644 --- a/webapp/src/components/IpxeBuilderModuleConfig.vue +++ b/webapp/src/components/IpxeBuilderModuleConfig.vue @@ -1,42 +1,44 @@ { "en": { - "efi": "EFI", + "alreadyBuiling": "The iPXE building process not finished", "bios": "BIOS", - "general": "general.h", - "console": "console.h", - "script": "Embedded script (EMBED=)", - "trust": "Embedded certificate (TRUST=)", - "ipxe": "iPXE", + "buildingIpxe": "Building iPXE ...", "buildIpxe": "Build iPXE", - "scriptSaved": "Embedded script saved successfully", + "cancelIpxe": "Cancel iPXE", "certificateSaved": "Certificate saved successfully", - "generalSaved": "general.h saved successfully", - "consoleSaved": "console.h saved successfully", - "buildingIpxe": "Building iPXE ...", - "cleanIpxe": "Clean iPXE", "cleaningIpxe": "Cleaning iPXE ...", - "alreadyBuiling": "The iPXE building process not finished", - "cancelIpxe": "Cancel iPXE" - }, - "de": { + "cleanIpxe": "Clean iPXE", + "console": "console.h", + "consoleSaved": "console.h saved successfully", "efi": "EFI", - "bios": "BIOS", "general": "general.h", - "console": "console.h", - "script": "Eingebettetes Skript (EMBED=)", - "trust": "Eingebettetes Zertifikat (TRUST=)", + "generalSaved": "general.h saved successfully", "ipxe": "iPXE", + "script": "Embedded script (EMBED=)", + "scriptSaved": "Embedded script saved successfully", + "scrollDown": "Go to the bottom", + "trust": "Embedded certificate (TRUST=)" + }, + "de": { + "alreadyBuiling": "Der iPXE build-Prozess ist noch nicht abgeschlossen", + "bios": "BIOS", + "buildingIpxe": "iPXE wird gebaut ...", "buildIpxe": "iPXE bauen", - "scriptSaved": "Eingebettetes Skript wurde erfolgreich gespeichert", + "cancelIpxe": "iPXE stoppen", "certificateSaved": "Zertifikat wurde erfolgreich gespeichert", - "generalSaved": "general.h wurde erfolgreich gespeichert", + "console": "console.h", "consoleSaved": "console.h wurde erfolgreich gespeichert", - "buildingIpxe": "iPXE wird gebaut ...", - "cleanIpxe": "iPXE aufräumen", "cleaningIpxe": "iPXE wird aufgeräumt ..", - "alreadyBuiling": "Der iPXE build-Prozess ist noch nicht abgeschlossen", - "cancelIpxe": "iPXE stoppen" + "cleanIpxe": "iPXE aufräumen", + "efi": "EFI", + "general": "general.h", + "generalSaved": "general.h wurde erfolgreich gespeichert", + "ipxe": "iPXE", + "script": "Eingebettetes Skript (EMBED=)", + "scriptSaved": "Eingebettetes Skript wurde erfolgreich gespeichert", + "scrollDown": "Gehe nach unten", + "trust": "Eingebettetes Zertifikat (TRUST=)" } } @@ -45,19 +47,30 @@
{{ $t('ipxe') }} - + +
{{ item.date }} {{ item.msg }}
+
- + +
{{ entry.date }} {{ entry.msg }}
+
+ --> + +
+
+ vertical_align_bottom
{{ $t('scrollDown') }}
+
+
+
delete{{ $t('cleanIpxe') }} cancel{{ $t('cancelIpxe') }} @@ -151,7 +164,8 @@ export default { generalExpanded: null, consoleExpanded: null, log: [], - disableButtons: false + disableButtons: false, + autoscroll: true } }, computed: { @@ -205,6 +219,14 @@ export default { axios.get('/api/ipxe/' + this.ipxeVersion + '/cancel').then(result => { if (result.data.status === 'SUCCESS') this.$snackbar({ color: 'primary', text: this.$tc('cleaningIpxe') }) // TODO: }) + }, + manualScroll (event) { + if (event.deltaY === -100) this.autoscroll = false + // else if (this.$refs.log.$el.scrollTop + 800 >= this.$refs.log.$el.scrollHeight) this.autoscroll = true + else if (this.$refs.log.$el.firstElementChild.scrollTop + 800 >= this.$refs.log.$el.firstElementChild.scrollHeight) this.autoscroll = true + }, + toTheBottom () { + this.autoscroll = true } }, created () { @@ -248,12 +270,29 @@ export default { }) }, updated () { - this.$refs.log.$el.firstElementChild.scrollTop = this.$refs.log.$el.firstElementChild.scrollHeight + if (this.autoscroll) { + // this.$refs.log.$el.scrollTop = this.$refs.log.$el.scrollHeight + // Use this instead for the virtual scroller + this.$refs.log.$el.firstElementChild.scrollTop = this.$refs.log.$el.firstElementChild.scrollHeight + } } } -- cgit v1.2.3-55-g7522