From d8c50752f727a37d8f36bafa6e5438f0b1951bb6 Mon Sep 17 00:00:00 2001 From: snowykami Date: Tue, 17 Sep 2024 15:58:45 +0800 Subject: [PATCH] =?UTF-8?q?:package:=20docs:=20=E8=B5=84=E6=BA=90=E5=95=86?= =?UTF-8?q?=E5=BA=97=E6=96=B0=E5=A2=9E=E5=8F=91=E5=B8=83=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/components/PluginStore.vue | 19 ++++++------------- docs/components/ResStore.vue | 9 +++------ liteyuki_flow/resource_handler.py | 3 ++- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/docs/components/PluginStore.vue b/docs/components/PluginStore.vue index f9be72db..95ec5e84 100644 --- a/docs/components/PluginStore.vue +++ b/docs/components/PluginStore.vue @@ -3,6 +3,7 @@ import {computed, ref} from 'vue' import ItemCard from './PluginItemCard.vue' import ToggleSwitch from "./ToggleSwitch.vue"; import {getTextRef} from "./scripts/i18n"; +import pluginsJson from "../public/plugins.json" let showLiteyukiPluginOnly = ref(false) let filteredItems = computed(() => { @@ -24,15 +25,7 @@ let filteredItems = computed(() => { let items = ref([]) let search = ref('') // 从官方拉取 -fetch("/plugins.json") - .then(response => response.json()) - .then(data => { - data.forEach(item => { - item.is_liteyuki_plugin = true - }) - items.value = data - }) - .catch(error => console.error(error)) +items.value = pluginsJson //追加 fetch('https://registry.nonebot.dev/plugins.json') @@ -58,10 +51,10 @@ fetch('https://registry.nonebot.dev/plugins.json') {{ getTextRef('liteyukiOnly') }} - - - - + + + +
diff --git a/docs/components/ResStore.vue b/docs/components/ResStore.vue index d192b9c8..f7f62730 100644 --- a/docs/components/ResStore.vue +++ b/docs/components/ResStore.vue @@ -5,6 +5,8 @@ import ResPubWindow from "./ResPubWindow.vue"; import {getTextRef} from "./scripts/i18n"; import {RepoUrl} from "./scripts/statsApi"; +import resourcesJson from "../public/resources.json" + // 从public/assets/resources.json加载插件 let filteredItems = computed(() => { if (!search.value) { @@ -19,12 +21,7 @@ let filteredItems = computed(() => { // 插件商店Nonebot let items = ref([]) let search = ref('') -fetch("/resources.json") - .then(response => response.json()) - .then(data => { - items.value = data - }) - .catch(error => console.error(error)) +items.value = resourcesJson // 列表倒序 const isPublishWindowOpen = ref(false) diff --git a/liteyuki_flow/resource_handler.py b/liteyuki_flow/resource_handler.py index 739375d0..f071f94a 100644 --- a/liteyuki_flow/resource_handler.py +++ b/liteyuki_flow/resource_handler.py @@ -96,7 +96,7 @@ def pre_check(github: Github, issue: Issue, repo: Repository) -> err: issue.edit(body=new_issue_body) issue.add_to_labels("pre-checked") - issue.get_comment(cid).edit("✅ 预检查通过\n## 元数据\n" + metadata_markdown) + issue.get_comment(cid).edit("✅ 预检查通过,等待管理员人工审核\n## 元数据\n" + metadata_markdown) return nil @@ -139,6 +139,7 @@ def add_resource(github: Github, issue: Issue, repo: Repository): ref.edit(commit.sha) issue.remove_from_labels("pre-checked") issue.add_to_labels("passed") + issue.create_comment(f"✅ 资源包 {name} 已发布!商店页面稍后就会更新。") def handle_resource(github: Github, issue: Issue, repo: Repository, act_type: str):