@@ -2,10 +2,10 @@ | |||||
<template> | <template> | ||||
<modal | <modal | ||||
name="advanced-settings" | name="advanced-settings" | ||||
:adaptive="true" | |||||
width="90%" | width="90%" | ||||
:maxWidth="600" | :maxWidth="600" | ||||
height="auto" | height="auto" | ||||
scrollable | |||||
> | > | ||||
<a class="close-btn" @click="hide"> | <a class="close-btn" @click="hide"> | ||||
<i class="fa fa-times"></i> | <i class="fa fa-times"></i> | ||||
@@ -295,6 +295,12 @@ | |||||
right: 20px; | right: 20px; | ||||
font-size: 20px; | font-size: 20px; | ||||
} | } | ||||
.vm--modal { | |||||
max-width: 600px; | |||||
left: 50% !important; | |||||
transform: translate(-50%, 0) !important; | |||||
} | |||||
</style> | </style> | ||||
<script> | <script> | ||||
@@ -228,8 +228,11 @@ | |||||
<div v-if="device.status.lastHandshakeTime"> | <div v-if="device.status.lastHandshakeTime"> | ||||
<hr /> | <hr /> | ||||
{{ messages.label_field_device_connection_handshake }}: | {{ messages.label_field_device_connection_handshake }}: | ||||
<span v-if="device.status.lastHandshakeDay"> | |||||
{{ device.status.lastHandshakeDays }}{{ messages.units_days }} | |||||
</span> | |||||
<span | <span | ||||
v-if=" | |||||
v-else-if=" | |||||
device.status.lastHandshakeHours && | device.status.lastHandshakeHours && | ||||
device.status.lastHandshakeMinutes | device.status.lastHandshakeMinutes | ||||
" | " | ||||
@@ -17,7 +17,13 @@ | |||||
class="d-flex flex-column align-items-center justify-content-center mt-5 mx-auto launch-bubble-wrapper" | class="d-flex flex-column align-items-center justify-content-center mt-5 mx-auto launch-bubble-wrapper" | ||||
> | > | ||||
<div ref="lottie" class="lottie"></div> | <div ref="lottie" class="lottie"></div> | ||||
<Button color="default" width="80%" height="60" @click="launchBubble"> | |||||
<Button | |||||
color="default" | |||||
width="80%" | |||||
height="60" | |||||
@click="launchBubble" | |||||
:disabled="loading()" | |||||
> | |||||
{{ messages.button_label_launch_bubble }} | {{ messages.button_label_launch_bubble }} | ||||
</Button> | </Button> | ||||
@@ -161,7 +167,11 @@ export default { | |||||
initDefaults() { | initDefaults() { | ||||
const currentUser = util.currentUser(); | const currentUser = util.currentUser(); | ||||
this.getAllAccountPaymentMethods({userId: currentUser.uuid, messages: this.messages, errors: this.errors}); | |||||
this.getAllAccountPaymentMethods({ | |||||
userId: currentUser.uuid, | |||||
messages: this.messages, | |||||
errors: this.errors, | |||||
}); | |||||
}, | }, | ||||
findRegion(uuid) { | findRegion(uuid) { | ||||
@@ -24,7 +24,11 @@ | |||||
> | > | ||||
<!-- adapted from: https://code-boxx.com/simple-vanilla-javascript-progress-bar/ --> | <!-- adapted from: https://code-boxx.com/simple-vanilla-javascript-progress-bar/ --> | ||||
<div v-if="stats.percent" class="progress-wrap"> | <div v-if="stats.percent" class="progress-wrap"> | ||||
<div class="progress-bar" :style="'width: '+stats.percent+'%'" :id="'progressBar_'+networkId"></div> | |||||
<div | |||||
class="progress-bar" | |||||
:style="'width: ' + stats.percent + '%'" | |||||
:id="'progressBar_' + networkId" | |||||
></div> | |||||
<div class="progress-text"> | <div class="progress-text"> | ||||
{{ | {{ | ||||
messages.label_percent.parseMessage(this, { | messages.label_percent.parseMessage(this, { | ||||
@@ -38,7 +42,7 @@ | |||||
</div> | </div> | ||||
<hr /> | <hr /> | ||||
</div> | </div> | ||||
<Button color="default" width="195" height="60"> | |||||
<Button color="default" width="195" height="60" @click="deleteNet"> | |||||
{{ messages.button_cancel_lauch_bubble }} | {{ messages.button_cancel_lauch_bubble }} | ||||
</Button> | </Button> | ||||
</div> | </div> | ||||
@@ -118,6 +122,9 @@ export default { | |||||
refresher: null, | refresher: null, | ||||
networkId: this.$route.params.id, | networkId: this.$route.params.id, | ||||
lottie: null, | lottie: null, | ||||
timerID: null, | |||||
frameNumber: 0, | |||||
targetFrameNumber: 0, | |||||
}; | }; | ||||
}, | }, | ||||
@@ -148,6 +155,17 @@ export default { | |||||
autoplay: false, | autoplay: false, | ||||
path: '/launching-bubble.json', | path: '/launching-bubble.json', | ||||
}); | }); | ||||
this.frameNumber = 0; | |||||
this.targetFrameNumber = 20; | |||||
setTimeout(() => { | |||||
this.timerID = setInterval(() => { | |||||
if (this.frameNumber < this.targetFrameNumber) { | |||||
console.log(this.frameNumber); | |||||
this.frameNumber++; | |||||
} | |||||
}, 100); | |||||
}, 2000); | |||||
}, | }, | ||||
beforeDestroy() { | beforeDestroy() { | ||||
@@ -245,6 +263,18 @@ export default { | |||||
} | } | ||||
} | } | ||||
}, | }, | ||||
deleteNet() { | |||||
if (confirm(this.messages.confirmation_network_action_delete)) { | |||||
this.errors.clear(); | |||||
this.deleteNetwork({ | |||||
userId: this.user.uuid, | |||||
networkId: this.networkId, | |||||
messages: this.messages, | |||||
errors: this.errors, | |||||
}); | |||||
} | |||||
}, | |||||
}, | }, | ||||
watch: { | watch: { | ||||
@@ -283,6 +313,7 @@ export default { | |||||
this.stats.messageKey.startsWith('meter_completed_'); | this.stats.messageKey.startsWith('meter_completed_'); | ||||
if ((this.statsError && !isStatsErrorRetry) || isStatsCompleted) { | if ((this.statsError && !isStatsErrorRetry) || isStatsCompleted) { | ||||
this.clearRefresherInterval(this.refresher); | this.clearRefresherInterval(this.refresher); | ||||
this.$router.push(`/bubble/${this.networkId}`); | |||||
} | } | ||||
} else { | } else { | ||||
// status not found for our network | // status not found for our network | ||||
@@ -290,10 +321,7 @@ export default { | |||||
} | } | ||||
if (this.stats) { | if (this.stats) { | ||||
this.lottie.goToAndStop( | |||||
(this.lottie.totalFrames / 100) * this.stats.percent, | |||||
true | |||||
); | |||||
this.targetFrameNumber = 20 + (30 / 100) * this.stats.percent; | |||||
} | } | ||||
}, | }, | ||||
@@ -302,6 +330,13 @@ export default { | |||||
this.$router.replace({ path: '/bubbles' }); | this.$router.replace({ path: '/bubbles' }); | ||||
} | } | ||||
}, | }, | ||||
frameNumber() { | |||||
this.lottie.goToAndStop(this.frameNumber, true); | |||||
if (this.frameNumber >= 50) { | |||||
clearInterval(this.timerID); | |||||
} | |||||
}, | |||||
}, | }, | ||||
}; | }; | ||||
</script> | </script> |
@@ -199,7 +199,7 @@ | |||||
actionIsAvailable(action, row) { | actionIsAvailable(action, row) { | ||||
if (typeof action.when === 'undefined' || action.when === null) return true; | if (typeof action.when === 'undefined' || action.when === null) return true; | ||||
try { | try { | ||||
return safeEval(action.when, {'item': row}) === true; | |||||
return safeEval(action.when, {'item': row, 'account': this.user}) === true; | |||||
} catch (e) { | } catch (e) { | ||||
console.log('actionIsAvailable: error evaluating when='+action.when+' for item='+JSON.stringify(row)+': '+e); | console.log('actionIsAvailable: error evaluating when='+action.when+' for item='+JSON.stringify(row)+': '+e); | ||||
return false; | return false; | ||||
@@ -145,7 +145,7 @@ | |||||
viewIsAvailable(view) { | viewIsAvailable(view) { | ||||
if (typeof view.when === 'undefined' || view.when === null) return true; | if (typeof view.when === 'undefined' || view.when === null) return true; | ||||
try { | try { | ||||
return safeEval(view.when, {'configs': this.configs}) === true; | |||||
return safeEval(view.when, {'configs': this.configs, 'account': this.user}) === true; | |||||
} catch (e) { | } catch (e) { | ||||
console.log('viewIsAvailable: error evaluating when='+view.when+': '+e); | console.log('viewIsAvailable: error evaluating when='+view.when+': '+e); | ||||
return false; | return false; | ||||
@@ -171,9 +171,10 @@ | |||||
const allConfigViews = a.dataConfig.configViews; | const allConfigViews = a.dataConfig.configViews; | ||||
const appConfigViews = []; | const appConfigViews = []; | ||||
for (let i=0; i<allConfigViews.length; i++) { | for (let i=0; i<allConfigViews.length; i++) { | ||||
if (typeof allConfigViews[i].root !== 'undefined' && allConfigViews[i].root !== null && allConfigViews[i].root === true) { | |||||
if (this.viewIsAvailable(allConfigViews[i])) { | |||||
appConfigViews.push(allConfigViews[i]); | |||||
let configView = allConfigViews[i]; | |||||
if (typeof configView.root !== 'undefined' && configView.root !== null && configView.root === true) { | |||||
if (this.viewIsAvailable(configView)) { | |||||
appConfigViews.push(configView); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -99,7 +99,8 @@ | |||||
<div v-if="device.status.lastHandshakeTime"> | <div v-if="device.status.lastHandshakeTime"> | ||||
<hr/> | <hr/> | ||||
{{messages.label_field_device_connection_handshake}}: | {{messages.label_field_device_connection_handshake}}: | ||||
<span v-if="device.status.lastHandshakeHours && device.status.lastHandshakeMinutes">{{device.status.lastHandshakeHours}}{{messages.units_hours_short}}, {{device.status.lastHandshakeMinutes}}{{messages.units_minutes_short}}</span> | |||||
<span v-if="device.status.lastHandshakeDays">{{device.status.lastHandshakeDays}}{{messages.units_days}}</span> | |||||
<span v-else-if="device.status.lastHandshakeHours && device.status.lastHandshakeMinutes">{{device.status.lastHandshakeHours}}{{messages.units_hours_short}}, {{device.status.lastHandshakeMinutes}}{{messages.units_minutes_short}}</span> | |||||
<span v-else-if="device.status.lastHandshakeHours">{{device.status.lastHandshakeHours}}{{messages.units_hours_short}}</span> | <span v-else-if="device.status.lastHandshakeHours">{{device.status.lastHandshakeHours}}{{messages.units_hours_short}}</span> | ||||
<span v-else-if="device.status.lastHandshakeMinutes && device.status.lastHandshakeSeconds">{{device.status.lastHandshakeMinutes}}{{messages.units_minutes_short}}, {{device.status.lastHandshakeSeconds}}{{messages.units_seconds_short}}</span> | <span v-else-if="device.status.lastHandshakeMinutes && device.status.lastHandshakeSeconds">{{device.status.lastHandshakeMinutes}}{{messages.units_minutes_short}}, {{device.status.lastHandshakeSeconds}}{{messages.units_seconds_short}}</span> | ||||
<span v-else-if="device.status.lastHandshakeMinutes">{{device.status.lastHandshakeMinutes}}{{messages.units_minutes_short}}</span> | <span v-else-if="device.status.lastHandshakeMinutes">{{device.status.lastHandshakeMinutes}}{{messages.units_minutes_short}}</span> | ||||
@@ -104,14 +104,15 @@ | |||||
<div v-if="showForkOption"> | <div v-if="showForkOption"> | ||||
<!-- network type --> | <!-- network type --> | ||||
<div class="form-group"> | <div class="form-group"> | ||||
<label for="networkType">{{messages.field_label_network_type}}</label> | |||||
<select v-model="networkType" name="networkType" class="form-control"> | |||||
<option value="bubble">{{messages.field_label_network_type_regular}}</option> | |||||
<option value="fork">{{messages.field_label_network_type_fork}}</option> | |||||
<label for="launchType">{{messages.field_label_network_type}}</label> | |||||
<select v-model="accountPlan.launchType" name="launchType" class="form-control"> | |||||
<option value="node">{{messages.field_label_network_type_regular}}</option> | |||||
<option value="fork_sage">{{messages.field_label_network_type_fork_sage}}</option> | |||||
<option value="fork_node">{{messages.field_label_network_type_fork_node}}</option> | |||||
</select> | </select> | ||||
</div> | </div> | ||||
<!-- fork host --> | <!-- fork host --> | ||||
<div v-if="networkType === 'fork'" class="form-group"> | |||||
<div v-if="accountPlan.launchType === 'fork_sage' || accountPlan.launchType === 'fork_node'" class="form-group"> | |||||
<label for="forkHost">{{messages.field_label_network_fork_host}}</label> | <label for="forkHost">{{messages.field_label_network_fork_host}}</label> | ||||
<input type="text" v-model="accountPlan.forkHost" name="forkHost" class="form-control" :class="{ 'is-invalid': submitted && errors.has('forkHost') }" /> | <input type="text" v-model="accountPlan.forkHost" name="forkHost" class="form-control" :class="{ 'is-invalid': submitted && errors.has('forkHost') }" /> | ||||
<div v-if="submitted && errors.has('forkHost')" class="invalid-feedback d-block">{{ errors.first('forkHost') }}</div> | <div v-if="submitted && errors.has('forkHost')" class="invalid-feedback d-block">{{ errors.first('forkHost') }}</div> | ||||
@@ -149,7 +150,7 @@ | |||||
</div> | </div> | ||||
<div> | <div> | ||||
{{messages['plan_description_'+accountPlan.plan]}} | {{messages['plan_description_'+accountPlan.plan]}} | ||||
<div v-if="networkType === 'fork'"><hr/>{{messages.message_plan_fork_apps}}</div> | |||||
<div v-if="accountPlan.launchType === 'fork_sage' || accountPlan.launchType === 'fork_node'"><hr/>{{messages.message_plan_fork_apps}}</div> | |||||
<div v-else-if="selectedPlan && selectedPlan.apps && selectedPlan.apps.length > 0"> | <div v-else-if="selectedPlan && selectedPlan.apps && selectedPlan.apps.length > 0"> | ||||
<div v-if="typeof selectedPlan.maxAccounts !== 'undefined' && selectedPlan.maxAccounts !== null && selectedPlan.maxAccounts === 1">• {{messages.message_plan_max_accounts_one}}</div> | <div v-if="typeof selectedPlan.maxAccounts !== 'undefined' && selectedPlan.maxAccounts !== null && selectedPlan.maxAccounts === 1">• {{messages.message_plan_max_accounts_one}}</div> | ||||
<div v-else-if="typeof selectedPlan.maxAccounts !== 'undefined' && selectedPlan.maxAccounts !== null && selectedPlan.maxAccounts > 1">• {{messages.message_plan_max_accounts_multiple.parseExpression({max: selectedPlan.maxAccounts})}}</div> | <div v-else-if="typeof selectedPlan.maxAccounts !== 'undefined' && selectedPlan.maxAccounts !== null && selectedPlan.maxAccounts > 1">• {{messages.message_plan_max_accounts_multiple.parseExpression({max: selectedPlan.maxAccounts})}}</div> | ||||
@@ -283,7 +284,7 @@ | |||||
<!-- <p>{{messages.field_label_sync_account_description}}</p>--> | <!-- <p>{{messages.field_label_sync_account_description}}</p>--> | ||||
<!-- </div>--> | <!-- </div>--> | ||||
<!-- launch lock --> | <!-- launch lock --> | ||||
<!-- <div class="form-group" v-if="networkType !== 'fork'">--> | |||||
<!-- <div class="form-group" v-if="accountPlan.launchType !== 'fork_sage' && accountPlan.launchType !== 'fork_node'">--> | |||||
<!-- <label for="launchLock">{{messages.field_label_launch_lock}}</label>--> | <!-- <label for="launchLock">{{messages.field_label_launch_lock}}</label>--> | ||||
<!-- <input type="checkbox" id="launchLock" v-model="accountPlan.launchLock">--> | <!-- <input type="checkbox" id="launchLock" v-model="accountPlan.launchLock">--> | ||||
<!-- <div v-if="submitted && errors.has('launchLock')" class="invalid-feedback d-block">{{ errors.first('launchLock') }}</div>--> | <!-- <div v-if="submitted && errors.has('launchLock')" class="invalid-feedback d-block">{{ errors.first('launchLock') }}</div>--> | ||||
@@ -393,12 +394,12 @@ | |||||
}, | }, | ||||
sshKey: '', | sshKey: '', | ||||
forkHost: '', | forkHost: '', | ||||
launchType: 'node', | |||||
syncAccount: true, | syncAccount: true, | ||||
launchLock: false, | launchLock: false, | ||||
sendErrors: true, | sendErrors: true, | ||||
sendMetrics: true | sendMetrics: true | ||||
}, | }, | ||||
networkType: 'bubble', | |||||
cloudRegionUuid: null, | cloudRegionUuid: null, | ||||
regions: [], | regions: [], | ||||
customize: { | customize: { | ||||