~forest/capsul-flask

capsul-flask/capsulflask/templates/capsul-detail.html -rw-r--r-- 7.5 KiB
f3630fbaforest account-balance cli command 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
{% extends 'base.html' %}

{% block title %}{{ vm['id'] }}{% endblock %}

{% block content %}

{% if deleted %}
<div class="row third-margin">
  <h1>DELETED</h1>
</div>
<div class="row third-margin">
  <p>{{ vm['id'] }} has been deleted.</p>
</div>
{% else %}
  {% if force_stop %}
    <div class="row third-margin">
      <h1>Are you sure?</h1>
    </div>
    <div class="row third-margin">
      <p>
        Are you sure you want to force stop {{ vm['id'] }}? 
        This would be like unplugging the power supply.
      </p>
    </div>
    <div class="row third-margin">
      <a href="/console/{{ vm['id'] }}">No, Cancel!</a>
      <form  method="post">
        <input type="hidden" name="action" value="force-stop"/>
        <input type="hidden" name="are_you_sure" value="True"/>
        <input type="hidden" name="csrf-token" value="{{ csrf_token }}"/>
        <input type="submit" class="form-submit-link" value="Yes, Force Stop">
      </form>
    </div>
  {% elif delete %}
    <div class="row third-margin">
      <h1>Are you sure?</h1>
    </div>
    <div class="row third-margin">
      <p>Are you sure you want to delete {{ vm['id'] }}?</p>
    </div>
    <div class="row third-margin">
      <a href="/console/{{ vm['id'] }}">No, Cancel!</a>
      <form  method="post">
        <input type="hidden" name="action" value="delete"/>
        <input type="hidden" name="are_you_sure" value="True"/>
        <input type="hidden" name="csrf-token" value="{{ csrf_token }}"/>
        <input type="submit" class="form-submit-link" value="Yes, Delete">
      </form>
    </div>
  {% else %}
    <div class="row third-margin">
      <h1>{{ vm['id'] }}</h1>
    </div>
    <div class="row wrap grid-large third-margin">
        
      <div class="row justify-start">
        <label class="align" for="created">Created</label>
        <span id="created">{{ vm['created'] }}</span>
      </div>
      <div class="row justify-start">
        <label class="align" for="size">Capsul Size</label>
        <span id="size">{{ vm['size'] }}</span>
      </div>
      <div class="row justify-start">
        <label class="align" for="vm_state">State</label>
        {% if vm['state'] == 'starting' or vm['state'] == 'stopping'  %}
          <span id="vm_state" class="waiting-pulse">{{ vm['state'] }}</span>
        {% elif vm['state'] == 'crashed' or vm['state'] == 'blocked'  %}
          <span id="vm_state" class="red">{{ vm['state'] }}</span>
        {% else  %}
          <span id="vm_state">{{ vm['state'] }}</span>
        {% endif  %}
      </div>
      <div class="row justify-start">
        <label class="align" for="dollars_per_month">Monthly Cost</label>
        <span id="dollars_per_month">${{ vm['dollars_per_month'] }}</span>
      </div>
      <div class="row justify-start">
        <label class="align" for="ipv4">IPv4 Address</label>
        <span id="ipv4">{{ vm['ipv4'] }}</span>
      </div>
      <div class="row justify-start">
        <label class="align" for="os_description">Operating System</label>
        <span id="os_description">{{ vm['os_description'] }}</span>
      </div>
      <div class="row justify-start">
        <label class="align" for="vcpus">VCPUs</label>
        <span id="vcpus">{{ vm['vcpus'] }}</span>
      </div>
      <div class="row justify-start">
        <label class="align" for="memory_mb">Memory</label>
        <span id="memory_mb">{{ vm['memory_mb'] }}MB</span>
      </div>
      <div class="row justify-start">
        <label class="align" for="bandwidth_gb_per_month">Bandwidth</label>
        <span id="bandwidth_gb_per_month">{{ vm['bandwidth_gb_per_month'] }}GB/month</span>
      </div>
      <div class="row justify-start">
        <label class="align" for="ssh_username">SSH Username</label>
        <span id="ssh_username">cyberian</span>
      </div>
      <div class="row justify-start">
        <label class="align" for="ssh_authorized_keys">SSH Authorized Keys</label>
        <a id="ssh_authorized_keys" href="/console/ssh">{{ vm['ssh_authorized_keys'] }}</a>
      </div>
      
    </div>
    <div class="row center justify-start vm-actions">
      <label class="align" for="delete_action">Actions</label>
      <form id="delete_action" method="post">
        <input type="hidden" name="action" value="delete"/>
        <input type="hidden" name="csrf-token" value="{{ csrf_token }}"/>
        <input type="submit" class="form-submit-link" value="Delete...">
      </form>
      {% if vm['state'] == 'crashed' or vm['state'] == 'stopped'  %}
      <form id="start_action" method="post">
        <input type="hidden" name="action" value="start"/>
        <input type="hidden" name="csrf-token" value="{{ csrf_token }}"/>
        <input type="submit" class="form-submit-link" value="Start">
      </form>
      {% endif  %}
      {% if vm['state'] != 'stopped' %}
      <form id="force_stop_action" method="post">
        <input type="hidden" name="action" value="force-stop"/>
        <input type="hidden" name="csrf-token" value="{{ csrf_token }}"/>
        <input type="submit" class="form-submit-link" value="Force Stop...">
      </form>
      {% endif  %}

    </div>
    <div class="row  third-margin">
      <h1>ssh host key fingerprints</h1>
    </div>
    
    <div class="row">
      <pre class="code">{% for key in vm['ssh_host_keys'] %}
SHA256:{{ key.sha256 }} ({{ key.key_type }}){% endfor %}</pre>
    </div>
    <div class="row">
      <span>(What's this? see <a href="/about-ssh">Understanding the Secure Shell Protocol (SSH)</a>)</span>
    </div>
    <div class="row ">
      <hr/>
    </div>
    <div class="row third-margin">
      {% for d in durations %}
        <a href="/console/{{  vm['id']  }}?duration={{ d }}">
          {% if d == duration %}
          <span class="code">{{ d }}</span>
          {% else %}
          {{ d }}
          {% endif %}

        </a>
      {% endfor %}
    </div>
    <div class="row wrap grid-small  justify-end">
      <div class="metric">
        <h1>cpu</h1>
        <a href="/metrics/html/cpu/{{ vm['id'] }}/{{ duration }}">
          <img src="/metrics/cpu/{{ vm['id'] }}/{{ duration }}/m"/>
        </a>
      </div>

      <div  class="metric">
        <h1>memory</h1>
        <a href="/metrics/html/memory/{{ vm['id'] }}/{{ duration }}">
          <img src="/metrics/memory/{{ vm['id'] }}/{{ duration }}/m"/>
        </a>
      </div>
      
      <div  class="metric">
        <h1>network_in</h1>
        <a href="/metrics/html/network_in/{{ vm['id'] }}/{{ duration }}">
          <img src="/metrics/network_in/{{ vm['id'] }}/{{ duration }}/m"/>
        </a>
      </div>

      <div  class="metric">
        <h1>network_out</h1>
        <a href="/metrics/html/network_out/{{ vm['id'] }}/{{ duration }}">
          <img src="/metrics/network_out/{{ vm['id'] }}/{{ duration }}/m"/>
        </a>
      </div>

      <div  class="metric">
        <h1>disk</h1>
        <a href="/metrics/html/disk/{{ vm['id'] }}/{{ duration }}">
          <img src="/metrics/disk/{{ vm['id'] }}/{{ duration }}/m"/>
        </a>
      </div>
    </div>
    <div class="row ">
      <hr/>
    </div>
    <div class="row half-margin">
      add the following to your ~/.ssh/known_hosts file (optional)
    </div>
    <div class="row">
      <pre class="code wrap break-all smalltext">{% for key in vm['ssh_host_keys'] %}
{{ vm['ipv4'] }} {{ key.content }}{% endfor %}
  </pre>
    </div>
    <div class="row">
      <span>(What's this? see <a href="/about-ssh">Understanding the Secure Shell Protocol (SSH)</a>)</span>
    </div>
  {% endif %}
{% endif %}

{% endblock %}

{% block pagesource %}/templates/create-capsul.html{% endblock %}