summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJannik Schönartz2019-03-10 03:24:33 +0100
committerJannik Schönartz2019-03-10 03:24:33 +0100
commit34ed0c5c0f85f620c1306db109b7f9fd69a4248f (patch)
tree932f0f3451d9ca54e87e76ff0faf0ec1ec35a1c9 /webapp
parent[webapp/ipxe] Fix console autoscroll on linux (diff)
downloadbas-34ed0c5c0f85f620c1306db109b7f9fd69a4248f.tar.gz
bas-34ed0c5c0f85f620c1306db109b7f9fd69a4248f.tar.xz
bas-34ed0c5c0f85f620c1306db109b7f9fd69a4248f.zip
[ipxe] Add parameter to api how many lines the response should send and adjust frontend
Diffstat (limited to 'webapp')
-rw-r--r--webapp/src/components/IpxeBuilderModuleConfig.vue34
1 files changed, 15 insertions, 19 deletions
diff --git a/webapp/src/components/IpxeBuilderModuleConfig.vue b/webapp/src/components/IpxeBuilderModuleConfig.vue
index e802d13..6454d41 100644
--- a/webapp/src/components/IpxeBuilderModuleConfig.vue
+++ b/webapp/src/components/IpxeBuilderModuleConfig.vue
@@ -45,25 +45,26 @@
<template>
<div>
-
<v-subheader>{{ $t('ipxe') }}</v-subheader>
- <v-card style="height: 588px;" ref="log" v-on:wheel="manualScroll">
- <RecycleScroller :items="log" :item-size="21" style="height: 100%;">
- <div slot-scope="{ item }" style="height: 21px;">
- <pre :class="item.status + '--text'" style="margin-bottom: 0px"><span>{{ item.date }} {{ item.msg }}</span></pre>
- </div>
- </RecycleScroller>
+ <!--
+ <v-card v-on:wheel="manualScroll">
+ <div>
+ <RecycleScroller :items="log" ref="log" :item-size="21" style="height: 588px;">
+ <div slot-scope="{ item }" style="height: 21px;">
+ <pre :class="item.status + '--text'" style="margin-bottom: 0px"><span>{{ item.date }} {{ item.msg }}</span></pre>
+ </div>
+ </RecycleScroller>
+ </div>
</v-card>
+ -->
<!-- Recycle Scroller or not?! One of them ^v has to go! -->
- <!--
- <v-card class="terminal" ref="log" v-on:wheel="manualScroll">
+ <v-card class="terminal" ref="log" v-on:wheel="manualScroll" style="padding-left: 0px">
<template v-for="(entry, index) in log">
- <pre :class="entry.status + '--text'" style="margin-bottom: 0px" :key="index"><span>{{ entry.date }} {{ entry.msg }}</span></pre>
+ <pre :class="entry.status + '--text'" style="margin-bottom: 0px;" :key="index"><span>{{ entry.date }} {{ entry.msg }}</span></pre>
</template>
</v-card>
- -->
<div class="scroll-overlay non-selectable" v-if="!autoscroll">
<div @click="toTheBottom" style="cursor: pointer; height: 100%; display: flex; align-items: center;">
@@ -221,10 +222,8 @@ export default {
})
},
manualScroll (event) {
- console.log(event)
if (event.deltaY < 0) 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
+ else if (this.$refs.log.$el.scrollTop + 800 >= this.$refs.log.$el.scrollHeight) this.autoscroll = true
},
toTheBottom () {
this.autoscroll = true
@@ -245,10 +244,8 @@ export default {
this.console = result.data
})
- axios.get('/api/ipxe/' + this.ipxeVersion + '/log').then(result => {
+ axios.get('/api/ipxe/' + this.ipxeVersion + '/log?max=500').then(result => {
var lines = result.data.split('\n')
- // Limit the log to 500 lines, to prevent lagging
- lines = lines.slice(-500)
for (var line in lines) {
if (lines[line] === '') continue
var attr = lines[line].split('\t')
@@ -272,9 +269,8 @@ export default {
},
updated () {
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
+ this.$refs.log.$el.scrollTop = this.$refs.log.$el.scrollHeight
}
}
}