Skip to content

Commit

Permalink
✨ feat(崩溃分析): 能读了
Browse files Browse the repository at this point in the history
  • Loading branch information
HRxiaohu committed Aug 3, 2023
1 parent 1d6cded commit 30287b7
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 34 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ cache
.pnp.loader.mjs
.yarn/install-state.gz
yarn.lock
.vscode
78 changes: 54 additions & 24 deletions components/analyzer.vue
Original file line number Diff line number Diff line change
@@ -1,41 +1,64 @@
<template>
<component is="script">
<!-- <script> -->
function Checkfiles() {
var fup = document.getElementById('file_uploader');
var fileName = fup.value;
var ext = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase();
if (ext == "zip" || ext == "log" || ext == "txt") {
document.getElementById('file_uploader_label').innerText = fileName;
document.getElementById('file_uploader_btn').innerHTML = "重新上传";
return true;
}
else {
document.getElementById('file_uploader_label').innerText = "请上传 .zip/.txt/.log 文件!";
fup.focus();
return false;
}
}
<!-- </script> -->
</component>
<div class="analyzer_main">
<div id="analyzer_main">
<h4 style="text-align: center;">请点击按钮上传导出的 .zip/.txt/.log 文件</h4>
<img class="icon_upload" src="../docs/src/logo-upload.svg">
<div class="file_uploader_container">
<h4 id="file_uploader_label" for="file_uploader" singleLine="false">未选择文件</h4>
<button id="file_uploader_btn" onclick="file_uploader.click()">开始上传</button>
<input type="file" name="file_uploader" id="file_uploader" onchange="Checkfiles()" style="display: none;" />
<h4 id="file_uploader_label" for="file_uploader" singleLine="false">{{ labelMsg }}</h4>
<button v-bind:disabled="isBtnDisabled" id="file_uploader_btn" onclick="file_uploader.click()">{{ btnMsg }}</button>
<input type="file" name="file_uploader" id="file_uploader" @change="Checkfiles" style="display: none;" />
</div>
</div>
</template>

<script setup>
import { ref } from 'vue';
var isBtnDisabled = ref(false);
var labelMsg = ref('未选择文件');
var btnMsg = ref('开始上传');
function Checkfiles() {
var fup = document.getElementById('file_uploader');
var fileName = fup.value;
var ext = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase();
if (ext == "zip" || ext == "log" || ext == "txt") {
labelMsg.value = fileName;
btnMsg.value = "正在分析";
isBtnDisabled.value = true;
var file = document.getElementById('file_uploader').files[0]
StartAnalysis(file, ext);
return true;
}
else {
document.getElementById('file_uploader_label').innerText = "请上传 .zip/.txt/.log 文件!";
fup.focus();
return false;
}
}
function StartAnalysis(file, ext) {
var reader = new FileReader(file);
if (ext != 'zip') {
reader.readAsText(file);
reader.onload = (e) => {
var logMsg = e.target.result;
if (logMsg.includes("BakaXL")) {
console.log('BakaXL');
}
};
}
}
function BakaXLLogAnalysis(log) {
}
</script>
<style scoped>
div {
height: auto;
width: auto;
}
.analyzer_main {
#analyzer_main {
border: 1px solid transparent;
border-color: var(--vp-custom-block-tip-border);
color: var(--vp-custom-block-tip-text);
Expand Down Expand Up @@ -67,5 +90,12 @@ div {
border-color: var(--vp-custom-block-tip-border);
background-color: var(--vp-custom-block-tip-bg);
border-radius: 8px;
transition: all 0.3s;
}
#file_uploader_btn:hover {
animation-direction: alternate;
transform: scale(1.05);
transition: all 0.3s;
}
</style>
6 changes: 4 additions & 2 deletions docs/analyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import analyzer from '../components/analyzer.vue'

<analyzer/>

::: warning 隐私声明
所有文件的分析仅会在本地进行,不会有任何数据上传到云端。
:::warning 隐私声明

所有文件的分析仅会在本地进行,不会有任何数据上传到云端。

:::
16 changes: 8 additions & 8 deletions docs/team.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ import { VPTeamMembers } from 'vitepress/theme'

const members = [
{
avatar: 'https://github.com/bwtx2023.png',
avatar: 'https://s1.ax1x.com/2023/08/03/pPiZ9DP.jpg',
name: 'bwtx2023',
title: '创建者',
links: [
{ icon: 'github', link: 'https://github.com/bwtx2023' },
]
},
{
avatar: 'https://jsd.onmicrosoft.cn/avatar/1dd95c166685a1aa305e102aa6828a84.png',
avatar: 'https://s1.ax1x.com/2023/08/02/pPP4Tc6.jpg',
name: 'HRxiaohu',
title: '开发者',
links: [
{ icon: 'github', link: 'https://github.com/HRxiaohu' },
]
},
{
avatar: 'https://jsd.onmicrosoft.cn/avatar/636d113ce37111d08f08faee780ce9b8',
avatar: 'https://s1.ax1x.com/2023/08/03/pPiZCHf.jpg',
name: 'Big_Cake',
title: '站点维护',
links: [
Expand Down Expand Up @@ -51,7 +51,7 @@ const members = [
]
},
{
avatar: 'https://github.com/Rovniced.png',
avatar: 'https://s1.ax1x.com/2023/08/03/pPiZiE8.jpg',
name: 'Enlysure',
title: '文档贡献者',
links: [
Expand All @@ -75,15 +75,15 @@ const members = [
]
},
{
avatar: 'https://github.com/zkitefly.png',
avatar: 'https://s1.ax1x.com/2023/08/03/pPiZFUS.jpg',
name: 'zkitefly',
title: '文档贡献者',
links: [
{ icon: 'github', link: 'https://github.com/zkitefly' },
]
},
{
avatar: 'https://github.com/ZhuRuoLing.png',
avatar: 'https://s1.ax1x.com/2023/08/03/pPiZk4g.jpg',
name: '竹若泠',
title: '文档贡献者',
links: [
Expand All @@ -99,7 +99,7 @@ const members = [
]
},
{
avatar: 'https://github.com/Hex-Dragon.png',
avatar: 'https://s1.ax1x.com/2023/08/03/pPiZECQ.png',
name: 'Hex Dragon',
title: '文档贡献组织',
links: [
Expand All @@ -111,6 +111,6 @@ const members = [

# GlobeMC 成员列表

此处列出了 GlobeMC 团队的所有成员,没有他们就不会有团队的立项
此处列出了 GlobeMC 团队的所有成员,没有他们就不会有项目的诞生

<VPTeamMembers size="small" :members="members" />

0 comments on commit 30287b7

Please sign in to comment.