<commit_before>{% extends "layout/layoutTable.html" %}
{% from "_helper.html" import image_button, image_popup %}
{% from "_helper.html" import cm_state_color %}

{% block contentbox %}
<h2> {{ image_button ("none", "365_restart", "/cm/refresh/servers") }} Servers </h2>
{% endblock contentbox %}

{% block content %}

<script type="text/javascript">

function killall(cloud) {
	var answer = confirm("Delete all selected VMs in "+cloud+"?");
	if (answer){
		window.location = "/cm/delete/"+cloud+"/";
	}
}

/* http://stackoverflow.com/a/10237915 */
(function($) {
    $(function() {
        $("#servers-accordion > div").accordion({ header: "h3", collapsible: true, heightStyle: "content", active: false });
    });
})(jQuery);

$(function() {
  {% for cloudnum in range(clouds|count) %}
    $("#cloud-table-{{ cloudnum }}").dataTable({
    	"aLengthMenu": [[-1, 10, 25, 50, 100], ["All", 10, 25, 50, 100]],
    	"iDisplayLength": 25,
    	"sPaginationType": "full_numbers",
    	"sDom": 'CR<"clear">lftipr',
        "oColVis": {
            "aiExclude": [ 0 ],
            "sAlign": "center"
        },
        "fnDrawCallback": function(o) {
            var nColVis = $('div.ColVis', o.nTableWrapper)[0];
            nColVis.align = "right";
            nColVis.style.paddingBottom = "15px";
        },
        aaSorting: [[1,'asc']],
        aoColumnDefs: [ {"bSortable": false, "aTargets": [0]} ]
    });
  {% endfor %}
});

</script>

 <!--
    for cloud in clouds:
        print cloud
        for server in clouds[cloud]:
            print server
            for attribute in clouds[cloud][server]:
                print attribute, clouds[cloud][server][attribute]
-->




<div id="servers-accordion">
  {% for cloud in clouds %}
  <div style="margin-bottom:1em;">
    <h3>
    	{{ image_button ("none", "365_restart", "/cm/refresh/" + cloud + "/servers") }}
      	&nbsp;
      	{{ image_button ("none", "190_circle_plus", "/cm/start/" + cloud +"/") }}
      	&nbsp;
      	{{ image_popup ("none", "041_charts", "/stats/table/count/weekly/" + cloud + "/") }}
      	&nbsp;
      	{{ image_button ("none", "044_keys", "/updatekeypair/" + cloud + "/") }}
      	{{ cloud }}
        <span class="badge"> {{ clouds[cloud] |count }} </span> VMs

    </h3>
    <div>
    <table id="cloud-table-{{ loop.index0 }}" >
      <thead>
          <tr>
	      	<th width="100"></th>

            {% for attribute in attributes %}
                  <th>{{attribute}}</th>
            {% endfor %}
          </tr>
      </thead>
      <tbody>
          {% for server in clouds[cloud] %}
             {% set s_id = clouds[cloud][server]['id'] %}
             <tr>
             	<td>
             	 	{{ image_button ("none", "368_collapse", "/cm/login/" ~ cloud ~ "/" ~ s_id ~ "/") }}
	  				{{ image_button ("right", "195_circle_info", "/cm/info/" ~ cloud ~ "/" ~ s_id ~ "/") }}
	  				<a href="/cm/assignpubip/{{cloud}}/{{s_id}}/">  IP </a>
	  				{{ image_button ("none", "041_charts", "/cm/stats/" ~ cloud ~ "/" ~ s_id ~ "/") }}
	  				{{ image_button ("right", "016_bin", "/cm/delete/" ~ cloud + "/" ~ s_id ~ "/") }}
             	 </td>
                 <!-- for attribute in clouds[cloud][server] -->
                 {% for attribute in attributes %}
                      {% if attribute == "created" %}
                          <td>{{ clouds[cloud][server][attribute] }}</td>
					  {% elif attribute == "status"%}
					      <td> {{ cm_state_color(clouds[cloud][server][attribute]) }}</td>
                      {% elif attribute == "flavor" %}
                          <td>{{ clouds[cloud][server][attribute]['id'] }}</td>
                      {% elif attribute == "addresses" %}
                          <td>{{ address_string(clouds[cloud][server][attribute]) }}</td>
                      {% else %}
                          <td>{{ clouds[cloud][server][attribute]  }}</td>
                      {% endif %}
                 {% endfor %}
             </tr>
          {% endfor %}
      </tbody>
    </table>
    </div>
  </div>
  {% endfor %}
</div>


{% endblock %}
<commit_msg>adding info<commit_after>{% extends "layout/layoutTable.html" %}
{% from "_helper.html" import image_button, image_popup %}
{% from "_helper.html" import cm_state_color %}

{% block contentbox %}
<h2> {{ image_button ("none", "365_restart", "/cm/refresh/servers") }} Servers </h2>
{% endblock contentbox %}

{% block content %}

<script type="text/javascript">

function killall(cloud) {
	var answer = confirm("Delete all selected VMs in "+cloud+"?");
	if (answer){
		window.location = "/cm/delete/"+cloud+"/";
	}
}

/* http://stackoverflow.com/a/10237915 */
(function($) {
    $(function() {
        $("#servers-accordion > div").accordion({ header: "h3", collapsible: true, heightStyle: "content", active: false });
    });
})(jQuery);

$(function() {
  {% for cloudnum in range(clouds|count) %}
    $("#cloud-table-{{ cloudnum }}").dataTable({
    	"aLengthMenu": [[-1, 10, 25, 50, 100], ["All", 10, 25, 50, 100]],
    	"iDisplayLength": 25,
    	"sPaginationType": "full_numbers",
    	"sDom": 'CR<"clear">lftipr',
        "oColVis": {
            "aiExclude": [ 0 ],
            "sAlign": "center"
        },
        "fnDrawCallback": function(o) {
            var nColVis = $('div.ColVis', o.nTableWrapper)[0];
            nColVis.align = "right";
            nColVis.style.paddingBottom = "15px";
        },
        aaSorting: [[1,'asc']],
        aoColumnDefs: [ {"bSortable": false, "aTargets": [0]} ]
    });
  {% endfor %}
});

</script>

 <!--
    for cloud in clouds:
        print cloud
        for server in clouds[cloud]:
            print server
            for attribute in clouds[cloud][server]:
                print attribute, clouds[cloud][server][attribute]
-->




<div id="servers-accordion">
  {% for cloud in clouds %}
  <div style="margin-bottom:1em;">
    <h3>
    	{{ image_button ("none", "365_restart", "/cm/refresh/" + cloud + "/servers") }}
      	&nbsp;
      	{{ image_button ("none", "190_circle_plus", "/cm/start/" + cloud +"/") }}
      	&nbsp;
      	{{ image_popup ("none", "041_charts", "/stats/table/count/weekly/" + cloud + "/") }}
      	&nbsp;
      	{{ image_button ("none", "044_keys", "/updatekeypair/" + cloud + "/") }}
      	{{ cloud }}
        <span class="badge"> {{ clouds[cloud] |count }} </span> VMs

    </h3>
    <div>

	{% set flavor_id = user.defaults.flavors[cloud] %}
    {% set image_id = user.defaults.images[cloud] %}

	<p>
		Defaults:
    <a href="/mesh/images"> Image: <span class="badge">{{images[cloud][image_id]['name']}} </span></a>
    <a href="/mesh/flavors">Flavor: <span class="badge">{{flavors[cloud][flavor_id]['name']}} </span></a>
    <a href="/profile"> last vm name: <span class="badge">{{user.defaults.prefix}}_{{user.defaults.index}} </span></a>
	</p>

    <table id="cloud-table-{{ loop.index0 }}" >
      <thead>
          <tr>
	      	<th width="100"></th>

            {% for attribute in attributes %}
                  <th>{{attribute}}</th>
            {% endfor %}
          </tr>
      </thead>
      <tbody>
          {% for server in clouds[cloud] %}
             {% set s_id = clouds[cloud][server]['id'] %}
             <tr>
             	<td>
	{{         clouds[cloud][server]}}
             	 	{{ image_button ("none", "368_collapse", "/cm/login/" ~ cloud ~ "/" ~ s_id ~ "/") }}
	  				{{ image_button ("right", "195_circle_info", "/cm/info/" ~ cloud ~ "/" ~ s_id ~ "/") }}
	  				<a href="/cm/assignpubip/{{cloud}}/{{s_id}}/">  IP </a>
	  				{{ image_button ("none", "041_charts", "/cm/stats/" ~ cloud ~ "/" ~ s_id ~ "/") }}
	  				{{ image_button ("right", "016_bin", "/cm/delete/" ~ cloud + "/" ~ s_id ~ "/") }}
             	 </td>
                 <!-- for attribute in clouds[cloud][server] -->
                 {% for attribute in attributes %}
                      {% if attribute == "created" %}
                          <td>{{ clouds[cloud][server][attribute] }}</td>

					  {% elif attribute == "status"%}
					      <td> {{ cm_state_color(clouds[cloud][server][attribute]) }}</td>

                      {% elif attribute == "flavor" %}
                      	{% set id = clouds[cloud][server][attribute]['id'] %}
                          <td> {{ flavors[cloud][id]['name']}}
                          </td>

                      {% elif attribute == "image" %}
                      	{% set id = clouds[cloud][server][attribute]['id'] %}
                          <td> {{ images[cloud][id]['name']}}
                          </td>

                      {% elif attribute == "addresses" %}
                          <td>{{ address_string(clouds[cloud][server][attribute]) }}</td>
                      {% else %}
                          <td>{{ clouds[cloud][server][attribute]  }}</td>
                      {% endif %}
                 {% endfor %}
             </tr>
          {% endfor %}
      </tbody>
    </table>
    </div>
  </div>
  {% endfor %}
</div>


{% endblock %}

{'fraction_non_alphanumeric': 0.20709993322946807, 'fraction_numerical': 0.016024927665257066, 'mean_word_length': 2.0188108834397043, 'pattern_counts': {'":': 20, '<': 109, '<?xml version=': 0, '>': 111, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2880654', 'n_tokens_mistral': 3121, 'n_tokens_neox': 2808, 'n_words': 574}