Skip to content

Commit

Permalink
v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
evercyan committed Apr 19, 2022
1 parent 6ff6c5b commit 0811031
Show file tree
Hide file tree
Showing 49 changed files with 13,262 additions and 10,275 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ bin/*
.idea/
.scannerwork/
logs/
build/
build/bin
build/darwin
info.plist

# frontend
node_modules/
dist/
package.json.md5

Cantor.dmg

38 changes: 27 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,39 @@
APP := "Cantor"
CREATE_DMG ?= $(shell which create-dmg)

define check
command -v $(1) 1>/dev/null || $(2)
endef

help:
@echo "Usage:"
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'

## run: 启动调试模式
run:
wails serve

## cli: 编译可执行文件
cli:
wails build -d
dev:
wails dev

## app: 编译 app 文件
app: clean
wails build -p
## build: 编译 app 文件
build: clean
wails build

## clean: 清除编译的程序
clean:
rm -rf ./build/*
rm -rf ./build/bin/*
rm -rf ./Cantor.dmg

## dmg: 生成 dmg 文件
dmg: build
@@$(call check,create-dmg,brew install create-dmg)
$(CREATE_DMG) \
--volname "Cantor" \
--background "assets/background.png" \
--window-size 558 367 \
--icon-size 100 \
--icon "Cantor.app" 200 190 \
--hide-extension "Cantor.app" \
--app-drop-link 370 190 \
"Cantor.dmg" \
"build/bin/"

.PHONY: clean run cli app help
.PHONY: help clean dev build dmg
82 changes: 40 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,54 @@

[![goreportcard](https://goreportcard.com/badge/github.com/evercyan/cantor)](https://goreportcard.com/report/github.com/evercyan/cantor)

基于 [wails](https://github.com/wailsapp/wails) + [vue](https://cn.vuejs.org/) + [github-api](https://docs.github.com/cn/rest/reference/repos#contents) 实现的个人图床 mac app
一个简单好用的图床应用

[点我下载 Cantor-v0.0.6.dmg](https://github.com/evercyan/cantor/releases/download/v0.0.6/Cantor-v0.0.6.dmg)
</div>

---

## QA

- Cantor 名字由来
- 有一位数学家名叫 Georg Cantor
- 他的成就之一就是集合论
- Cantor, 意指 "康托尔集", 实指 "图床"


- 使用应用前的准备工作
- 自己的 GitHub 账号, e.g. `evercyan`
- 自己的邮箱(commit 使用), e.g. `evercyan@qq.com`
- 新建一个 GitHub 仓库, e.g. `evercyan/repository`
- 申请 GitHub access_token [点击申请](https://github.com/settings/tokens)


- 如何使用应用
- 打开应用
- 设置 GihHub 配置
```
未配置时, 会自动打开配置窗口
后面可以通过点击设置按钮触发
配置存储于 `~/.cantor/config.json`
```
- 上传图片
```text
点击左侧上传按钮, 选择图片文件进行添加
应用会通过 GitHub Api 将图片文件上传至配置中的仓库
同时会写入本地数据库 ~/.cantor/cantor.db
并同步 cantor.db 到 仓库/resource/cantor.db
```

- blabla...
- app 实测支持 Mac 10.14+, 其他平台需自行下载源码编译
- 应用日志存储于 ~/.cantor/app.log
- 上传图片大小最大为 2M
- 上传图片格式只支持 png gif jpg jpeg
## Install

[点击下载](https://github.com/evercyan/cantor/releases/download/v0.1.0/Cantor-v0.1.0.dmg) Mac Cantor-v0.1.0.dmg

或者 `git clone` 源码自行编译, 可支持多平台

---

## Snapshot
## Prepare

- 有一个 GitHub 账号, e.g. `evercyan`
- 有一个自己的邮箱, commit 时使用, e.g. `evercyan@qq.com`
- 有一个仓库, e.g. `evercyan/repository`
- 申请 GitHub access_token [点击申请](https://github.com/settings/tokens)

---

## Usage

![cantor-1](https://cdn.jsdelivr.net/gh/evercyan/repository/resource/76/763cda4bd4b0e2fd359799311383cf65.png)
- 打开应用

![cantor-2](https://cdn.jsdelivr.net/gh/evercyan/repository/resource/43/431c46df6fc2171e08d6fbfa174d6562.png)
- GitHub 配置
```text
未配置时, 会自动打开编辑窗口, 也可以通过点击设置按钮触发编辑窗口
配置存储于 `~/.cantor/config.yaml`
```

- 上传图片
```text
点击上传按钮, 或者菜单-文件-上传图片, 可批量选择图片进行上传
单次最多可上传 10 张图片, 单张图片最大支持 4M, 图片格式仅支持 png gif jpg jpeg
```

- 终端使用

```shell
go install github.com/evercyan/cantor/cmd/cantor@latest
cantor upload ~/demo.png ~/demo1.png
```

---

## Snapshot

![cantor-3](https://cdn.jsdelivr.net/gh/evercyan/repository/resource/d7/d77e72f7234e37c3c5906023a541fb71.png)
![cantor](https://cdn.jsdelivr.net/gh/evercyan/repository/resource/1c/1c98042d7f58d999fdd080dc6bdf68aa.png)
Binary file modified appicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0811031

Please sign in to comment.