Follow upstream recommendation to have html templates below script in .vue files

This commit is contained in:
Johannes Zellner
2025-01-19 12:00:22 +01:00
parent 0280059c13
commit dfb3285e18
21 changed files with 1008 additions and 1021 deletions

View File

@@ -1,30 +1,3 @@
<template>
<MainLayout>
<template #dialogs>
<InputDialog ref="inputDialog" />
</template>
<template #header>
<TopBar class="navbar">
<template #left>
<span class="title">{{ name }}</span>
</template>
<template #right>
<Button icon="fa-solid fa-eraser" @click="onClear()" style="margin-right: 5px">{{ $t('logs.clear') }}</Button>
<Button :href="downloadUrl" target="_blank" icon="fa-solid fa-download">{{ $t('logs.download') }}</Button>
<Button style="margin-left: 20px;" :title="$t('filemanager.toolbar.restartApp')" v-show="showRestart" secondary tool :loading="busyRestart" icon="fa-solid fa-arrows-rotate" @click="onRestartApp"/>
<Button :href="'/terminal.html?id=' + id" target="_blank" v-show="showTerminal" secondary tool icon="fa-solid fa-terminal" :title="$t('terminal.title')" />
<Button :href="'/filemanager.html#/home/app/' + id" target="_blank" v-show="showFilemanager" secondary tool icon="fa-solid fa-folder" :title="$t('filemanager.title')" />
</template>
</TopBar>
</template>
<template #body>
<div ref="linesContainer"></div>
<div class="bottom-spacer"></div>
</template>
</MainLayout>
</template>
<script>
import { Button, InputDialog, TopBar, MainLayout } from 'pankow';
@@ -149,9 +122,9 @@ export default {
const tmp = document.getElementsByClassName('pankow-main-layout-body')[0];
setInterval(() => {
newLogLines = newLogLines.slice(-maxLines)
newLogLines = newLogLines.slice(-maxLines);
for (let line of newLogLines) {
for (const line of newLogLines) {
if (lines < maxLines) ++lines;
else this.$refs.linesContainer.removeChild(this.$refs.linesContainer.firstChild);
@@ -171,12 +144,39 @@ export default {
newLogLines.push({ time, html });
}, function (error) {
newLogLines.push({ time: error.time, html: error.html });
})
});
}
};
</script>
<template>
<MainLayout>
<template #dialogs>
<InputDialog ref="inputDialog" />
</template>
<template #header>
<TopBar class="navbar">
<template #left>
<span class="title">{{ name }}</span>
</template>
<template #right>
<Button icon="fa-solid fa-eraser" @click="onClear()" style="margin-right: 5px">{{ $t('logs.clear') }}</Button>
<Button :href="downloadUrl" target="_blank" icon="fa-solid fa-download">{{ $t('logs.download') }}</Button>
<Button style="margin-left: 20px;" :title="$t('filemanager.toolbar.restartApp')" v-show="showRestart" secondary tool :loading="busyRestart" icon="fa-solid fa-arrows-rotate" @click="onRestartApp"/>
<Button :href="'/terminal.html?id=' + id" target="_blank" v-show="showTerminal" secondary tool icon="fa-solid fa-terminal" :title="$t('terminal.title')" />
<Button :href="'/filemanager.html#/home/app/' + id" target="_blank" v-show="showFilemanager" secondary tool icon="fa-solid fa-folder" :title="$t('filemanager.title')" />
</template>
</TopBar>
</template>
<template #body>
<div ref="linesContainer"></div>
<div class="bottom-spacer"></div>
</template>
</MainLayout>
</template>
<style>
body {