advance.html.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <div class='panel'>
  2. <?php $ips = (array) zget($domain,'load_balancer_ips', new stdclass);?>
  3. <?php if(!empty($ips)):?>
  4. <div class='panel-heading'>
  5. <div class='panel-title'><?php echo $lang->instance->visitIP;?></span></div>
  6. </div>
  7. <div class='panel-body'>
  8. <table class='table table-form cell'>
  9. <?php foreach($ips as $key => $value):?>
  10. <tr>
  11. <th><?php echo $key;?></th>
  12. <td><?php echo $value;?></td>
  13. </tr>
  14. <?php endforeach;?>
  15. </table>
  16. </div>
  17. <?php endif;?>
  18. <div class='panel-heading'>
  19. <div class='panel-title'><?php echo $lang->instance->mem;?></span></div>
  20. </div>
  21. <div class='panel-body'>
  22. <form id='memoryForm' class='cell not-watch load-indicator'>
  23. <table class='table table-form'>
  24. <tr>
  25. <th></th>
  26. <td colspan="3">
  27. <span class='label label-info'><?php echo $lang->instance->currentMemory;?>:<?php echo helper::formatKB($currentResource->resources->memory / 1024);?></span>
  28. <span class='label label-warning'><?php $this->instance->printSuggestedMemory($instanceMetric->memory, $lang->instance->memOptions);?></span>
  29. </td>
  30. </tr>
  31. <tr>
  32. <th><?php echo $lang->instance->adjustMem;?></th>
  33. <td class='w-100px'><?php echo html::select('memory_kb', $this->instance->filterMemOptions($currentResource), '', "class='form-control'");?></td>
  34. <td></td>
  35. <td></td>
  36. </tr>
  37. <tr>
  38. <th></th>
  39. <td class='text-center'>
  40. <?php echo html::commonButton($lang->instance->saveSetting, "id='memBtn' instance-id='$instance->id'", 'btn btn-primary'); ?>
  41. </td>
  42. <td></td>
  43. <td></td>
  44. </tr>
  45. </table>
  46. </form>
  47. </div>
  48. <?php if(isset($cloudApp->features->ldap)):?>
  49. <div class='panel-heading'>
  50. <div class='panel-title'><?php echo $lang->system->ldapManagement;?></span></div>
  51. </div>
  52. <div class='panel-body'>
  53. <form id='LDAPForm' class='cell not-watch load-indicator'>
  54. <table class='table table-form'>
  55. <tr>
  56. <?php $LDAPInstalled = $this->system->hasSystemLDAP();?>
  57. <?php $enableLDAP = $instance->ldapSnippetName ? 'true' : '' ;?>
  58. <td class='w-120px'><?php echo html::checkbox('enableLDAP', array('true' => $lang->instance->enableLDAP), $enableLDAP, ($LDAPInstalled ? '' : 'disabled'));?></td>
  59. <td colspan='2'>
  60. <?php if(!$LDAPInstalled):?>
  61. <?php echo $lang->instance->systemLDAPInactive;?>
  62. <?php echo html::a(helper::createLink('system', 'installLDAP'), $lang->instance->toSystemLDAP, '', "class='btn btn-default'");?>
  63. <?php endif?>
  64. </td>
  65. <td></td>
  66. </tr>
  67. <tr>
  68. <th></th>
  69. <td class='w-100px text-center'>
  70. <?php echo html::commonButton($lang->instance->saveSetting, "id='ldapBtn' instance-id='$instance->id'" . ($LDAPInstalled ? '' : 'disabled'), 'btn btn-primary');?>
  71. </td>
  72. <td></td>
  73. <td></td>
  74. </tr>
  75. </table>
  76. </form>
  77. </div>
  78. <?php endif;?>
  79. <?php if(isset($cloudApp->features->mail)):?>
  80. <div class='panel-heading'>
  81. <div class='panel-title'><?php echo $lang->system->SMTP->common;?></span></div>
  82. </div>
  83. <div class='panel-body'>
  84. <form id='SMTPForm' class='cell not-watch load-indicator'>
  85. <table class='table table-form'>
  86. <tr>
  87. <?php $SMTPInstalled = $this->system->isSMTPEnabled();?>
  88. <?php $enableSMTP = $instance->smtpSnippetName ? 'true' : '' ;?>
  89. <td class='w-120px'><?php echo html::checkbox('enableSMTP', array('true' => $lang->instance->enableSMTP), $enableSMTP, ($SMTPInstalled ? '' : 'disabled'));?></td>
  90. <td colspan='2'>
  91. <?php if(!$SMTPInstalled):?>
  92. <?php echo $lang->instance->systemSMTPInactive;?>
  93. <?php echo html::a(helper::createLink('system', 'installSMTP'), $lang->instance->toSystemSMTP, '', "class='btn btn-default'");?>
  94. <?php endif?>
  95. </td>
  96. <td></td>
  97. </tr>
  98. <tr>
  99. <th></th>
  100. <td class='w-100px text-center'>
  101. <?php echo html::commonButton($lang->instance->saveSetting, "id='smtpBtn' instance-id='$instance->id'" . ($SMTPInstalled ? '' : 'disabled'), 'btn btn-primary');?>
  102. </td>
  103. <td></td>
  104. <td></td>
  105. </tr>
  106. </table>
  107. </form>
  108. </div>
  109. <?php endif;?>
  110. <?php if(!empty($currentResource->scalable) && $config->edition == 'biz'):?>
  111. <div class='panel-heading'>
  112. <div class='panel-title'><?php echo $lang->instance->scalable;?></span></div>
  113. </div>
  114. <div class='panel-body'>
  115. <form id='replicasForm' class='cell not-watch load-indicator'>
  116. <table class='table table-form'>
  117. <tr>
  118. <th><?php echo $lang->instance->componentFields['replicas'];?></th>
  119. <td class='w-80px center'>
  120. <span id="replicas-text"><?php echo $currentResource->replicas;?></span>
  121. <?php echo html::select('scalable', array(1=>1, 2=>2, 3=>3, 4=>4), intval($currentResource->replicas) ? : 1, " id='replicas-input' max='4' min='1' class='form-control scalable-input hide'");?>
  122. </td>
  123. <td>
  124. <?php echo html::commonButton($lang->instance->change, 'id="replicas-edit"', 'btn btn-primary ' . (in_array($instance->status, array('uninstalling', 'destroying', 'destroyed', 'unknown', 'abnormal')) ? 'disabled' : ''));?>
  125. <?php echo html::commonButton($lang->instance->saveSetting, "id='replicas-save' instance-id='$instance->id'", 'btn btn-primary hide');?>
  126. </td>
  127. <td></td>
  128. </tr>
  129. </table>
  130. </form>
  131. </div>
  132. <?php endif;?>
  133. <?php if(count($customItems)):?>
  134. <div class='panel-heading'>
  135. <div class='panel-title'><?php echo $lang->instance->customSetting;?></span></div>
  136. </div>
  137. <div class='panel-body'>
  138. <form id='customForm' class='cell not-watch load-indicator'>
  139. <table class='table table-form'>
  140. <?php foreach($customItems as $item):?>
  141. <tr>
  142. <th><?php echo $item->label;?></th>
  143. <td>
  144. <?php echo html::input($item->name, $item->default, "class='form-control' placeholder='{$item->label}'");?>
  145. </td>
  146. <td></td>
  147. <td></td>
  148. </tr>
  149. <?php endforeach;?>
  150. <tr>
  151. <th></th>
  152. <td class='text-center'>
  153. <?php echo html::commonButton($lang->instance->saveSetting, "id='customBtn' instance-id='$instance->id'", 'btn btn-primary'); ?>
  154. </td>
  155. <td></td>
  156. <td></td>
  157. </tr>
  158. </table>
  159. </form>
  160. </div>
  161. <?php endif;?>
  162. <?php if(!empty($dbList)):?>
  163. <hr/>
  164. <div class='panel-heading'>
  165. <div class='panel-title'><?php echo $lang->instance->dbList;?></div>
  166. </div>
  167. <div class='panel-body'>
  168. <table class='table table-bordered text-center'>
  169. <thead>
  170. <tr>
  171. <th><?php echo $lang->instance->dbName;?></th>
  172. <th><?php echo $lang->instance->dbType;?></th>
  173. <th><?php echo $lang->instance->dbStatus;?></th>
  174. <th><?php echo $lang->instance->action;?></th>
  175. </tr>
  176. </thead>
  177. <tbody>
  178. <?php foreach($dbList as $db):?>
  179. <tr>
  180. <td><?php echo $db->db_name;?></td>
  181. <td><?php echo $db->db_type;?></td>
  182. <td><?php echo $db->ready ? $lang->instance->dbReady : $lang->instance->dbWaiting;?></td>
  183. <td><?php $this->instance->printDBAction($db, $instance);?></td>
  184. <tr>
  185. <?php endforeach;?>
  186. <tbody>
  187. </table>
  188. </div>
  189. <?php endif;?>
  190. </div>