1 <%doc>Copyright (C) 2010 HDE, Inc.</%doc>
2 <%inherit file="../include/common.part" />
4 <script type="text/javascript">
6 function validates_bonding(){
10 if ($("#bonding_target_dev_list input:checkbox:checked").length < 2){
12 // bonding対象のデバイス数が足りません
13 ERROR_MSG += "${_('hoge')}";
18 if ($("#bonding_target_dev_list input:radio:enabled:checked").length != 1){
21 ERROR_MSG += "${_('hoge')}";
27 show_alert_msg("${_('Please input correct value.')}" + "\n" + ERROR_MSG);
32 $(document).ready(function(){
33 %if "XEN" in hypervisors:
35 $("#input_bonding_setting :input").attr("disabled", "disabled");
36 $(".grayout-footer span.button-right").html("${_('Close')}");
37 $(".grayout-footer a").attr("id", "grayout_close_button");
38 $("#grayout_close_button span").removeClass("onclick");
39 grayout_submit_effect("#grayout_close_button");
40 $("#grayout_close_button").one("click", function(){
41 $('#dialog_screen').dialog('close');
45 // ハイパーバイザ「XEN」上でのbonding作成には対応していません。
46 show_alert_msg("${_('Hypervisor \'XEN\' on the bonding does not support creation.')}", "ERROR");
50 "#add_bonding_setting_button",
51 "${ctx.homepath}/host/${host_id}/networksettings.part",
52 "#input_bonding_setting :input",
57 // 設定を行うと、同時にネットワークの再起動を行います。
58 show_alert_msg("${_('When set, do a reboot of the network simultaneously')}", "CAUTION");
62 $("tr[id^='bonding_target_dev_']").each(function(){
63 var id = $(this).attr("id");
64 if ($("#" + id + " td").children().is(".already_bonding")){
65 $(this).css("color", "#DDDDDD");
66 $(this).find("input").attr("disabled","disabled");
70 $("input[id^='bonding_target_dev_select_']").click(function(){
71 var radio_obj = $(this).parent().parent().find(":radio");
72 if ($(this).is(":checked")){
73 radio_obj.removeAttr("disabled");
74 if ($("#bonding_target_dev_list input:checkbox:checked").length == 1){
75 radio_obj.attr("checked","checked");
78 radio_obj.attr("disabled", "disabled");
79 if ($("#bonding_target_dev_list input:radio:enabled:checked").length == 0){
80 $("#bonding_target_dev_list input:checkbox:checked:first").parent().parent().find(":radio").attr("checked","checked");
86 // bonding作成時の名前です。自動で連番が振られるため、変更することは出来ません。
87 helptip("#bonding_name_help",
88 "${_('Bonding Name')}",
92 // bondingするデバイスを選択してください。
93 // IPアドレスなどは、プライマリで選択したデバイスの情報を引き継ぎます。
94 helptip("#bonding_target_device_help",
95 "${_('Bonding Target Device')}",
101 // http://kaede.blog.abk.nu/rh-bonding
102 // http://www.jp.redhat.com/magazine/jp/200904/rhel.html
103 // http://d.hatena.ne.jp/sen-u/20061002/p1
104 // http://blog.dc-d.jp/?p=290
105 helptip("#bonding_mode_help",
106 "${_('Bonding Mode')}",
112 <div id="input_bonding_setting">
113 <div class="caution-alt"></div>
114 <form method="post" action="" id="input_bonding_setting_form" name="input_bonding_setting_form">
115 <div class="grayout-head">
116 <span class="grayout-title">
117 <img src="${ctx.homepath}/static/images/settings-title.gif">${_('Add Bonding')}
119 <br style="clear: both;"/>
121 <div class="grayout-contents">
122 <div class="grayout-param">${_('Create Bonding Name')}<span id="bonding_name_help" /></div>
123 <div class="grayout-value grayout-form">
124 ${create_bond_name | h}
126 <div class="grayout-param">${_('Bonding Target Device')}<span id="bonding_target_device_help" /></div>
127 <div class="grayout-value grayout-form">
128 <table id="bonding_target_dev_list">
131 <th width="50px"></th>
132 <th width="50px">${_('Name')}</th>
136 bonding対象のデバイスのチェックボックスの名前
139 <th width="50px">${_('Select')}</th>
140 <th width="50px">${_('Primary')}</th>
144 % for key in sorted(bond_target_dev.keys()):
145 <tr id="bonding_target_dev_${key}">
147 % if 'bond' in bond_target_dev[key]:
148 <span class="already_bonding">${bond_target_dev[key]["bond"] | h}</span>
153 <input type="checkbox" id="bonding_target_dev_select_${key}" name="bonding_target_dev_select_${key}" value="true" />
156 <input type="radio" name="bonding_target_dev_primary" value="${key}" disabled/>
164 <div class="grayout-param">${_('Bonding Mode')}<span id="bonding_mode_help" /></div>
165 <div class="grayout-value grayout-form">
166 <select id="bonding_mode" name="bonding_mode">
171 http://www.jp.redhat.com/magazine/jp/200904/rhel.html
173 <option value="0">0: ${_('balance-rr') | h}</option>
174 <option value="1" selected>1: ${_('active-backup') | h}</option>
175 <option value="2">2: ${_('balance-xor') | h}</option>
176 <option value="3">3: ${_('broadcast') | h}</option>
177 <option value="4">4: ${_('802.3ad') | h}</option>
178 <option value="5">5: ${_('balance-tlb') | h}</option>
179 <option value="6">6: ${_('balance-alb') | h}</option>
183 <div class="grayout-footer">
184 <a href="#" name="add_bonding_setting_button" id="add_bonding_setting_button" class="button">
185 <span class="button-left"> </span><span class="button-right">${_('Add')}</span>
187 <br style="clear: both;"/>
189 <br style="clear: both;"/>