update for fitting height of replication page.

This commit is contained in:
kunw 2016-06-28 13:12:25 +08:00
parent 9b39950382
commit f1197ef8a7
14 changed files with 56 additions and 49 deletions

View File

@ -13,6 +13,7 @@
padding: 15px;
margin-top: 20px;
background-color: #FFFFFF;
height: 100%;
width: 100%;
min-height: 579px;
}

View File

@ -33,17 +33,14 @@
#upon-pane {
margin-top: 10px;
height: 270px;
min-height: 100px;
max-height: 270px;
height: 320px;
}
#upon-pane table>tbody>tr {
cursor: all-scroll;
}
#down-pane {
height: 100%;
min-height: 80px;
height: 450px;
}
.sub-pane-split {

View File

@ -15,25 +15,27 @@
return directive;
function link(scope, element, attrs) {
var w = angular.element($window);
scope.getDimension = function() {
return {'h' : w.height()};
};
if(!angular.isDefined(scope.subsHeight)) scope.subsHeight = 110;
if(!angular.isDefined(scope.subsSection)) scope.subsSection = 32;
if(!angular.isDefined(scope.subsSubPane)) scope.subsSubPane = 226;
scope.$watch(scope.getDimension, function(current) {
if(current) {
var h = current.h;
var h = current.h;
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.subsSubPane) + 'px'});
}
}, true);
w.on('pageshow, resize', function() {
w.on('pageshow, resize', function() {
scope.$apply();
});
}

View File

@ -13,6 +13,9 @@
$scope.subsTabPane = 30;
var vm = this;
vm.sectionHeight = {'min-height': '579px'};
vm.isOpen = false;
vm.beginTimestamp = 0;
@ -106,7 +109,9 @@
var directive = {
restrict: 'E',
templateUrl: '/static/resources/js/components/log/list-log.directive.html',
scope: true,
scope: {
'sectionHeight': '='
},
controller: ListLogController,
controllerAs: 'vm',
bindToController: true

View File

@ -1,7 +1,6 @@
<div class="well panel-group well-custom" style="margin: 0;">
<div class="row">
<div class="pull-right clearfix"><a href="javascript:void(0);" ng-click="vm.close()"><span class="glyphicon glyphicon-remove-circle"></span></a></div>
<form name="form" class="css-form" novalidate>
<form name="form" class="css-form form-custom" novalidate>
<div class="col-xs-10 col-md-10">
<div class="form-group col-md-6">
<input type="text" class="form-control" id="addUsername" placeholder="// 'username' | tr //" ng-model="pm.username" name="uUsername" ng-model-options="{ debounce: 250 }" ng-change="vm.reset()" required>

View File

@ -20,7 +20,6 @@
vm.save = save;
vm.cancel = cancel;
vm.close = close;
vm.reset = reset;
vm.hasError = false;
@ -46,11 +45,7 @@
vm.hasError = false;
vm.errorMessage = '';
}
function close() {
vm.isOpen = false;
}
function addProjectMemberComplete(data, status, header) {
console.log('addProjectMemberComplete: status:' + status + ', data:' + data);
vm.reload();

View File

@ -80,12 +80,14 @@
function listProjectMember() {
var directive = {
restrict: 'E',
templateUrl: '/static/resources/js/components/project-member/list-project-member.directive.html',
scope: true,
controller: ListProjectMemberController,
controllerAs: 'vm',
bindToController: true
'restrict': 'E',
'templateUrl': '/static/resources/js/components/project-member/list-project-member.directive.html',
'scope': {
'sectionHeight': '='
},
'controller': ListProjectMemberController,
'controllerAs': 'vm',
'bindToController': true
};
return directive;

View File

@ -1,5 +1,4 @@
<div class="well well-custom">
<div class="pull-right clearfix"><a href="javascript:void(0);" ng-click="vm.close()"><span class="glyphicon glyphicon-remove-circle"></span></a></div>
<form name="form" class="css-form form-custom" novalidate>
<div class="row">
<div class="col-xs-10 col-md-10">
@ -13,7 +12,7 @@
<span ng-show="vm.hasError">// vm.errorMessage | tr //</span>
</div>
</div>
<div class="form-group">
<div class="form-group" style="margin-top: 5px;">
<input type="checkbox" ng-model="vm.isPublic">&nbsp;// 'public' | tr //
</div>
</div>

View File

@ -18,8 +18,7 @@
vm.addProject = addProject;
vm.cancel = cancel;
vm.close = close;
vm.reset = reset;
vm.hasError = false;
@ -62,14 +61,10 @@
vm0.projectName = '';
vm.isPublic = false;
vm.hasError = false;
vm.hasError = false; vm.close = close;
vm.errorMessage = '';
}
function close() {
vm.isOpen = false;
}
function reset() {
vm.hasError = false;
vm.errorMessage = '';

View File

@ -24,7 +24,7 @@
</thead>
</table>
</div>
<div class="table-body-container" style="height: 200px;">
<div class="table-body-container" style="height: 250px;">
<table class="table table-pane">
<tbody>
<tr ng-if="vm.replicationPolicies.length == 0">
@ -56,7 +56,7 @@
</div>
</div>
<div class="col-xs-4 col-md-12 well well-sm well-custom well-split"><div class="col-md-offset-10">//vm.replicationPolicies ? vm.replicationPolicies.length : 0// // 'items' | tr //</div></div>
<p class="split-handle"><span class="glyphicon glyphicon-align-justify"></span></p>
<!--p class="split-handle"><span class="glyphicon glyphicon-align-justify"></span></p-->
<h4 class="h4-custom-down">// 'replication_jobs' | tr //</h4>
<hr class="hr-line"/>
<div class="form-inline">
@ -84,7 +84,7 @@
</thead>
</table>
</div>
<div class="table-body-container" style="height: 200px;">
<div class="table-body-container" style="height: 370px;">
<table class="table table-pane">
<tbody>
<tr ng-if="vm.replicationJobs.length == 0">

View File

@ -11,6 +11,8 @@
function ListReplicationController($scope, getParameterByName, $location, ListReplicationPolicyService, ToggleReplicationPolicyService, ListReplicationJobService, $window, $filter, trFilter) {
var vm = this;
vm.sectionHeight = {'min-height': '1200px'};
$scope.$on('$locationChangeSuccess', function() {
vm.projectId = getParameterByName('project_id', $location.absUrl());
vm.retrievePolicy();
@ -109,7 +111,9 @@
var directive = {
'restrict': 'E',
'templateUrl': '/static/resources/js/components/replication/list-replication.directive.html',
'scope': true,
'scope': {
'sectionHeight': '='
},
'link': link,
'controller': ListReplicationController,
'controllerAs': 'vm',
@ -118,6 +122,7 @@
return directive;
function link(scope, element, attrs, ctrl) {
/*
var uponPaneHeight = element.find('#upon-pane').height();
var handleHeight = element.find('.split-handle').height() + element.find('.split-handle').offset().top + element.find('.well').height() - 24;
@ -144,7 +149,7 @@
$(document).off('mousedown');
$(document).off('mousemove');
}
*/
ctrl.lastPolicyId = -1;
scope.$watch('vm.replicationPolicies', function(current) {

View File

@ -13,6 +13,8 @@
var vm = this;
vm.sectionHeight = {'min-height': '579px'};
vm.filterInput = '';
var hashValue = $location.hash();
@ -107,11 +109,14 @@
function listRepository() {
var directive = {
restrict: 'E',
templateUrl: '/static/resources/js/components/repository/list-repository.directive.html',
controller: ListRepositoryController,
controllerAs: 'vm',
bindToController: true
'restrict': 'E',
'templateUrl': '/static/resources/js/components/repository/list-repository.directive.html',
'scope': {
'sectionHeight': '='
},
'controller': ListRepositoryController,
'controllerAs': 'vm',
'bindToController': true
};
return directive;

View File

@ -17,6 +17,8 @@
vm.togglePublicity = togglePublicity;
vm.target = 'repositories';
vm.sectionDefaultHeight = {'min-height': '579px'};
function togglePublicity(e) {
vm.publicity = e.publicity;
}

View File

@ -2,7 +2,7 @@
<div class="container container-custom">
<div class="row extend-height">
<div class="col-xs-12 col-md-12 extend-height">
<div class="section">
<div class="section" ng-style="vm.sectionHeight">
<h4 class="page-header">
<span ng-show="!vm.publicity">// 'my_projects' | tr //</span>
<a ng-show="vm.publicity" href="#/repositories?project_id=//vm.selectedProject.project_id//" class="title-color" ng-click="vm.togglePublicity({publicity: false})">// 'my_projects' | tr //</a>
@ -19,10 +19,10 @@
<!-- Tab panes -->
<div class="tab-content" ng-click="vm.closeRetrievePane()">
<input type="hidden" id="HarborRegUrl" value="{{.HarborRegUrl}}">
<list-repository ng-if="vm.target === 'repositories'"></list-repository>
<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>
<list-repository ng-if="vm.target === 'repositories'" section-height="vm.sectionHeight"></list-repository>
<list-replication ng-if="vm.target === 'replication'" section-height="vm.sectionHeight"></list-replication>
<list-project-member ng-if="vm.target === 'users'" section-height="vm.sectionHeight"></list-project-member>
<list-log ng-if="vm.target === 'logs'" section-height="vm.sectionHeight"></list-log>
</div>
</div>
</div>