<h3>Pool {{operation}}</h3>
<br />
<form name="form" novalidate class="form-horizontal">
    <div class="control-group">
        <label for="pool.pool_name" class="col-sm-2 control-label">pool name :</label>
        <div class="controls">
            <input type=text id="pool.pool_name"  ng-model="pool.pool_name" placeholder="Pool name" required/>
        </div>
    </div>
    <div class="control-group">
        <label for="pool.type" class="col-sm-2 control-label">type : </label>
        <div class="controls">
            <select id="pool.type" ng-model="pool.type" ng-options="type for type in ['replicated','erasure']" required ng-disabled="operation == 'modification'"></select>
        </div>
    </div>
    <div class="control-group" ng-hide="pool.type!='erasure'">
        <label for="pool.erasure_code_profile" class="col-sm-2 control-label">erasure code profile : </label>
        <div class="controls">
            <select id="pool.erasure_code_profile" ng-model="pool.erasure_code_profile" ng-options="profile for profile in erasureProfiles" ng-required="pool.type=='erasure' && operation == 'creation'" ng-disabled="operation == 'modification'"></select>
        </div>
    </div>
    <div class="control-group">
        <label for="pool.crush_rule" class="col-sm-2 control-label">rule : </label>
        <div class="controls">
            <select id="pool.crush_rule" ng-model="pool.crush_rule" >
                <option ng-repeat="item in rulestab[pool.type]" value="{{ item.rule }}" ng-selected="item.rule == pool.crush_rule">{{ item.rule_name }}</option>
            </select>
            &nbsp;<a class="tooltips"><i class="icon-book"> </i><span>rule to use for mapping object placement in the cluster</span></a>
        </div>
    </div>
    <div class="control-group">
        <label for="pool.pg_num" class="col-sm-2 control-label">pg num : </label>
        <div class="controls">
            <input type=number id="pool.pg_num"  ng-model="pool.pg_num" required/>
            &nbsp;<a class="tooltips"><i class="icon-book"> </i><span>recommended value:<br>(OSDS * 100)/nb replicas<br>rounded up to the nearest power of 2</span></a>
        </div>
    </div>
    <div class="control-group">
        <label for="pool.pg_placement_num" class="col-sm-2 control-label">pg placement num : </label>
        <div class="controls">
            <input type=number id="pool.pg_placement_num"  ng-model="pool.pg_placement_num" required/>
            &nbsp;<a class="tooltips"><i class="icon-book"> </i><span>may be the same as pg num</span></a>
        </div>
    </div>
    <div class="control-group">
        <label for="pool.size" class="col-sm-2 control-label">size : </label>
        <div class="controls">
            <input type=number id="pool.size"  ng-model="pool.size" required/>
            &nbsp;<a class="tooltips"><i class="icon-book"> </i><span>number of replicas for objects in the pool</span></a>
        </div>
    </div>
    <div class="control-group">
        <label for="pool.min_size" class="col-sm-2 control-label">min size : </label>
        <div class="controls">
            <input type=number id="pool.min_size"  ng-model="pool.min_size" required/>
            &nbsp;<a class="tooltips"><i class="icon-book"> </i><span>minimum number of replicas required for io</span></a>
        </div>
    </div>
    <div class="control-group">
        <label for="pool.crash_replay_interval" class="col-sm-2 control-label">crash replay interval : </label>
        <div class="controls">
            <input type=number id="pool.crash_replay_interval"  ng-model="pool.crash_replay_interval" required/>
            &nbsp;<a class="tooltips"><i class="icon-book"> </i><span>number of seconds to allow clients to replay acknowledged, but uncommitted requests</span></a>
        </div>
    </div>
    <div class="control-group">
        <label for="pool.quota_max_objects" class="col-sm-2 control-label">quota max objects : </label>
        <div class="controls">
            <input type=number id="pool.quota_max_objects"  ng-model="pool.quota_max_objects" required/>
            &nbsp;<a class="tooltips"><i class="icon-book"> </i><span>0 = infinite</span></a>
        </div>
    </div>
    <div class="control-group">
        <label for="pool.quota_max_bytes" class="col-sm-2 control-label">quota max bytes : </label>
        <div class="controls">
            <input type=number id="pool.quota_max_bytes"  ng-model="pool.quota_max_bytes" required/>
            &nbsp;<a class="tooltips"><i class="icon-book"> </i><span>0 = infinite</span></a>
        </div>
    </div>
    <div class="control-group">
        <label for="pool.application_metadata" class="col-sm-2 control-label">application tag : </label>
        <div class="controls">
            <input type="text" id="pool.application_metadata"  ng-model="pool.application_metadata" required/>
            &nbsp;<a class="tooltips"><i class="icon-book"> </i><span>standard tags are cephfs, rbd, rgw, but you can put your own</span></a>
        </div>
    </div>

    <br/>
    <br />

    <div class="button-bar">
        <button ng-click="submit()" ng-disabled="form.$invalid || isUnchanged(pool)" class="btn btn-success">
            {{ (operation=="creation"?"Create":"Modify") }}
        </button>
       <button ng-click="reset()" ng-disabled="isUnchanged(pool)" class="btn btn-default">
            Reset
        </button>
        <button ng-click="cancel()" class="btn btn-default">Cancel</button>

    </div>
</form>
<br>
<!--
<pre>
Debug info :

form = {{pool | json}}

master = {{master | json}}

url: {{uri}}

http status code: {{status}}

http response data: {{data}}</pre>
-->
