Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
CS-Tao committed Aug 1, 2018
2 parents 9a0e599 + 4366d68 commit 35243f6
Show file tree
Hide file tree
Showing 11 changed files with 160 additions and 85 deletions.
26 changes: 6 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,10 @@ script:
#- yarn run pack && xvfb-maybe node_modules/.bin/mocha test/e2e
- yarn build:docs
- yarn build
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar -cf build/linux-unpacked.tar build/linux-unpacked/*; fi

deploy:
- provider: pages
skip-cleanup: true
github-token: $GH_TOKEN
on:
branch:
- master
local-dir: dist/docs
- provider: releases
api_key: $GH_TOKEN
file_glob: true
file:
- build/whu-library-seat-*.dmg
- build/whu-library-seat-*.zip
- build/whu-library-seat-*.AppImage
- build/linux-unpacked.tar
skip_cleanup: true
on:
tags: true
provider: pages
skip-cleanup: true
github-token: $GH_TOKEN
on:
branch: master
local-dir: dist/docs
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,37 @@
## 下载和安装

下载链接:[https://github.com/CS-Tao/whu-library-seat/releases/latest](https://github.com/CS-Tao/whu-library-seat/releases/latest)
### 最新版本

### 下载说明
最新版本(包括预览版): [https://github.com/CS-Tao/whu-library-seat/releases/latest](https://github.com/CS-Tao/whu-library-seat/releases/latest)

### 稳定版本

- Windows
- 安装包: `whu-library-seat.Setup.<version>.exe`
- 免安装: `win-unpacked.zip`
- 安装包: `whu-library-seat-setup-<version>.exe`
- 稳定版本: [v1.0.2](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.0.2/whu-library-seat-setup-1.0.2.exe)

- Mac OS
- 安装包: `whu-library-seat-<version>.dmg`
- 免安装: `whu-library-seat-<version>-mac.zip`
- 稳定版本:[v1.0.2](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.0.2/whu-library-seat-1.0.2.dmg)

- Linux
- 安装包: `whu-library-seat-<version>-x86_64.AppImage`
- 免安装: `linux-unpacked.tar`
- 稳定版本:[v1.0.2](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.0.2/whu-library-seat-1.0.2-x86_64.AppImage)

### 安装软件

下载了安装版的用户请直接执行文件夹中的安装文件安装本软件,下载了免安装绿色版的用户请将解压后的文件夹放到您方便找到的目录下
运行安装包即可

### 申请软件使用权

在您登录之前,软件会检查您的学号是否被记录在[这个文件](https://github.com/CS-Tao/whu-library-seat/blob/user-validation/validation.json)中,只有被记录在这个文件中的学号才能使用本软件,如果您的学号没有被记录,您可以通过邮件[联系我](http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&[email protected])(请在邮件中注明学号、院系和姓名)

当然,因为本软件为开源软件,您可以在遵守本软件[#版权声明](#版权声明)的前提下,自己构建软件并删除其中的认证代码,具体请查看[#面向开发者](#面向开发者)
当然,因为本软件为开源软件,您可以在遵守本软件[版权声明](#版权声明)的前提下,自己构建软件并删除其中的认证代码,具体请查看[面向开发者](#面向开发者)

### 软件更新

软件启动的时候会自动访问[GitHub Release](https://github.com/CS-Tao/whu-library-seat/releases/latest)检查更新,如果有更新,在软件的左下角会出现更新的按钮

## 使用说明

Expand Down Expand Up @@ -72,6 +78,6 @@ yarn build

## 版权声明

本软件开源,但没有向开发者提供任何源码`许可证`,作者本人保留源代码的所有权利,任何组织和个人不得将本软件的全部或部分源码用于商业活动
本软件开源,但没有向开发者提供任何源码`许可证`,作者本人保留源代码的所有权利,任何组织和个人不得将本软件或源码用于商业活动

Copyright © 2018 CS-Tao
23 changes: 4 additions & 19 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# https://simulatedgreg.gitbooks.io/electron-vue/content/en/testing.html#on-the-subject-of-ci-testing
version: 0.1.{build}

branches:
only:
- master

image: Visual Studio 2017
platform:
- x64
Expand All @@ -26,22 +30,3 @@ build_script:
- yarn build

test: off

artifacts:
- path: build/*.exe
name: installer
- path: build/win-unpacked
name: win-unpacked
type: zip

deploy:
description: 'Release by appveyor'
provider: GitHub
auth_token:
secure: 6k7lLw3aFPNhLQDxVsQmkZv/OtFz7IQSLMbLM7nJdltRBAqiej4MkxCPLFzgfak+
artifact: installer, win-unpacked
draft: false
prerelease: false
force_update: true
on:
appveyor_repo_tag: true
2 changes: 1 addition & 1 deletion docs/copyright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ editLink: false
next: false
---
::: warning Copyright © 2018 CS-Tao
本软件开源,但没有向开发者提供任何源码许可证,作者本人保留源代码的所有权利,任何组织和个人不得将本软件的全部或部分源码用于商业活动
本软件开源,但没有向开发者提供任何源码`许可证`,作者本人保留源代码的所有权利,任何组织和个人不得将本软件或源码用于商业活动
:::
20 changes: 13 additions & 7 deletions docs/specification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,34 @@

本软件是针对`武汉大学`图书馆预约系统开发的抢座软件,支持 Windows、Mac OS、Linux 等操作系统

下载链接:[https://github.com/CS-Tao/whu-library-seat/releases/latest](https://github.com/CS-Tao/whu-library-seat/releases/latest)
#### 最新版本

#### 下载说明
最新版本(包括预览版): [https://github.com/CS-Tao/whu-library-seat/releases/latest](https://github.com/CS-Tao/whu-library-seat/releases/latest)

#### 稳定版本

- Windows
- 安装包: `whu-library-seat.Setup.<version>.exe`
- 免安装: `win-unpacked.zip`
- 安装包: `whu-library-seat-setup-<version>.exe`
- 稳定版本: [v1.0.2](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.0.2/whu-library-seat-setup-1.0.2.exe)

- Mac OS
- 安装包: `whu-library-seat-<version>.dmg`
- 免安装: `whu-library-seat-<version>-mac.zip`
- 稳定版本:[v1.0.2](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.0.2/whu-library-seat-1.0.2.dmg)

- Linux
- 安装包: `whu-library-seat-<version>-x86_64.AppImage`
- 免安装: `linux-unpacked.tar`
- 稳定版本:[v1.0.2](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.0.2/whu-library-seat-1.0.2-x86_64.AppImage)

### 安装软件

下载了安装版的用户请直接执行文件夹中的安装文件安装本软件,下载了免安装绿色版的用户请将解压后的文件夹放到您方便找到的目录下
运行安装包即可

### 申请软件使用权

在您登录之前,软件会检查您的学号是否被记录在[这个文件](https://github.com/CS-Tao/whu-library-seat/blob/user-validation/validation.json)中,只有被记录在这个文件中的学号才能使用本软件,如果您的学号没有被记录,您可以通过邮件[联系我](http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&[email protected])(请在邮件中注明学号、院系和姓名)

当然,因为本软件为开源软件,您可以在遵守本软件[版权声明](https://github.com/CS-Tao/whu-library-seat/blob/master/README.md#版权声明)的前提下,自己构建软件并删除其中的认证代码,具体请查看[面向开发者](https://github.com/CS-Tao/whu-library-seat/blob/master/README.md#面向开发者)

### 软件更新

软件启动的时候会自动访问[GitHub Release](https://github.com/CS-Tao/whu-library-seat/releases/latest)检查更新,如果有更新,在软件的左下角会出现更新的按钮
12 changes: 10 additions & 2 deletions docs/specification/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@

最小化窗口

- 关闭
- 退出到托盘

退出软件或将软件隐藏到托盘(详见[设置](/specification/settings.html#退出到托盘)),和窗体自带的关闭按钮功能一致
将软件隐藏到托盘

### 关于

Expand All @@ -48,6 +48,14 @@

打开[项目地址](https://github.com/CS-Tao/whu-library-seat)

- 申请权限

打开[申请软件使用权](https://home.cs-tao.cc/whu-library-seat/specification/#申请软件使用权)

- 申请权限

打开[用户白名单](https://github.com/CS-Tao/whu-library-seat/blob/user-validation/validation.json)

- 问题反馈

[issues](https://github.com/CS-Tao/whu-library-seat/issues/new)页面反馈软件存在的 bug,也可以提出对软件的改进意见
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "whu-library-seat",
"version": "1.0.1",
"version": "1.0.2",
"author": "CS-Tao <[email protected]>",
"description": "武汉大学图书馆抢座软件",
"license": null,
Expand Down Expand Up @@ -54,11 +54,19 @@
},
"linux": {
"icon": "build/icons"
}
},
"publish": [
{
"provider": "github",
"owner": "CS-Tao",
"repo": "whu-library-seat"
}
]
},
"dependencies": {
"axios": "^0.16.1",
"electron-store": "^2.0.0",
"electron-updater": "^3.0.3",
"element-ui": "^2.4.4",
"mockjs": "^1.0.1-beta3",
"vue": "^2.3.3",
Expand Down
53 changes: 38 additions & 15 deletions src/main/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict'

import { autoUpdater } from 'electron-updater'
import { app, BrowserWindow, Menu, Tray, ipcMain } from 'electron'
import path from 'path'
import Store from 'electron-store'
Expand All @@ -21,6 +22,8 @@ const winURL = process.env.NODE_ENV === 'development'
? `http://localhost:9080`
: `file://${__dirname}/index.html`

const appVersion = app.getVersion()

let tray = null
app.on('ready', () => {
tray = new Tray(path.join(__static, '/tray.png'))
Expand Down Expand Up @@ -113,13 +116,24 @@ const template = [
}
},
{ role: 'minimize', label: '最小化' },
{ role: 'close', label: '关闭' }
{
label: '退出到托盘',
click: (menuItem, browserWindow, event) => {
mainWindow.hide()
mainWindow.setSkipTaskbar(true)
}
}
]
},
{
label: '关于',
role: 'about',
submenu: [
{
label: '版本 v' + appVersion,
enabled: false
},
{ type: 'separator' },
{
label: '文档',
click () { require('electron').shell.openExternal('https://home.cs-tao.cc/whu-library-seat/') }
Expand All @@ -128,6 +142,16 @@ const template = [
label: '项目',
click () { require('electron').shell.openExternal('https://github.com/CS-Tao/whu-library-seat') }
},
{ type: 'separator' },
{
label: '申请权限',
click () { require('electron').shell.openExternal('https://home.cs-tao.cc/whu-library-seat/specification/#申请软件使用权') }
},
{
label: '用户白名单',
click () { require('electron').shell.openExternal('https://github.com/CS-Tao/whu-library-seat/blob/user-validation/validation.json') }
},
{ type: 'separator' },
{
label: '问题反馈',
click () { require('electron').shell.openExternal('https://github.com/CS-Tao/whu-library-seat/issues/new') }
Expand Down Expand Up @@ -216,22 +240,21 @@ ipcMain.on('exit-app', (event, arg) => {
}
})

/**
* Auto Updater
*
* Uncomment the following code below and install `electron-updater` to
* support auto updating. Code Signing with a valid certificate is required.
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-electron-builder.html#auto-updating
*/
// 配置自动更新

/*
import { autoUpdater } from 'electron-updater'
ipcMain.on('check-updates', (event, arg) => {
// 检查更新
if (process.env.NODE_ENV === 'production') autoUpdater.checkForUpdates()
})

autoUpdater.on('update-downloaded', () => {
autoUpdater.quitAndInstall()
ipcMain.on('quit-and-install', (event, arg) => {
// 退出安装
if (process.env.NODE_ENV === 'production') autoUpdater.quitAndInstall()
})

app.on('ready', () => {
if (process.env.NODE_ENV === 'production') autoUpdater.checkForUpdates()
autoUpdater.autoInstallOnAppQuit = false

autoUpdater.on('update-downloaded', () => {
// 更新下载完毕
mainWindow.webContents.send('update-downloaded')
})
*/
35 changes: 34 additions & 1 deletion src/renderer/components/Footer/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<template>
<div class="footer" :class="{'footer-unlogin': !hasToken}">
<div class="warper flex-col" @click="openMainBody()">
<span class="text">&nbsp; © 2018 CS-Tao</span>
<span style="cursor: default!important;">&nbsp;&nbsp;</span>
<el-button v-if="updateDownloaded" type="primary" class="el-icon-refresh update-button" @click="quitAndUpdate()">&nbsp;重启更新</el-button>
<span class="text">{{!updateDownloaded?'© 2018 CS-Tao':''}}</span>
<i v-if="!hasToken" class="operation-icon" @click="openSource()">
<svg class="operation-icon" aria-labelledby="simpleicons-github-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-github-icon">GitHub icon</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>
</i>
Expand Down Expand Up @@ -38,6 +40,11 @@ export default {
require: true
}
},
data () {
return {
updateDownloaded: false
}
},
computed: {
...mapGetters([
'userAccount',
Expand All @@ -53,6 +60,12 @@ export default {
return this.userAccount === 2017302590175
}
},
mounted () {
ipcRenderer.on('update-downloaded', () => {
this.updateDownloaded = true
})
ipcRenderer.send('check-updates')
},
methods: {
openSource () {
this.$openLink('https://github.com/CS-Tao/whu-library-seat')
Expand All @@ -70,6 +83,10 @@ export default {
openMainBody () {
this.$emit('iconClicked', 'normal')
},
quitAndUpdate () {
ipcRenderer.send('quit-and-install')
ipcRenderer.send('exit-app', 0)
},
exitApp () {
ipcRenderer.sendSync('exit-app', 0)
}
Expand Down Expand Up @@ -123,6 +140,22 @@ export default {
fill: $exit-button-background-click;
}
}
.update-button {
margin: auto;
height: 25px;
padding: 0 13px;
flex: 1;
font-size: $text-size-small + 2;
color: $text-color-highlight;
background: $ok-button-background-blur!important;
border-color: $button-green!important;
&:hover {
background: $ok-button-background-hover!important;
}
&:active {
background: $ok-button-background-click!important;
}
}
.text {
color: $second-color;
margin: auto;
Expand Down
Loading

0 comments on commit 35243f6

Please sign in to comment.