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

fix: to #47864637 修复STS登陆后地址栏工作不正常的问题 #446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
PeterRao merged 8 commits into aliyun:develop from shungang:csg/fix/develop/47864637
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions all-releases.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

||Windows ia32|Windows x64| Mac(zip) |Linux ia32|Linux x64|Release note|
|-----|-----|-----|-----|--------|--------|---|
|1.16.0|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.16.0/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.16.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.16.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.16.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.16.0/oss-browser-linux-x64.zip)|[1.16.0.md](release-notes/1.16.0.en-US.md)|
|1.15.0|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.15.0/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.15.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.15.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.15.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.15.0/oss-browser-linux-x64.zip)|[1.15.0.md](release-notes/1.15.0.en-US.md)|
|1.14.0|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.14.0/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.14.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.14.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.14.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.14.0/oss-browser-linux-x64.zip)|[1.14.0.md](release-notes/1.14.0.en-US.md)|
|1.13.0|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.13.0/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.13.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.13.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.13.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.13.0/oss-browser-linux-x64.zip)|[1.13.0.md](release-notes/1.13.0.en-US.md)|
Expand Down
13 changes: 8 additions & 5 deletions app/components/services/auth.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ angular.module('web').factory('Auth', [

var df = $q.defer();

data.httpOptions = { timeout: 15000 };
data.httpOptions = {
timeout: 15000
};

if (data.id.indexOf('STS.') != 0) {
delete data.stoken;
Expand Down Expand Up @@ -51,8 +53,7 @@ angular.module('web').factory('Auth', [
message: T('login.endpoint.error')
}); // '请确定Endpoint是否正确'
}
})
['catch']((err) => {
})['catch']((err) => {
df.reject(err);
});
} else {
Expand All @@ -66,12 +67,14 @@ angular.module('web').factory('Auth', [
// 失败
df.reject(err);
}
} else if (result.RequestId && result.Buckets) {
} else if (result.Buckets) {
// 登录成功
AuthInfo.save(data);
df.resolve();
} else {
df.reject({ code: 'Error', message: T('login.endpoint.error') });
df.reject({
code: 'Error', message: T('login.endpoint.error')
});
}
});
}
Expand Down
21 changes: 14 additions & 7 deletions app/components/services/oss2.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ angular.module('web').factory('ossSvs2', [
if (res.keyCount != 0) {
return true;
}

return false;
});
}
Expand Down Expand Up @@ -337,7 +337,7 @@ angular.module('web').factory('ossSvs2', [
if (nextContinuationToken) {
return listDeleteFolder(nextContinuationToken);
}

listFinish = true;

return '';
Expand Down Expand Up @@ -1170,7 +1170,7 @@ angular.module('web').factory('ossSvs2', [
});
}

function saveContent(region, bucket, key, content) {
function saveContent(region, bucket, key, content, isCodeSave) {
return new Promise(function(resolve, reject) {
// aliyun sdk, browser
const client = getClient({
Expand Down Expand Up @@ -1204,12 +1204,18 @@ angular.module('web').factory('ossSvs2', [
}).join('&');
}

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

client3.put(key, new Buffer(content), {
mime: headResult.ContentType,
meta: headResult.Metadata,
headers: {
'Content-Disposition': headResult.ContentDisposition,
'Content-Encoding': headResult.ContentEncoding,
'Content-Encoding': encoding,
'Cache-Control': headResult.CacheControl,
'Content-Language': headResult.ContentLanguage,
'x-oss-storage-class': headResult.StorageClass,
Expand Down Expand Up @@ -1632,8 +1638,9 @@ angular.module('web').factory('ossSvs2', [
name: name === '/' ? name : name.replace(/\/$/, '')
};
});
//保证oss://10012/1/2/3/oss-browser-develop.zip也能加载成功
const objects = (resp.objects || [])
.filter((n) => n.name !== key)
.filter((n) => n.name !== key || (!key.endsWith('/') && n.name === key))
.map((n) => {
const arr = n.name.split('/').filter((k) => !!k);
const name = arr[arr.length - 1];
Expand Down Expand Up @@ -1777,7 +1784,7 @@ angular.module('web').factory('ossSvs2', [
if (resp.nextContinuationToken) {
return listMore(resp.nextContinuationToken);
}

return all_dirs.concat(all_objects);
});
}
Expand Down Expand Up @@ -1993,7 +2000,7 @@ angular.module('web').factory('ossSvs2', [
protocol + '//' + bucket + '.' + region + '.aliyuncs.com' + '/' + key
);
}

let domain;

if (eptpl.indexOf('https://') == 0) {
Expand Down
66 changes: 47 additions & 19 deletions app/const.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ angular.module('web').factory('Const', [
label: '华东2(上海)',
storageClasses: getStorageClasses(3)
},
{
id: 'oss-cn-nanjing',
label: '华东5(南京本地地域)',
storageClasses: getStorageClasses(3)
},
{
id: 'oss-cn-fuzhou',
label: '华东6(福州本地地域)',
storageClasses: getStorageClasses(3)
},
{
id: 'oss-cn-qingdao',
label: '华北1(青岛)',
Expand All @@ -106,6 +116,11 @@ angular.module('web').factory('Const', [
label: '华北5(呼和浩特)',
storageClasses: getStorageClasses(3)
},
{
id: 'oss-cn-wulanchabu',
label: '华北6(乌兰察布)',
storageClasses: getStorageClasses(3)
},
{
id: 'oss-cn-shenzhen',
label: '华南1(深圳)',
Expand All @@ -128,10 +143,29 @@ angular.module('web').factory('Const', [
},
{
id: 'oss-cn-hongkong',
label: '香港',
label: '中国(香港)',
storageClasses: getStorageClasses(3)
},
{
id: 'oss-us-west-1',
label: '美国西部1(硅谷)',
storageClasses: getStorageClasses(3)
},
{
id: 'oss-us-east-1',
label: '美国东部1(弗吉尼亚)',
storageClasses: getStorageClasses(3)
},
{
id: 'oss-ap-northeast-1',
label: '日本(东京)',
storageClasses: getStorageClasses(3)
},
{
id: 'oss-ap-northeast-2',
label: '韩国(首尔)',
storageClasses: getStorageClasses(3)
},

{
id: 'oss-ap-southeast-1',
label: '亚太东南1(新加坡)',
Expand All @@ -153,39 +187,33 @@ angular.module('web').factory('Const', [
storageClasses: getStorageClasses(3)
},
{
id: 'oss-ap-northeast-1',
label: '亚太东北1(东京)',
id: 'oss-ap-southeast-6',
label: '菲律宾(马尼拉)',
storageClasses: getStorageClasses(3)
},
{
id: 'oss-ap-south-1',
label: '亚太南部(孟买)',
id: 'oss-ap-southeast-7',
label: '泰国(曼谷)',
storageClasses: getStorageClasses(3)
},

{
id: 'oss-us-west-1',
label: '美国西部1(硅谷)',
storageClasses: getStorageClasses(3)
},
{
id: 'oss-us-east-1',
label: '美国东部1(弗吉尼亚)',
id: 'oss-ap-south-1',
label: '印度(孟买)',
storageClasses: getStorageClasses(3)
},
{
id: 'oss-eu-central-1',
label: '欧洲中部1(法兰克福)',
label: '德国(法兰克福)',
storageClasses: getStorageClasses(3)
},
{
id: 'oss-me-east-1',
label: '中东东部1(迪拜)',
id: 'oss-eu-west-1',
label: '英国(伦敦)',
storageClasses: getStorageClasses(3)
},
{
id: 'oss-eu-west-1',
label: '英国(伦敦)',
id: 'oss-me-east-1',
label: '阿联酋(迪拜)',
storageClasses: getStorageClasses(3)
}
],
Expand Down
2 changes: 1 addition & 1 deletion app/main/auth/login.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ angular.module('web').controller('loginCtrl', [
$scope.item.osspath = $scope.item.osspath || '';

if (
$scope.item.osspath_isdir &&
// $scope.item.osspath_isdir && //默认用户登陆的输入都是目录,而不是文件路径
$scope.item.osspath &&
!$scope.item.osspath.endsWith('/')
) {
Expand Down
2 changes: 1 addition & 1 deletion app/main/files/_/sub-address-bar.html
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="pd4 address-bar" ng-controller="subAddressBarCtrl">
<form ng-submit="go()" name="form1">
<form ng-submit="subGo()" name="form1">
<div class="input-group input-group-sm">
<span class="input-group-btn">
<button
Expand Down
20 changes: 16 additions & 4 deletions app/main/files/_/sub-address-bar.js
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* eslint-disable no-console */
/* eslint-disable object-curly-newline */
/* eslint-disable brace-style */
/* eslint-disable padding-line-between-statements */
angular.module('web').controller('subAddressBarCtrl', [
'$scope',
'$translate',
Expand All @@ -14,6 +18,7 @@ angular.module('web').controller('subAddressBarCtrl', [
subAddress: '/',
goUp: goUp,
go: go,
subGo: subGo,
goHome: goHome,
saveDefaultAddress: saveDefaultAddress,
getDefaultAddress: getDefaultAddress,
Expand Down Expand Up @@ -115,15 +120,15 @@ angular.module('web').controller('subAddressBarCtrl', [
function goBack() {
var addr = His.goBack();

// console.log('-->',addr);
// console.log('goBack-->',addr);
$scope.address = addr.url;
$scope.subAddress = getSubAddress();
$scope.$emit('ossAddressChange', addr.url);
}
function goAhead() {
var addr = His.goAhead();

// console.log('-->',addr);
// console.log('goAhead-->',addr);
$scope.address = addr.url;
$scope.subAddress = getSubAddress();
$scope.$emit('ossAddressChange', addr.url);
Expand Down Expand Up @@ -165,7 +170,7 @@ angular.module('web').controller('subAddressBarCtrl', [
if (!addr) {
$scope.address = DEF_ADDR;
$scope.subAddress = getSubAddress();
length;
// length;

return DEF_ADDR;
}
Expand Down Expand Up @@ -193,6 +198,11 @@ angular.module('web').controller('subAddressBarCtrl', [
console.log(addr);
$scope.$emit('ossAddressChange', addr, force);
}
// 地址栏改变后 刷新
function subGo() {
$scope.address = DEF_ADDR + $scope.subAddress.substring(1);
go();
}
// 向上
function goUp() {
var addr = getAddress();
Expand Down Expand Up @@ -222,8 +232,10 @@ angular.module('web').controller('subAddressBarCtrl', [
function getSubAddress(addr) {
addr = addr || $scope.address;
addr = addr.substring(DEF_ADDR.length);
if (addr == '/') { return addr; }
if (addr.indexOf('/') == 0) { return addr; }

return addr == '/' ? '/' : '/' + addr;
return '/' + addr;
}
}
]);
3 changes: 2 additions & 1 deletion app/main/files/modals/preview/code-modal.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ angular.module('web').controller('codeModalCtrl', [
bucketInfo.region,
bucketInfo.bucket,
objectInfo.path,
v
v,
true
)
.then(function() {
Toast.success(T('save.successfully')); // '保存成功'
Expand Down
14 changes: 10 additions & 4 deletions node/i18n/en-US.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,33 @@ module.exports = {

"region.oss-cn-hangzhou": "East China 1(Hangzhou)",
"region.oss-cn-shanghai": "East China 2(Shanghai)",
"region.oss-cn-nanjing": "East China 5(Nanjing Local Region)",
"region.oss-cn-fuzhou": "East China 6(Local area of Fuzhou)",
"region.oss-cn-qingdao": "North China 1(Qingdao)",
"region.oss-cn-beijing": "North China 2(Beijing)",
"region.oss-cn-zhangjiakou": "North China 3(Zhangjiakou)",
"region.oss-cn-huhehaote": "North China 5(Huhehaote)",
"region.oss-cn-wulanchabu": "North China 6(Ulanchap)",
"region.oss-cn-shenzhen": "South China 1(Shenzhen)",
"region.oss-cn-heyuan": "South China 2(Heyuan)",
"region.oss-cn-chengdu": "Southwest China 1(Chengdu)",
"region.oss-cn-hongkong": "Hongkong",
"region.oss-cn-hongkong": "China (Hong Kong)",
"region.oss-cn-guangzhou": "South China 3(Guangzhou)",

"region.oss-ap-southeast-1": "Asia Pacific Southeast 1(Singapore)",
"region.oss-ap-southeast-2": "Asia Pacific Southeast 2(Sydney)",
"region.oss-ap-southeast-3": "Asia Pacific Southeast 3(Kuala Lumpur)",
"region.oss-ap-southeast-5": "Asia Pacific Southeast 5(Jakarta)",
"region.oss-ap-northeast-1": "Asia Pacific Northeast 1(Tokyo)",
"region.oss-ap-northeast-1": "Japan (Tokyo)",
"region.oss-ap-northeast-2": "South Korea (Seoul)",
"region.oss-ap-south-1": "Asia Pacific South 1(Mumbai)",
"region.oss-ap-southeast-6": "Philippines (Manila)",
"region.oss-ap-southeast-7": "Thailand (Bangkok)",

"region.oss-us-west-1": "Western US 1(Silicon Valley)",
"region.oss-us-east-1": "Eastern US 1(Virginia)",
"region.oss-eu-central-1": "Central Europe 1(Frankfurt)",
"region.oss-me-east-1": "Middle East East 1(Dubai)",
"region.oss-eu-central-1": "CGermany (Frankfurt)",
"region.oss-me-east-1": "United Arab Emirates (Dubai)",
"region.oss-eu-west-1": "England (LonDon)",

optional: "Optional",
Expand Down
Loading

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