diff --git a/.eslintrc.json b/.eslintrc.json index 730d1bb1..d7d90e6c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,7 +8,8 @@ } }, "rules": { - "semi": 2 + "semi": 0, + "quotes": 0 }, "extends": ["eslint:recommended", "plugin:prettier/recommended"], "ignorePatterns": ["static/", "vendor/", "dist/", "node_modules/", "test/"], diff --git a/all-releases.md b/all-releases.md index 041c7592..770f4618 100644 --- a/all-releases.md +++ b/all-releases.md @@ -2,25 +2,24 @@ ## Download from download -||Windows ia32|Windows x64| Mac(zip) |Linux ia32|Linux x64|Release note| - |-----|-----|-----|-----|--------|--------|---| -|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)| -|1.12.0|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.12.0/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.12.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.12.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.12.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.12.0/oss-browser-linux-x64.zip)|[1.12.0.md](release-notes/1.12.0.en-US.md)| -|1.11.0|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.11.0/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.11.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.11.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.11.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.11.0/oss-browser-linux-x64.zip)|[1.11.0.md](release-notes/1.11.0.en-US.md)| -|1.10.0|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.10.0/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.10.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.10.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.10.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.10.0/oss-browser-linux-x64.zip)|[1.10.0.md](release-notes/1.10.0.en-US.md)| -|1.9.5|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.5/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.5/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.5/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.5/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.5/oss-browser-linux-x64.zip)|[1.9.5.md](release-notes/1.9.5.en-US.md)| -|1.9.4|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.4/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.4/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.4/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.4/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.4/oss-browser-linux-x64.zip)|[1.9.4.md](release-notes/1.9.4.en-US.md)| -|1.9.3|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.3/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.3/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.3/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.3/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.3/oss-browser-linux-x64.zip)|[1.9.3.md](release-notes/1.9.3.en-US.md)| -|1.9.2|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.2/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.2/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.2/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.2/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.2/oss-browser-linux-x64.zip)|[1.9.2.md](release-notes/1.9.2.en-US.md)| -|1.9.1|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.1/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.1/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.1/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.1/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.1/oss-browser-linux-x64.zip)|[1.9.1.md](release-notes/1.9.1.en-US.md)| -|1.9.0|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.0/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.0/oss-browser-linux-x64.zip)|[1.9.0.md](release-notes/1.9.0.en-US.md)| -|1.8.1|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.1/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.1/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.1/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.1/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.1/oss-browser-linux-x64.zip)|[1.8.1.md](release-notes/1.8.1.en-US.md)| -|1.8.0|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.0/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.0/oss-browser-linux-x64.zip)|[1.8.0.md](release-notes/1.8.0.en-US.md)| -|1.7.4|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.4/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.4/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.4/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.4/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.4/oss-browser-linux-x64.zip)|[1.7.4.md](release-notes/1.7.4.en-US.md)| -|1.7.3|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.3/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.3/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.3/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.3/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.3/oss-browser-linux-x64.zip)|[1.7.3.md](release-notes/1.7.3.en-US.md)| -|1.7.2|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.2/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.2/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.2/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.2/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.2/oss-browser-linux-x64.zip)|[1.7.2.md](release-notes/1.7.2.en-US.md)| -|1.7.1|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.1/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.1/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.1/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.1/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.1/oss-browser-linux-x64.zip)|[1.7.1.md](release-notes/1.7.1.en-US.md)| -|1.7.0|[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.0/oss-browser-win32-ia32.zip) |[Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.0/oss-browser-linux-x64.zip)|[1.7.0.md](release-notes/1.7.0.en-US.md)| - +| | Windows ia32 | Windows x64 | Mac(zip) | Linux ia32 | Linux x64 | Release note | +| ------ | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | +| 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) | +| 1.12.0 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.12.0/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.12.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.12.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.12.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.12.0/oss-browser-linux-x64.zip) | [1.12.0.md](release-notes/1.12.0.en-US.md) | +| 1.11.0 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.11.0/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.11.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.11.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.11.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.11.0/oss-browser-linux-x64.zip) | [1.11.0.md](release-notes/1.11.0.en-US.md) | +| 1.10.0 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.10.0/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.10.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.10.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.10.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.10.0/oss-browser-linux-x64.zip) | [1.10.0.md](release-notes/1.10.0.en-US.md) | +| 1.9.5 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.5/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.5/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.5/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.5/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.5/oss-browser-linux-x64.zip) | [1.9.5.md](release-notes/1.9.5.en-US.md) | +| 1.9.4 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.4/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.4/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.4/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.4/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.4/oss-browser-linux-x64.zip) | [1.9.4.md](release-notes/1.9.4.en-US.md) | +| 1.9.3 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.3/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.3/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.3/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.3/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.3/oss-browser-linux-x64.zip) | [1.9.3.md](release-notes/1.9.3.en-US.md) | +| 1.9.2 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.2/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.2/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.2/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.2/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.2/oss-browser-linux-x64.zip) | [1.9.2.md](release-notes/1.9.2.en-US.md) | +| 1.9.1 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.1/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.1/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.1/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.1/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.1/oss-browser-linux-x64.zip) | [1.9.1.md](release-notes/1.9.1.en-US.md) | +| 1.9.0 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.0/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.9.0/oss-browser-linux-x64.zip) | [1.9.0.md](release-notes/1.9.0.en-US.md) | +| 1.8.1 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.1/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.1/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.1/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.1/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.1/oss-browser-linux-x64.zip) | [1.8.1.md](release-notes/1.8.1.en-US.md) | +| 1.8.0 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.0/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.8.0/oss-browser-linux-x64.zip) | [1.8.0.md](release-notes/1.8.0.en-US.md) | +| 1.7.4 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.4/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.4/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.4/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.4/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.4/oss-browser-linux-x64.zip) | [1.7.4.md](release-notes/1.7.4.en-US.md) | +| 1.7.3 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.3/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.3/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.3/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.3/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.3/oss-browser-linux-x64.zip) | [1.7.3.md](release-notes/1.7.3.en-US.md) | +| 1.7.2 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.2/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.2/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.2/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.2/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.2/oss-browser-linux-x64.zip) | [1.7.2.md](release-notes/1.7.2.en-US.md) | +| 1.7.1 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.1/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.1/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.1/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.1/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.1/oss-browser-linux-x64.zip) | [1.7.1.md](release-notes/1.7.1.en-US.md) | +| 1.7.0 | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.0/oss-browser-win32-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.0/oss-browser-win32-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.0/oss-browser-darwin-x64.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.0/oss-browser-linux-ia32.zip) | [Download](https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/1.7.0/oss-browser-linux-x64.zip) | [1.7.0.md](release-notes/1.7.0.en-US.md) | [Earlier Releases](earlier-releases.md) diff --git a/app/components/services/auto-upgrade.js b/app/components/services/auto-upgrade.js index 9dfdcca0..788fc45d 100644 --- a/app/components/services/auto-upgrade.js +++ b/app/components/services/auto-upgrade.js @@ -1,6 +1,6 @@ angular.module("web").factory("autoUpgradeSvs", [ "settingsSvs", - function (settingsSvs) { + function () { var util = require("./node/ossstore/lib/util"); var NAME = "oss-browser"; @@ -219,8 +219,6 @@ angular.module("web").factory("autoUpgradeSvs", [ //暂时只支持1个文件更新 data.file = data.files.length > 0 ? data.files[0] : null; - var jobs = []; - //var fileName = NAME + '-' + process.platform + '-' + process.arch + '.zip'; var pkgLink = @@ -238,8 +236,6 @@ angular.module("web").factory("autoUpgradeSvs", [ upgradeOpt.upgradeJob.progress = 0; upgradeOpt.upgradeJob.pkgLink = pkgLink; - var jobsFinishedCount = 0; - var to = path.join(__dirname, "..", lastVersion + "-" + data.file); job = new FlatDownloadJob(data.file, pkgLink, to); @@ -292,7 +288,7 @@ angular.module("web").factory("autoUpgradeSvs", [ Range: "bytes=30-210", }, }).then( - function (data) { + function () { var t2 = Date.now(); t.push({ time: t2 - t1, linkPre: linkPre }); diff --git a/app/components/services/oss-download-manager.js b/app/components/services/oss-download-manager.js index 851a2dcd..6678795f 100644 --- a/app/components/services/oss-download-manager.js +++ b/app/components/services/oss-download-manager.js @@ -73,7 +73,7 @@ angular.module("web").factory("ossDownloadManager", [ //save saveProg(); - job.on("partcomplete", function (prog) { + job.on("partcomplete", function () { safeApply($scope); //save saveProg($scope); @@ -140,10 +140,19 @@ angular.module("web").factory("ossDownloadManager", [ //console.log('--------downloadFilesHandler', fromOssInfos, toLocalPath); var authInfo = AuthInfo.get(); var dirPath = path.dirname(fromOssInfos[0].path); + // 多版本下可能会下载同一文件不同历史版本,自动重命名文件 + const fileVersionCount = {}; + fromOssInfos.forEach((info) => { + if (!fileVersionCount[info.path]) { + fileVersionCount[info.path] = 1; + } else { + fileVersionCount[info.path] += 1; + } + }); loop( fromOssInfos, - function (jobs) {}, + function () {}, function () { if (jobsAddedFn) jobsAddedFn(); } @@ -202,11 +211,18 @@ angular.module("web").factory("ossDownloadManager", [ return; } - var fileName = path.basename(ossInfo.path); - var filePath = path.join( - toLocalPath, - path.relative(dirPath, ossInfo.path) - ); + let fileName; + if (fileVersionCount[ossInfo.path] > 1) { + fileName = + path.basename(ossInfo.path, path.extname(ossInfo.path)) + + "(" + + moment(ossInfo.lastModified).format("YYYY_MM_DD_HH_mm_ss") + + ")" + + path.extname(ossInfo.path); + } else { + fileName = path.basename(ossInfo.path); + } + var filePath = path.join(toLocalPath, path.relative(dirPath, fileName)); if (ossInfo.isFolder) { //目录 @@ -249,7 +265,7 @@ angular.module("web").factory("ossDownloadManager", [ //文件 if (process.platform == "win32") { //修复window下,文件名含非法字符需要转义 - if (/[\/\\\:\<\>\?\*\"\|]/.test(fileName)) { + if (/[/\\:<>?*"|]/.test(fileName)) { fileName = encodeURIComponent(fileName); filePath = path.join( path.dirname(filePath), @@ -274,6 +290,7 @@ angular.module("web").factory("ossDownloadManager", [ from: { bucket: ossInfo.bucket, key: truePath, + versionId: ossInfo.versionId, }, to: { name: fileName, @@ -302,9 +319,10 @@ angular.module("web").factory("ossDownloadManager", [ var cname = AuthInfo.get().cname || false; var endpointname = cname ? auth.eptplcname : auth.eptpl; + let store; //stsToken if (auth.stoken && auth.id.indexOf("STS.") == 0) { - var store = new OssStore({ + store = new OssStore({ stsToken: { Credentials: { AccessKeyId: auth.id, @@ -320,7 +338,7 @@ angular.module("web").factory("ossDownloadManager", [ cname: cname, }); } else { - var store = new OssStore({ + store = new OssStore({ aliyunCredential: { accessKeyId: auth.id, secretAccessKey: auth.secret, @@ -373,7 +391,9 @@ angular.module("web").factory("ossDownloadManager", [ try { var data = fs.readFileSync(getDownProgFilePath()); return JSON.parse(data ? data.toString() : "[]"); - } catch (e) {} + } catch (e) { + // + } return []; } diff --git a/app/components/services/oss2.js b/app/components/services/oss2.js index d4fe82cf..2ec0483b 100644 --- a/app/components/services/oss2.js +++ b/app/components/services/oss2.js @@ -39,6 +39,10 @@ angular.module("web").factory("ossSvs2", [ listAllBuckets: listAllBuckets, + // 多版本 + checkBucketIsSupportMultiVersion, + getBucketVersions, + listAllFiles: listAllFiles, listFiles: listFiles, getContent: getContent, @@ -77,26 +81,9 @@ angular.module("web").factory("ossSvs2", [ parseRestoreInfo: parseRestoreInfo, signatureUrl: signatureUrl, - getClient2: getClient2, signatureUrl2: signatureUrl2, }; - function getClient2(opt) { - var options = prepaireOptions(opt); - // console.log(options) - var client = new OSS({ - accessKeyId: options.accessKeyId, - accessKeySecret: options.secretAccessKey, - endpoint: options.endpoint, - bucket: opt.bucket, - stsToken: options.securityToken, - cname: options.cname, - isRequestPay: options.isRequestPayer, - }); - client.userAgent = USER_AGENT; - return client; - } - function getClient3(opt) { const options = prepaireOptions(opt); const final = { @@ -117,34 +104,21 @@ angular.module("web").factory("ossSvs2", [ return client; } - function signatureUrl2(region, bucket, key, expires, xprocess) { - var client = getClient2({ + function signatureUrl2(region, bucket, key, options) { + var client = getClient3({ region: region, bucket: bucket, }); - return client.signatureUrl(key, { - expires: expires, - process: xprocess, - }); + return client.signatureUrl(key, options); } function checkFileExists(region, bucket, key) { - return new Promise(function (a, b) { - var client = getClient({ - region: region, - bucket: bucket, - }); - var opt = { - Bucket: bucket, - Key: key, - }; - client.headObject(opt, function (err, data) { - if (err) { - b(err); - } else { - a(data); - } - }); + const client = getClient3({ + region: region, + bucket: bucket, + }); + return client.head(key).catch((err) => { + return Promise.reject(err); }); } @@ -278,7 +252,14 @@ angular.module("web").factory("ossSvs2", [ objectsCount + foldersCount < len ) { //删除文件 - itemsToDelete.push(item.path); + if (item.versionId !== undefined) { + itemsToDelete.push({ + key: item.path, + versionId: item.versionId, + }); + } else { + itemsToDelete.push(item.path); + } objectsCount++; if ( @@ -295,6 +276,7 @@ angular.module("web").factory("ossSvs2", [ $timeout(dig, NEXT_TICK); }) .catch(function (err) { + handleError(err); terr.push({ item: item, error: err, @@ -305,8 +287,18 @@ angular.module("web").factory("ossSvs2", [ $timeout(dig, NEXT_TICK); }); } else { + const obj = itemsToDelete[0]; + let name, options; + if (typeof obj === "object") { + name = obj.key; + options = { + versionId: obj.versionId, + }; + } else { + name = obj; + } client - .delete(itemsToDelete[0]) + .delete(name, options) .then(function () { c += itemsToDelete.length; progress.current += itemsToDelete.length; @@ -314,6 +306,7 @@ angular.module("web").factory("ossSvs2", [ $timeout(dig, NEXT_TICK); }) .catch(function (err) { + handleError(err); terr.push({ item: item, error: err, @@ -339,15 +332,21 @@ angular.module("web").factory("ossSvs2", [ ]); return; } - + const options = + item.versionId !== undefined + ? { + versionId: item.versionId, + } + : undefined; client - .delete(item.path) + .delete(item.path, options) .then(function () { c++; progress.current++; $timeout(dig, NEXT_TICK); }) .catch(function (err) { + handleError(err); terr.push({ item: item, error: err, @@ -398,48 +397,35 @@ angular.module("web").factory("ossSvs2", [ //copy oss file function copyOssFile(client, from, to, fn) { - var toKey = to.key; - var fromKey = "/" + from.bucket + "/" + encodeURIComponent(from.key); console.info( removeAfterCopy ? "move" : "copy", "::", from.bucket + "/" + from.key, "==>", - to.bucket + "/" + toKey + to.bucket + "/" + to.key ); - client.copyObject( - { - Bucket: to.bucket, - Key: toKey, - CopySource: fromKey, - }, - function (err) { - if (err) { - fn(err); - return; - } - + const options = + from.versionId === undefined + ? undefined + : { versionId: from.versionId }; + client + .copy(to.key, from.key, from.bucket, options) + .then(() => { if (removeAfterCopy) { - var client2 = getClient({ + const client2 = getClient3({ region: region, bucket: from.bucket, }); - client2.deleteObject( - { - Bucket: from.bucket, - Key: from.key, - }, - function (err) { - if (err) fn(err); - else fn(); - } - ); + client2.delete(from.key, options).then(() => fn()); } else { fn(); } - } - ); + }) + .catch((err) => { + handleError(err); + fn(err); + }); } //打平,一条一条 copy @@ -450,7 +436,7 @@ angular.module("web").factory("ossSvs2", [ progress.total += len; - var client = getClient({ + const client = getClient3({ region: region, bucket: target.bucket, }); @@ -482,6 +468,7 @@ angular.module("web").factory("ossSvs2", [ { bucket: bucket, key: item.path, + versionId: item.versionId, }, { bucket: target.bucket, @@ -623,7 +610,7 @@ angular.module("web").factory("ossSvs2", [ } function doCopyFile(source, target, fn) { - var client = getClient({ + const client = getClient3({ region: region, bucket: target.bucket, }); @@ -632,6 +619,7 @@ angular.module("web").factory("ossSvs2", [ { bucket: source.bucket, key: source.path, + versionId: source.versionId, }, { bucket: target.bucket, @@ -690,7 +678,7 @@ angular.module("web").factory("ossSvs2", [ }; c++; - if (item.isFile) { + if (!item.name.endsWith("/")) { doCopyFile(item, newTarget, function (err) { if (err) { progress.errorCount++; @@ -736,44 +724,23 @@ angular.module("web").factory("ossSvs2", [ } //移动文件,重命名文件 - function moveFile(region, bucket, oldKey, newKey, isCopy) { - var df = $q.defer(); - var client = getClient({ - region: region, - bucket: bucket, + function moveFile(region, bucket, oldKey, newKey, isCopy, versionId) { + const client = getClient3({ + region, + bucket, }); - client.copyObject( - { - Bucket: bucket, - Key: newKey, - CopySource: "/" + bucket + "/" + encodeURIComponent(oldKey), - MetadataDirective: "COPY", // 'REPLACE' 表示覆盖 meta 信息,'COPY' 表示不覆盖,只拷贝, - }, - function (err) { - if (err) { - df.reject(err); - handleError(err); - } else { - if (isCopy) { - df.resolve(); - } else { - client.deleteObject( - { - Bucket: bucket, - Key: oldKey, - }, - function (err) { - if (err) { - df.reject(err); - handleError(err); - } else df.resolve(); - } - ); - } + const options = versionId === undefined ? undefined : { versionId }; + return client + .copy(newKey, oldKey, bucket, options) + .then(() => { + if (!isCopy) { + return client.delete(oldKey, options); } - } - ); - return df.promise; + }) + .catch((err) => { + handleError(err); + return Promise.reject(err); + }); } /**************************************/ @@ -798,6 +765,7 @@ angular.module("web").factory("ossSvs2", [ ); client.listMultipartUploads(opt, function (err, result) { if (err) { + handleError(err); df.reject(err); return; } @@ -849,8 +817,10 @@ angular.module("web").factory("ossSvs2", [ UploadId: uploads[c].uploadId, }, function (err) { - if (err) df.reject(err); - else { + if (err) { + handleError(err); + df.reject(err); + } else { c++; $timeout(dig, NEXT_TICK); } @@ -976,59 +946,23 @@ angular.module("web").factory("ossSvs2", [ return df.promise; } - function getACL(region, bucket, key) { - return new Promise(function (a, b) { - var client = getClient({ - region: region, - bucket: bucket, - }); - client.getObjectAcl( - { - Bucket: bucket, - Key: key, - }, - function (err, data) { - if (err) { - handleError(err); - b(err); - } else { - if (data.Grants && data.Grants.length == 1) { - var t = []; - for (var k in data.Grants[0]) { - t.push(data.Grants[0][k]); - } - data.acl = t.join(""); - } else { - data.acl = "default"; - } - a(data); - } - } - ); + function getACL(region, bucket, key, options) { + const client = getClient3({ + region, + bucket, + }); + + return client.getACL(key, options).catch((err) => { + handleError(err); + return Promise.reject(err); }); } - function updateACL(region, bucket, key, acl) { - return new Promise(function (a, b) { - var client = getClient({ - region: region, - bucket: bucket, - }); - client.putObjectAcl( - { - Bucket: bucket, - Key: key, - ACL: acl, - }, - function (err, data) { - if (err) { - handleError(err); - b(err); - } else { - a(data); - } - } - ); + function updateACL(region, bucket, key, acl, options) { + const client = getClient3({ region, bucket }); + return client.putACL(key, acl, options).catch((err) => { + handleError(err); + return Promise.reject(err); }); } @@ -1055,21 +989,18 @@ angular.module("web").factory("ossSvs2", [ }); } - function getContent(region, bucket, key) { - return new Promise(function (a, b) { - const client = getClient3({ - region: region, - bucket: bucket, - }); - client - .get(key) - .then((resp) => { - a(resp); - }) - .catch((err) => { - handleError(err); - b(err); - }); + function getContent(region, bucket, key, versionId) { + const client = getClient3({ + region: region, + bucket: bucket, + }); + const options = {}; + if (versionId !== undefined) { + options.versionId = versionId; + } + return client.get(key, options).catch((err) => { + handleError(err); + return Promise.reject(err); }); } @@ -1179,7 +1110,7 @@ angular.module("web").factory("ossSvs2", [ }); } - function getMeta2(region, bucket, key) { + function getMeta2(region, bucket, key, options) { const client = getClient3({ region, bucket }); function adapter(obj) { const outputStructure = { @@ -1267,9 +1198,16 @@ angular.module("web").factory("ossSvs2", [ headers["x-oss-request-id"] || headers["x-oss-requestid"]; return output; } - return client.head(key).then((res) => { - return adapter(res); - }); + + return client + .head(key, options) + .then((res) => { + return adapter(res); + }) + .catch((err) => { + handleError(err); + return Promise.reject(err); + }); } function setMeta(region, bucket, key, headers, metas) { @@ -1304,80 +1242,29 @@ angular.module("web").factory("ossSvs2", [ }); } - function setMeta2(region, bucket, key, headers, meta) { + function setMeta2(region, bucket, key, options) { const client = getClient3({ region, bucket }); - return client - .copy(key, key, { - headers, - meta, - }) - .catch(handleError); + return client.copy(key, key, options).catch((err) => { + handleError(err); + return Promise.reject(err); + }); } - function restoreFile(region, bucket, key, days) { + function restoreFile(region, bucket, key, options) { return new Promise(function (a, b) { - var client = getClient({ + var client = getClient3({ region: region, bucket: bucket, }); - var opt = { - Bucket: bucket, - Key: key, - RestoreRequest: { - Days: days || 7, - }, - }; - - client.restoreObject(opt, function (err, data) { - if (err) { - handleError(err); - b(err); - } else { + client + .restore(key, options) + .then((data) => { a(data); - } - }); - }); - } - - function listFiles(region, bucket, key, marker) { - return new Promise(function (a, b) { - let ready = []; - - function get(m) { - return _listFilesOrigion(region, bucket, key, m).then((result) => { - if (result.data) { - ready = ready.concat(result.data); - if ( - ready.length < result.maxKeys && - result.truncated && - result.marker - ) { - return get(result.marker); - } - } - return { - data: ready, - marker: result.marker, - truncated: result.truncated, - maxKeys: result.maxKeys, - }; + }) + .catch((e) => { + handleError(e); + b(e); }); - } - - get(marker).then( - function (result) { - var arr = result.data; - if (arr && arr.length) { - $timeout(() => { - loadStorageStatus(region, bucket, arr); - }, NEXT_TICK); - } - a(result); - }, - function (err) { - b(err); - } - ); }); } @@ -1424,32 +1311,6 @@ angular.module("web").factory("ossSvs2", [ }); } - function loadObjectSymlinkMeta(region, bucket, key) { - const client = getClient3({ region, bucket }); - return new Promise((a, b) => { - client - .getSymlink(key) - .then((data) => a(data)) - .catch((e) => { - handleError(e); - b(e); - }); - }); - } - - function putObjectSymlinkMeta(region, bucket, key, targetName) { - const client = getClient3({ region, bucket }); - return new Promise((a, b) => { - client - .putSymlink(key, targetName) - .then((data) => a(data)) - .catch((e) => { - handleError(e); - b(e); - }); - }); - } - function _listFilesOrigion(region, bucket, key, marker) { return new Promise(function (resolve, reject) { var client = getClient({ @@ -1520,8 +1381,6 @@ angular.module("web").factory("ossSvs2", [ resolve({ data: t_pre.concat(t), marker: result.NextMarker, - truncated: result.IsTruncated, - maxKeys: result.MaxKeys, }); }); }); @@ -1625,11 +1484,74 @@ angular.module("web").factory("ossSvs2", [ } }); } + } - ////////////////////////// - this.abort = function () { - stopFlag = true; - }; + function listFiles(region, bucket, key, marker) { + return new Promise(function (a, b) { + let ready = []; + + function get(m) { + return _listFilesOrigion(region, bucket, key, m).then((result) => { + if (result.data) { + ready = ready.concat(result.data); + if ( + ready.length < result.maxKeys && + result.truncated && + result.marker + ) { + return get(result.marker); + } + } + return { + data: ready, + marker: result.marker, + truncated: result.truncated, + maxKeys: result.maxKeys, + }; + }); + } + + get(marker).then( + function (result) { + var arr = result.data; + if (arr && arr.length) { + $timeout(() => { + loadStorageStatus(region, bucket, arr); + }, NEXT_TICK); + } + a(result); + }, + function (err) { + b(err); + } + ); + }); + } + + function loadObjectSymlinkMeta(region, bucket, key) { + const client = getClient3({ region, bucket }); + return new Promise((a, b) => { + client + .getSymlink(key) + .then((data) => a(data)) + .catch((e) => { + handleError(e); + b(e); + }); + }); + } + + function putObjectSymlinkMeta(region, bucket, key, targetName) { + const client = getClient3({ region, bucket }); + return new Promise((a, b) => { + client + .putSymlink(key, targetName) + .then((data) => a(data)) + .catch((e) => { + handleError(e); + b(e); + }); + }); } function listAllBuckets() { @@ -1681,6 +1603,31 @@ angular.module("web").factory("ossSvs2", [ }); } + // 检查该bucket是否支持多版本控制 + function checkBucketIsSupportMultiVersion(region, bucket) { + console.log("checkBucketIsSupportMultiVersion", region, bucket); + const STATUS_MULTI_VERSIONS = ["Enabled", "Suspended"]; + const store = getClient3({ region, bucket }); + return store + .getBucketVersioning(bucket) + .then(({ versionStatus }) => + STATUS_MULTI_VERSIONS.includes(versionStatus) + ) + .catch((err) => { + handleError(err); + return Promise.reject(err); + }); + } + + // 获取bucket的objects历史版本 + function getBucketVersions(region, bucket, options) { + const store = getClient3({ region, bucket }); + return store.getBucketVersions(options).catch((err) => { + handleError(err); + return Promise.reject(err); + }); + } + function parseRestoreInfo(s) { //"ongoing-request="true" var arr = s.match(/([\w-]+)="([^"]+)"/g); @@ -1713,10 +1660,13 @@ angular.module("web").factory("ossSvs2", [ err.message.indexOf("ENOTFOUND") != -1 ) { console.error(err); - } else - Toast.error(err.code + ": " + err.message, undefined, err.requestId); + } else { + // 兼容ali-oss, ali-yun sdk + const requestId = + err.requestId || err.RequestId || err.headers["x-oss-request-id"]; + Toast.error(err.code + ": " + err.message, undefined, requestId); + } } - return Promise.reject(err); } /** @@ -1774,8 +1724,7 @@ angular.module("web").factory("ossSvs2", [ var str = ossPath.substring(DEF_ADDR.length); var ind = str.indexOf("/"); - let bucket; - let key; + let bucket, key; if (ind == -1) { bucket = str; key = ""; @@ -1877,7 +1826,7 @@ angular.module("web").factory("ossSvs2", [ } function listAllCustomDomains(bucket, options) { - const client = getClient2({ + const client = getClient3({ bucket: bucket, }); @@ -1898,7 +1847,10 @@ angular.module("web").factory("ossSvs2", [ return Cname.map((_) => _.Domain); }; - return client.getCnameList(bucket); + return client.getCnameList(bucket).catch((err) => { + handleError(err); + return Promise.reject(err); + }); } }, ]); diff --git a/app/index.html b/app/index.html index c1d7ab9c..d950cba7 100644 --- a/app/index.html +++ b/app/index.html @@ -63,7 +63,7 @@ if (window.module) module = window.module; - +