Skip to content

Commit

Permalink
Merge pull request #56 from willnewii/dev
Browse files Browse the repository at this point in the history
0.3.0
  • Loading branch information
willnewii authored Dec 25, 2018
2 parents 849fc56 + 8a8f275 commit ce5aea5
Show file tree
Hide file tree
Showing 33 changed files with 498 additions and 302 deletions.
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# 云存储管理客户端 v0.2.2
![](http://blog-res.mayday5.me/niu_128.png?imageView2/1/w/30/h/30/q/75|imageslim)
> 云存储管理客户端。支持七牛云、腾讯云、青云。仿文件夹式管理、图片预览、拖拽上传、文件夹上传、同步、批量导出URL等功能
# 云存储管理客户端 v0.3.0

![](http://blog-res.mayday5.me/file/icon.png?imageView2/1/w/80/h/80/q/75|imageslim) 女朋友给做的新图标😜
> 云存储管理客户端。支持七牛云、腾讯云、青云、阿里云、又拍云。仿文件夹式管理、图片预览、拖拽上传、文件夹上传、同步、批量导出URL等功能
## 效果图
【目前已支持 七牛云、腾讯云、青云】
![%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202018-11-20%20%E4%B8%8B%E5%8D%883.50.48.png](http://blog-res.mayday5.me/img/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202018-11-20%20%E4%B8%8B%E5%8D%883.50.48.png)
【目前已支持 七牛云、腾讯云、青云、阿里云、又拍云
![屏幕快照 2018-12-25 下午4.02.10.png](http://blog-res.mayday5.me/img/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202018-12-25%20%E4%B8%8B%E5%8D%884.02.10.png)

多选 按住 mac:command win:ctrl
![qiniuClient-1.0.0截图1.png](http://blog-res.mayday5.me/img/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202018-10-24%20%E4%B8%8B%E5%8D%885.10.48.png)
批量选择
![屏幕快照 2018-12-25 下午4.26.14.png](http://blog-res.mayday5.me/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202018-12-25%20%E4%B8%8B%E5%8D%884.26.14.png)

【右键菜单&dark 配色】
![qiniuClient-1.0.0截图2.png](http://blog-res.mayday5.me/img/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202018-10-24%20%E4%B8%8B%E5%8D%885.05.42.png)
![屏幕快照 2018-12-25 下午4.28.47.png](http://blog-res.mayday5.me/img/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202018-12-25%20%E4%B8%8B%E5%8D%884.28.47.png)

## 更新说明
2018.12.25
***
- 🎄圣诞快乐~
- 优化了构建流程
- 新增分页模式,针对七牛云文件量很大的用户,应该会好一些.
- 新增支持**又拍云**对象存储
2018.12.07
***
- 腾讯云支持自定义域名
Expand Down Expand Up @@ -52,8 +59,8 @@ old
- 私有空间操作([说明](https://github.com/willnewii/qiniuClient/wiki/%E4%B8%83%E7%89%9B%E7%A7%81%E6%9C%89%E7%A9%BA%E9%97%B4%E5%92%8C%E6%8E%88%E6%9D%83%E7%A9%BA%E9%97%B4%E5%A4%84%E7%90%86)

## 下载
- [mac v0.2.2](http://blog-res.mayday5.me/file/%E4%BA%91%E5%AD%98%E5%82%A8%E7%AE%A1%E7%90%86%E5%AE%A2%E6%88%B7%E7%AB%AF-0.2.2-1207-mac.dmg)
- [win v0.2.0](http://blog-res.mayday5.me/file/COS%E7%AE%A1%E7%90%86%E5%AE%A2%E6%88%B7%E7%AB%AF-0.2.0-win_2.exe)
- [云存储管理客户端-0.3.0-mac.dmg](http://blog-res.mayday5.me/file/%E4%BA%91%E5%AD%98%E5%82%A8%E7%AE%A1%E7%90%86%E5%AE%A2%E6%88%B7%E7%AB%AF-0.3.0-mac.dmg)
- [云存储管理客户端-0.3.0-win.exe](http://blog-res.mayday5.me/file/%E4%BA%91%E5%AD%98%E5%82%A8%E7%AE%A1%E7%90%86%E5%AE%A2%E6%88%B7%E7%AB%AF-0.3.0-win.exe)

## Build Setup
``` bash
Expand All @@ -76,7 +83,6 @@ npm run build:win32
- [vue-virtual-scroll-list](https://github.com/tangbc/vue-virtual-scroll-list)

## 参考资料
- [图标来源:懒人图库](http://www.lanrentuku.com/vector/animal/lansexinxianniunaibiaoqian-shiliang.html)
- [electron 文档](https://github.com/electron/electron/tree/master/docs-translations/zh-CN)
- [electron-vue 文档](https://simulatedgreg.gitbooks.io/electron-vue/cn/)
- [七牛API](https://developer.qiniu.com/kodo/api/1731/api-overview)
Expand Down
Binary file modified build/icons/icon.icns
Binary file not shown.
Binary file modified build/icons/icon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "qiniuclient",
"cnname": "云存储管理客户端",
"version": "0.2.3",
"version": "0.3.0",
"description": "云存储管理客户端。仿文件夹式管理、图片预览、拖拽上传、文件夹上传、同步、批量导出URL等功能",
"author": "诗人的咸鱼 <[email protected]>",
"license": "MIT",
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
computed: {
...mapGetters({
setup_theme: types.setup.setup_theme,
setup_theme: types.setup.theme,
}),
appHeight() {
if (document.getElementById('title'))
Expand All @@ -29,7 +29,7 @@
document.getElementById('title').remove();
}*/
this[types.setup.setup_init](() => {
this[types.setup.init](() => {
if (this.setup_theme === 'auto') {
this.$electron.ipcRenderer.on(Constants.Listener.darkMode, (event, arg) => {
util.loadTheme(arg ? 'dark' : 'light');
Expand All @@ -42,7 +42,7 @@
},
methods: {
...mapActions([
types.setup.setup_init,
types.setup.init,
]),
}
};
Expand Down
10 changes: 6 additions & 4 deletions src/renderer/api/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
*/
import axios from 'axios';
import config from './config';
import * as util from '../service/util';

import Qs from 'qs';

class API {

constructor(view) {
this.view = view;
this.config = util.deepCopy(config);
}

post(url, param) {
Expand All @@ -24,19 +26,19 @@ class API {
}

setAuthorization(authorization) {
config.headers.Authorization = authorization;
this.config.headers.Authorization = authorization;
}

_request(url, type, param) {
this.view && this.view.$Loading.start();

config.method = type;
this.config.method = type;

let request;
if (type === 'get') {
request = axios.get(url, config);
request = axios.get(url, this.config);
} else {
request = axios[type](url, param, config);
request = axios[type](url, param, this.config);
}

request.then((response) => {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/api/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
onDownloadProgress: function (progressEvent) {
// Do whatever you want with the native progress event
},
maxContentLength: 2000,
maxContentLength: 5000,
validateStatus: function (status) {
return status >= 200 && status < 300; // default
},
Expand Down
Binary file modified src/renderer/assets/img/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 19 additions & 17 deletions src/renderer/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,20 @@
</div>
</template>

<div @mouseenter="toggleShow($event)" @mouseleave="toggleShow($event)">
<i-button class="button" type="text" @click="actionBtn(6)" v-if="bucket.name">
<Tooltip :content="`同步bucket:${bucket.name}`" placement="bottom">
<Icon type="md-sync" size="24"/>
</Tooltip>
<Dropdown @on-click="clickMore">
<i-button class="button" type="text" v-if="bucket.name">
<Icon type="md-more" size="24"/>
</i-button>
</div>
<DropdownMenu slot="list">
<DropdownItem name="7" @click="actionBtn(7)">
{{`批量导出资源URL`}}
</DropdownItem>
<DropdownItem name="6" @click="actionBtn(6)">
同步bucket
</DropdownItem>
</DropdownMenu>
</Dropdown>

<div @mouseenter="toggleShow($event)" @mouseleave="toggleShow($event)">
<i-button class="button" type="text" @click="actionBtn(7)" v-if="bucket.name">
<Tooltip :content="`批量导出bucket:${bucket.name} URL`" placement="bottom">
<Icon type="md-code-download" size="24"/>
</Tooltip>
</i-button>
</div>
<Input class="input-search" v-model="search" placeholder="搜索" icon="md-close-circle"
@on-enter="actionBtn(2)" @on-click="clearSearch"
v-show="bucket.name"/>
Expand Down Expand Up @@ -91,7 +90,7 @@
},
computed: {
...mapGetters({
customedomain: types.setup.setup_customedomain,
customedomain: types.setup.customedomain,
}),
domainPlaceholder() {
switch (this.$storage.name) {
Expand Down Expand Up @@ -129,7 +128,7 @@
},
methods: {
...mapActions([
types.setup.setup_a_customedomain,
types.setup.a_customedomain,
]),
updateSupport() {
this.isSupportUrlUpload = [brand.qiniu.key, brand.qingstor.key].indexOf(this.$storage.name) !== -1;
Expand All @@ -141,7 +140,7 @@
if (val.length === 0) {//腾讯云有默认链接
let obj = {};
obj[this.bucket.name] = '';
this[types.setup.setup_a_customedomain](obj);
this[types.setup.a_customedomain](obj);
return;
}
Expand All @@ -151,7 +150,7 @@
let obj = {};
obj[this.bucket.name] = url.origin;
this.bucket.domain = url.origin;
this[types.setup.setup_a_customedomain](obj);
this[types.setup.a_customedomain](obj);
this.$Message.success('自定义域名保存成功,请刷新页面');
}
} catch (err) {
Expand Down Expand Up @@ -200,6 +199,9 @@
this.$parent.exportURL();
break;
}
},
clickMore(name) {
this.actionBtn(name);
}
}
};
Expand Down
29 changes: 19 additions & 10 deletions src/renderer/components/ResourceGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,12 @@
this.selectFile(index);
} else {
if (file._directory) {
console.log(file._path);
if (this.bucket.paging) {//切换目录模式,需要重置marker
this.bucket.marker = null;
this.bucket.getResources({
keyword: file._path
});
}
this.bucket.folderPath = file._path;
} else {
if (util.isSupportImage(file.mimeType)) {
Expand Down Expand Up @@ -299,21 +304,25 @@
}
}
//去除前缀然后再split
if (file.type === 'F') {//又拍云文件夹类型判断
files.push({
key: file.key,
_name: file.key,
_path: (folderPath ? folderPath + Constants.DELIMITER : '') + file.key,
if (file.type === Constants.FileType.folder) {//又拍云文件夹类型判断 && 七牛也用次参数来判断文件夹
let temp = {
key: temp_key.replace(folderPath + Constants.DELIMITER, ''),
_name: temp_key.replace(folderPath + Constants.DELIMITER, ''),
_path: file.key,
_directory: true,
_icon: 'md-folder',
_contextmenu: 'folderMenu'
});
};
console.log(temp);
if (this.$storage.name === brand.qiniu.key) {
temp._name = temp_key.replace(folderPath + Constants.DELIMITER, '');
temp._path = file.key;
}
files.push(temp);
return;
} else if (folderPath.length > 0) {
} else if (folderPath.length > 0) {//去除前缀然后再split
temp_key = temp_key.replace(folderPath + Constants.DELIMITER, '');
}
let temps = temp_key.split(Constants.DELIMITER);
//根据分隔符切分,如果 length ===1 ,则为文件,否则为下级目录
if (temps.length === 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/UploadModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
computed: {
...mapGetters({
setup_isOverwrite: types.setup.setup_isOverwrite,
setup_isOverwrite: types.setup.isOverwrite,
})
},
created() {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/cos/CloudObjectStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class CloudObjectStorage {

getBuckets(callback) {
this.cos.getBuckets((error, result) => {
console.log(result);
console.log("获取存储桶===>", result);
callback && callback(error, result);
});
}
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/cos/aliBucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ class Bucket extends baseBucket {
callback && callback();
}

getResources(keyword) {
getResources(option = {}) {
//delimiter
let params = {
'max-keys': this.limit,
};

if (keyword) {
params.prefix = keyword;
if (option.keyword) {
params.prefix = option.keyword;
}

if (this.marker) {
Expand All @@ -93,7 +93,7 @@ class Bucket extends baseBucket {

data.items = files;
data.marker = data.nextMarker;
this.appendResources(data, keyword);
this.appendResources(data, option);
});
}

Expand Down
Loading

0 comments on commit ce5aea5

Please sign in to comment.