<div ng-controller="BackupAndRestoreCtrl" class="wrapper">
	<div cg-busy="{promise:myPromise,backdrop:true,message:'请稍后...'}">
	<div class="panel panel-default">
		<div class="panel-body">
		  <div class="form-inline">
		  		<button ng-click="backup()" class="btn btn-primary">
					<i class="glyphicon glyphicon-check">备份</i>
				</button>
				<div class="input-group col-sm-3">
		      		<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
					<input type="text" class="form-control" ng-model="search.originalName" placeholder="备份版本" ng-change="goPage(1)"/>
				</div>
		  </div>
			<table class="table table-striped">
				<thead>
					<tr>
						<th nowrap="nowrap">备份版本</th>
						<th nowrap="nowrap">备份日期</th>
					</tr>										
				</thead>
				<tbody>
					<tr ng-repeat="row in pageModel.array">
						<td>{{row.originalName}}</td>
						<td>{{row.createdTime | date:'yyyy-MM-dd'}}</td>
						<td>
							<button ng-click="restore(row.originalName)" class="btn btn-primary">
								<i class="glyphicon glyphicon-check">还原</i>
							</button>
						</td>
					</tr>
				</tbody>
			</table>
			<nav ng-if="pageModel.totalPage > 1">
				<ul class="pagination">
					<li class="{{pageModel.curPage == 1 ? 'disabled' : ''}}" ng-click="goPage(pageModel.curPage - 1)">
						<a aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>
			      	</li>
				    <li ng-repeat="i in [9,8,7,6,5,4,3,2,1]" ng-if="pageModel.curPage - i > 0" ng-click="goPage(pageModel.curPage - i)">
				    	<a>{{pageModel.curPage - i}}</a>
			    	</li>
				    <li class="active"><a href="#">{{pageModel.curPage}}</a></li>
				    <li ng-repeat="i in [1,2,3,4,5,6,7,8,9]" ng-if="pageModel.curPage + i <= pageModel.totalPage" ng-click="goPage(pageModel.curPage + i)">
				    	<a>{{pageModel.curPage + i}}</a>
			    	</li>
				    <li class="{{pageModel.curPage == pageModel.totalPage ? 'disabled' : ''}}" ng-click="goPage(pageModel.curPage + 1)">
				      	<a aria-label="Next"><span aria-hidden="true">&raquo;</span></a>
				    </li>
				</ul>
			</div>
			
		</div>
	</div>
	</div>
</div>