PageRenderTime 43ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/scalr-2/tags/scalr-2.0.0/app/templates/en_US/dns_zone_add.tpl

http://scalr.googlecode.com/
Smarty Template | 267 lines | 249 code | 18 blank | 0 comment | 75 complexity | 86f032b0fc33e821ba3c1b4b13fe3028 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, GPL-3.0
  1. {include file="inc/header.tpl"}
  2. <script language="javascript" type="text/javascript">
  3. {literal}
  4. function CheckPrAdd(tp, id, val)
  5. {
  6. Ext.get(tp+"_"+id+"_weight").dom.style.display = 'none';
  7. Ext.get(tp+"_"+id+"_port").dom.style.display = 'none';
  8. if (val == 'MX')
  9. {
  10. Ext.get(tp+"_"+id).dom.style.display = '';
  11. Ext.get(tp+"_"+id).dom.value = '10';
  12. }
  13. else if (val == 'SRV')
  14. {
  15. Ext.get(tp+"_"+id).dom.style.display = '';
  16. Ext.get(tp+"_"+id+"_weight").dom.style.display = '';
  17. Ext.get(tp+"_"+id+"_port").dom.style.display = '';
  18. }
  19. else if (val == 'TXT')
  20. {
  21. Ext.get(tp+"_"+id).dom.style.display = 'none';
  22. Ext.get(tp+"_"+id).dom.value = '';
  23. }
  24. else
  25. {
  26. Ext.get(tp+"_"+id).dom.style.display = 'none';
  27. Ext.get(tp+"_"+id).dom.value = '';
  28. }
  29. }
  30. Ext.onReady(function ()
  31. {
  32. if (Ext.get('farm_target_combo'))
  33. {
  34. var farmsStore = new Ext.data.Store(
  35. {
  36. url: "/server/ajax-ui-server.php",
  37. baseParams: {action: "LoadFarms"},
  38. reader: new Ext.ux.scalr.JsonReader(
  39. {
  40. root: 'data', // from php file: array("data" => $result);
  41. id: 'id',
  42. fields:['id','name']
  43. })
  44. });
  45. var roleStore = new Ext.data.Store(
  46. {
  47. url: "/server/ajax-ui-server.php",
  48. baseParams: {action: "LoadFarmRoles"},
  49. reader: new Ext.ux.scalr.JsonReader(
  50. {
  51. root: 'data', // from php file: array("data" => $result);
  52. id: 'id',
  53. fields:['id','name']
  54. })
  55. });
  56. farmsCombo = new Ext.form.ComboBox(
  57. {
  58. renderTo: 'farm_target_combo',
  59. allowBlank: true,
  60. width: 150,
  61. hiddenName: 'farmid',
  62. store: farmsStore,
  63. displayField: 'name',
  64. valueField: 'id',
  65. typeAhead: true,
  66. mode: 'local',
  67. triggerAction: 'all',
  68. emptyText: '',
  69. selectOnFocus: true,
  70. listeners:{
  71. select: function(combo, record, index)
  72. {
  73. // reset selected text in roleCombo
  74. if(roleCombo)
  75. roleCombo.clearValue();
  76. // load farm roles of selected farm by farmId ( from farmsStore comboBox)
  77. roleStore.baseParams.farmId = record.data.id;
  78. roleStore.load();
  79. Ext.get('farmid').dom.value = record.data.id;
  80. }
  81. }
  82. });
  83. roleCombo = new Ext.form.ComboBox(
  84. {
  85. renderTo: 'role_target_combo',
  86. allowBlank: true,
  87. width: 150,
  88. hiddenName: 'farm_roleid',
  89. valueField: 'id',
  90. store: roleStore,
  91. displayField: 'name',
  92. typeAhead: true,
  93. farmsCombo: farmsCombo,
  94. triggerAction: 'all',
  95. emptyText: '',
  96. selectOnFocus: true,
  97. listeners:{
  98. select:function(combo, record, index){
  99. Ext.get('farm_roleid').dom.value = record.data.id;
  100. }
  101. }
  102. });
  103. farmsStore.load();
  104. }
  105. });
  106. {/literal}
  107. </script>
  108. <script type="text/javascript" src="js/class.NewPopup.js"></script>
  109. <link href="css/popup.css" rel="stylesheet" type="text/css" />
  110. {if (!$step || $step == 1) && !$edit}
  111. {include file="inc/table_header.tpl" nofilter=1}
  112. {include file="inc/intable_header.tpl" header="DNS zone information" color="Gray"}
  113. <tr>
  114. <td colspan="2" style="padding:5px;"><input style="vertical-align:middle;" type="radio" name="dns_domain_type" value="scalr" /> {t}Use domain automatically generated and provided by Scalr{/t}</td>
  115. </tr>
  116. <tr>
  117. <td style="padding:5px;"><input style="vertical-align:middle;" checked="checked" type="radio" name="dns_domain_type" value="own" /> {t}Use own domain name{/t}:</td>
  118. <td style="padding:5px;"><input type="text" class="text" name="domainname" style="width:310px;" /></td>
  119. </tr>
  120. <tr valign="top">
  121. <td style="padding:5px;">{t}Farm:{/t}</td>
  122. <td style="padding:5px;padding-left:10px;">
  123. <div id="farm_target_combo" style="float:left;margin-right:10px;"></div>
  124. <div style="padding-top:3px;font-style:italic;">Each server in this farm will add int-rolename ext-rolename records. Leave blank if you don't need such records.</div>
  125. </td>
  126. </tr>
  127. <tr valign="top">
  128. <td style="padding:5px;">{t}Role:{/t}</td>
  129. <td style="padding:5px;padding-left:10px;">
  130. <div id="role_target_combo" style="float:left;margin-right:10px;"></div>
  131. <div style="padding-top:3px;font-style:italic;">Servers of this role will create root records. Leave blank to add root records manually.</div>
  132. </td>
  133. </tr>
  134. {include file="inc/intable_footer.tpl" color="Gray"}
  135. {assign var=button2_name value="Next"}
  136. {elseif $step == 2 || $edit }
  137. {include file="inc/table_header.tpl" nofilter=1}
  138. {include file="inc/intable_header.tpl" header="Application information" color="Gray"}
  139. <tr>
  140. <td style="padding:5px;">Domain name:</td>
  141. <td style="padding:5px;">{$domainname}</td>
  142. </tr>
  143. <tr>
  144. <td style="padding:5px;">SOA retry:</td>
  145. <td style="padding:5px;">
  146. <select name="zone[soa_retry]">
  147. <option {if $zone.soa_retry == 1800}selected{/if} value="1800">30 minutes</option>
  148. <option {if $zone.soa_retry == 3600}selected{/if} value="3600">1 hour</option>
  149. <option {if $zone.soa_retry == 7200 || !$zone.soa_retry}selected{/if} value="7200">2 hours</option>
  150. <option {if $zone.soa_retry == 14400}selected{/if} value="14400">4 hours</option>
  151. <option {if $zone.soa_retry == 28800}selected{/if} value="28800">8 hours</option>
  152. <option {if $zone.soa_retry == 86400}selected{/if} value="86400">1 day</option>
  153. </select>
  154. </td>
  155. </tr>
  156. <tr>
  157. <td style="padding:5px;">SOA refresh:</td>
  158. <td style="padding:5px;">
  159. <select name="zone[soa_refresh]">
  160. <option {if $zone.soa_refresh == 3600}selected{/if} value="3600">1 hour</option>
  161. <option {if $zone.soa_refresh == 7200}selected{/if} value="7200">2 hours</option>
  162. <option {if $zone.soa_refresh == 14400 || !$zone.soa_refresh}selected{/if} value="14400">4 hours</option>
  163. <option {if $zone.soa_refresh == 28800}selected{/if} value="28800">8 hours</option>
  164. <option {if $zone.soa_refresh == 86400}selected{/if} value="86400">1 day</option>
  165. </select>
  166. </td>
  167. </tr>
  168. <tr>
  169. <td style="padding:5px;">SOA expire:</td>
  170. <td style="padding:5px;">
  171. <select name="zone[soa_expire]">
  172. <option {if $zone.soa_expire == 86400}selected{/if} value="86400">1 day</option>
  173. <option {if $zone.soa_expire == 259200}selected{/if} value="259200">3 days</option>
  174. <option {if $zone.soa_expire == 432000}selected{/if} value="432000">5 days</option>
  175. <option {if $zone.soa_expire == 604800}selected{/if} value="604800">1 week</option>
  176. <option {if $zone.soa_expire == 3024000 || $zone.soa_expire == 3600000}selected{/if} value="3024000">5 weeks</option>
  177. <option {if $zone.soa_expire == 6048000}selected{/if} value="6048000">10 weeks</option>
  178. </select>
  179. </td>
  180. </tr>
  181. {include file="inc/intable_footer.tpl" color="Gray"}
  182. <table cellpadding="0" cellspacing="0" width="100%">
  183. <tr>
  184. <td width="20%" class="th" style="padding-left:26px;">{t}Domain{/t}</td>
  185. <td width="6%" class="th" style="padding-left:16px;">{t}TTL{/t}</td>
  186. <td width="6%" nowrap="nowrap" class="th">{t}Record Type{/t}</td>
  187. <td class="th" colspan="3" style="padding-left:16px;">{t}Record value{/t}<td>
  188. </tr>
  189. </table>
  190. {include file="inc/intable_header.tpl" header="DNS records" color="Gray"}
  191. {section name=id loop=$zone.records}
  192. <tr>
  193. <td width="20%"><input {if $zone.records[id].issystem == 1 && $zone.allow_manage_system_records == 0}disabled{/if} type="text" class="text" name="records[{$smarty.section.id.iteration}][name]" size=30 value="{$zone.records[id].name}"></td>
  194. <td width="6%"><input {if $zone.records[id].issystem == 1 && $zone.allow_manage_system_records == 0}disabled{/if} type="text" class="text" name="records[{$smarty.section.id.iteration}][ttl]" size=6 value="{$zone.records[id].ttl}"></td>
  195. <td width="6%"><select {if $zone.records[id].issystem == 1 && $zone.allow_manage_system_records == 0}disabled{/if} class="text" name="records[{$smarty.section.id.iteration}][type]" onchange="CheckPrAdd('ed', '{$smarty.section.id.iteration}', this.value)">
  196. <option {if $zone.records[id].type == "A"}selected{/if} value="A">A</option>
  197. <option {if $zone.records[id].type == "CNAME"}selected{/if} value="CNAME">CNAME</option>
  198. <option {if $zone.records[id].type == "MX"}selected{/if} value="MX">MX</option>
  199. <option {if $zone.records[id].type == "NS"}selected{/if} value="NS">NS</option>
  200. <option {if $zone.records[id].type == "TXT"}selected{/if} value="TXT">TXT</option>
  201. <option {if $zone.records[id].type == "SRV"}selected{/if} value="SRV">SRV</option>
  202. </select>
  203. </td>
  204. <td colspan="2">
  205. <input {if $zone.records[id].issystem == 1 && $zone.allow_manage_system_records == 0}disabled{/if} onclick="{literal}if (this.value == 'priority') { this.value=''; } {/literal}" id="ed_{$smarty.section.id.iteration}" size="5" style="display:{if $zone.records[id].type != "MX" && $zone.records[id].type != "SRV"}none{/if};" type="text" class="text" name="records[{$smarty.section.id.iteration}][priority]" value="{$zone.records[id].priority}" size=30>
  206. <input {if $zone.records[id].issystem == 1 && $zone.allow_manage_system_records == 0}disabled{/if} onclick="{literal}if (this.value == 'weight') { this.value=''; } {/literal}" id="ed_{$smarty.section.id.iteration}_weight" size="5" style="display:{if $zone.records[id].type != "SRV"}none{/if};" type="text" class="text" name="records[{$smarty.section.id.iteration}][weight]" value="{$zone.records[id].weight}" size=30>
  207. <input {if $zone.records[id].issystem == 1 && $zone.allow_manage_system_records == 0}disabled{/if} onclick="{literal}if (this.value == 'port') { this.value=''; } {/literal}" id="ed_{$smarty.section.id.iteration}_port" size="5" style="display:{if $zone.records[id].type != "SRV"}none{/if};" type="text" class="text" name="records[{$smarty.section.id.iteration}][port]" value="{$zone.records[id].port}" size=30>
  208. <input {if $zone.records[id].issystem == 1 && $zone.allow_manage_system_records == 0}disabled{/if} class="text" type=text id="zone[records][{$smarty.section.id.iteration}][rvalue]" name="records[{$smarty.section.id.iteration}][value]" size=60 value="{$zone.records[id].value}">
  209. </td>
  210. </tr>
  211. {sectionelse}
  212. <tr>
  213. <td colspan="20" align="center">No DNS records defined</td>
  214. </tr>
  215. {/section}
  216. {include file="inc/intable_footer.tpl" color="Gray"}
  217. {include file="inc/intable_header.tpl" header="Add New DNS Records" color="Gray"}
  218. {section name=new_records start=1 loop=6 step=1}
  219. {assign var=new_record_id value=$smarty.section.new_records.index}
  220. <tr>
  221. <td width="20%"><input type="text" class="text" name="records[n{$new_record_id}][name]" size=30></td>
  222. <td width="6%"><input type="text" class="text" name="records[n{$new_record_id}][ttl]" size=6 value="14400"></td>
  223. <td width="6%"><select class="text" name="records[n{$new_record_id}][type]" onchange="CheckPrAdd('ad', '{$new_record_id}', this.value)">
  224. <option selected value="A">A</option>
  225. <option value="CNAME">CNAME</option>
  226. <option value="MX">MX</option>
  227. <option value="TXT">TXT</option>
  228. <option value="NS">NS</option>
  229. <option value="SRV">SRV</option>
  230. </select>
  231. </td>
  232. <td width="75%">
  233. <input onclick="{literal}if (this.value == 'priority') { this.value=''; } {/literal}" id="ad_{$new_record_id}" size="5" style="display:none;" type="text" class="text" name="records[n{$new_record_id}][priority]" value="priority" size=30>
  234. <input onclick="{literal}if (this.value == 'weight') { this.value=''; } {/literal}" id="ad_{$new_record_id}_weight" size="5" style="display:none;" type="text" class="text" name="records[n{$new_record_id}][weight]" value="weight" size=30>
  235. <input onclick="{literal}if (this.value == 'port') { this.value=''; } {/literal}" id="ad_{$new_record_id}_port" size="5" style="display:none;" type="text" class="text" name="records[n{$new_record_id}][port]" value="port" size=30>
  236. <input type="text" class="text" id="records[{$new_record_id}][rvalue]" name="records[n{$new_record_id}][value]" size=60 />
  237. </td>
  238. </tr>
  239. {/section}
  240. {include file="inc/intable_footer.tpl" color="Gray"}
  241. <input type="hidden" name="step" value="2" />
  242. {if !$edit}
  243. {assign var=button2_name value="Create DNS zone"}
  244. {else}
  245. {assign var=button2_name value="Save"}
  246. {/if}
  247. {/if}
  248. {include file="inc/table_footer.tpl" button2=1}
  249. {include file="inc/footer.tpl"}