Skip to content

Commit

Permalink
Merge pull request #147 from GlobeMC/dev
Browse files Browse the repository at this point in the history
Update Main Branch
  • Loading branch information
bingling-sama committed Sep 2, 2023
2 parents e5d570f + 01ec16f commit 0cc3730
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 91 deletions.
41 changes: 21 additions & 20 deletions docs/.vitepress/theme/components/Analyzer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ function startAnalysis(file, ext) {
.then(function (content) {
logAnalysis(content)
})
.catch((reason) => {
finishAnalysis("EncryptedZipFile", reason)
})
} catch (error) {
finishAnalysis("UnzipErr", error)
}
Expand Down Expand Up @@ -491,10 +494,10 @@ function logAnalysis(log) {
matches = spilted[key].match(/'([^']+)'/g)
missingMod.push(
matches[0].replace(/'/g, "") +
" " + // Mod 名称,例如 'oculus'
matches[2]
.replace(/'/g, "")
.replace(/\$\{minecraft_version\}/g, "MinecraftVersion"), // Mod 版本,例如 '[1.4,)',之后可以把最低 / 最高版本提取出来解析一遍
" " + // Mod 名称,例如 'oculus'
matches[2]
.replace(/'/g, "")
.replace(/\$\{minecraft_version\}/g, "MinecraftVersion"), // Mod 版本,例如 '[1.4,)',之后可以把最低 / 最高版本提取出来解析一遍
)
}
}
Expand Down Expand Up @@ -724,6 +727,16 @@ function finishAnalysis(status, msg) {
ErrMsg: msg,
})
break
case "EncryptedZipFile":
labelMsg.value = "不支持加密 zip 文件"
btnMsg.value = "重新上传"
umami.track("Analysis Error", {
Status: "Cannot_Load_Encrypted_Log_File",
ErrMsg: msg,
})
break
case "ErrOpenRstPage":
umami.track("Analysis Error", {
Status: "Cannot_Redirect_To_Resolution",
Expand Down Expand Up @@ -771,12 +784,8 @@ function redirectBtnClick() {

<template>
<ClientOnly>
<div
class="analyzer-main"
:style="{ 'background-color': analyzerBackgroundColor }"
@dragenter.prevent="handleDragEnter"
@dragover.prevent="handleDragOver"
@drop.prevent="handleDrop"
<div class="analyzer-main" :style="{ 'background-color': analyzerBackgroundColor }"
@dragenter.prevent="handleDragEnter" @dragover.prevent="handleDragOver" @drop.prevent="handleDrop"
@dragleave.prevent="handleDragLeave">
<h4 style="text-align: center">
请点击按钮上传导出的 .zip/.txt/.log 文件, 并尽量不要更改导出文件的名称。
Expand All @@ -786,19 +795,11 @@ function redirectBtnClick() {
<h4 class="file-uploader-label" for="file-uploader" singleLine="false">
{{ labelMsg }}
</h4>
<button
:disabled="isBtnDisabled"
class="file-uploader-btn"
data-umami-event="Analysis Button Click"
<button :disabled="isBtnDisabled" class="file-uploader-btn" data-umami-event="Analysis Button Click"
@click="fileUploader.click()">
{{ btnMsg }}
</button>
<input
ref="fileUploader"
type="file"
name="file_uploader"
id="file-uploader"
@change="checkfiles"
<input ref="fileUploader" type="file" name="file_uploader" id="file-uploader" @change="checkfiles"
style="display: none" />
</div>
<Transition name="analysis-result">
Expand Down
69 changes: 0 additions & 69 deletions docs/.vitepress/theme/components/Comment.vue

This file was deleted.

31 changes: 29 additions & 2 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,49 @@
import Theme from "vitepress/theme"
import { h } from "vue"
import Comment from "./components/Comment.vue"
import Contributors from "./components/Contributors.vue"
import LauncherBadge from "./components/LauncherBadge.vue"
import ReloadPrompt from "./components/ReloadPrompt.vue"
import giscusTalk from "vitepress-plugin-comment-with-giscus"
import { useData, useRoute } from "vitepress"
import "./style.css"

export default {
...Theme,
Layout: () => {
return h(Theme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
"doc-after": () => h(Comment),
"doc-footer-before": () => h(Contributors),
"layout-bottom": () => h(ReloadPrompt),
})
},
enhanceApp(ctx) {
ctx.app.component("LauncherBadge", LauncherBadge)
},
setup() {
// Get frontmatter and route
const { frontmatter } = useData()
const route = useRoute()

// Obtain configuration from: https://giscus.app/
giscusTalk(
{
repo: "GlobeMC/crashmc.com",
repoId: "R_kgDOKBR8xw",
category: "Giscus",
categoryId: "DIC_kwDOKBR8x84CYOmB",
mapping: "title",
strict: "0",
reactionsEnabled: "1",
emitMetadata: "0",
inputPosition: "top",
theme: "preferred_color_scheme",
lang: "zh-CN",
loading: "lazy",
},
{
frontmatter,
route,
},
)
},
}
4 changes: 4 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 0cc3730

Please sign in to comment.