Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c3a7c7f

Browse files
shungangchenshungang
and
chenshungang
authored
fix: to #48424264 添加上传错误时展示ec code 和 request id (#451)
* fix: when saving the code module, change the head encoding to gzip, causing SDK to fail to parse the response content * fix: the latest mac operating system login requestId compatibility error * fix: Repair the Japanese name habit * fix: to #48424264 添加上传错误时展示ec code 和 request id * feat: to #49342210 新增列举object最大数量设置 * feat: to #49342210 新增列举object最大数量设置, 修改提示 * feat: to #49342210 删除.vscode的git跟踪 --------- Co-authored-by: chenshungang <csg01123119@alibaba-inc.com>
1 parent 71ad3f8 commit c3a7c7f

File tree

21 files changed

+139
-81
lines changed

21 files changed

+139
-81
lines changed

‎.eslintrc.json‎

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,41 @@
88
}
99
},
1010
"rules": {
11-
"semi": 2
11+
"semi": 2,
12+
"quotes": 0,
13+
"strict": 0,
14+
"padding-line-between-statements": 0,
15+
"spaced-comment": 0,
16+
"no-console": 0,
17+
"comma-dangle": 0,
18+
"no-unneeded-ternary": 0,
19+
"space-before-function-paren": 0,
20+
"indent": 0,
21+
"curly": 0,
22+
"no-unused-vars": 0,
23+
"guard-for-in": 0,
24+
"radix": 0,
25+
"no-param-reassign": 0,
26+
"no-else-return": 0,
27+
"eqeqeq": 0,
28+
"dot-notation": 0,
29+
"object-curly-newline": 0,
30+
"operator-assignment": 0,
31+
"no-shadow": 0,
32+
"require-atomic-updates": 0,
33+
"nonblock-statement-body-position": 0,
34+
"no-empty": 0,
35+
"no-lonely-if": 0,
36+
"one-var": 0,
37+
"block-scoped-var": 0,
38+
"no-redeclare": 0,
39+
"no-useless-return": 0,
40+
"no-loop-func": 0,
41+
"default-case": 0,
42+
"no-fallthrough": 0,
43+
"prefer-promise-reject-errors": 0,
44+
"no-throw-literal": 0,
45+
"brace-style": 0
1246
},
1347
"extends": ["@alicloud/eslint-config/es5"],
1448
"ignorePatterns": ["static/", "vendor/", "dist/", "node_modules/", "test/"],

‎app/components/filters/formater.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
angular
32
.module('web')
43
.filter('trustAsResourceUrl', [

‎app/components/filters/list-filter.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
angular.module('web').filter('listFilter', function() {
32
return function(arr, keyFn, value) {
43
if (!value) { return arr; }

‎app/components/services/cipher.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ angular.module('web').factory('Cipher', function() {
99
};
1010

1111
function cipher(buf, key, algorithm) {
12-
if (!buf instanceof Buffer) {
12+
if (!(buf instanceof Buffer)) {
1313
buf = new Buffer(buf);
1414
}
1515

‎app/components/services/diff-modal.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
angular
32
.module('web')
43
.factory('DiffModal', [

‎app/components/services/oss-download-manager.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ angular.module('web').factory('ossDownloadManager', [
259259
// 文件
260260
if (process.platform == 'win32') {
261261
// 修复window下,文件名含非法字符需要转义
262+
// eslint-disable-next-line no-useless-escape
262263
if (/[\/\\\:\<\>\?\*\"\|]/.test(fileName)) {
263264
fileName = encodeURIComponent(fileName);
264265
filePath = path.join(

‎app/components/services/oss-upload-manager.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,13 @@ angular.module('web').factory('ossUploadManager', [
367367
from: n.from,
368368
status: n.status,
369369
message: n.message,
370+
ecCode: n.ecCode,
371+
requestId: n.requestId,
370372
prog: n.prog
371373
});
372374
});
373375

374376
// console.log('request save upload:', t);
375-
376-
// console.log('-save')
377377
fs.writeFileSync(getUpProgFilePath(), JSON.stringify(t));
378378
$scope.calcTotalProg();
379379
},

‎app/components/services/oss2.js‎

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-unexpected-multiline */
12
angular.module('web').factory('ossSvs2', [
23
'$q',
34
'$rootScope',
@@ -245,6 +246,7 @@ angular.module('web').factory('ossSvs2', [
245246
if (i.status === 'fulfilled') {
246247
fulfilled.push(i.value);
247248
} else {
249+
// eslint-disable-next-line no-unused-expressions
248250
i.status === 'rejected';
249251

250252
if (Array.isArray(i.reason)) {
@@ -1200,14 +1202,15 @@ angular.module('web').factory('ossSvs2', [
12001202

12011203
if (taggingResult && taggingResult.tag) {
12021204
tagging = Object.keys(taggingResult.tag).map(function(k) {
1205+
// eslint-disable-next-line no-undef
12031206
return encodeURIComponent(k) + '=' + encodeURIComponent(data[k]);
12041207
}).join('&');
12051208
}
12061209

12071210
let encoding = headResult.ContentEncoding;
12081211
// code-modal保存时,如果encoding=gzip,就不变更gzip,避免内容未做gzip压缩,导致sdk中的urllib响应内容解析失败
1209-
if(isCodeSave && encoding === 'gzip'){
1210-
encoding=undefined;
1212+
if(isCodeSave && encoding === 'gzip'){
1213+
encoding=undefined;
12111214
}
12121215

12131216
client3.put(key, new Buffer(content), {
@@ -1611,7 +1614,9 @@ angular.module('web').factory('ossSvs2', [
16111614
});
16121615
}
16131616

1614-
function _listFilesOrigion(region, bucket, key, marker = '', length = 1000) {
1617+
function _listFilesOrigion(region, bucket, key, marker = '', length) {
1618+
if (!length) length = localStorage.getItem("listObjectNum") || 500;
1619+
console.log('list-object-max-length', length);
16151620
const client = getClient3({
16161621
region,
16171622
bucket
@@ -1689,51 +1694,6 @@ angular.module('web').factory('ossSvs2', [
16891694

16901695
list(marker);
16911696
});
1692-
1693-
return client.listV2(Object.assign({}, options, { 'continuation-token': marker }))
1694-
.then((resp) => {
1695-
const dirs = (resp.prefixes || [])
1696-
.filter((n) => n !== key)
1697-
.map((n) => {
1698-
const arr = n.split('/').filter((k) => !!k);
1699-
const name = arr[arr.length - 1];
1700-
1701-
return {
1702-
isFolder: true,
1703-
itemType: 'folder',
1704-
path: n,
1705-
name: name === '/' ? name : name.replace(/\/$/, '')
1706-
};
1707-
});
1708-
const objects = (resp.objects || [])
1709-
.filter((n) => n.name !== key)
1710-
.map((n) => {
1711-
const arr = n.name.split('/').filter((k) => !!k);
1712-
const name = arr[arr.length - 1];
1713-
1714-
return Object.assign(n, {
1715-
isFile: true,
1716-
itemType: 'file',
1717-
path: n.name,
1718-
name: name
1719-
});
1720-
});
1721-
1722-
return {
1723-
data: {
1724-
dirs,
1725-
objects
1726-
},
1727-
marker: resp.nextContinuationToken,
1728-
truncated: resp.isTruncated,
1729-
maxKeys: +resp.keyCount
1730-
};
1731-
})
1732-
['catch']((e) => {
1733-
handleError(e);
1734-
1735-
return Promise.reject(e);
1736-
});
17371697
}
17381698

17391699
function listAllFiles(region, bucket, key, folderOnly) {
@@ -1997,7 +1957,7 @@ angular.module('web').factory('ossSvs2', [
19971957
}
19981958

19991959
return (
2000-
protocol + '//' + bucket + '.' + region + '.aliyuncs.com'+'/' + key
1960+
protocol + '//' + bucket + '.' + region + '.aliyuncs.com/' + key
20011961
);
20021962
}
20031963

@@ -2018,7 +1978,7 @@ angular.module('web').factory('ossSvs2', [
20181978
}
20191979

20201980
return (
2021-
protocol + '//' + bucket + '.' + region + '.aliyuncs.com'+'/' + key
1981+
protocol + '//' + bucket + '.' + region + '.aliyuncs.com/' + key
20221982
);
20231983
}
20241984

‎app/components/services/settings.js‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ angular.module('web').factory('settingsSvs', [
112112
return localStorage.setItem('downloadConcurrecyPartSize', v);
113113
}
114114
},
115+
listObjectNum: {
116+
get: function() {
117+
return parseInt(
118+
localStorage.getItem('listObjectNum') || 500
119+
);
120+
},
121+
set: function(v) {
122+
return localStorage.setItem('listObjectNum', v);
123+
}
124+
},
115125
uploadAndDownloadRetryTimes: {
116126
get: function() {
117127
return parseInt(

‎app/main/files/files.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ angular
648648
function(result) {
649649
const arr = result.data;
650650

651+
// eslint-disable-next-line no-unused-expressions
651652
settingsSvs.showImageSnapshot.get() == 1
652653
? signPicURL(info, arr)
653654
: null;
@@ -726,8 +727,7 @@ angular
726727
`)
727728
);
728729
safeApply($scope);
729-
})
730-
['finally'](() => {
730+
}).finally(() => {
731731
$timeout(() => {
732732
isLoadingObjectSymlinkMeta = false;
733733
}, 500);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /