<?php
/**
 * The view view file of vm module of ZenTaoPMS.
 *
 * @copyright   Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      xiawenlong <xiawenlong@cnezsoft.com>
 * @package     host
 * @version     $Id$
 * @link        http://www.zentao.net
 */
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('confirmDelete', $lang->vm->confirmDelete)?>
<?php js::set('confirmBoot', $lang->vm->confirmBoot)?>
<?php js::set('confirmReboot', $lang->vm->confirmReboot)?>
<?php js::set('confirmShutdown', $lang->vm->confirmShutdown)?>
<?php js::set('actionSuccess', $lang->vm->actionSuccess)?>
<div id='mainContent' class='main-content'>
  <div class='main-header'>
    <h2><?php echo $lang->vm->view;?></h2>
  </div>
  <div class='main'>
    <div class='detail'>
      <table class='table table-striped'>
        <tr>
          <th class='thWidth'><?php echo $lang->vm->name;?></th>
          <td><?php echo $vm->name;?></td>
          <th></th><td></td>
        </tr>
        <tr>
          <th><?php echo $lang->vm->osType;?></th>
          <td><?php echo $vm->osType;?></td>
          <th><?php echo $lang->vm->osCategory;?></th>
          <td><?php echo $vm->osCategory;?></td>
        </tr>
        <tr>
          <th><?php echo $lang->vm->osArch;?></th>
          <td><?php echo $vm->osArch;?></td>
          <th><?php echo $lang->vm->osLang;?></th>
          <td><?php echo $vm->osLang;?></td>
        </tr>
        <tr>
          <th><?php echo $lang->vm->ip;?></th>
          <td><?php echo $vm->ip;?></td>
          <th><?php echo $lang->vm->macAddress;?></th>
          <td><?php echo $vm->macAddress;?></td>
        </tr>
        <tr>
          <th><?php echo $lang->vm->vnc;?></th>
          <td><?php echo $vm->vnc;?></td>
          <th><?php echo $lang->vm->status;?></th>
          <td><?php echo zget($lang->vm->statusList, $vm->status);?></td>
        </tr>
        <tr>
          <th><?php echo $lang->vm->createdDate;?></th>
          <td><?php echo $vm->createdDate;?></td>
          <th><?php echo $lang->vm->destroyAt;?></th>
          <td><?php echo $vm->destroyAt;?></td>
        </tr>
      </table>
    </div>
    <?php include '../../common/view/action.html.php'?>
  </div>
  <div id='mainActions' class='main-actions'>
    <nav class='container'></nav>
    <div class='btn-toolbar'>
      <?php
      /* if(common::hasPriv('vm', 'boot'))
      {
          $url = $this->createLink('vm', 'handleVM', "vmID=$vm->id&type=boot");
          echo html::a("javascript:ajaxAction(\"$url\", \"mainContent\", confirmBoot)", '<i class="icon-play"></i> ' . $lang->vm->boot , '', "class='btn' title='{$lang->vm->boot}'");

      } */
      if(common::hasPriv('vm', 'reboot') && empty($vm->destroyAt))
      {
          $url = $this->createLink('vm', 'handleVM', "vmID=$vm->id&type=reboot");
          echo html::a("javascript:ajaxAction(\"$url\", \"mainContent\", confirmReboot)", '<i class="icon-refresh"></i> ' . $lang->vm->reboot, '', "class='btn' title='{$lang->vm->reboot}'");

      }
      /* if(common::hasPriv('vm', 'shutdown'))
      {
          $url = $this->createLink('vm', 'handleVM', "vmID=$vm->id&type=shutdown");
          echo html::a("javascript:ajaxAction(\"$url\", \"mainContent\", confirmShutdown)", '<i class="icon-off"></i> ' . $lang->vm->shutdown, '', "class='btn' title='{$lang->vm->shutdown}'");

      } */
      if(common::hasPriv('vm', 'delete') && empty($vm->destroyAt))
      {
          $deleteURL = $this->createLink('vm', 'destroy', "vmID=$vm->id");
          echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"mainContent\", confirmDelete)", '<i class="icon-trash"></i> '. $lang->vm->destroy, '', "class='btn' title='{$lang->vm->destroy}'");
      }
      if(!isonlybody()) common::printLink('vm', 'browse', "", "<i class='icon-goback icon-back'></i> " . $lang->goback, '', "class='btn'");
      ?>
    </div>
  </div>
</div>
<?php include '../../common/view/footer.html.php';?>
