Replace branding route calling for name and footer in views

This commit is contained in:
Johannes Zellner
2025-07-11 12:42:21 +02:00
parent 5852fe54a7
commit 3b50a732b5
5 changed files with 25 additions and 24 deletions
+4 -12
View File
@@ -2,19 +2,19 @@
import { ref, onMounted, useTemplateRef } from 'vue';
import { marked } from 'marked';
import { Button, PasswordInput, FormGroup, TextInput, fetcher } from '@cloudron/pankow';
import { API_ORIGIN } from '../constants.js';
import { Button, PasswordInput, FormGroup, TextInput } from '@cloudron/pankow';
import PublicPageLayout from '../components/PublicPageLayout.vue';
import ProfileModel from '../models/ProfileModel.js';
const profileModel = ProfileModel.create();
const footer = marked.parse(window.cloudron.footer);
const cloudronName = window.cloudron.name;
const ready = ref(false);
const busy = ref(false);
const formError = ref({});
const mode = ref('');
const footer = ref('');
const cloudronName = ref('');
const form = useTemplateRef('form');
const profileLocked = ref(false);
const existingUsername = ref(false);
@@ -83,14 +83,6 @@ async function onSubmit() {
onMounted(async () => {
const search = decodeURIComponent(window.location.search).slice(1).split('&').map(function (item) { return item.indexOf('=') === -1 ? [item, true] : [item.slice(0, item.indexOf('=')), item.slice(item.indexOf('=')+1)]; }).reduce(function (o, k) { o[k[0]] = k[1]; return o; }, {});
try {
const res = await fetcher.get(`${API_ORIGIN}/api/v1/auth/branding`);
footer.value = marked.parse(res.body.footer);
cloudronName.value = res.body.cloudronName;
} catch (error) {
console.error('Failed to get branding info.', error);
}
profileLocked.value = !!search.profileLocked;
existingUsername.value = !!search.username;
username.value = search.username || '';