1 <%doc>Copyright (C) 2009-2010 HDE, Inc.</%doc>
2 <%inherit file="../include/common.part" />
4 <script type="text/javascript">
6 function validates_network_storage(){
10 check = check_domainname(
11 $("#network_storage_host_name"),
12 CHECK_EMPTY | CHECK_VALID,
17 $("#network_storage_port_number"),
18 CHECK_VALID | CHECK_MIN | CHECK_MAX,
19 "${_('Port Number')}",
24 if ($("input:radio[name='network_storage_authentication']:checked").val() == "CHAP") {
26 $("#network_storage_user"),
27 CHECK_EMPTY | CHECK_ONLYSPACE,
28 "${_('Authentication User')}",
34 check = check_password(
35 $("#network_storage_password"),
36 $("#network_storage_password"),
37 CHECK_LENGTH | CHECK_VALID | CHECK_EMPTY,
38 "${_('Authentication Password')}",
39 CHAP_PASSWORD_MIN_LENGTH,
40 CHAP_PASSWORD_MAX_LENGTH
45 show_alert_msg("${_('Please input correct value.')}\n" + ERROR_MSG);
51 $(document).ready(function(){
53 "#add_network_storage_button",
54 "${ctx.homepath}/host/${host_id}/networkstorage",
55 "#input_network_storage :input",
56 validates_network_storage
59 $("input:radio[name='network_storage_authentication']").click(function(){
60 if($(this).val() == "None") {
61 $("#auth-section").hide();
62 } else if ($(this).val() == "CHAP") {
63 $("#auth-section").show();
69 // 自前で適当な英語と日本語を入れてあるので、修正をお願いします
70 helptip("#network_storage_type_help",
71 "${_('Device Type')}",
72 "${_(r'Type of the network storage to add. Choose \"iSCSI\" to add a new iSCSI device to the host.')}");
74 helptip("#network_storage_host_name_help",
76 "${_('Network storage target. Please input either of the host name or IP address.')}");
78 helptip("#network_storage_port_number_help",
79 "${_('Port Number')}",
80 "${_('Network storage target port number. When nothing is input, it becomes 3260 number of the iSCSI defaults.')}");
82 helptip("#network_storage_authentication_help",
83 "${_('Authentication')}",
84 "${_('iSCSI authentication type. Please do not authentication or select either of the CHAP authentication.')}");
86 helptip("#network_storage_user_help",
88 "${_('iSCSI authentication user name. Please input the alphanumeric character up to 256 characters.')}");
90 helptip("#network_storage_password_help",
92 "${_('iSCSI authentication password. Please input the alphanumeric character up to 256 characters. ')}");
94 helptip("#network_storage_auto_start_help",
96 "${_('When checked, the connection automatically at startup.')}");
101 <div id="input_network_storage">
102 <form method="post" action="" id="input_network_storage_form" name="input_network_storage_form">
103 <div class="grayout-head">
104 <span class="grayout-title">
105 <a href="#" id="server" class="path-a"><img src="${ctx.homepath}/static/images/settings-title.gif">${_('Add Network_Storage')}</a>
107 <br style="clear: both;"/>
111 hostby1networkstorage.part(一覧表示の画面)と表記を統一してください
113 <div class="grayout-contents">
114 <div class="grayout-param">${_('Device Type')}<span id="network_storage_type_help" /></div>
115 <div class="grayout-value grayout-form">
116 <select name="network_storage_type" id="network_storage_type">
117 <option id="network_storage_type_iscsi" value="iscsi">${_('iSCSI')}</option>
121 <div class="grayout-param">${_('Target host name')}<span id="network_storage_host_name_help" /></div>
122 <div class="grayout-value grayout-form">
123 <input type="text" name="network_storage_host_name" id="network_storage_host_name" value="${info['hostname'] | h}" size="40" maxlength="256" />
124 <span class="require-text">${_('Require')}</span>
127 <div class="grayout-param">${_('Port Number')}<span id="network_storage_port_number_help" /></div>
128 <div class="grayout-value grayout-form">
129 <input type="text" name="network_storage_port_number" id="network_storage_port_number" value="${info['port'] | h}" size="5" maxlength="5" />
132 <div class="grayout-param">${_('Authentication')}<span id="network_storage_authentication_help" /></div>
133 <div class="grayout-value grayout-form">
134 <input type="radio" name="network_storage_authentication" id="network_storage_auth_chap" value="CHAP" checked/>${_('CHAP')}
135 <input type="radio" name="network_storage_authentication" id="network_storage_auth_none" value="None" />${_('None')}
138 <div id="auth-section">
139 <div class="grayout-param">${_('Authentication user name')}<span id="network_storage_user_help" /></div>
140 <div class="grayout-value grayout-form">
141 <input type="text" name="network_storage_user" id="network_storage_user" value="${info['user'] | h}" size="40" maxlength="256" />
142 <span class="require-text">${_('Require')}</span>
145 <div class="grayout-param">${_('Authentication password')}<span id="network_storage_password_help" /></div>
146 <div class="grayout-value grayout-form">
147 <input type="password" name="network_storage_password" id="network_storage_password" value="" size="40" maxlength="256" />
148 <span class="require-text">${_('Require')}</span>
152 <div class="grayout-param">${_('Autostart')}<span id="network_storage_auto_start_help" /></div>
153 <div class="grayout-value grayout-form">
154 % if info['autostart'] == 1:
155 <input type="checkbox" name="network_storage_auto_start" id="network_storage_auto_start" value="auto_start" checked />${_('Enable Autostart')}
157 <input type="checkbox" name="network_storage_auto_start" id="network_storage_auto_start" value="auto_start" /> ${_('Enable Autostart')}
161 <div class="grayout-footer">
162 <a href="#" name="add_network_storage_button" id="add_network_storage_button" class="button">
163 <span class="button-left"> </span><span class="button-right">${_('Add')}</span>
165 <br style="clear: both;"/>
167 <br style="clear: both;"/>