Replace branding route calling for name and footer in views
This commit is contained in:
@@ -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 || '';
|
||||
|
||||
Reference in New Issue
Block a user