Skip to content

Commit

Permalink
Add Container Type in Container Details. Fix Delete Bug for Ephemeral…
Browse files Browse the repository at this point in the history
… Containers
  • Loading branch information
nbesimi committed Apr 5, 2018
1 parent 3430618 commit 2f71144
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/api/models/LXCContainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ def create(self, waitIt=True):
def delete(self, force=False):
try:
container = self.client.containers.get(self.data.get('name'))
if force and self.info().get('status') == 'Running':
if self.info().get('ephemeral'):
container.stop(wait=True)
return
elif force and self.info().get('status') == 'Running':
container.stop(wait=True)
container.delete()
except Exception as e:
Expand Down
11 changes: 11 additions & 0 deletions app/ui/templates/container-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<div class="col-lg-12 main-div">
{% if container == None %}
<div class="alert alert-danger" role="alert"> CONTAINER <b>{{name}}</b> : {{message}} !</div>
<script>
window.location = '/ui/containers';
</script>
{% else %}
<script>
$(function () {
Expand Down Expand Up @@ -43,6 +46,14 @@ <h5 style="display:inline">Currently Running Processes :</h5>
</div>
{% endif %}
</div>
<div class="form-group">
<h5 style="display:inline">Type :</h5>
{% if container.ephemeral %}
<b>Ephemeral</b>
{% else %}
<b>Persistent</b>
{% endif %}
</div>
<div class="form-group">
<h5 style="display:inline">Architecture :</h5>
<b>{{container.architecture}}</b>
Expand Down

0 comments on commit 2f71144

Please sign in to comment.