Skip to content

Commit

Permalink
feat: 自定义和pvl方式不支持创建bucket选地域
Browse files Browse the repository at this point in the history
  • Loading branch information
liaojiawei committed May 27, 2024
1 parent 4a84b93 commit 2650cd8
Show file tree
Hide file tree
Showing 6 changed files with 2,584 additions and 21,212 deletions.
Empty file added .npmrc
Empty file.
7 changes: 0 additions & 7 deletions app/main/auth/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ angular.module('web').controller('loginCtrl', [
eptplChange: eptplChange
});

$scope.$watch('item.eptpl', function(v) {
$scope.eptplType =
v.indexOf('{region}.aliyuncs.com') !== -1 ? 'default' : 'customize';
});

$scope.$watch('gtab', function(v) {
localStorage.setItem('gtag', v);
});
Expand All @@ -86,7 +81,6 @@ angular.module('web').controller('loginCtrl', [
function eptplChange(t) {
$scope.eptplType = t;

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

function onSubmit(form1) {
if (!form1.$valid) { return; }

localStorage.setItem(KEY_REMEMBER, $scope.flags.remember);
const isPrivateLink = $scope.eptplType === "privateLink";
if (isPrivateLink) {
Expand Down
2 changes: 1 addition & 1 deletion app/main/files/modals/add-bucket-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h4 class="modal-title">
</div>
</div>

<div class="form-group">
<div class="form-group" ng-if="showRegion">
<label class="col-sm-2 control-label" for="region">
{{'region'|translate}}:
<a
Expand Down
10 changes: 6 additions & 4 deletions app/main/files/modals/add-bucket-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ angular.module('web').controller('addBucketModalCtrl', [
'$scope',
'$uibModalInstance',
'$translate',
'AuthInfo',
'callback',
'ossSvs2',
'Const',
Expand All @@ -11,27 +12,28 @@ angular.module('web').controller('addBucketModalCtrl', [
$scope,
$modalInstance,
$translate,
AuthInfo,
callback,
ossSvs2,
Const,
Toast,
Dialog
Dialog,
) {
var T = $translate.instant;

var bucketACL = angular.copy(Const.bucketACL);
var regions = angular.copy(Const.regions);
var storageClassesMap = {};

angular.forEach(regions, function(n) {
storageClassesMap[n.id] = n.storageClasses;
});

var authInfo = AuthInfo.get();
var eptplType = typeof authInfo === "object" ? authInfo.eptplType : undefined;
angular.extend($scope, {
bucketACL: [], // angular.copy(Const.bucketACL),
regions: [],
cancel: cancel,
onSubmit: onSubmit,
showRegion: !(eptplType === "customize" || eptplType === "privateLink"),
storageClasses: [],
item: {
acl: bucketACL[0].acl,
Expand Down
Loading

0 comments on commit 2650cd8

Please sign in to comment.