
<!-- Copyright 2014 Intel Corporation, All Rights Reserved.

 Licensed under the Apache License, Version 2.0 (the"License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied. See the License for the
 specific language governing permissions and limitations
 under the License.
 --> 

{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Add Cache Tier" %}{% endblock %}

{% block page_header %}
  {% include "horizon/common/_page_header.html" with title=_("Add Cache Tier") %}
  <link href="{{ STATIC_URL }}dashboard/css/poolmgmt.css" rel="stylesheet">

{% endblock page_header %}

{% block main %}
    {% csrf_token %}
    <div id="divPoolForm" >
	    <div class="left">
	    <form>
		    <fieldset>
		    	<div class="control-group form-field clearfix required">
	                <label>{% trans "Cache Tier Pool" %}:</label>
	                <span class="help-block"></span>
	                <div class="input">
	                  	<select id="selCacheTierPool" class="form-control" >
	                  		{%for pool in pool_list%}
	                  			<option value="{{pool.0}}">{{pool.1}}</option>
	                  		{%endfor%}
	                  	</select>
	                </div>
            	</div>
            	<div class="control-group form-field clearfix required">
	                <label>{% trans "Storage Tier Pool" %}:</label>
	                <span class="help-block"></span>
	                <div class="input">
	                  	<select id="selStorageTierPool" class="form-control" >
	                  		{%for pool in pool_list%}
	                  			<option value="{{pool.0}}">{{pool.1}}</option>
	                  		{%endfor%}
	                  	</select>
	                </div>
            	</div>
            	<div class="control-group form-field clearfix required">
	                <label>{% trans "Cache Mode" %}:</label>
	                <span class="help-block"></span>
	                <div class="input">
	                  	<select id="selCacheMode" class="form-control" >
	                  		{%for cache_mode in cache_mode_list%}
	                  			<option value="{{cache_mode.0}}">{{cache_mode.1}}</option>
	                  		{%endfor%}
	                  	</select>
	                </div>
            	</div>
            	<div class="control-group form-field">
	                <label>{% trans "FORCE NONEMPTY" %}:</label>
	                <input id="chkForceNonempty" type="checkbox" />
            	</div>

                <div class="control-group form-field">
	                <label>{% trans "Advanced Settings" %}:</label>
	                <input id="chkAdvancedSettings" type="checkbox" onchange="SwithAdvancedSettings(this.checked)" />
            	</div>

            	<div id="divAdvancedSettings" style="display:none">
            		<div class="control-group form-field clearfix required">
		                <label>{% trans "Hit Set Type" %}:</label>
		                <span class="help-block"></span>
		                <div class="input">
		                  	<select id="selHitSetType" class="form-control" >
		                  		{%for hit_set_type in hit_set_type_list%}
		                  			<option value="{{hit_set_type.0}}" >{{hit_set_type.1}}</option>
		                  		{%endfor%}
		                  	</select>
		                </div>
            		</div>

            		<div class="control-group form-field clearfix required">
		                <label>{% trans "Hit Set Count" %}:</label>
		                <span class="help-block"></span>
		                <div class="input">
		                  	<input id="txtHitSetCount" maxlength="255"  type="text" class="form-control" value="{{settings.ct_hit_set_count}}" >
		                </div>
		            </div>

		            <div class="control-group form-field clearfix required">
		                <label>{% trans "Hit Set Period(s)" %}:</label>
		                <span class="help-block"></span>
		                <div class="input">
		                  	<input id="txtHitSetPeriod" maxlength="255"  type="text" class="form-control" value="{{settings.ct_hit_set_period_s}}">
		                </div>
		            </div>


		            <div class="control-group form-field clearfix required">
		                <label>{% trans "Target Maximum Memory(MB)" %}:</label>
		                <span class="help-block"></span>
		                <div class="input">
		                  	<input id="txtTargetMaximumMemory" maxlength="255"  type="text" class="form-control"  value="{{settings.ct_target_max_mem_mb}}">
		                </div>
		            </div>



		            <div class="control-group form-field clearfix required">
		                <label>{% trans "Target Dirty Ratio" %}:</label>
		                <span class="help-block"></span>
		                <div class="input">
		                  	<input id="txtTargetDirtyRatio" maxlength="255"  type="text" class="form-control" value="{{settings.ct_target_dirty_ratio}}">
		                </div>
		            </div>



		            <div class="control-group form-field clearfix required">
		                <label>{% trans "Target Full Ratio" %}:</label>
		                <span class="help-block"></span>
		                <div class="input">
		                  	<input id="txtTargetFullRatio" maxlength="255"  type="text" class="form-control" value="{{settings.ct_target_full_ratio}}">
		                </div>
		            </div>


		            <div class="control-group form-field clearfix required">
		                <label>{% trans "Target Maximum Objects" %}:</label>
		                <span class="help-block"></span>
		                <div class="input">
		                  	<input id="txtTargetMaximumObjects" maxlength="255"  type="text" class="form-control" value="{{settings.ct_target_max_objects}}">
		                </div>
		            </div>


		            <div class="control-group form-field clearfix required">
		                <label>{% trans "Target Minimum Flush Age(m)" %}:</label>
		                <span class="help-block"></span>
		                <div class="input">
		                  	<input id="txtTargetMinimumFlushAge" maxlength="255"  type="text" class="form-control" value="{{settings.ct_target_min_flush_age_m}}">
		                </div>
		            </div>

		             <div class="control-group form-field clearfix required">
		                <label>{% trans "Target Minimum Evict Age(m)" %}:</label>
		                <span class="help-block"></span>
		                <div class="input">
		                  	<input id="txtTargetMinimumEvictAge" maxlength="255"  type="text" class="form-control" value="{{settings.ct_target_min_evict_age_m}}">
		                </div>
		            </div>

            	</div>
		    </fieldset>
			</div>
			<div class="right">
			    <h3>{% trans "Description" %}:</h3>
			    <p>{% trans "From here you can create cache tiers" %}</p>
			</div>
		</form>
		 <div id="divFormOptions" class="vsm-options-bar">
	    	<button id="btnAddCacheTier" class="btn btn-primary">{% trans "Submit" %}</button>
	    	<a id="btnCancel" class="btn btn-default" href="/dashboard/vsm/poolsmanagement/">{% trans "Cancel" %}</a>
	    </div>
	</div>
{% endblock %}


{% block js %}
    {{ block.super }}
    <script src='{{ STATIC_URL }}dashboard/js/vsm.spin.js' type='text/javascript' charset='utf-8'></script>
    <script src="{{ STATIC_URL }}dashboard/js/addcachetier.js"></script> 
{% endblock %}

