mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:21:16 +02:00
Add domain label creation step 1 of wizard.
This commit is contained in:
parent
2e75166e0d
commit
2546639171
2 changed files with 57 additions and 1 deletions
|
@ -500,6 +500,33 @@ function prepareAccessTokenPrompt(callback) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createDomainIDPrompt(callback) {
|
||||||
|
swal({
|
||||||
|
title: 'Finish Registering Domain',
|
||||||
|
type: 'input',
|
||||||
|
text: 'Enter a label for this machine.</br></br>This will help you identify which domain ID belongs to which machine.</br></br>This is a required step for registration.</br></br>',
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: "Create",
|
||||||
|
closeOnConfirm: false,
|
||||||
|
html: true
|
||||||
|
}, function(inputValue){
|
||||||
|
if (inputValue === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inputValue === "") {
|
||||||
|
swal.showInputError("Please enter a valid label for your machine.")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (callback) {
|
||||||
|
callback(inputValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
swal.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function getMetaverseUrl(callback) {
|
function getMetaverseUrl(callback) {
|
||||||
$.ajax('/api/metaverse_info', {
|
$.ajax('/api/metaverse_info', {
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
|
|
@ -50,6 +50,7 @@ $(document).ready(function(){
|
||||||
prepareAccessTokenPrompt(function(accessToken) {
|
prepareAccessTokenPrompt(function(accessToken) {
|
||||||
Metaverse.accessToken = accessToken;
|
Metaverse.accessToken = accessToken;
|
||||||
saveAccessToken();
|
saveAccessToken();
|
||||||
|
promptToCreateDomainID();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -171,6 +172,34 @@ function setupWizardSteps() {
|
||||||
$(currentStep).show();
|
$(currentStep).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function promptToCreateDomainID() {
|
||||||
|
setTimeout(function(){
|
||||||
|
createDomainIDPrompt(function(label) {
|
||||||
|
var domainJSON = {
|
||||||
|
"label": label
|
||||||
|
}
|
||||||
|
|
||||||
|
$.post("/api/domains", domainJSON, function(data){
|
||||||
|
// we successfully created a domain ID, set it on that field
|
||||||
|
var domainID = data.domain.domainId;
|
||||||
|
console.log("Setting domain ID to ", data, domainID);
|
||||||
|
|
||||||
|
var formJSON = {
|
||||||
|
"metaverse": {
|
||||||
|
"id": domainID
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST the form JSON to the domain-server settings.json endpoint so the settings are saved
|
||||||
|
postSettings(formJSON, goToNextStep);
|
||||||
|
}, 'json').fail(function(){
|
||||||
|
console.log("Failed to create domain ID...");
|
||||||
|
goToNextStep();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}, 500); // Apparently swal needs time before opening another prompt.
|
||||||
|
}
|
||||||
|
|
||||||
function updatePlaceNameLink(address) {
|
function updatePlaceNameLink(address) {
|
||||||
if (address) {
|
if (address) {
|
||||||
var url = URLs.PLACE_URL + '/' + address;
|
var url = URLs.PLACE_URL + '/' + address;
|
||||||
|
@ -341,7 +370,7 @@ function saveAccessToken() {
|
||||||
$(this).blur();
|
$(this).blur();
|
||||||
|
|
||||||
// POST the form JSON to the domain-server settings.json endpoint so the settings are saved
|
// POST the form JSON to the domain-server settings.json endpoint so the settings are saved
|
||||||
postSettings(formJSON, goToNextStep);
|
postSettings(formJSON);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSettingDescriptionForKey(groupKey, settingKey) {
|
function getSettingDescriptionForKey(groupKey, settingKey) {
|
||||||
|
|
Loading…
Reference in a new issue