Finish initial implementation dns setup view
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { Button, FormGroup, TextInput, PasswordInput, EmailInput } from 'pankow';
|
||||
import CloudronModel from '../models/CloudronModel.js';
|
||||
import ProvisionModel from '../models/ProvisionModel.js';
|
||||
import { redirectIfNeeded } from '../utils.js';
|
||||
|
||||
const cloudronModel = CloudronModel.create();
|
||||
const provisionModel = ProvisionModel.create();
|
||||
|
||||
const VIEWS = {
|
||||
OWNER: 'owner',
|
||||
@@ -45,7 +45,7 @@ async function onOwnerSubmit() {
|
||||
setupToken: setupToken.value,
|
||||
};
|
||||
|
||||
const [error, result] = await cloudronModel.createAdmin(data);
|
||||
const [error, result] = await provisionModel.createAdmin(data);
|
||||
if (error) {
|
||||
if (error.status === 400) {
|
||||
if (error.body.message === 'Invalid email') {
|
||||
@@ -68,11 +68,11 @@ async function onOwnerSubmit() {
|
||||
localStorage.cloudronFirstTimeToken = result;
|
||||
|
||||
firstTimeLoginUrl.value = '/openid/auth?client_id=cid-webadmin&scope=openid email profile&response_type=code token&redirect_uri=' + window.location.origin + '/authcallback.html';
|
||||
view.value = VIEWS.FINISHED
|
||||
view.value = VIEWS.FINISHED;
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const [error, result] = await cloudronModel.provisionStatus();
|
||||
const [error, result] = await provisionModel.status();
|
||||
if (error) return console.error(error);
|
||||
|
||||
if (redirectIfNeeded(result, 'activation')) return; // redirected to some other view...
|
||||
|
||||
Reference in New Issue
Block a user