filemanager: make footer render the custom branding

This commit is contained in:
Johannes Zellner
2023-07-24 12:07:23 +02:00
parent fcfc8ce66d
commit c3574614bc
3 changed files with 33 additions and 1 deletions
+20 -1
View File
@@ -105,7 +105,9 @@
@finished="onUploadFinished"
:tr="$t"
/>
<BottomBar />
<BottomBar>
<div v-html="footerContent" class="bottom-bar-content"></div>
</BottomBar>
</template>
</MainLayout>
</template>
@@ -113,6 +115,7 @@
<script>
import superagent from 'superagent';
import { marked } from 'marked';
import Button from 'primevue/button';
import Dialog from 'primevue/dialog';
@@ -164,6 +167,7 @@ export default {
extractInProgress: false,
pasteInProgress: false,
deleteInProgress: false,
footerContent: '',
activeItem: null,
activeDirectoryItem: {},
items: [],
@@ -493,6 +497,13 @@ export default {
return;
}
try {
const result = await superagent.get(`${this.apiOrigin}/api/v1/config`).query({ access_token: this.accessToken });
this.footerContent = marked.parse(result.body.footer);
} catch (e) {
console.error('Failed to fetch Cloudron config.', e);
}
window.document.title = `File Manager - ${this.title}`;
this.cwd = sanitize('/' + (cwd ? cwd.join('/') : '/'));
@@ -554,3 +565,11 @@ export default {
}
</style>
<style>
.bottom-bar-content > p {
margin: 0;
}
</style>