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
+3 -10
View File
@@ -6,12 +6,13 @@ import { Button, PasswordInput, TextInput, fetcher, FormGroup } from '@cloudron/
import { API_ORIGIN } from '../constants.js';
import PublicPageLayout from '../components/PublicPageLayout.vue';
const footer = marked.parse(window.cloudron.footer);
const cloudronName = window.cloudron.name;
const ready = ref(false);
const busy = ref(false);
const error = ref({});
const mode = ref('');
const footer = ref('');
const cloudronName = ref('');
const resetToken = ref('');
const passwordResetIdentifier = ref('');
const newPassword = ref('');
@@ -78,14 +79,6 @@ async function onNewPassword() {
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);
}
// Init into the correct view
if (search.resetToken) {
resetToken.value = search.resetToken;