|
|
@@ -1,10 +1,18 @@ |
|
|
|
<!-- Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/ --> |
|
|
|
<template> |
|
|
|
<div v-if="network"> |
|
|
|
<h4 v-if="network.state === 'running' && configs && configs.networkUuid && network.uuid !== configs.networkUuid"> |
|
|
|
<a target="_blank" rel="noopener noreferrer" :href="networkAppLoginUrl">{{network.nickname}}</a> - <i>{{messages['msg_network_state_'+network.state]}}</i> |
|
|
|
<h4> |
|
|
|
<a v-if="network.state === 'running' && isNotSelfNet" target="_blank" rel="noopener noreferrer" |
|
|
|
:href="networkAppLoginUrl"> |
|
|
|
{{ network.nickname }} |
|
|
|
</a> |
|
|
|
<a v-else-if="isInReadyToRestoreState" target="_blank" rel="noopener noreferrer" :href="nodeRestoreUrl"> |
|
|
|
{{ network.nickname }} |
|
|
|
</a> |
|
|
|
<a v-else style="pointer-events: none; cursor: default">{{ network.nickname }}</a> |
|
|
|
|
|
|
|
- <i>{{ messages['msg_network_state_'+network.state] }}</i> |
|
|
|
</h4> |
|
|
|
<h4 v-else>{{network.nickname}} - <i>{{messages['msg_network_state_'+network.state]}}</i></h4> |
|
|
|
|
|
|
|
<div v-if="stats && network.state !== 'stopped'"> |
|
|
|
<!-- adapted from: https://code-boxx.com/simple-vanilla-javascript-progress-bar/ --> |
|
|
@@ -230,6 +238,9 @@ |
|
|
|
networkAppLoginUrl: function () { |
|
|
|
return 'https://'+this.network.name+'.'+this.network.domainName+'/appLogin?session='+util.currentUser().token+'&uri=/'; |
|
|
|
}, |
|
|
|
nodeRestoreUrl: function () { |
|
|
|
return 'https://' + this.networkNodes[0].fqdn + ':' + this.networkNodes[0].sslPort + '/restore'; |
|
|
|
}, |
|
|
|
allowQueueBackup: function () { |
|
|
|
if (this.backups === null) return false; |
|
|
|
if (this.backups.length === 0) return true; |
|
|
@@ -251,8 +262,16 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
isSelfNetAndRunning: function() { |
|
|
|
return this.network.state === 'running' |
|
|
|
&& this.configs.networkUuid && this.network.uuid === this.configs.networkUuid; |
|
|
|
return this.network && this.network.state === 'running' |
|
|
|
&& this.configs && this.configs.networkUuid && this.network.uuid === this.configs.networkUuid; |
|
|
|
}, |
|
|
|
isNotSelfNet: function() { |
|
|
|
return this.configs && this.configs.networkUuid && this.network.uuid !== this.configs.networkUuid |
|
|
|
}, |
|
|
|
isInReadyToRestoreState: function() { |
|
|
|
return this.network && this.network.state === 'restoring' && this.isNotSelfNet |
|
|
|
&& this.stats && this.stats.percent === 100 |
|
|
|
&& this.networkNodes && this.networkNodes.length === 1 |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|