Skip to content

Commit

Permalink
增加英文文档
Browse files Browse the repository at this point in the history
  • Loading branch information
aleelock committed Nov 8, 2017
1 parent 7f43498 commit 3d86e14
Show file tree
Hide file tree
Showing 14 changed files with 194 additions and 52 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ mac:
rm -rf releases/$(VERSION)/$(NAME)-darwin-x64.zip && mkdir -p releases/$(VERSION)
cd build && zip ../releases/$(VERSION)/$(NAME)-darwin-x64.zip -r $(NAME)-darwin-x64
dmg:
npm run mac
rm -rf releases/$(VERSION)/$(NAME)-darwin-x64.zip && mkdir -p releases/$(VERSION)
rm build/$(NAME)-darwin-x64/LICENSE* build/$(NAME)-darwin-x64/version
ln -s /Applications/ build/$(NAME)-darwin-x64/Applications
#cp dist/icons/icon.icns build/$(NAME)-darwin-x64/.VolumeIcon.icns
Expand Down
93 changes: 49 additions & 44 deletions app/main/modals/about.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,56 @@
'use strict';

angular.module('web')
.controller('aboutCtrl', ['$scope','$state','$uibModalInstance','upgradeSvs','safeApply','Toast',
function($scope,$state,$modalInstance,upgradeSvs,safeApply, Toast){

angular.extend($scope, {
cancel: cancel,
open: open,
app_logo: Global.app.logo,
info: {
currentVersion: Global.app.version
},
custom_about_html: Global.about_html
});

init();
function init(){
$scope.isLoading=true;
upgradeSvs.load(function(info){
$scope.isLoading=false;

angular.extend($scope.info, info);

safeApply($scope);

//不是最新版本,获取最新版本的releaseNote
if(!$scope.info.isLastVersion){
var converter = new showdown.Converter();
upgradeSvs.getLastestReleaseNote($scope.info.lastVersion, function(text){

text = text + '';
var html = converter.makeHtml(text);
$scope.info.lastReleaseNote = html;

safeApply($scope);
})
}
.controller('aboutCtrl', ['$scope', '$state', '$uibModalInstance',
'upgradeSvs', 'safeApply', 'Toast',
function($scope, $state, $modalInstance, upgradeSvs, safeApply, Toast) {

angular.extend($scope, {
cancel: cancel,
open: open,
app_logo: Global.app.logo,
info: {
currentVersion: Global.app.version
},
custom_about_html: Global.about_html
});
}

function open(a){
openExternal(a);
}
init();

function cancel(){
$modalInstance.dismiss('close');
}
function init() {
if (!Global.upgrade_url) return;

$scope.isLoading = true;
upgradeSvs.load(function(info) {
$scope.isLoading = false;

angular.extend($scope.info, info);

safeApply($scope);

}])
;
//不是最新版本,获取最新版本的releaseNote
if (!$scope.info.isLastVersion) {
var converter = new showdown.Converter();
upgradeSvs.getLastestReleaseNote($scope.info.lastVersion,
function(text) {

text = text + '';
var html = converter.makeHtml(text);
$scope.info.lastReleaseNote = html;

safeApply($scope);
})
}
});
}

function open(a) {
openExternal(a);
}

function cancel() {
$modalInstance.dismiss('close');
}

}
]);
File renamed without changes.
File renamed without changes.
File renamed without changes
6 changes: 3 additions & 3 deletions custom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ module.exports= {


//logo png 格式, 主要用于mac和linux系统
logo_png: path.join(__dirname, './logo.png'),
logo_png: path.join(__dirname, './icon.png'),

//logo icns 格式,主要用于mac系统
logo_ico: path.join(__dirname, './logo.icns'),
logo_ico: path.join(__dirname, './icon.icns'),

//logo ico 格式,主要用于windows系统
logo_ico: path.join(__dirname, './logo.ico'),
logo_ico: path.join(__dirname, './icon.ico'),


//release notes目录后缀,里面有 ${version}.md, 如 1.0.0.md
Expand Down
7 changes: 7 additions & 0 deletions docs/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ OSS 浏览器文档
* [AK登录](aklogin.md)
* [临时授权码支持](authToken.md)
* [邮件设置](smtpSetting.md)


For English:

* [Access Key-based logon](en-aklogin.md)
* [Authorization code support](en-authToken.md)
* [邮件设置](en-smtpSetting.md)
3 changes: 2 additions & 1 deletion docs/aklogin.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# AK登录

> [For English](en-aklogin.md)
### 1. 大权限子账号AK登录

* 不推荐使用主账号AK登录。推荐大权限子账号。
Expand All @@ -12,7 +14,6 @@

![](../preview/genToken1.png)


#### (1) 公有云登录样例:

![](../preview/login.png)
Expand Down
4 changes: 3 additions & 1 deletion docs/authToken.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 授权码支持

> [For English](en-authToken.md)
主要支持2个功能:

1. 使用阿里云STS服务临时授权得到授权码。
Expand Down Expand Up @@ -38,7 +40,7 @@

如果您使用程序生成授权码, 请按照以下格式生成:

```
```javascript
var opt = {
id: '',
secret: '',
Expand Down
32 changes: 32 additions & 0 deletions docs/en-aklogin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Access Key-based logon

## 1. Logon using the Access Key of a subaccount with high-level privilege

* The primary account is not recommended for Access Key-based logon. A subaccount with high-level privilege is recommended.

* Go to the [RAM console](https://ram.console.aliyun.com) to create a subaccount Access Key.

* The subaccount must be assigned the "AliyunSTSAssumeRoleAccess" and "AliyunRAMReadOnlyAccess" permissions and the permission to access the directory to be authorized.

* Authorization of the subaccount with high-level privilege (recommended configuration for novice users):

![](../preview/genToken1.png)


(1) Example of logon to public cloud:

![](../preview/login.png)

(2) Example of logon to private cloud:

![](../preview/login2.png)

2. Logon using a subaccount with low-level privilege

Assume that a subaccount is assigned the read or write permission on the `oss://aabbcc4/dd/` directory. The subaccount is considered to have low-level privilege. Logon using this subaccount is as follows:

![](../preview/login-subak1.png)

Or:

![](../preview/login-subak2.png)
60 changes: 60 additions & 0 deletions docs/en-authToken.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Authorization code support

Two functions are supported:

Obtain an authorization code by using the on-demand authorization function of Alibaba Cloud Security Token Service (STS).

Log on to the OSS browser by using the authorization code.

For details, visit https://help.aliyun.com/document_detail/31935.html

## 1. Create a role

Create a role in accordance with the instructions described in [STS On-demand Access Authorization](https://help.aliyun.com/document_detail/31935.html).

## 2. Generate an authorization code in the OSS browser

* Log on using the Access Key of a subaccount rather than the primary account.

* The subaccount must be assigned the "AliyunSTSAssumeRoleAccess" and "AliyunRAMReadOnlyAccess" permissions and the permission to access the directory to be authorized.

Subaccount authorization (recommended configuration for novice users):

![](../preview/genToken1.png)


Authorization in the OSS browser:


![](../preview/genToken2.png)

![](../preview/genToken3.png)



3. Logon using the authorization code:

![](../preview/token-login.png)

4. Authorization code format

The authorization code generated by a program must adopt the following format:

```javascript
var opt = {
id: '',
secret: '',
stoken: '',
privilege: '',
expiration: '',
osspath: ''
};

//toString
opt = JSON.stringify(opt);

//base64 encode
Buffer.from(opt, 'base64').toString();
```

For details, see the following code: [app/main/files/modals/grant-token-modal.js](app/main/files/modals/grant-token-modal.js).
35 changes: 35 additions & 0 deletions docs/en-smtpSetting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Email sending settings

## Examples:

#### 1. QQ Mail:

```
"host": "smtp.qq.com",
"port": 465,
"secure": true
```

#### 2. Gmail:

```
"host": "smtp.gmail.com",
"port": 465,
"secure": true
```

#### 3. 126

```
"host": "smtp.126.com",
"port": 465,
"secure": true
```

#### 4. 163

```
"host": "smtp.163.com",
"port": 465,
"secure": true
```
2 changes: 2 additions & 0 deletions docs/smtpSetting.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 邮件发送设置

> [For English](en-smtpSetting.md)
## 举例参考:


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build": "gulp build",
"win64": "cross-env ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ electron-packager ./dist --asar --overwrite --out=build --version=1.7.5 --platform=win32 --arch=x64",
"win32": "cross-env ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ electron-packager ./dist --asar --overwrite --out=build --version=1.7.5 --platform=win32 --arch=ia32",
"mac": "cross-env ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ electron-packager ./dist --asar --overwrite --out=build --version=1.7.5 --platform=darwin --arch=x64 --icon=./custom/logo.icns",
"mac": "cross-env ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ electron-packager ./dist --asar --overwrite --out=build --version=1.7.5 --platform=darwin --arch=x64 --icon=./custom/icon.icns",
"linux32": "cross-env ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ electron-packager ./dist --asar --overwrite --out=build --version=1.7.5 --platform=linux --arch=ia32",
"linux64": "cross-env ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ electron-packager ./dist --asar --overwrite --out=build --version=1.7.5 --platform=linux --arch=x64",
"all": "cross-env ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ electron-packager ./dist --asar --overwrite --out=build --version=1.7.5 --all --icon=./custom/"
Expand Down

0 comments on commit 3d86e14

Please sign in to comment.