提交 7717d958 编辑于 作者: AzurCrystal's avatar AzurCrystal
浏览文件

Merge remote-tracking branch 'upstream/master'

......@@ -2,13 +2,13 @@
name: Bug report / Bug 反馈
about: Create a report to help us improve
title: "[BUG] 标题"
labels: ''
labels: 'bug'
assignees: ''
---
首先通过 issues 的搜索功能,查找这个 bug 是否已经被反馈过。
请仔细描述这个 bug 是如何出现的,并附上 bug 出现时的截图。
最好能同时附上控制台的报错信息、版本信息。
首先通过 issues 的搜索功能,查找这个 bug 是否已经被反馈过。
请仔细描述这个 bug 是如何出现的,并附上 bug 出现时的截图。(如果网页问题,请附上浏览器控制台错误信息)
最好能同时附上控制台的报错信息、版本信息。
请删除上面的内容并开始描述问题。
......@@ -2,7 +2,7 @@
name: Feature request / 建议
about: Suggest an idea for this project
title: "[Feature request] 标题"
labels: ''
labels: 'enhancement'
assignees: ''
---
......
......@@ -2,12 +2,12 @@
name: Question / 使用问题
about: Question about the usage
title: "[Question] 标题"
labels: ''
labels: 'question'
assignees: ''
---
首先查看文档中 FAQ,确认这个问题不在常见问题里。
请仔细描述使用场景、你进行的操作、你期望的表现与实际表现不一致的地方。
首先查看文档中 FAQ,确认这个问题不在常见问题里。
请仔细描述使用场景、你进行的操作、你期望的表现与实际表现不一致的地方。
请删除上面的内容并开始描述内容。
......@@ -7,6 +7,7 @@ src/client/*/
!src/client/ybplugins/
!src/client/yybplugins/
!src/client/public/
!src/client/packedfiles/
src/client/.*
src/client/*.json
!src/client/default_*
......@@ -15,7 +16,6 @@ src/client/*.db
src/client/*.db-*
src/client/*.ics
src/client/*.pid
src/client/*.spec
src/client/test.py
.env
cqhttp
......
{
"stable": {
"version": 3458,
"url": "http://img.yobot.xyz/yobot/yobot3458.zip"
"version": 3477,
"url": "http://img.yobot.xyz/yobot/yobot3477.zip"
}
}
\ No newline at end of file
......@@ -11,7 +11,8 @@ head:
href: /logo/logo.ico
themeConfig:
logo: /logo/logo.png
search: false
search: true
searchMaxSuggestions: 10
smoothScroll: true
repo: https://github.com/yuudi/yobot
docsDir: documents
......@@ -58,6 +59,8 @@ themeConfig:
link: /project/open-source/
- text: 更新日志
link: /project/changelog/
- text: 项目贡献者
link: /project/contributors/
- text: 待办事项
link: https://github.com/yuudi/yobot/projects/1
plugins:
......
......@@ -12,6 +12,7 @@ QQ群:
1044314369(满)
1067699252(满)
774394459
<!-- 1087420601 -->
[项目贡献者](./project/contributors.md)
[更新日志](./project/changelog.md)
......
......@@ -58,6 +58,7 @@
| (自动:新闻推送) | 推送最新的新闻 |
| 日程(今日/明日/x月x日)(可自动) | 查看活动日程 |
| 日程表 | 查看一周日程 |
| 挖矿计算 +当前名次 | 计算剩余可获得的奖励钻石 |
## 娱乐类
......
# 更新日志
## 3.6.2
- 按日计算的统计图表([#99](https://github.com/yuudi/yobot/pull/99)
- 优化 Dockerfile([#97](https://github.com/yuudi/yobot/pull/97)
- 挖矿计算([#103](https://github.com/yuudi/yobot/pull/103)
## 3.6.1
- 竞技场查询支持pcrdfans
......@@ -9,11 +15,9 @@
## 3.6.0
- 公会战数据多存档
- 开放统计api与数据下载
- 开放统计
- 统计:出刀顺序表([#75](https://github.com/yuudi/yobot/pull/75)
- 统计:出刀统计图([#77](https://github.com/yuudi/yobot/pull/77)[#79](https://github.com/yuudi/yobot/pull/79)
- 自动更新时有反馈
- 允许删除公会
## 3.5
......
......@@ -17,6 +17,7 @@
[@winrey](https://github.com/winrey)
[@yyuueexxiinngg](https://github.com/yyuueexxiinngg)
[@AzurCrystal](https://github.com/AzurCrystal)
## Bug Report
......
......@@ -2,7 +2,23 @@
## 运行环境
python最低要求为`python3.6`
python最低要求为 `python3.6`
## 打包
安装 `pyinstaller`
```sh
pip install pyinstaller
```
打包程序
```sh
pyinstaller main.spec
```
`dist` 中找到目标文件
## 扩展
......
......@@ -15,14 +15,17 @@ loop=true
while $loop
do
loop=false
python3 main.py -g
{} -g
if [ -f .YOBOT_RESTART ]
then
loop=true
rm .YOBOT_RESTART
fi
done
""")
""".format(
'./yobot' if '_MEIPASS' in dir(sys) else 'python3 main.py'
)
)
print('请通过"sh yobotg.sh"启动')
sys.exit()
if os.path.exists('.YOBOT_RESTART'):
......
# -*- mode: python ; coding: utf-8 -*-
import os
import site
sitepackages = site.getsitepackages()
def sitepackages_location(package_name):
for sp in sitepackages:
if os.path.exists(os.path.join(sp,package_name)):
return sp
raise RuntimeError(f"{package_name} not found")
block_cipher = None
a = Analysis(
['main.py'],
pathex=['.'],
binaries=[],
datas=[
("packedfiles", "packedfiles"),
("public", "public"),
(f"{sitepackages_location('opencc')}/opencc/config", "opencc/config"),
(f"{sitepackages_location('opencc')}/opencc/dictionary", "opencc/dictionary"),
],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='yobot',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
icon='./logo.ico',
)
......@@ -29,6 +29,8 @@ var vm = new Vue({
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
start.setHours(0, 0, 0, 0);
end.setHours(0, 0, 0, 0);
picker.$emit('pick', [start, end]);
}
}, {
......@@ -37,6 +39,8 @@ var vm = new Vue({
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 15);
start.setHours(0, 0, 0, 0);
end.setHours(0, 0, 0, 0);
picker.$emit('pick', [start, end]);
}
}, {
......@@ -45,6 +49,8 @@ var vm = new Vue({
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
start.setHours(0, 0, 0, 0);
end.setHours(0, 0, 0, 0);
picker.$emit('pick', [start, end]);
}
}, {
......@@ -53,6 +59,8 @@ var vm = new Vue({
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
start.setHours(0, 0, 0, 0);
end.setHours(0, 0, 0, 0);
picker.$emit('pick', [start, end]);
}
}, {
......@@ -61,69 +69,73 @@ var vm = new Vue({
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 365);
start.setHours(0, 0, 0, 0);
end.setHours(0, 0, 0, 0);
picker.$emit('pick', [start, end]);
}
}]
},
challenges: [],
allChallenges: [],
activeIndex: '4',
challenge_map: {},
player_damage_cache: {},
total_damage: {},
contain_tail_and_continue: true,
global_table_data: [],
player_data: {
challengeMap: {},
challenges: [],
playerDamages: {},
totalDamage: {},
containTailAndContinue: true,
globalTableData: [],
playerData: {
damage: [
],
},
color_list: ['#c23531','#2f4554', '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622', '#bda29a','#6e7074', '#546570', '#c4ccd3'],
challenge_chart: null,
boss_dmg_chart: null,
miss_chart: null,
last_chart: null,
boss_blood_chart: null,
total_time_chart: null,
boss_hit_chart: null,
personal_progress_chart: null,
personal_time_chart: null,
total_damage_chart: null,
is_loading: true,
selecting_tab: "table",
selecting_qqid: parseInt(qqid)
colorList: ['#c23531','#2f4554', '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622', '#bda29a','#6e7074', '#546570', '#c4ccd3'],
challengeChart: null,
bossDmgChart: null,
missChart: null,
lastChart: null,
bossBloodChart: null,
totalTimeChart: null,
bossHitChart: null,
personalProgressChart: null,
personalTimeChart: null,
totalDamageChart: null,
isLoading: true,
selectingTab: "table",
selectingQQid: parseInt(qqid)
},
mounted() {
this.boss_dmg_chart = echarts.init(document.getElementById("boss_dmg_chart"));
this.challenge_chart = echarts.init(document.getElementById("challenge_chart"));
this.sum_dmg_chart = echarts.init(document.getElementById("sum_dmg_chart"));
this.miss_chart = echarts.init(document.getElementById("miss_chart"));
this.last_chart = echarts.init(document.getElementById("last_chart"));
this.boss_blood_chart = echarts.init(document.getElementById("boss_blood_chart"));
this.total_time_chart = echarts.init(document.getElementById("total_time_chart"));
this.boss_hit_chart = echarts.init(document.getElementById("boss_hit_chart"));
this.personal_progress_chart = echarts.init(document.getElementById("personal_progress_chart"));
this.personal_time_chart = echarts.init(document.getElementById("personal_time_chart"));
this.total_damage_chart = echarts.init(document.getElementById("total_damage_chart"));
this.selecting_tab = "total";
this.refresh_data();
this.bossDmgChart = echarts.init(document.getElementById("bossDmgChart"));
this.challengeChart = echarts.init(document.getElementById("challengeChart"));
this.sumDmgChart = echarts.init(document.getElementById("sumDmgChart"));
this.missChart = echarts.init(document.getElementById("missChart"));
this.lastChart = echarts.init(document.getElementById("lastChart"));
this.bossBloodChart = echarts.init(document.getElementById("bossBloodChart"));
this.totalTimeChart = echarts.init(document.getElementById("totalTimeChart"));
this.bossHitChart = echarts.init(document.getElementById("bossHitChart"));
this.personalProgressChart = echarts.init(document.getElementById("personalProgressChart"));
this.personalTimeChart = echarts.init(document.getElementById("personalTimeChart"));
this.totalDamageChart = echarts.init(document.getElementById("totalDamageChart"));
this.selectingTab = "total";
this.fetchData();
},
watch: {
contain_tail_and_continue: function() {
containTailAndContinue: function() {
this.init();
},
selecting_qqid: function() {
this.init_chart(this.player_damage(this.selecting_qqid).boss_damage_list);
this.init_player_data();
selectingQQid: function() {
this.initChart(this.playerDamage(this.selectingQQid).bossDamageList);
this.initPlayerData();
},
selecting_tab: function() {
selectingTab: function() {
this.init();
setTimeout("vm.resizeAll()", 100);
},
range: function(value) {
range: function() {
this.refreshData();
this.init();
console.log(value);
},
},
methods: {
// tools function
sum: (iterable) => {
......@@ -131,55 +143,74 @@ var vm = new Vue({
iterable.forEach(v => sum += v);
return sum;
},
format_to2: (num) => { return (num >= 10) ? num.toString() : '0' + num.toString() },
formatTo2: (num) => { return (num >= 10) ? num.toString() : '0' + num.toString() },
refresh_data: function() {
fetchData: function() {
const that = this;
axios.get('../api/').then(res=> {
if (res.data.code != 0) {
that.$alert(res.data.message, '获取记录失败');
that.is_loading = false;
that.isLoading = false;
return;
}
that.challenges = res.data.challenges;
that.allChallenges = res.data.challenges;
that.members = res.data.members;
for (let challenge of that.challenges) {
let arr = that.challenge_map[challenge.qqid];
if (arr == undefined) {
arr = [];
that.challenge_map[challenge.qqid] = arr;
}
arr.push(challenge);
}
for (let member of that.members) {
member.challenges = that.challenge_map[member.qqid];
if (that.members.filter((elem) => {return elem.qqid == that.selectingQQid}).length == 0) {
that.selectingQQid = that.members[0].qqid;
}
that.sort_and_divide();
that.init();
that.is_loading = false;
// }).catch(function (error) {
// thisvue.$alert(error, '获取数据失败');
// thisvue.is_loading = false;
that.refreshData();
}).catch(function (error) {
that.$alert(error, '获取数据失败,请联系维护人员');
that.isLoading = false;
console.error(error);
console.error(error.stack);
});
},
filtedChallenge: function() {
if (!this.range) return this.allChallenges;
const leftRange = this.range[0].getTime() / 1000 + 18000;
const rightRange = this.range[1].getTime() / 1000 + 18000 + 86400;
return this.allChallenges.filter((elem) => {return elem.challenge_time <= rightRange && elem.challenge_time >= leftRange});
},
refreshData: function() {
this.challenges = this.filtedChallenge();
this.challengeMap = {};
for (let challenge of this.challenges) {
let arr = this.challengeMap[challenge.qqid];
if (arr == undefined) {
arr = [];
this.challengeMap[challenge.qqid] = arr;
}
arr.push(challenge);
}
for (let member of this.members) {
member.challenges = this.challengeMap[member.qqid];
}
this.sortAndDivide();
this.init();
this.isLoading = false;
},
init: function() {
this.__total_damage();
this.__global_table_data();
this.init_player_data();
if (this.selecting_tab === 'total') {
this.init_chart(this.total_damage.boss_damage_list);
this.initTotalDamage();
this.initPlayerDamage();
this.initGlobalTableData();
this.initPlayerData();
if (this.selectingTab === 'total') {
this.initChart(this.totalDamage.bossDamageList);
}
else if (this.selecting_tab === 'channel') {
this.init_chart(this.total_damage.boss_damage_list);
else if (this.selectingTab === 'channel') {
this.initChart(this.totalDamage.bossDamageList);
}
else {
this.init_chart(this.player_damage(this.selecting_qqid).boss_damage_list);
this.initChart(this.playerDamage(this.selectingQQid).bossDamageList);
}
},
// function for init
init_chart: function(boss_damage_list) {
let temp = this.boss_average_damage_for_chart(boss_damage_list, this.contain_tail_and_continue);
initChart: function(bossDamageList) {
let temp = this.bossAverageDamageForChart(bossDamageList, this.containTailAndContinue);
let option = {
title: {
text: '不同 Boss 刀均伤害'
......@@ -202,14 +233,14 @@ var vm = new Vue({
data: temp[1],
itemStyle: {
color: (params) => {
let boss_id = parseInt(temp[0][params.dataIndex][0]) - 1;
return this.color_list[boss_id];
let bossId = parseInt(temp[0][params.dataIndex][0]) - 1;
return this.colorList[bossId];
},
}
}]
}
let temp2 = this.boss_challenge_count_for_chart(boss_damage_list, true);
let temp2 = this.bossChallengeCountForChart(bossDamageList, true);
let option2 = {
title: {
text: '不同 Boss 出刀数'
......@@ -221,13 +252,13 @@ var vm = new Vue({
data: temp2,
itemStyle: {
color: (params) => {
let boss_id = parseInt(temp2[params.dataIndex].name[0]) - 1;
return this.color_list[boss_id];
let bossId = parseInt(temp2[params.dataIndex].name[0]) - 1;
return this.colorList[bossId];
}
}
}]
}
let temp3 = this.boss_sum_damage_for_chart(boss_damage_list);
let temp3 = this.bossSumDamageForChart(bossDamageList);
let option3 = {
title: {
text: 'Boss 总伤害'
......@@ -250,13 +281,13 @@ var vm = new Vue({
data: temp3[1],
itemStyle: {
color: (params) => {
let boss_id = parseInt(temp3[0][params.dataIndex][0]) - 1;
return this.color_list[boss_id];
let bossId = parseInt(temp3[0][params.dataIndex][0]) - 1;
return this.colorList[bossId];
},
}
}]
}
let temp4 = this.boss_miss_for_chart(this.global_table_data);
let temp4 = this.bossMissForChart(this.globalTableData);
let option4 = {
title: {
text: '成员出刀考勤'
......@@ -291,7 +322,7 @@ var vm = new Vue({
}
}]
}
let temp5 = this.boss_last_for_chart();
let temp5 = this.bossLastForChart();
let option5 = {
title: {
text: '尾刀统计',
......@@ -316,7 +347,7 @@ var vm = new Vue({
}
]
};
let temp6 = this.boss_blood_for_chart();
let temp6 = this.bossBloodForChart();
let option6 = {
title: {
text: 'BOSS血量曲线',
......@@ -406,7 +437,7 @@ var vm = new Vue({
}
]
};
let temp7 = this.time_for_chart(this.challenges);
let temp7 = this.timeForChart(this.challenges);
let option7 = {
title: {
text: '出刀时间',
......@@ -452,7 +483,7 @@ var vm = new Vue({
data: temp7
}
}
let temp8 = this.boss_player_hit_count_for_chart();