update for auto-resize of UI.

This commit is contained in:
kunw 2016-06-26 12:56:58 +08:00
parent 55b811e9ec
commit cded535892
14 changed files with 76 additions and 54 deletions

View File

@ -42,7 +42,7 @@
.sub-pane {
margin: 15px;
min-height: 300px;
min-height: 1px;
overflow-y: auto;
}

View File

@ -42,7 +42,7 @@
cursor: all-scroll;
}
#down-pane {
height: 80px;
height: 100%;
min-height: 80px;
}
@ -54,7 +54,8 @@
}
.well-split {
margin-bottom: 0;
margin: 0;
position: relative;
}
.split-handle {

View File

@ -23,15 +23,15 @@
if(!angular.isDefined(scope.subsHeight)) scope.subsHeight = 110;
if(!angular.isDefined(scope.subsSection)) scope.subsSection = 32;
if(!angular.isDefined(scope.subsSubPane)) scope.subsSubPane = 226;
if(!angular.isDefined(scope.subsTabPane)) scope.subsTabPane = 226;
if(!angular.isDefined(scope.subsTabPane)) scope.subsTabPane = 66;
scope.$watch(scope.getDimension, function(current) {
if(current) {
var h = current.h;
element.css({'height' : (h - scope.subsHeight) + 'px'});
element.find('.section').css({'height': (h - scope.subsHeight - scope.subsSection) + 'px'});
element.css({'height' : (h - scope.subsHeight) + 'px'});
element.find('.section').css({'height': (h - scope.subsHeight - scope.subsSection) + 'px'});
element.find('.sub-pane').css({'height': (h - scope.subsHeight - scope.subsSubPane) + 'px'});
element.find('.tab-pane').css({'height': (h - scope.subsHeight - scope.subsTabPane) + 'px'});
element.find('.tab-pane').css({'height': (h - scope.subsHeight - scope.subsTabPane) + 'px'});
}
}, true);

View File

@ -1,4 +1,4 @@
<div class="tab-pane" id="logs">
<div class="tab-pane" id="logs" element-height>
<div class="col-xs-12 col-md-12 each-tab-pane">
<div class="form-inline">
<div class="input-group">
@ -20,7 +20,7 @@
</thead>
<tbody>
<tr ng-repeat="log in vm.logs">
<td>//log.username//</td><td>//log.repo_name//</td><td>//log.operation//</td><td>//log.op_time | dateL : 'YYYY-MM-DD HH:mm:ss'//</td>
<td>//log.username//</td><td>//log.repo_name//</td><td>//log.operation//</td><td>//log.op_time | dateL : 'YYYY-MM-DD HH:mm:ss'//</td>
</tr>
</tbody>
</table>

View File

@ -9,6 +9,9 @@
ListLogController.$inject = ['$scope','ListLogService', 'getParameterByName', '$location'];
function ListLogController($scope, ListLogService, getParameterByName, $location) {
$scope.subsTabPane = 20;
var vm = this;
vm.isOpen = false;

View File

@ -9,6 +9,9 @@
ListProjectMemberController.$inject = ['$scope', 'ListProjectMemberService', 'DeleteProjectMemberService', 'getParameterByName', '$location', 'currentUser', '$filter', 'trFilter'];
function ListProjectMemberController($scope, ListProjectMemberService, DeleteProjectMemberService, getParameterByName, $location, currentUser, $filter, trFilter) {
$scope.subsTabPane = 110;
var vm = this;
vm.isOpen = false;

View File

@ -1,5 +1,5 @@
<modal-dialog modal-title="// vm.modalDialogTitle //" modal-message="// vm.modalDialogMessage //" action="vm.deleteDestination()"></modal-dialog>
<div class="tab-pane">
<div class="tab-pane" element-height>
<div class="col-xs-12 col-md-12 each-tab-pane">
<div class="form-inline">
<div class="input-group">
@ -38,6 +38,6 @@
</table>
</div>
</div>
<div class="col-xs-4 col-md-12 well well-sm well-custom well-split"><div class="col-md-offset-10">//vm.destinations ? vm.destinations.length : 0// // 'items' | tr //</div></div>
<div class="col-xs-4 col-md-12 well well-sm well-custom"><div class="col-md-offset-10">//vm.destinations ? vm.destinations.length : 0// // 'items' | tr //</div></div>
</div>
</div>

View File

@ -9,6 +9,9 @@
DestinationController.$inject = ['$scope', 'ListDestinationService', 'DeleteDestinationService', '$filter', 'trFilter'];
function DestinationController($scope, ListDestinationService, DeleteDestinationService, $filter, trFilter) {
$scope.subsSubPane = 276;
var vm = this;
vm.retrieve = retrieve;

View File

@ -1,4 +1,4 @@
<div class="tab-pane">
<div class="tab-pane" element-height>
<div class="col-xs-12 col-md-12 each-tab-pane">
<div class="form-inline">
<div class="input-group">
@ -46,10 +46,10 @@
<a href="javascript:void(0);"><span class="glyphicon glyphicon-trash"></span></a>
</td>
</tr>
</tbody>
</tbody>well-split
</table>
</div>
</div>
<div class="col-xs-4 col-md-12 well well-sm well-custom well-split"><div class="col-md-offset-10">//vm.replications ? vm.replications.length : 0// // 'items' | tr //</div></div>
<div class="col-xs-4 col-md-12 well well-sm well-custom"><div class="col-md-offset-10">//vm.replications ? vm.replications.length : 0// // 'items' | tr //</div></div>
</div>
</div>

View File

@ -6,9 +6,12 @@
.module('harbor.system.management')
.directive('replication', replication);
ReplicationController.$inject = ['ListReplicationPolicyService', 'ToggleReplicationPolicyService'];
ReplicationController.$inject = ['$scope', 'ListReplicationPolicyService', 'ToggleReplicationPolicyService'];
function ReplicationController(ListReplicationPolicyService, ToggleReplicationPolicyService) {
function ReplicationController($scope, ListReplicationPolicyService, ToggleReplicationPolicyService) {
$scope.subsSubPane = 276;
var vm = this;
vm.retrieve = retrieve;
vm.search = search;

View File

@ -1,40 +1,44 @@
<div class="search-pane">
<div class="form-inline">
<div class="input-group">
<input type="text" class="form-control" placeholder="" ng-model="vm.username" size="30">
<span class="input-group-btn">
<button class="btn btn-primary" type="button" ng-click="vm.searchUser()"><span class="glyphicon glyphicon-search"></span></button>
</span>
<div class="tab-pane" element-height>
<div class="col-xs-12 col-md-12 each-tab-pane">
<div class="form-inline">
<div class="input-group">
<input type="text" class="form-control" placeholder="" ng-model="vm.username" size="30">
<span class="input-group-btn">
<button class="btn btn-primary" type="button" ng-click="vm.searchUser()"><span class="glyphicon glyphicon-search"></span></button>
</span>
</div>
</div>
<modal-dialog modal-title="// 'confirm_to_delete_user_title' | tr //" modal-message="// 'confirm_to_delete_user' | tr //" action="vm.deleteUser()"></modal-dialog>
<div class="pane">
<div class="sub-pane">
<table class="table table-pane">
<thead>
<th>// 'username' | tr //</th>
<th>// 'email' | tr //</th>
<th>// 'registration_time' | tr //</th>
<th>// 'administrator' | tr //</th>
<th>// 'operation' | tr //</th>
</thead>
<tbody>
<tr ng-repeat="u in vm.users">
<td>//u.username//</td>
<td>//u.email//</td>
<td>//u.creation_time | dateL : 'YYYY-MM-DD HH:mm:ss'//</td>
<td>
<toggle-admin has-admin-role="u.has_admin_role == 1" user-id="//u.user_id//"></toggle-admin>
</td>
<td>
&nbsp;&nbsp;<a href="javascript:void(0)" data-toggle="modal" data-target="#myModal" ng-click="vm.confirmToDelete(u.user_id)"><span class="glyphicon glyphicon-trash"></span></a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-4 col-md-12 well well-sm well-custom">
<div class="col-md-offset-10">//vm.users ? vm.users.length : 0// items</div>
</div>
</div>
</div>
</div>
<modal-dialog modal-title="// 'confirm_to_delete_user_title' | tr //" modal-message="// 'confirm_to_delete_user' | tr //" action="vm.deleteUser()"></modal-dialog>
<div class="sub-pane">
<table class="table">
<thead>
<th>// 'username' | tr //</th>
<th>// 'email' | tr //</th>
<th>// 'registration_time' | tr //</th>
<th>// 'administrator' | tr //</th>
<th>// 'operation' | tr //</th>
</thead>
<tbody>
<tr ng-repeat="u in vm.users">
<td>//u.username//</td>
<td>//u.email//</td>
<td>//u.creation_time | dateL : 'YYYY-MM-DD HH:mm:ss'//</td>
<td>
<toggle-admin has-admin-role="u.has_admin_role == 1" user-id="//u.user_id//"></toggle-admin>
</td>
<td>
&nbsp;&nbsp;<a href="javascript:void(0)" data-toggle="modal" data-target="#myModal" ng-click="vm.confirmToDelete(u.user_id)"><span class="glyphicon glyphicon-trash"></span></a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-4 col-md-12 well well-sm well-custom">
<div class="col-md-offset-10">//vm.users ? vm.users.length : 0// items</div>
</div>
</div>

View File

@ -9,6 +9,9 @@
ListUserController.$inject = ['$scope', 'ListUserService', 'DeleteUserService'];
function ListUserController($scope, ListUserService, DeleteUserService) {
$scope.subsSubPane = 226;
var vm = this;
vm.username = '';

View File

@ -10,7 +10,8 @@
function AdminOptionController($scope) {
$scope.subsSubPane = 276;
$scope.subsSubPane = 296;
var vm = this;
vm.toggle = false;
vm.toggleAdminOption = toggleAdminOption;

View File

@ -23,6 +23,7 @@
<list-replication ng-if="vm.target === 'replication'"></list-replication>
<list-project-member ng-if="vm.target === 'users'"></list-project-member>
<list-log ng-if="vm.target === 'logs'"></list-log>
</div>
</div>
</div>
</div>