Skip to content

Commit 2650cd8

Browse files
author
liaojiawei
committed
feat: 自定义和pvl方式不支持创建bucket选地域
1 parent 4a84b93 commit 2650cd8

File tree

6 files changed

+2584
-21212
lines changed

6 files changed

+2584
-21212
lines changed

.npmrc

Whitespace-only changes.

app/main/auth/login.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ angular.module('web').controller('loginCtrl', [
6666
eptplChange: eptplChange
6767
});
6868

69-
$scope.$watch('item.eptpl', function(v) {
70-
$scope.eptplType =
71-
v.indexOf('{region}.aliyuncs.com') !== -1 ? 'default' : 'customize';
72-
});
73-
7469
$scope.$watch('gtab', function(v) {
7570
localStorage.setItem('gtag', v);
7671
});
@@ -86,7 +81,6 @@ angular.module('web').controller('loginCtrl', [
8681
function eptplChange(t) {
8782
$scope.eptplType = t;
8883

89-
// console.log(t);
9084
if (t == 'default') {
9185
$scope.item.eptpl = DEF_EP_TPL;
9286
$scope.item.cname = false;
@@ -273,7 +267,6 @@ angular.module('web').controller('loginCtrl', [
273267

274268
function onSubmit(form1) {
275269
if (!form1.$valid) { return; }
276-
277270
localStorage.setItem(KEY_REMEMBER, $scope.flags.remember);
278271
const isPrivateLink = $scope.eptplType === "privateLink";
279272
if (isPrivateLink) {

app/main/files/modals/add-bucket-modal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h4 class="modal-title">
4040
</div>
4141
</div>
4242

43-
<div class="form-group">
43+
<div class="form-group" ng-if="showRegion">
4444
<label class="col-sm-2 control-label" for="region">
4545
{{'region'|translate}}:
4646
<a

app/main/files/modals/add-bucket-modal.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ angular.module('web').controller('addBucketModalCtrl', [
22
'$scope',
33
'$uibModalInstance',
44
'$translate',
5+
'AuthInfo',
56
'callback',
67
'ossSvs2',
78
'Const',
@@ -11,27 +12,28 @@ angular.module('web').controller('addBucketModalCtrl', [
1112
$scope,
1213
$modalInstance,
1314
$translate,
15+
AuthInfo,
1416
callback,
1517
ossSvs2,
1618
Const,
1719
Toast,
18-
Dialog
20+
Dialog,
1921
) {
2022
var T = $translate.instant;
21-
2223
var bucketACL = angular.copy(Const.bucketACL);
2324
var regions = angular.copy(Const.regions);
2425
var storageClassesMap = {};
25-
2626
angular.forEach(regions, function(n) {
2727
storageClassesMap[n.id] = n.storageClasses;
2828
});
29-
29+
var authInfo = AuthInfo.get();
30+
var eptplType = typeof authInfo === "object" ? authInfo.eptplType : undefined;
3031
angular.extend($scope, {
3132
bucketACL: [], // angular.copy(Const.bucketACL),
3233
regions: [],
3334
cancel: cancel,
3435
onSubmit: onSubmit,
36+
showRegion: !(eptplType === "customize" || eptplType === "privateLink"),
3537
storageClasses: [],
3638
item: {
3739
acl: bucketACL[0].acl,

0 commit comments

Comments
 (0)