@ -41,7 +41,7 @@ class Cache(object):
data = ''
return data
except:
return {'error': 'true'}
return ''
def get_info(self, codename):
key_name = f'node_{codename}_info'
@ -89,6 +89,10 @@ class DigitalOcean(object):
# Droplets
def create_droplet(self, name, region, extra_vols=[]):
# First check that droplet name does not exist
de = self.check_droplet_exists(name)
if de[0]:
return self.show_droplet(de[1])
data = {
'name': name,
'region': region,
@ -31,7 +31,7 @@ class Operation(db.Model):
def get_node_tor_url(self):
u = cache.get_tor_url(self.codename)
return u.decode()
return u
def get_node_url(self):
return f'{self.codename}.node.{config.DO_DOMAIN}'
@ -94,4 +94,4 @@ class Payout(db.Model):
hours_since_last = db.Column(db.Integer)
def __repr__(self):
return self.id
return f'payout-{self.id}'
@ -34,7 +34,11 @@
<td>{{ op.account_idx }}</td>
<td>{{ op.droplet_id }}</td>
<td>{{ op.volume_id }}</td>
{% if op.get_last_payout() %}
<td>{{ op.get_last_payout().create_date | humanize }}</td>
{% else %}
<td>None</td>
{% endif %}
<td>{{ unlocked }} XMR ({{ locked }} locked)</td>
</tr>
{% endfor %}