Skip to content

Commit a1f7fed

Browse files
author
csg01123119
committed
feat: add authorization code display
1 parent caa1e58 commit a1f7fed

File tree

4 files changed

+62
-3
lines changed

4 files changed

+62
-3
lines changed

app/main/files/modals/get-address.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ angular.module('web').controller('getAddressModalCtrl', [
132132

133133
$scope.isLoading = false;
134134
safeApply($scope);
135-
})
136-
['catch']((e) => {
135+
})['catch']((e) => {
137136
console.log(e);
138137
$scope.isLoading = false;
139138
safeApply($scope);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<form name="form1">
2+
<div class="modal-header">
3+
<button type="button" class="close" ng-click="cancel()">
4+
<span aria-hidden="true">&times;</span>
5+
</button>
6+
<h4 class="modal-title text-danger">
7+
<!-- 简化Policy授权 -->
8+
{{'simplePolicy.title'|translate}}
9+
</h4>
10+
</div>
11+
<div class="modal-body">
12+
<div class="clearfix">
13+
<div ng-bind-html="htm"></div>
14+
</div>
15+
</div>
16+
<div class="modal-footer">
17+
<button type="button" class="btn btn-default btn-sm" ng-click="cancel()">
18+
<i class="glyphicon glyphicon-remove"></i>
19+
<!-- 关闭 -->
20+
{{'close'|translate}}
21+
</button>
22+
</div>
23+
</form>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
angular.module('web').controller('grantModalCtrlCode', [
2+
'$scope',
3+
'$sce',
4+
'$uibModalInstance',
5+
'items',
6+
function(
7+
$scope,
8+
$sce,
9+
$modalInstance,
10+
items
11+
) {
12+
angular.extend($scope, {
13+
cancel: cancel,
14+
htm: $sce.trustAsHtml(items.html)
15+
});
16+
17+
function cancel() {
18+
$modalInstance.dismiss('close');
19+
}
20+
}
21+
]);

app/main/files/modals/grant-modal.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ angular.module('web').controller('grantModalCtrl', [
33
'$q',
44
'$uibModalInstance',
55
'$translate',
6+
'$uibModal',
67
'items',
78
'currentInfo',
89
'ramSvs',
@@ -19,6 +20,7 @@ angular.module('web').controller('grantModalCtrl', [
1920
$q,
2021
$modalInstance,
2122
$translate,
23+
$modal,
2224
items,
2325
currentInfo,
2426
ramSvs,
@@ -114,6 +116,19 @@ angular.module('web').controller('grantModalCtrl', [
114116
);
115117
}
116118

119+
function openCodeWindow(items) {
120+
$modal.open({
121+
templateUrl: 'main/files/modals/grant-modal-code.html',
122+
controller: 'grantModalCtrlCode',
123+
backdrop: 'static',
124+
resolve: {
125+
items: function() {
126+
return items;
127+
}
128+
}
129+
});
130+
}
131+
117132
// Object的读操作包括:GetObject,HeadObject,CopyObject和UploadPartCopy中的对source object的读;
118133
// Object的写操作包括:PutObject,PostObject,AppendObject,DeleteObject,DeleteMultipleObjects,CompleteMultipartUpload以及CopyObject对新的Object的写。
119134

@@ -230,6 +245,7 @@ angular.module('web').controller('grantModalCtrl', [
230245
.then(function() {
231246
// 发邮件
232247
if (sendInfo) {
248+
openCodeWindow(sendInfo);
233249
Mailer.send(sendInfo).then(
234250
function(result) {
235251
console.log(result);
@@ -416,7 +432,7 @@ AccessKeySecret: ${secret}<br/>
416432
417433
2. ${T('auth.tokenLogin')}:<br/><br/>
418434
419-
<code>${tokenStr}</code>
435+
<code style="word-wrap:break-word;">${tokenStr}</code>
420436
421437
<br/>
422438
<hr/>

0 commit comments

Comments
 (0)