Merge branch 'feature/task3637' of https://github.com/siarheipuhach/dynamicweb into feature/task3637
This commit is contained in:
		
				commit
				
					
						fd2bc6e5cf
					
				
			
		
					 28 changed files with 1153 additions and 613 deletions
				
			
		| 
						 | 
				
			
			@ -18,6 +18,7 @@
 | 
			
		|||
 | 
			
		||||
    <!-- Custom CSS -->
 | 
			
		||||
    <link href="{% static 'hosting/css/landing-page.css' %}" rel="stylesheet">
 | 
			
		||||
    <link href="{% static 'hosting/css/user_keys.css' %}" rel="stylesheet">
 | 
			
		||||
    <link href="{% static 'hosting/css/payment.css' %}" rel="stylesheet">
 | 
			
		||||
    <link href="{% static 'hosting/css/order.css' %}" rel="stylesheet">
 | 
			
		||||
    <link href="{% static 'hosting/css/orders.css' %}" rel="stylesheet">
 | 
			
		||||
| 
						 | 
				
			
			@ -27,7 +28,7 @@
 | 
			
		|||
    <!-- Custom Fonts -->
 | 
			
		||||
    <link href='//fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>
 | 
			
		||||
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
 | 
			
		||||
    <link href="//fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
 | 
			
		||||
    <link href="//fonts.googleapis.com/css?family=Lato:300,400,500,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
 | 
			
		||||
    <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
 | 
			
		||||
    <link rel="stylesheet" href="{% static 'hosting/css/owl.carousel.min.css' %}">
 | 
			
		||||
    <link rel="stylesheet" href="{% static 'hosting/css/owl.theme.default.min.css' %}">
 | 
			
		||||
| 
						 | 
				
			
			@ -84,7 +85,7 @@
 | 
			
		|||
                          <ul id="g-account-menu" class="dropdown-menu" role="menu">
 | 
			
		||||
                            <li>
 | 
			
		||||
                                <a href="{% url 'hosting:ssh_keys' %}">
 | 
			
		||||
                                    <i class="fa fa-key"></i> {% trans "Keys"%}
 | 
			
		||||
                                    <i class="fa fa-key"></i> {% trans "SSH Keys" %}
 | 
			
		||||
                                </a>
 | 
			
		||||
                            </li>
 | 
			
		||||
                            <li>
 | 
			
		||||
| 
						 | 
				
			
			@ -114,7 +115,7 @@
 | 
			
		|||
    {% if request.user.is_authenticated %}
 | 
			
		||||
    <footer class="footer-vm">
 | 
			
		||||
        <div class="container">
 | 
			
		||||
            <p class="copyright text-muted small">Copyright © ungleich GmbH {% now "Y" %}. All Rights Reserved</p>
 | 
			
		||||
            <p class="copyright text-muted small">Copyright © ungleich GmbH {% now "Y" %}. {% trans "All Rights Reserved" %}</p>
 | 
			
		||||
        </div>
 | 
			
		||||
    </footer>
 | 
			
		||||
    {% else %}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										66
									
								
								hosting/templates/hosting/choice_ssh_keys.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								hosting/templates/hosting/choice_ssh_keys.html
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,66 @@
 | 
			
		|||
{% extends "hosting/base_short.html" %}
 | 
			
		||||
{% load staticfiles bootstrap3 i18n %}
 | 
			
		||||
{% block content %}
 | 
			
		||||
<div>
 | 
			
		||||
	<div class="container virtual-machine-container dashboard-container dashboard-choice-container">
 | 
			
		||||
		<div class="wide440">
 | 
			
		||||
            <div class="page-header">
 | 
			
		||||
                <h1 class="h1-thin"><i class="fa fa-key" aria-hidden="true"></i> {% trans "SSH Key"%}</h1>
 | 
			
		||||
                <p>{% trans "Choose a key option in order to access your VM" %}.</p>
 | 
			
		||||
            </div>
 | 
			
		||||
            {% if messages %}
 | 
			
		||||
            <div class="alert alert-warning">
 | 
			
		||||
                {% for message in messages %}
 | 
			
		||||
                <span>{{ message }}</span>
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
            </div>
 | 
			
		||||
            {% endif %}
 | 
			
		||||
            <div class="choice-container">
 | 
			
		||||
                <div class="choice-container-top">
 | 
			
		||||
                    <h2>{% trans "Generating a new key pair" %}</h2>
 | 
			
		||||
                    <p>{% trans "I want to generate a new key pair" %}.</p>
 | 
			
		||||
                    <form class="text-right" action="" method="post">
 | 
			
		||||
                        {% csrf_token %}
 | 
			
		||||
                        <button type="submit" class="btn choice-btn choice-btn-faded">
 | 
			
		||||
                            {% trans "Generate" %}
 | 
			
		||||
                        </button>
 | 
			
		||||
                    </form>
 | 
			
		||||
 | 
			
		||||
                </div>
 | 
			
		||||
                <div>
 | 
			
		||||
                    <h2>{% trans "Using existing key" %}</h2>
 | 
			
		||||
                    <p>{% trans "I want to use my existing public key"%}.</p>
 | 
			
		||||
                    <form class="text-right" action="{% url 'hosting:create_ssh_key' %}">
 | 
			
		||||
                        <button type="submit" class="btn choice-btn">
 | 
			
		||||
                            {% trans "Upload" %}
 | 
			
		||||
                        </button>
 | 
			
		||||
                    </form>
 | 
			
		||||
                </div>
 | 
			
		||||
			</div>
 | 
			
		||||
	    </div>
 | 
			
		||||
	</div>
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
{% if next_url %}
 | 
			
		||||
    <script type="text/javascript">
 | 
			
		||||
        window.location.href = '{{next_url}}';
 | 
			
		||||
    </script>
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
 | 
			
		||||
    window.onload = function () {
 | 
			
		||||
        {% for user_key in keys %}
 | 
			
		||||
            var locale_date = moment.utc(document.getElementById("ssh-created_at-{{user_key.id}}").textContent,'YYYY-MM-DD HH:mm').toDate();
 | 
			
		||||
            locale_date =  moment(locale_date).format("YYYY-MM-DD h:mm:ss a");
 | 
			
		||||
            document.getElementById('ssh-created_at-{{user_key.id}}').innerHTML = locale_date;
 | 
			
		||||
        {% endfor %}
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{%endblock%}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -26,8 +26,8 @@
 | 
			
		|||
                        <a href="#contact">Contact</a>
 | 
			
		||||
                    </li>
 | 
			
		||||
                </ul>
 | 
			
		||||
                <p class="copyright text-muted small">Copyright © ungleich GmbH {% now "Y" %}. All Rights Reserved</p>
 | 
			
		||||
                <p class="copyright text-muted small">Copyright © ungleich GmbH {% now "Y" %}. {% trans "All Rights Reserved" %}</p>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</footer>
 | 
			
		||||
</footer>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,7 +20,7 @@
 | 
			
		|||
    <div class="row">  
 | 
			
		||||
        <div class="col-xs-12 col-md-8 col-md-offset-2">
 | 
			
		||||
    		<div class="invoice-title">
 | 
			
		||||
    			<h2>{% trans "Confirm Order"%}</h2><h3 class="pull-right">{% trans "Order #"%} {{order.id}}</h3>
 | 
			
		||||
    			<h2>{{page_header_text}}</h2><h3 class="pull-right">{% trans "Order #"%} {{order.id}}</h3>
 | 
			
		||||
    		</div>
 | 
			
		||||
    		<hr>
 | 
			
		||||
    		<div class="row">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -52,16 +52,13 @@
 | 
			
		|||
                                            </button>
 | 
			
		||||
                                        </div>
 | 
			
		||||
                                        <div class="modal-body">
 | 
			
		||||
                                            <h4 class="modal-title" id="ModalLabel">{% trans "Do You want to delete your order?"%}</h4>
 | 
			
		||||
                                            <div class="modal-icon"><i class="fa fa-trash" aria-hidden="true"></i></div>
 | 
			
		||||
                                            <h4 class="modal-title" id="ModalLabel">{% trans "Do you want to delete your order?"%}</h4>
 | 
			
		||||
 | 
			
		||||
                                            <form method="post"
 | 
			
		||||
                                                  action="{% url 'hosting:delete_order' order.id %}">
 | 
			
		||||
                                                {% csrf_token %}
 | 
			
		||||
                                                <div class="modal-footer">
 | 
			
		||||
                                                    <button type="button" class="btn btn-default"
 | 
			
		||||
                                                            data-dismiss="modal">
 | 
			
		||||
                                                        {% trans "Close"%}
 | 
			
		||||
                                                    </button>
 | 
			
		||||
                                                    <button type="submit" class="btn btn-primary">{% trans "Delete"%}
 | 
			
		||||
                                                    </button>
 | 
			
		||||
                                                </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -71,7 +68,6 @@
 | 
			
		|||
                                </div>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        {% endfor %}
 | 
			
		||||
 | 
			
		||||
                        </tbody>
 | 
			
		||||
                    </table>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -86,7 +86,7 @@
 | 
			
		|||
                            </form>
 | 
			
		||||
                            <div class="row">
 | 
			
		||||
                                <div class="col-xs-12">
 | 
			
		||||
                                    <p>
 | 
			
		||||
                                    <p class="card-warning-content card-warning-addtional-margin">
 | 
			
		||||
                                        {% blocktrans %}
 | 
			
		||||
                                        You are not making any payment yet. After submitting your card
 | 
			
		||||
                                        information, you will be taken to the Confirm Order Page.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,60 +1,61 @@
 | 
			
		|||
{% extends "hosting/base_short.html" %}
 | 
			
		||||
{% load staticfiles bootstrap3 i18n %}
 | 
			
		||||
{% block content %} 
 | 
			
		||||
{% block content %}
 | 
			
		||||
<div>
 | 
			
		||||
	<div class="virtual-machine-container dashboard-container ">
 | 
			
		||||
	<div class="virtual-machine-container dashboard-container">
 | 
			
		||||
		<div class="row">
 | 
			
		||||
			<div class="container-table col-md-9 col-md-offset-2">
 | 
			
		||||
				 <div  class="col-sm-12">
 | 
			
		||||
                    <form method="POST" action="" novalidate class="form-ssh">
 | 
			
		||||
                        {% csrf_token %}
 | 
			
		||||
				        <h3><i class="fa fa-key fa-separate" aria-hidden="true"></i>{% trans "Access Key"%} </h3>
 | 
			
		||||
                        {% if messages %}
 | 
			
		||||
			<div class="col-md-9 col-md-offset-2">
 | 
			
		||||
                <form method="POST" action="" novalidate class="form-ssh">
 | 
			
		||||
                    {% csrf_token %}
 | 
			
		||||
                    <div class="page-header">
 | 
			
		||||
                        <h1 class="h1-thin"><i class="fa fa-key" aria-hidden="true"></i> {% trans "Add your public SSH key" %}</h1>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    {% if messages %}
 | 
			
		||||
                        <div class="alert alert-warning">
 | 
			
		||||
                            {% for message in messages %}
 | 
			
		||||
                            <span>{{ message }}</span>
 | 
			
		||||
                            {% endfor %}
 | 
			
		||||
                        </div>
 | 
			
		||||
						{% endif %}
 | 
			
		||||
                        {% for field in form %}
 | 
			
		||||
                            {% bootstrap_field field %}
 | 
			
		||||
                        {% endfor %}
 | 
			
		||||
                        {% buttons %}
 | 
			
		||||
                            <button type="submit" class="btn btn-success">
 | 
			
		||||
                                {% trans "Upload your own key. "%} 
 | 
			
		||||
					{% endif %}
 | 
			
		||||
                    {% for field in form %}
 | 
			
		||||
                        {% bootstrap_field field %}
 | 
			
		||||
                    {% endfor %}
 | 
			
		||||
                    {% buttons %}
 | 
			
		||||
                    <div class="underform-contaner">
 | 
			
		||||
                        <h4>{% trans "Use your created key to access to the VM" %}.</h4>
 | 
			
		||||
                        <div class="btn-container">
 | 
			
		||||
                            <button type="submit" name="add_ssh" class="btn choice-btn choice-btn-faded">
 | 
			
		||||
                                {% trans "Add SSH Key" %}
 | 
			
		||||
                            </button>
 | 
			
		||||
<br />
 | 
			
		||||
<br />
 | 
			
		||||
							{% trans "Or generate a new key pair."%} <br />
 | 
			
		||||
<br />
 | 
			
		||||
                                <button class="btn btn-success">{% trans "Generate Key Pair"%} </a>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="underform-contaner">
 | 
			
		||||
                        <h4>{% trans "Or you can generate a new key pair"%}.</h4>
 | 
			
		||||
                        <div class="btn-container">
 | 
			
		||||
                            <button type="submit" name="generate" class="btn choice-btn">
 | 
			
		||||
                                {% trans "Generate" %}
 | 
			
		||||
                            </button>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    {% endbuttons %}
 | 
			
		||||
                </form>
 | 
			
		||||
 | 
			
		||||
                        {% endbuttons %} 
 | 
			
		||||
                        </form>
 | 
			
		||||
                        <h5> Use your created key to access to the machine. If you lost it, contact us. </h5>
 | 
			
		||||
 | 
			
		||||
				        {% if private_key %}
 | 
			
		||||
				 		<div class="alert alert-warning">
 | 
			
		||||
				 			 
 | 
			
		||||
  							<strong>{% trans "Warning!"%}</strong>{% trans "You can download your SSH  private key once. Don't lost your key"%}  
 | 
			
		||||
						</div>
 | 
			
		||||
						<div class="form-group">
 | 
			
		||||
						  <textarea class="form-control" rows="6" id="ssh_key" type="hidden" style="display:none">{{private_key}}</textarea>
 | 
			
		||||
 | 
			
		||||
						</div>
 | 
			
		||||
						{% endif %}
 | 
			
		||||
						<div class="clearfix"></div>
 | 
			
		||||
				</div>
 | 
			
		||||
		        {% if private_key %}
 | 
			
		||||
    		 		<div class="alert alert-warning">
 | 
			
		||||
						<strong>{% trans "Warning!"%}</strong>{% trans "You can download your SSH  private key once. Don't loose your key" %}
 | 
			
		||||
    				</div>
 | 
			
		||||
    				<div class="form-group">
 | 
			
		||||
    				    <textarea class="form-control" rows="6" id="ssh_key" type="hidden" style="display:none">{{private_key}}</textarea>
 | 
			
		||||
    				</div>
 | 
			
		||||
				{% endif %}
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
	    </div>
 | 
			
		||||
	</div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
{% if private_key %}
 | 
			
		||||
<!-- Force to download ssh key on page load -->
 | 
			
		||||
<script type="text/javascript"> 
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
 | 
			
		||||
        var key = window.document.getElementById('ssh_key');
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -75,7 +76,7 @@
 | 
			
		|||
{%endif%}
 | 
			
		||||
 | 
			
		||||
{% if next_url %}
 | 
			
		||||
    <script type="text/javascript"> 
 | 
			
		||||
    <script type="text/javascript">
 | 
			
		||||
        window.location.href = '{{next_url}}';
 | 
			
		||||
    </script>
 | 
			
		||||
{% endif %}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,104 +1,124 @@
 | 
			
		|||
{% extends "hosting/base_short.html" %}
 | 
			
		||||
{% load staticfiles bootstrap3 i18n %}
 | 
			
		||||
{% block content %} 
 | 
			
		||||
{% block content %}
 | 
			
		||||
<div>
 | 
			
		||||
	<div class="container virtual-machine-container dashboard-container ">
 | 
			
		||||
		<div class="row">
 | 
			
		||||
			<div class="col-md-9 col-md-offset-2">
 | 
			
		||||
				 <div  class="col-sm-12">
 | 
			
		||||
                    <h3><i class="fa fa-key" aria-hidden="true"></i>{% trans "Access Key"%} </h3>
 | 
			
		||||
                    {% if messages %}
 | 
			
		||||
                    <div class="alert alert-warning">
 | 
			
		||||
                        {% for message in messages %}
 | 
			
		||||
                        <span>{{ message }}</span>
 | 
			
		||||
                        {% endfor %}
 | 
			
		||||
                    </div>
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
                    <p class="pull-right">
 | 
			
		||||
                        <a class="btn btn-success" href="{% url 'hosting:create_ssh_key' %}" >{% trans "Add Key"%} </a>
 | 
			
		||||
                    </p>
 | 
			
		||||
                    <h5> Use your created key to access to the machine. If you lost it, contact us. </h5>
 | 
			
		||||
                    <table class="table borderless table-hover"> 
 | 
			
		||||
                        <br/>
 | 
			
		||||
                        <thead> 
 | 
			
		||||
                        <tr> 
 | 
			
		||||
                            <th>{% trans "Name"%}</th>
 | 
			
		||||
                            <th>{% trans "Created at"%} </th>
 | 
			
		||||
                            <th>{% trans "Status"%} </th>
 | 
			
		||||
                            <th></th>
 | 
			
		||||
                        </tr>
 | 
			
		||||
                        </thead>
 | 
			
		||||
                        <tbody> 
 | 
			
		||||
                            {% for user_key in keys %}
 | 
			
		||||
                            <tr> 
 | 
			
		||||
                                <td scope="row">{{user_key.name}}</td> 
 | 
			
		||||
 | 
			
		||||
                                <td><span id="ssh-created_at-{{user_key.id}}">{{user_key.created_at|date:'Y-m-d H:i' }}</span></td> 
 | 
			
		||||
                                <td>
 | 
			
		||||
                                    <span class="h3 label label-success"><strong>Active</strong></span>
 | 
			
		||||
                                </td> 
 | 
			
		||||
                                <td> 
 | 
			
		||||
                                <button type="button" class="btn btn-default" data-toggle="modal"
 | 
			
		||||
                                        data-target="#Modal{{ user_key.id }}"><a
 | 
			
		||||
                                        href="#">{% trans "Delete Key"%}</a>
 | 
			
		||||
                                </button>
 | 
			
		||||
 | 
			
		||||
    <div class="modal fade" id="Modal{{user_key.id }}" tabindex="-1" role="dialog">
 | 
			
		||||
        <div class="modal-dialog" role="document">
 | 
			
		||||
            <div class="modal-content">
 | 
			
		||||
                <div class="modal-header">
 | 
			
		||||
                    <button type="button" class="close" data-dismiss="modal"
 | 
			
		||||
                            aria-label="Confirm"><span
 | 
			
		||||
                            aria-hidden="true">×</span>
 | 
			
		||||
                    </button>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="modal-body">
 | 
			
		||||
                    <h4 class="modal-title" id="ModalLabel">{% trans "Do You want to delete this key?"%}</h4>
 | 
			
		||||
 | 
			
		||||
                    <form method="post" action="{% url 'hosting:delete_ssh_key' user_key.id %}">
 | 
			
		||||
                        {% csrf_token %}
 | 
			
		||||
                        <div class="modal-footer">
 | 
			
		||||
                            <button type="button" class="btn btn-default"
 | 
			
		||||
                                    data-dismiss="modal">
 | 
			
		||||
                                {% trans "Close"%}
 | 
			
		||||
                            </button>
 | 
			
		||||
                            <button type="submit" class="btn btn-primary">{% trans "Delete"%}
 | 
			
		||||
                            </button>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </form>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        <h1 class="h1-thin"><i class="fa fa-key" aria-hidden="true"></i> {% trans "Your SSH Keys" %}</h1>
 | 
			
		||||
        {% if messages %}
 | 
			
		||||
        <div class="alert alert-warning">
 | 
			
		||||
            {% for message in messages %}
 | 
			
		||||
            <span>{{ message }}</span>
 | 
			
		||||
            {% endfor %}
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
                                 </td>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                            {% endfor %}
 | 
			
		||||
                                </tbody> 
 | 
			
		||||
                            </table>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
         <div class="ssh-header-container">
 | 
			
		||||
            <p>{% trans "To generate a new key pair or to upload your existing key, click 'Add Key'" %}</p>
 | 
			
		||||
            <a class="btn choice-btn" href="{% url 'hosting:choice_ssh_keys' %}" >
 | 
			
		||||
                <span class="fa fa-plus"></span>  {% trans "Add SSH Key" %}
 | 
			
		||||
            </a>
 | 
			
		||||
         </div>
 | 
			
		||||
 | 
			
		||||
        <table class="table borderless table-hover ssh-keys-table">
 | 
			
		||||
            <br/>
 | 
			
		||||
            <thead>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <th>{% trans "Name" %}</th>
 | 
			
		||||
                <th>{% trans "Delete Key" %}</th>
 | 
			
		||||
                <th>{% trans "Public Key" %}</th>
 | 
			
		||||
                <th>{% trans "Private Key" %}</th>
 | 
			
		||||
            </tr>
 | 
			
		||||
            </thead>
 | 
			
		||||
            <tbody>
 | 
			
		||||
                {% for user_key in keys %}
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td scope="row">{{user_key.name}}</td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <button type="button" class="btn btn-default btn-custom-delete" data-toggle="modal"
 | 
			
		||||
                                data-target="#Modal{{ user_key.id }}" style="color: #717274">
 | 
			
		||||
                            <span class="pc-only">{% trans "Delete" %}</span>
 | 
			
		||||
                            <span class="mob-only"><i class="fa fa-trash"></i></span>
 | 
			
		||||
                        </button>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
						<div class="clearfix"></div>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
	    </div>
 | 
			
		||||
                        <div class="modal fade" id="Modal{{user_key.id }}" tabindex="-1" role="dialog">
 | 
			
		||||
                            <div class="modal-dialog" role="document">
 | 
			
		||||
                                <div class="modal-content">
 | 
			
		||||
                                    <div class="modal-header">
 | 
			
		||||
                                        <button type="button" class="close" data-dismiss="modal"
 | 
			
		||||
                                                aria-label="Confirm"><span
 | 
			
		||||
                                                aria-hidden="true">×</span>
 | 
			
		||||
                                        </button>
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                    <div class="modal-body">
 | 
			
		||||
                                        <h4 class="modal-title" id="ModalLabel">{% trans "Do You want to delete this key?" %}</h4>
 | 
			
		||||
                                        <form method="post" action="{% url 'hosting:delete_ssh_key' user_key.id %}">
 | 
			
		||||
                                            {% csrf_token %}
 | 
			
		||||
                                            <div class="modal-footer">
 | 
			
		||||
                                                <button type="submit" class="btn btn-primary">{% trans "Delete" %}
 | 
			
		||||
                                                </button>
 | 
			
		||||
                                            </div>
 | 
			
		||||
                                        </form>
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                     </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <p type="button"  data-toggle="modal" style="margin: 0" data-target="#Modal_public_key{{ user_key.id }}">
 | 
			
		||||
                            <a href="#">{% trans "Show" %}</a>
 | 
			
		||||
                        </p>
 | 
			
		||||
                        <div class="modal fade" id="Modal_public_key{{user_key.id }}" tabindex="-1" role="dialog">
 | 
			
		||||
                            <div class="modal-dialog" role="document">
 | 
			
		||||
                                <div class="modal-content">
 | 
			
		||||
                                    <div class="modal-header">
 | 
			
		||||
                                        <button type="button" class="close" data-dismiss="modal"
 | 
			
		||||
                                                aria-label="Confirm"><span
 | 
			
		||||
                                                aria-hidden="true">×</span>
 | 
			
		||||
                                        </button>
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                    <div class="modal-body">
 | 
			
		||||
                                        <h4 class="modal-title" id="ModalLabel_Public_Key">{% trans "Public ssh key" %}</h4>
 | 
			
		||||
                                        <p style="margin-top: 10px;">{{ user_key.public_key }}</p>
 | 
			
		||||
                                        <div class="modal-footer">
 | 
			
		||||
                                            <button type="button" class="btn btn-default"
 | 
			
		||||
                                                    data-dismiss="modal">
 | 
			
		||||
                                                {% trans "Close" %}
 | 
			
		||||
                                            </button>
 | 
			
		||||
                                        </div>
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                     </td>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        {% if user_key.private_key %}
 | 
			
		||||
                        <form action="{{ user_key.private_key.url }}">
 | 
			
		||||
                            <button style="color: #717274" type="submit" class="btn btn-default" data-toggle="modal"
 | 
			
		||||
                                    >
 | 
			
		||||
                                    <span class="pc-only">{% trans "Download" %}</span>
 | 
			
		||||
                                    <span class="mob-only"><i class="fa fa-download"></i></span>
 | 
			
		||||
                            </button>
 | 
			
		||||
                        </form>
 | 
			
		||||
                        {% endif %}
 | 
			
		||||
                    </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
            </tbody>
 | 
			
		||||
        </table>
 | 
			
		||||
	</div>
 | 
			
		||||
    
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
{% if next_url %}
 | 
			
		||||
    <script type="text/javascript"> 
 | 
			
		||||
    <script type="text/javascript">
 | 
			
		||||
        window.location.href = '{{next_url}}';
 | 
			
		||||
    </script>
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
<script type="text/javascript"> 
 | 
			
		||||
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
 | 
			
		||||
    window.onload = function () {
 | 
			
		||||
        {% for user_key in keys %}
 | 
			
		||||
            // var locale_date = new Date(document.getElementById("ssh-created_at-{{user_key.id}}").textContent).toISOString();
 | 
			
		||||
            var locale_date = moment.utc(document.getElementById("ssh-created_at-{{user_key.id}}").textContent,'YYYY-MM-DD HH:mm').toDate();
 | 
			
		||||
            locale_date =  moment(locale_date).format("YYYY-MM-DD h:mm:ss a");
 | 
			
		||||
            document.getElementById('ssh-created_at-{{user_key.id}}').innerHTML = locale_date;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,7 @@
 | 
			
		|||
{% load staticfiles bootstrap3 %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
 | 
			
		||||
{% block content %} 
 | 
			
		||||
{% block content %}
 | 
			
		||||
<div>
 | 
			
		||||
	<div class="virtual-machine-container dashboard-container ">
 | 
			
		||||
		<div class="row">
 | 
			
		||||
| 
						 | 
				
			
			@ -46,19 +46,19 @@
 | 
			
		|||
												<button type="link"
 | 
			
		||||
					data-clipboard-text="{{virtual_machine.ipv4}}" id="copy_vm_id" class="to_copy btn btn-link"
 | 
			
		||||
													data-toggle="tooltip"  data-placement="bottom" title="Copied"  data-trigger="click">
 | 
			
		||||
														Ipv4: {{virtual_machine.ipv4}} <i class="fa fa-files-o" aria-hidden="true"></i> 
 | 
			
		||||
														Ipv4: {{virtual_machine.ipv4}} <i class="fa fa-files-o" aria-hidden="true"></i>
 | 
			
		||||
												</button>
 | 
			
		||||
												<button type="link"
 | 
			
		||||
					data-clipboard-text="{{virtual_machine.ipv6}}" id="copy_vm_id" class="to_copy btn btn-link"
 | 
			
		||||
													data-toggle="tooltip"  data-placement="bottom" title="Copied"  data-trigger="click">
 | 
			
		||||
														Ipv6: {{virtual_machine.ipv6}} <i class="fa fa-files-o" aria-hidden="true"></i> 
 | 
			
		||||
														Ipv6: {{virtual_machine.ipv6}} <i class="fa fa-files-o" aria-hidden="true"></i>
 | 
			
		||||
												</button>
 | 
			
		||||
											</div>
 | 
			
		||||
										{% else %}
 | 
			
		||||
 | 
			
		||||
											<div class="pull-right right-place">
 | 
			
		||||
												<span class="label label-warning"><strong>{% trans "Ip not assigned yet"%}</strong></span>
 | 
			
		||||
												<i data-toggle="tooltip"  title="Your ip will be assigned soon" class="fa fa-info-circle" aria-hidden="true"></i> 
 | 
			
		||||
												<i data-toggle="tooltip"  title="Your ip will be assigned soon" class="fa fa-info-circle" aria-hidden="true"></i>
 | 
			
		||||
											</div>
 | 
			
		||||
 | 
			
		||||
										{% endif %}
 | 
			
		||||
| 
						 | 
				
			
			@ -85,12 +85,12 @@
 | 
			
		|||
								      </div>
 | 
			
		||||
								      <div class="col-md-3">
 | 
			
		||||
								        <div class="well text-center box-setting">
 | 
			
		||||
								        	<i class="fa fa-hdd-o" aria-hidden="true"></i> 
 | 
			
		||||
								        	<i class="fa fa-hdd-o" aria-hidden="true"></i>
 | 
			
		||||
								        	<span>{% trans "Disk"%}</span>
 | 
			
		||||
								        	<span class="label label-success">{{virtual_machine.disk_size|floatformat:2}} GB</span>
 | 
			
		||||
								        </div>
 | 
			
		||||
								      </div>
 | 
			
		||||
								    </div><!--/row-->    
 | 
			
		||||
								    </div><!--/row-->
 | 
			
		||||
								  </div><!--/col-12-->
 | 
			
		||||
								</div><!--/row-->
 | 
			
		||||
								<div class="row">
 | 
			
		||||
| 
						 | 
				
			
			@ -106,7 +106,7 @@
 | 
			
		|||
				            	<div class="row ">
 | 
			
		||||
									<div class="col-md-12 inline-headers">
 | 
			
		||||
										<h3>{% trans "Current pricing"%}</h3>
 | 
			
		||||
										<span class="h3 pull-right"><strong>{{virtual_machine.price|floatformat}} CHF</strong>/month</span> 
 | 
			
		||||
										<span class="h3 pull-right"><strong>{{virtual_machine.price|floatformat}} CHF</strong>/month</span>
 | 
			
		||||
										<hr>
 | 
			
		||||
									</div>
 | 
			
		||||
				            	</div>
 | 
			
		||||
| 
						 | 
				
			
			@ -136,13 +136,13 @@
 | 
			
		|||
										<div class="pull-right">
 | 
			
		||||
											<form method="POST"
 | 
			
		||||
                 id="virtual_machine_cancel_form" class="cancel-form" action="{% url 'hosting:virtual_machines' virtual_machine.vm_id %}">
 | 
			
		||||
											{% csrf_token %} 
 | 
			
		||||
											</form>	
 | 
			
		||||
												
 | 
			
		||||
											{% csrf_token %}
 | 
			
		||||
											</form>
 | 
			
		||||
 | 
			
		||||
												<button type="text" data-href="{% url 'hosting:virtual_machines' virtual_machine.vm_id %}" data-toggle="modal" data-target="#confirm-cancel" class="btn btn-danger">{% trans "Terminate Virtual Machine"%}</button>
 | 
			
		||||
																						
 | 
			
		||||
 | 
			
		||||
										</div>
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
									</div>
 | 
			
		||||
                                    <div class="col-md-12">
 | 
			
		||||
                                        <br/>
 | 
			
		||||
| 
						 | 
				
			
			@ -159,14 +159,18 @@
 | 
			
		|||
									<div class="modal fade" id="confirm-cancel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
 | 
			
		||||
									    <div class="modal-dialog">
 | 
			
		||||
									        <div class="modal-content">
 | 
			
		||||
									            <div class="modal-header">
 | 
			
		||||
									                {% trans "Terminate your Virtual Machine"%}
 | 
			
		||||
									            </div>
 | 
			
		||||
												<div class="modal-header">
 | 
			
		||||
													<button type="button" class="close" data-dismiss="modal"
 | 
			
		||||
															aria-label="Confirm"><span
 | 
			
		||||
															aria-hidden="true">×</span>
 | 
			
		||||
													</button>
 | 
			
		||||
												</div>
 | 
			
		||||
									            <div class="modal-body">
 | 
			
		||||
									                {% trans "Are you sure do you want to cancel your Virtual Machine "%} {{virtual_machine.name}} ?
 | 
			
		||||
													<div class="modal-icon"><i class="fa fa-ban" aria-hidden="true"></i></div>
 | 
			
		||||
													<h4 class="modal-title" id="ModalLabel">{% trans "Terminate your Virtual Machine"%}</h4>
 | 
			
		||||
									                <p class="modal-text">{% trans "Are you sure do you want to cancel your Virtual Machine "%} {{virtual_machine.name}} ?</p>
 | 
			
		||||
									            </div>
 | 
			
		||||
									            <div class="modal-footer">
 | 
			
		||||
									                <button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Cancel"%}</button>
 | 
			
		||||
									                <a class="btn btn-danger btn-ok">OK</a>
 | 
			
		||||
									            </div>
 | 
			
		||||
									        </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue