1
0
forked from bot/app

📝 [docs]: 新增在线展示

This commit is contained in:
远野千束 2024-09-01 22:14:09 +08:00
parent 58d0d12c1f
commit c805db3371
8 changed files with 34 additions and 23 deletions

View File

@ -2,13 +2,17 @@ import DefaultTheme from 'vitepress/theme'
import './liteyuki.css' import './liteyuki.css'
import StatsBar from '../../components/StatsBar.vue' import StatsBar from '../../components/StatsBar.vue'
import PluginStore from '../../components/PluginStore.vue'
import ResStore from '../../components/ResStore.vue'
export default { export default {
extends: DefaultTheme, extends: DefaultTheme,
enhanceApp({ app }) { enhanceApp({ app }) {
app.component('StatsBar', StatsBar) app.component('StatsBar', StatsBar);
app.component('PluginStore', PluginStore);
app.component('ResStore', ResStore);
}, },
Layout: StatsBar Layout: StatsBar
} }

View File

@ -2,16 +2,17 @@
import {computed, ref} from 'vue' import {computed, ref} from 'vue'
import ItemCard from './PluginItemCard.vue' import ItemCard from './PluginItemCard.vue'
import ToggleSwitch from "./ToggleSwitch.vue"; import ToggleSwitch from "./ToggleSwitch.vue";
import {getTextRef} from "./scripts/i18n";
let showLiteyukiPluginOnly = ref(false) let showLiteyukiPluginOnly = ref(false)
let filteredItems = computed(() => { let filteredItems = computed(() => {
let filtered = items.value let filtered = items.value
if (search.value) { if (search.value) {
filtered = filtered.filter(item => filtered = filtered.filter(item =>
item.name.toLowerCase().includes(search.value.toLowerCase()) || item.name.toLowerCase().includes(search.value.toLowerCase()) ||
item.desc.toLowerCase().includes(search.value.toLowerCase()) || item.desc.toLowerCase().includes(search.value.toLowerCase()) ||
item.author.toLowerCase().includes(search.value.toLowerCase()) || item.author.toLowerCase().includes(search.value.toLowerCase()) ||
item.module_name.toLowerCase().includes(search.value.toLowerCase()) item.module_name.toLowerCase().includes(search.value.toLowerCase())
) )
} }
if (showLiteyukiPluginOnly.value) { if (showLiteyukiPluginOnly.value) {
@ -48,12 +49,13 @@ fetch('https://registry.nonebot.dev/plugins.json')
<template> <template>
<div class="market"> <div class="market">
<h1>插件商店</h1> <h1>{{ getTextRef('pluginStore') }}</h1>
<p>内容来自轻雪商店及<a href="https://nonebot.dev/store/plugins">NoneBot插件商店</a>轻雪通过nonebot插件实现兼容NoneBot在此仅作引用具体请访问NoneBot插件商店</p> <p>{{ getTextRef('pluginStoreDesc') }}</p>
<!-- 搜索框--> <!-- 搜索框-->
<div class="search-box-div"> <div class="search-box-div">
<input class="item-search-box" type="text" placeholder="搜索插件" v-model="search"/> <input class="item-search-box" type="text" v-model="search" :placeholder="getTextRef('search')"/>
<ToggleSwitch v-model:modelValue="showLiteyukiPluginOnly" />仅轻雪插件 <ToggleSwitch v-model:modelValue="showLiteyukiPluginOnly"/>
{{ getTextRef('liteyukiOnly') }}
</div> </div>
<div class="items"> <div class="items">
<!-- 使用filteredItems来布局商品 --> <!-- 使用filteredItems来布局商品 -->

View File

@ -2,6 +2,7 @@
import {computed, ref} from 'vue' import {computed, ref} from 'vue'
import ItemCard from './ResItemCard.vue' import ItemCard from './ResItemCard.vue'
import * as url from "node:url"; import * as url from "node:url";
import {getTextRef} from "./scripts/i18n";
// public/assets/resources.json // public/assets/resources.json
let filteredItems = computed(() => { let filteredItems = computed(() => {
@ -29,8 +30,8 @@ fetch("/resources.json")
<template> <template>
<div class="market"> <div class="market">
<h1>主题/资源商店</h1> <h1>{{ getTextRef('resourceStore') }}</h1>
<div class="search-box-div"><input class="item-search-box" type="text" placeholder="搜索资源" v-model="search" /></div> <div class="search-box-div"><input class="item-search-box" type="text" :placeholder="getTextRef('search')" v-model="search" /></div>
<div class="items"> <div class="items">
<!-- 使用filteredItems来布局商品 --> <!-- 使用filteredItems来布局商品 -->
<ItemCard v-for="item in filteredItems" :key="item.id" :item="item"/> <ItemCard v-for="item in filteredItems" :key="item.id" :item="item"/>

View File

@ -15,6 +15,11 @@ const i18nData = {
size: 'Size', size: 'Size',
plugins: 'Plugins', plugins: 'Plugins',
resources: 'Resources', resources: 'Resources',
pluginStore: 'Plugin Store',
pluginStoreDesc: 'Content from the LightSnow Plugin Store, LightSnow supports NoneBot through the lpnonebot plugin, and references some NoneBot plugins',
liteyukiOnly: 'Liteyuki Only',
search: 'Search',
resourceStore: 'Resources Store',
}, },
zh: { zh: {
online: '在线', online: '在线',
@ -28,6 +33,12 @@ const i18nData = {
size: '大小', size: '大小',
plugins: '插件', plugins: '插件',
resources: '主题资源', resources: '主题资源',
store: '商店',
pluginStore: '插件商店',
pluginStoreDesc: '内容来自轻雪插件商店轻雪通过lpnonebot插件对NoneBot实现支持引用了部分NoneBot插件',
liteyukiOnly: '仅轻雪',
search: '搜索',
resourceStore: '资源商店',
} }
} }

View File

@ -1,6 +1,6 @@
--- ---
title: 插件商店 title: Plugin Store
order: 2 order: 2
--- ---
<pluginStoreComp /> <PluginStore />

View File

@ -1,6 +1,6 @@
--- ---
title: 资源商店 title: Resource Store
order: 1 order: 1
--- ---
<resourceStoreComp /> <ResStore />

View File

@ -3,8 +3,4 @@ title: 插件商店
order: 2 order: 2
--- ---
<script setup> <PluginStore />
import PluginStore from '../../components/PluginStore.vue';
</script>
<PluginStore></PluginStore>

View File

@ -2,8 +2,5 @@
title: 资源商店 title: 资源商店
order: 1 order: 1
--- ---
<script setup>
import ResStore from '../../components/ResStore.vue';
</script>
<ResStore /> <ResStore />