<commit_before>/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org)             */
/*                                                                            */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may    */
/* not use this file except in compliance with the License. You may obtain    */
/* a copy of the License at                                                   */
/*                                                                            */
/* http://www.apache.org/licenses/LICENSE-2.0                                 */
/*                                                                            */
/* Unless required by applicable law or agreed to in writing, software        */
/* distributed under the License is distributed on an "AS IS" BASIS,          */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   */
/* See the License for the specific language governing permissions and        */
/* limitations under the License.                                             */
/* -------------------------------------------------------------------------- */

/*Host tab plugin*/
/* HOST_HISTORY_LENGTH is ignored by server */
var HOST_HISTORY_LENGTH = 40;
var host_graphs = [
    {
        title : "CPU Monitoring information",
        monitor_resources : "cpu_usage,used_cpu,max_cpu",
        humanize_figures : false,
        history_length : HOST_HISTORY_LENGTH
    },
    {
        title: "Memory monitoring information",
        monitor_resources : "mem_usage,used_mem,max_mem",
        humanize_figures : true,
        history_length : HOST_HISTORY_LENGTH
    }
]


var hosts_tab_content =
'<form id="form_hosts" action="javascript:alert(\'js errors?!\')">\
  <div class="action_blocks">\
  </div>\
<table id="datatable_hosts" class="display">\
  <thead>\
    <tr>\
      <th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
      <th>ID</th>\
      <th>Name</th>\
      <th>Running VMs</th>\
      <th>CPU Use</th>\
      <th>Memory use</th>\
      <th>Status</th>\
    </tr>\
  </thead>\
  <tbody id="tbodyhosts">\
  </tbody>\
</table>\
</form>';

var create_host_tmpl =
'<div class="create_form"><form id="create_host_form" action="">\
  <fieldset>\
  <legend style="display:none;">Host parameters</legend>\
  <label for="name">Name: </label><input type="text" name="name" id="name" />\
  </fieldset>\
  <h3>Drivers</h3>\
  <fieldset>\
    <div class="manager clear" id="vmm_mads">\
          <label>Virtualization Manager:</label>\
          <select id="vmm_mad" name="vmm">\
                <option value="vmm_kvm">KVM</option>\
                <option value="vmm_xen">XEN</option>\
                <option value="vmm_ec2">EC2</option>\
                <option value="vmm_dummy">Dummy</option>\
          </select>\
    </div>\
    <div class="manager clear" id="im_mads">\
      <label>Information Manager:</label>\
      <select id="im_mad" name="im">\
               <option value="im_kvm">KVM</option>\
               <option value="im_xen">XEN</option>\
               <option value="im_ec2">EC2</option>\
               <option value="im_dummy">Dummy</option>\
      </select>\
    </div>\
    <div class="manager clear" id="vnm_mads">\
      <label>Virtual Network Manager:</label>\
       <select id="vnm_mad" name="vn">\
         <option value="dummy">Dummy</option>\
         <option value="etables">Etables</option>\
         <option value="ovswitch">Open vSwitch</option>\
         <option value="802.1Q">802.1Q</option>\
       </select>\
    </div>\
    <div class="manager clear" id="tm_mads">\
      <label>Transfer Manager:</label>\
       <select id="tm_mad" name="tm">\
         <option value="tm_shared">Shared</option>\
         <option value="tm_ssh">SSH</option>\
         <option value="tm_dummy">Dummy</option>\
       </select>\
    </div>\
    </fieldset>\
    <fieldset>\
    <div class="form_buttons">\
        <div><button class="button" id="create_host_submit" value="OpenNebula.Host.create">Create</button>\
        <button class="button" type="reset" value="reset">Reset</button></div>\
    </div>\
  </fieldset>\
</form></div>';

var hosts_select="";
var dataTable_hosts;
var $create_host_dialog;

//Setup actions
var host_actions = {

    "Host.create" : {
        type: "create",
        call : OpenNebula.Host.create,
        callback : addHostElement,<commit_msg>Sunstone: add "fw" driver to host creation dialog<commit_after>/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org)             */
/*                                                                            */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may    */
/* not use this file except in compliance with the License. You may obtain    */
/* a copy of the License at                                                   */
/*                                                                            */
/* http://www.apache.org/licenses/LICENSE-2.0                                 */
/*                                                                            */
/* Unless required by applicable law or agreed to in writing, software        */
/* distributed under the License is distributed on an "AS IS" BASIS,          */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   */
/* See the License for the specific language governing permissions and        */
/* limitations under the License.                                             */
/* -------------------------------------------------------------------------- */

/*Host tab plugin*/
/* HOST_HISTORY_LENGTH is ignored by server */
var HOST_HISTORY_LENGTH = 40;
var host_graphs = [
    {
        title : "CPU Monitoring information",
        monitor_resources : "cpu_usage,used_cpu,max_cpu",
        humanize_figures : false,
        history_length : HOST_HISTORY_LENGTH
    },
    {
        title: "Memory monitoring information",
        monitor_resources : "mem_usage,used_mem,max_mem",
        humanize_figures : true,
        history_length : HOST_HISTORY_LENGTH
    }
]


var hosts_tab_content =
'<form id="form_hosts" action="javascript:alert(\'js errors?!\')">\
  <div class="action_blocks">\
  </div>\
<table id="datatable_hosts" class="display">\
  <thead>\
    <tr>\
      <th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
      <th>ID</th>\
      <th>Name</th>\
      <th>Running VMs</th>\
      <th>CPU Use</th>\
      <th>Memory use</th>\
      <th>Status</th>\
    </tr>\
  </thead>\
  <tbody id="tbodyhosts">\
  </tbody>\
</table>\
</form>';

var create_host_tmpl =
'<div class="create_form"><form id="create_host_form" action="">\
  <fieldset>\
  <legend style="display:none;">Host parameters</legend>\
  <label for="name">Name: </label><input type="text" name="name" id="name" />\
  </fieldset>\
  <h3>Drivers</h3>\
  <fieldset>\
    <div class="manager clear" id="vmm_mads">\
          <label>Virtualization Manager:</label>\
          <select id="vmm_mad" name="vmm">\
                <option value="vmm_kvm">KVM</option>\
                <option value="vmm_xen">XEN</option>\
                <option value="vmm_ec2">EC2</option>\
                <option value="vmm_dummy">Dummy</option>\
          </select>\
    </div>\
    <div class="manager clear" id="im_mads">\
      <label>Information Manager:</label>\
      <select id="im_mad" name="im">\
               <option value="im_kvm">KVM</option>\
               <option value="im_xen">XEN</option>\
               <option value="im_ec2">EC2</option>\
               <option value="im_dummy">Dummy</option>\
      </select>\
    </div>\
    <div class="manager clear" id="vnm_mads">\
      <label>Virtual Network Manager:</label>\
       <select id="vnm_mad" name="vn">\
         <option value="dummy">Default (dummy)</option>\
         <option value="fw">Firewall</option>\
         <option value="802.1Q">802.1Q</option>\
         <option value="ebtables">Ebtables</option>\
         <option value="ovswitch">Open vSwitch</option>\
       </select>\
    </div>\
    <div class="manager clear" id="tm_mads">\
      <label>Transfer Manager:</label>\
       <select id="tm_mad" name="tm">\
         <option value="tm_shared">Shared</option>\
         <option value="tm_ssh">SSH</option>\
         <option value="tm_dummy">Dummy</option>\
       </select>\
    </div>\
    </fieldset>\
    <fieldset>\
    <div class="form_buttons">\
        <div><button class="button" id="create_host_submit" value="OpenNebula.Host.create">Create</button>\
        <button class="button" type="reset" value="reset">Reset</button></div>\
    </div>\
  </fieldset>\
</form></div>';

var hosts_select="";
var dataTable_hosts;
var $create_host_dialog;

//Setup actions
var host_actions = {

    "Host.create" : {
        type: "create",
        call : OpenNebula.Host.create,
        callback : addHostElement,
{'fraction_non_alphanumeric': 0.18578157519991237, 'fraction_numerical': 0.006134297294336729, 'mean_word_length': 1.8549093183239524, 'pattern_counts': {'":': 0, '<': 219, '<?xml version=': 0, '>': 219, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6636351', 'n_tokens_mistral': 2625, 'n_tokens_neox': 2548, 'n_words': 569}