mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 03:15:24 +08:00
✨ change publish and issue
This commit is contained in:
parent
4ed5b06db0
commit
611049681a
46
.github/ISSUE_TEMPLATE/adapter-publish.md
vendored
46
.github/ISSUE_TEMPLATE/adapter-publish.md
vendored
@ -1,46 +0,0 @@
|
||||
---
|
||||
name: Adapter Publish
|
||||
about: Publish your adapter to nonebot homepage and nb-cli
|
||||
title: "Adapter: blabla 协议"
|
||||
labels: Adapter
|
||||
assignees: ""
|
||||
|
||||
---
|
||||
|
||||
**你的协议名称:**
|
||||
|
||||
example
|
||||
|
||||
<!-- 协议连接时使用的名称:/<name>/ws -->
|
||||
|
||||
**简短描述协议:**
|
||||
|
||||
Example 协议
|
||||
|
||||
**插件 import 使用的名称**
|
||||
|
||||
nonebot.adapters.example
|
||||
|
||||
<!-- 或 nonebot_adapter_example 等合法包名 -->
|
||||
|
||||
**插件 install 使用的名称**
|
||||
|
||||
nonebot-adapter-example
|
||||
|
||||
<!--
|
||||
例 1:nonebot-adapter-example
|
||||
|
||||
通过 pypi 安装
|
||||
|
||||
> 请事先发布插件到[pypi](https://pypi.org/)
|
||||
|
||||
例 2:git+https://github.com/nonebot/nonebot-adapter-example
|
||||
|
||||
从 github 仓库安装
|
||||
-->
|
||||
|
||||
**插件项目仓库/主页链接**
|
||||
|
||||
nonebot/nonebot2
|
||||
|
||||
<!-- 默认 github 或其他完整链接,请勿使用 markdown 语法 -->
|
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Plugin Publish
|
||||
url: https://v2.nonebot.dev/store.html
|
||||
about: Publish your plugin to nonebot homepage and nb-cli
|
||||
- name: Adapter Publish
|
||||
url: https://v2.nonebot.dev/store.html
|
||||
about: Publish your adapter to nonebot homepage and nb-cli
|
||||
- name: Bot Publish
|
||||
url: https://v2.nonebot.dev/store.html
|
||||
about: Publish your bot to nonebot homepage and nb-cli
|
44
.github/ISSUE_TEMPLATE/plugin-publish.md
vendored
44
.github/ISSUE_TEMPLATE/plugin-publish.md
vendored
@ -1,44 +0,0 @@
|
||||
---
|
||||
name: Plugin Publish
|
||||
about: Publish your plugin to nonebot homepage and nb-cli
|
||||
title: "Plugin: blabla 的插件"
|
||||
labels: Plugin
|
||||
assignees: ""
|
||||
|
||||
---
|
||||
|
||||
**你的插件名称:**
|
||||
|
||||
例:复读机
|
||||
|
||||
**简短描述插件功能:**
|
||||
|
||||
例:复读群友的消息
|
||||
|
||||
**插件 import 使用的名称**
|
||||
|
||||
nonebot_plugin_example
|
||||
|
||||
<!-- 或其他合法包名 -->
|
||||
|
||||
**插件 install 使用的名称**
|
||||
|
||||
nonebot-plugin-example
|
||||
|
||||
<!--
|
||||
例 1:nonebot-plugin-example
|
||||
|
||||
通过 pypi 安装
|
||||
|
||||
> 请事先发布插件到[pypi](https://pypi.org/)
|
||||
|
||||
例 2:git+https://github.com/nonebot/nonebot-plugin-example
|
||||
|
||||
从 github 仓库安装
|
||||
-->
|
||||
|
||||
**插件项目仓库/主页链接**
|
||||
|
||||
nonebot/nonebot2
|
||||
|
||||
<!-- 默认 github 或其他完整链接,请勿使用 markdown 语法 -->
|
@ -24,8 +24,8 @@
|
||||
"link": "/api/"
|
||||
},
|
||||
{
|
||||
"text": "插件广场",
|
||||
"link": "/plugin-store"
|
||||
"text": "商店",
|
||||
"link": "/store"
|
||||
},
|
||||
{
|
||||
"text": "更新日志",
|
||||
@ -63,11 +63,7 @@
|
||||
"title": "协议适配",
|
||||
"collapsable": false,
|
||||
"sidebar": "auto",
|
||||
"children": [
|
||||
"cqhttp-guide",
|
||||
"ding-guide",
|
||||
"mirai-guide"
|
||||
]
|
||||
"children": ["cqhttp-guide", "ding-guide", "mirai-guide"]
|
||||
}
|
||||
],
|
||||
"/advanced/": [
|
||||
@ -88,9 +84,7 @@
|
||||
"title": "发布",
|
||||
"collapsable": false,
|
||||
"sidebar": "auto",
|
||||
"children": [
|
||||
"publish-plugin"
|
||||
]
|
||||
"children": ["publish-plugin"]
|
||||
}
|
||||
],
|
||||
"/api/": [
|
||||
|
@ -24,8 +24,8 @@
|
||||
"link": "/api/"
|
||||
},
|
||||
{
|
||||
"text": "插件广场",
|
||||
"link": "/plugin-store"
|
||||
"text": "商店",
|
||||
"link": "/store"
|
||||
},
|
||||
{
|
||||
"text": "更新日志",
|
||||
@ -77,9 +77,7 @@
|
||||
"title": "发布",
|
||||
"collapsable": false,
|
||||
"sidebar": "auto",
|
||||
"children": [
|
||||
"publish-plugin"
|
||||
]
|
||||
"children": ["publish-plugin"]
|
||||
}
|
||||
],
|
||||
"/api/": [
|
||||
|
@ -24,8 +24,8 @@
|
||||
"link": "/api/"
|
||||
},
|
||||
{
|
||||
"text": "插件广场",
|
||||
"link": "/plugin-store"
|
||||
"text": "商店",
|
||||
"link": "/store"
|
||||
},
|
||||
{
|
||||
"text": "更新日志",
|
||||
@ -63,10 +63,7 @@
|
||||
"title": "协议适配",
|
||||
"collapsable": false,
|
||||
"sidebar": "auto",
|
||||
"children": [
|
||||
"cqhttp-guide",
|
||||
"ding-guide"
|
||||
]
|
||||
"children": ["cqhttp-guide", "ding-guide"]
|
||||
}
|
||||
],
|
||||
"/advanced/": [
|
||||
@ -87,9 +84,7 @@
|
||||
"title": "发布",
|
||||
"collapsable": false,
|
||||
"sidebar": "auto",
|
||||
"children": [
|
||||
"publish-plugin"
|
||||
]
|
||||
"children": ["publish-plugin"]
|
||||
}
|
||||
],
|
||||
"/api/": [
|
||||
|
221
docs/.vuepress/components/Adapter.vue
Normal file
221
docs/.vuepress/components/Adapter.vue
Normal file
@ -0,0 +1,221 @@
|
||||
<template>
|
||||
<v-card flat class="adapters">
|
||||
<v-row>
|
||||
<v-col cols="12" sm="4">
|
||||
<v-text-field
|
||||
v-model="filterText"
|
||||
dense
|
||||
rounded
|
||||
outlined
|
||||
clearable
|
||||
hide-details
|
||||
label="Filter Adapter"
|
||||
>
|
||||
<template v-slot:prepend-inner>
|
||||
<div class="v-input__icon v-input__icon--prepend-inner">
|
||||
<v-icon small>fa-filter</v-icon>
|
||||
</div>
|
||||
</template>
|
||||
</v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="4">
|
||||
<v-dialog v-model="dialog" max-width="600px">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn dark block color="primary" v-bind="attrs" v-on="on"
|
||||
>Publish Your Adapter
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Adapter Information</span>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-form ref="newAdapterForm" v-model="valid" lazy-validation>
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
v-model="newAdapter.name"
|
||||
label="协议名称"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
v-model="newAdapter.desc"
|
||||
label="协议介绍"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
v-model="newAdapter.id"
|
||||
label="PyPI 项目名"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
v-model="newAdapter.link"
|
||||
label="协议 import 包名"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
v-model="newAdapter.repo"
|
||||
label="仓库/主页链接"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-form>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" text @click="dialog = false">
|
||||
Close
|
||||
</v-btn>
|
||||
<v-btn
|
||||
:disabled="!valid"
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="
|
||||
dialog = false;
|
||||
publishAdapter();
|
||||
"
|
||||
>
|
||||
Publish
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="4">
|
||||
<v-pagination
|
||||
v-model="page"
|
||||
:length="pageNum"
|
||||
prev-icon="fa-caret-left"
|
||||
next-icon="fa-caret-right"
|
||||
></v-pagination>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<hr />
|
||||
<v-row>
|
||||
<v-col
|
||||
cols="12"
|
||||
sm="6"
|
||||
v-for="(adapter, index) in displayAdapters"
|
||||
:key="index"
|
||||
>
|
||||
<PublishCard
|
||||
:name="adapter.name"
|
||||
:desc="adapter.desc"
|
||||
:id="adapter.id"
|
||||
:author="adapter.author"
|
||||
:link="adapter.repo"
|
||||
></PublishCard>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-pagination
|
||||
v-model="page"
|
||||
:length="pageNum"
|
||||
prev-icon="fa-caret-left"
|
||||
next-icon="fa-caret-right"
|
||||
></v-pagination>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PublishCard from "./PublishCard.vue";
|
||||
import adapters from "../public/adapters.json";
|
||||
|
||||
export default {
|
||||
name: "Adapters",
|
||||
components: {
|
||||
PublishCard
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
adapters: adapters,
|
||||
filterText: "",
|
||||
page: 1,
|
||||
dialog: false,
|
||||
valid: false,
|
||||
newAdapter: {
|
||||
name: null,
|
||||
desc: null,
|
||||
id: null,
|
||||
link: null,
|
||||
repo: null
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
pageNum() {
|
||||
return Math.ceil(this.filteredAdapters.length / 10);
|
||||
},
|
||||
filteredAdapters() {
|
||||
return this.adapters.filter(adapter => {
|
||||
return (
|
||||
adapter.id.indexOf(this.filterText || "") != -1 ||
|
||||
adapter.name.indexOf(this.filterText || "") != -1 ||
|
||||
adapter.desc.indexOf(this.filterText || "") != -1 ||
|
||||
adapter.author.indexOf(this.filterText || "") != -1
|
||||
);
|
||||
});
|
||||
},
|
||||
displayAdapters() {
|
||||
return this.filteredAdapters.slice((this.page - 1) * 10, this.page * 10);
|
||||
},
|
||||
publishPlugin() {
|
||||
if (!this.$refs.newAdapterForm.validate()) {
|
||||
return;
|
||||
}
|
||||
const title = encodeURIComponent(
|
||||
`Adapter: ${this.newAdapter.name}`
|
||||
).replace(/%2B/gi, "+");
|
||||
const body = encodeURIComponent(
|
||||
`
|
||||
**协议名称:**
|
||||
|
||||
${this.newAdapter.name}
|
||||
|
||||
**协议功能:**
|
||||
|
||||
${this.newAdapter.desc}
|
||||
|
||||
**PyPI 项目名:**
|
||||
|
||||
${this.newAdapter.link}
|
||||
|
||||
**协议 import 包名:**
|
||||
|
||||
${this.newAdapter.id}
|
||||
|
||||
**协议项目仓库/主页链接:**
|
||||
|
||||
${this.newAdapter.repo}
|
||||
|
||||
<!-- DO NOT EDIT ! -->
|
||||
<!--
|
||||
- id: ${this.newAdapter.id}
|
||||
- link: ${this.newAdapter.link}
|
||||
- name: ${this.newAdapter.name}
|
||||
- desc: ${this.newAdapter.desc}
|
||||
- repo: ${this.newAdapter.repo}
|
||||
-->
|
||||
`.trim()
|
||||
).replace(/%2B/gi, "+");
|
||||
window.open(
|
||||
`https://github.com/nonebot/nonebot2/issues/new?title=${title}&body=${body}&labels=Adapter`
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
190
docs/.vuepress/components/Bot.vue
Normal file
190
docs/.vuepress/components/Bot.vue
Normal file
@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<v-card flat class="bots">
|
||||
<v-row>
|
||||
<v-col cols="12" sm="4">
|
||||
<v-text-field
|
||||
v-model="filterText"
|
||||
dense
|
||||
rounded
|
||||
outlined
|
||||
clearable
|
||||
hide-details
|
||||
label="Filter Bot"
|
||||
>
|
||||
<template v-slot:prepend-inner>
|
||||
<div class="v-input__icon v-input__icon--prepend-inner">
|
||||
<v-icon small>fa-filter</v-icon>
|
||||
</div>
|
||||
</template>
|
||||
</v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="4">
|
||||
<v-dialog v-model="dialog" max-width="600px">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn dark block color="primary" v-bind="attrs" v-on="on"
|
||||
>Publish Your Bot
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Bot Information</span>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-form ref="newBotForm" v-model="valid" lazy-validation>
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
v-model="newBot.name"
|
||||
label="机器人名称"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
v-model="newBot.desc"
|
||||
label="机器人介绍"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
v-model="newBot.repo"
|
||||
label="仓库/主页链接"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-form>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" text @click="dialog = false">
|
||||
Close
|
||||
</v-btn>
|
||||
<v-btn
|
||||
:disabled="!valid"
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="
|
||||
dialog = false;
|
||||
publishBot();
|
||||
"
|
||||
>
|
||||
Publish
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="4">
|
||||
<v-pagination
|
||||
v-model="page"
|
||||
:length="pageNum"
|
||||
prev-icon="fa-caret-left"
|
||||
next-icon="fa-caret-right"
|
||||
></v-pagination>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<hr />
|
||||
<v-row>
|
||||
<v-col cols="12" sm="6" v-for="(bot, index) in displayBots" :key="index">
|
||||
<PublishCard
|
||||
:name="bot.name"
|
||||
:desc="bot.desc"
|
||||
:author="bot.author"
|
||||
:link="bot.repo"
|
||||
></PublishCard>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-pagination
|
||||
v-model="page"
|
||||
:length="pageNum"
|
||||
prev-icon="fa-caret-left"
|
||||
next-icon="fa-caret-right"
|
||||
></v-pagination>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PublishCard from "./PublishCard.vue";
|
||||
import bots from "../public/bots.json";
|
||||
|
||||
export default {
|
||||
name: "Bots",
|
||||
components: {
|
||||
PublishCard
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
bots: bots,
|
||||
filterText: "",
|
||||
page: 1,
|
||||
dialog: false,
|
||||
valid: false,
|
||||
newBot: {
|
||||
name: null,
|
||||
desc: null,
|
||||
repo: null
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
pageNum() {
|
||||
return Math.ceil(this.filteredBots.length / 10);
|
||||
},
|
||||
filteredBots() {
|
||||
return this.bots.filter(bot => {
|
||||
return (
|
||||
bot.id.indexOf(this.filterText || "") != -1 ||
|
||||
bot.name.indexOf(this.filterText || "") != -1 ||
|
||||
bot.desc.indexOf(this.filterText || "") != -1 ||
|
||||
bot.author.indexOf(this.filterText || "") != -1
|
||||
);
|
||||
});
|
||||
},
|
||||
displayBots() {
|
||||
return this.filteredBots.slice((this.page - 1) * 10, this.page * 10);
|
||||
},
|
||||
publishBot() {
|
||||
if (!this.$refs.newBotForm.validate()) {
|
||||
return;
|
||||
}
|
||||
const title = encodeURIComponent(`Bot: ${this.newBot.name}`).replace(
|
||||
/%2B/gi,
|
||||
"+"
|
||||
);
|
||||
const body = encodeURIComponent(
|
||||
`
|
||||
**机器人名称:**
|
||||
|
||||
${this.newBot.name}
|
||||
|
||||
**机器人功能:**
|
||||
|
||||
${this.newBot.desc}
|
||||
|
||||
**机器人项目仓库/主页链接:**
|
||||
|
||||
${this.newBot.repo}
|
||||
|
||||
<!-- DO NOT EDIT ! -->
|
||||
<!--
|
||||
- name: ${this.newBot.name}
|
||||
- desc: ${this.newBot.desc}
|
||||
- repo: ${this.newBot.repo}
|
||||
-->
|
||||
`.trim()
|
||||
).replace(/%2B/gi, "+");
|
||||
window.open(
|
||||
`https://github.com/nonebot/nonebot2/issues/new?title=${title}&body=${body}&labels=Bot`
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
223
docs/.vuepress/components/Plugin.vue
Normal file
223
docs/.vuepress/components/Plugin.vue
Normal file
@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<v-card flat class="plugins">
|
||||
<v-row>
|
||||
<v-col cols="12" sm="4">
|
||||
<v-text-field
|
||||
v-model="filterText"
|
||||
dense
|
||||
rounded
|
||||
outlined
|
||||
clearable
|
||||
hide-details
|
||||
label="Filter Plugin"
|
||||
>
|
||||
<template v-slot:prepend-inner>
|
||||
<div class="v-input__icon v-input__icon--prepend-inner">
|
||||
<v-icon small>fa-filter</v-icon>
|
||||
</div>
|
||||
</template>
|
||||
</v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="4">
|
||||
<v-dialog v-model="dialog" max-width="600px">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn dark block color="primary" v-bind="attrs" v-on="on"
|
||||
>Publish Your Plugin
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Plugin Information</span>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-form ref="newPluginForm" v-model="valid" lazy-validation>
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
v-model="newPlugin.name"
|
||||
label="插件名称"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
v-model="newPlugin.desc"
|
||||
label="插件介绍"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
v-model="newPlugin.id"
|
||||
label="PyPI 项目名"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
v-model="newPlugin.link"
|
||||
label="插件 import 包名"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
v-model="newPlugin.repo"
|
||||
label="仓库/主页链接"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-form>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" text @click="dialog = false">
|
||||
Close
|
||||
</v-btn>
|
||||
<v-btn
|
||||
:disabled="!valid"
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="
|
||||
dialog = false;
|
||||
publishPlugin();
|
||||
"
|
||||
>
|
||||
Publish
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="4">
|
||||
<v-pagination
|
||||
v-model="page"
|
||||
:length="pageNum"
|
||||
prev-icon="fa-caret-left"
|
||||
next-icon="fa-caret-right"
|
||||
></v-pagination>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<hr />
|
||||
<v-row>
|
||||
<v-col
|
||||
cols="12"
|
||||
sm="6"
|
||||
v-for="(plugin, index) in displayPlugins"
|
||||
:key="index"
|
||||
>
|
||||
<PublishCard
|
||||
:name="plugin.name"
|
||||
:desc="plugin.desc"
|
||||
:id="plugin.id"
|
||||
:author="plugin.author"
|
||||
:link="plugin.repo"
|
||||
text="copy nb install command"
|
||||
:command="`nb plugin install ${plugin.id}`"
|
||||
></PublishCard>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-pagination
|
||||
v-model="page"
|
||||
:length="pageNum"
|
||||
prev-icon="fa-caret-left"
|
||||
next-icon="fa-caret-right"
|
||||
></v-pagination>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PublishCard from "./PublishCard.vue";
|
||||
import plugins from "../public/plugins.json";
|
||||
|
||||
export default {
|
||||
name: "Plugins",
|
||||
components: {
|
||||
PublishCard
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
plugins: plugins,
|
||||
filterText: "",
|
||||
page: 1,
|
||||
dialog: false,
|
||||
valid: false,
|
||||
newPlugin: {
|
||||
name: null,
|
||||
desc: null,
|
||||
id: null,
|
||||
link: null,
|
||||
repo: null
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
pageNum() {
|
||||
return Math.ceil(this.filteredPlugins.length / 10);
|
||||
},
|
||||
filteredPlugins() {
|
||||
return this.plugins.filter(plugin => {
|
||||
return (
|
||||
plugin.id.indexOf(this.filterText || "") != -1 ||
|
||||
plugin.name.indexOf(this.filterText || "") != -1 ||
|
||||
plugin.desc.indexOf(this.filterText || "") != -1 ||
|
||||
plugin.author.indexOf(this.filterText || "") != -1
|
||||
);
|
||||
});
|
||||
},
|
||||
displayPlugins() {
|
||||
return this.filteredPlugins.slice((this.page - 1) * 10, this.page * 10);
|
||||
},
|
||||
publishPlugin() {
|
||||
if (!this.$refs.newPluginForm.validate()) {
|
||||
return;
|
||||
}
|
||||
const title = encodeURIComponent(
|
||||
`Plugin: ${this.newPlugin.name}`
|
||||
).replace(/%2B/gi, "+");
|
||||
const body = encodeURIComponent(
|
||||
`
|
||||
**插件名称:**
|
||||
|
||||
${this.newPlugin.name}
|
||||
|
||||
**插件功能:**
|
||||
|
||||
${this.newPlugin.desc}
|
||||
|
||||
**PyPI 项目名:**
|
||||
|
||||
${this.newPlugin.link}
|
||||
|
||||
**插件 import 包名:**
|
||||
|
||||
${this.newPlugin.id}
|
||||
|
||||
**插件项目仓库/主页链接:**
|
||||
|
||||
${this.newPlugin.repo}
|
||||
|
||||
<!-- DO NOT EDIT ! -->
|
||||
<!--
|
||||
- id: ${this.newPlugin.id}
|
||||
- link: ${this.newPlugin.link}
|
||||
- name: ${this.newPlugin.name}
|
||||
- desc: ${this.newPlugin.desc}
|
||||
- repo: ${this.newPlugin.repo}
|
||||
-->
|
||||
`.trim()
|
||||
).replace(/%2B/gi, "+");
|
||||
window.open(
|
||||
`https://github.com/nonebot/nonebot2/issues/new?title=${title}&body=${body}&labels=Plugin`
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,165 +0,0 @@
|
||||
<template>
|
||||
<div class="plugins">
|
||||
<v-app>
|
||||
<v-main>
|
||||
<v-row>
|
||||
<v-col cols="12" sm="4">
|
||||
<v-text-field
|
||||
v-model="filterText"
|
||||
dense
|
||||
rounded
|
||||
outlined
|
||||
clearable
|
||||
hide-details
|
||||
label="Filter Plugin"
|
||||
>
|
||||
<template v-slot:prepend-inner>
|
||||
<div class="v-input__icon v-input__icon--prepend-inner">
|
||||
<v-icon small>fa-filter</v-icon>
|
||||
</div>
|
||||
</template>
|
||||
</v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="4">
|
||||
<v-btn
|
||||
block
|
||||
color="primary"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
href="https://github.com/nonebot/nonebot2/issues/new?labels=Plugin&template=plugin-publish.md&title=Plugin%3A+blabla+的插件"
|
||||
>Publish Your Plugin
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="4">
|
||||
<v-pagination
|
||||
v-model="page"
|
||||
:length="pageNum"
|
||||
prev-icon="fa-caret-left"
|
||||
next-icon="fa-caret-right"
|
||||
></v-pagination>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<hr />
|
||||
<v-row>
|
||||
<v-col
|
||||
cols="12"
|
||||
sm="6"
|
||||
v-for="(plugin, index) in displayPlugins"
|
||||
:key="index"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
{{ plugin.name }}
|
||||
<v-spacer></v-spacer>
|
||||
<a
|
||||
class="repo-link"
|
||||
v-if="repoLink(plugin.repo)"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
:title="plugin.repo"
|
||||
:href="repoLink(plugin.repo)"
|
||||
>
|
||||
<v-icon>fab fa-github</v-icon>
|
||||
</a>
|
||||
</v-card-title>
|
||||
<v-card-text>{{ plugin.desc }}</v-card-text>
|
||||
<v-card-text>
|
||||
<v-icon x-small>fa-fingerprint</v-icon>
|
||||
{{ plugin.id }}
|
||||
<v-icon x-small class="ml-2">fa-user</v-icon>
|
||||
{{ plugin.author }}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn
|
||||
block
|
||||
depressed
|
||||
class="btn-copy"
|
||||
@click="copyCommand(plugin)"
|
||||
>
|
||||
copy nb-cli command
|
||||
<v-icon right small>fa-copy</v-icon>
|
||||
</v-btn>
|
||||
<v-snackbar v-model="snackbar">Copied!</v-snackbar>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-pagination
|
||||
v-model="page"
|
||||
:length="pageNum"
|
||||
prev-icon="fa-caret-left"
|
||||
next-icon="fa-caret-right"
|
||||
></v-pagination>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-main>
|
||||
</v-app>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import copy from "copy-to-clipboard";
|
||||
import plugins from "../public/plugins.json";
|
||||
|
||||
export default {
|
||||
name: "Plugins",
|
||||
data() {
|
||||
return {
|
||||
plugins: plugins,
|
||||
snackbar: false,
|
||||
filterText: "",
|
||||
page: 1
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
pageNum() {
|
||||
return Math.ceil(this.filteredPlugins.length / 10);
|
||||
},
|
||||
filteredPlugins() {
|
||||
return this.plugins.filter(plugin => {
|
||||
return (
|
||||
plugin.id.indexOf(this.filterText) != -1 ||
|
||||
plugin.name.indexOf(this.filterText) != -1 ||
|
||||
plugin.desc.indexOf(this.filterText) != -1 ||
|
||||
plugin.author.indexOf(this.filterText) != -1
|
||||
);
|
||||
});
|
||||
},
|
||||
displayPlugins() {
|
||||
return this.filteredPlugins.slice((this.page - 1) * 10, this.page * 10);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
repoLink(repo) {
|
||||
if (repo) {
|
||||
return /^https?:/.test(repo) ? repo : `https://github.com/${repo}`;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
copyCommand(plugin) {
|
||||
copy(`nb plugin install ${plugin.id}`, {
|
||||
format: "text/plain"
|
||||
});
|
||||
this.snackbar = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.v-application--wrap {
|
||||
min-height: 0 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.repo-link {
|
||||
text-decoration: none !important;
|
||||
display: inline-block;
|
||||
}
|
||||
.repo-link:hover i {
|
||||
color: #ea5252;
|
||||
}
|
||||
</style>
|
84
docs/.vuepress/components/PublishCard.vue
Normal file
84
docs/.vuepress/components/PublishCard.vue
Normal file
@ -0,0 +1,84 @@
|
||||
<template>
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
{{ name }}
|
||||
<v-spacer></v-spacer>
|
||||
<a
|
||||
class="repo-link"
|
||||
v-if="repoLink(link)"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
:title="link"
|
||||
:href="repoLink(link)"
|
||||
>
|
||||
<v-icon>fab fa-github</v-icon>
|
||||
</a>
|
||||
</v-card-title>
|
||||
<v-card-text>{{ desc }}</v-card-text>
|
||||
<v-card-text>
|
||||
<template v-if="id">
|
||||
<v-icon x-small>fa-fingerprint</v-icon>
|
||||
{{ id }}
|
||||
</template>
|
||||
<v-icon x-small class="ml-2">fa-user</v-icon>
|
||||
{{ author }}
|
||||
</v-card-text>
|
||||
<v-card-actions v-if="showCommand">
|
||||
<v-btn block depressed class="btn-copy" @click="copyCommand()">
|
||||
{{ text }}
|
||||
<v-icon right small>fa-copy</v-icon>
|
||||
</v-btn>
|
||||
<v-snackbar v-model="snackbar">Copied!</v-snackbar>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import copy from "copy-to-clipboard";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
name: String,
|
||||
desc: String,
|
||||
id: String,
|
||||
author: String,
|
||||
link: String,
|
||||
text: String,
|
||||
command: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
snackbar: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
showCommand() {
|
||||
return this.text && this.command;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
repoLink(repo) {
|
||||
if (repo) {
|
||||
return /^https?:/.test(repo) ? repo : `https://github.com/${repo}`;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
copyCommand() {
|
||||
copy(this.command, {
|
||||
format: "text/plain"
|
||||
});
|
||||
this.snackbar = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.repo-link {
|
||||
text-decoration: none !important;
|
||||
display: inline-block;
|
||||
}
|
||||
.repo-link:hover i {
|
||||
color: #ea5252;
|
||||
}
|
||||
</style>
|
70
docs/.vuepress/components/Store.vue
Normal file
70
docs/.vuepress/components/Store.vue
Normal file
@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div class="store">
|
||||
<v-app>
|
||||
<v-main>
|
||||
<v-card>
|
||||
<v-toolbar dense flat>
|
||||
<v-tabs v-model="tab" centered>
|
||||
<v-tab v-for="(name, index) in tabs" :key="index">{{
|
||||
name
|
||||
}}</v-tab>
|
||||
</v-tabs>
|
||||
</v-toolbar>
|
||||
<v-tabs-items class="sub-item" v-model="tab">
|
||||
<v-tab-item>
|
||||
<Adapter></Adapter>
|
||||
</v-tab-item>
|
||||
<v-tab-item>
|
||||
<Plugin></Plugin>
|
||||
</v-tab-item>
|
||||
<v-tab-item>
|
||||
<Bot></Bot>
|
||||
</v-tab-item>
|
||||
</v-tabs-items>
|
||||
</v-card>
|
||||
</v-main>
|
||||
</v-app>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Adapter from "./Adapter.vue";
|
||||
import Plugin from "./Plugin.vue";
|
||||
import Bot from "./Bot.vue";
|
||||
|
||||
export default {
|
||||
name: "Store",
|
||||
components: {
|
||||
Adapter,
|
||||
Plugin,
|
||||
Bot
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tab: 1,
|
||||
tabs: {
|
||||
0: "协议",
|
||||
1: "插件",
|
||||
2: "机器人"
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.v-application--wrap {
|
||||
min-height: 0 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.store {
|
||||
margin: 0 -20px;
|
||||
}
|
||||
.sub-item {
|
||||
padding: 0 10px;
|
||||
}
|
||||
</style>
|
@ -82,7 +82,7 @@ module.exports = context => ({
|
||||
{ text: "指南", link: "/guide/" },
|
||||
{ text: "进阶", link: "/advanced/" },
|
||||
{ text: "API", link: "/api/" },
|
||||
{ text: "插件广场", link: "/plugin-store" },
|
||||
{ text: "商店", link: "/store" },
|
||||
{ text: "更新日志", link: "/changelog" }
|
||||
],
|
||||
sidebarDepth: 2,
|
||||
|
1
docs/.vuepress/public/bots.json
Normal file
1
docs/.vuepress/public/bots.json
Normal file
@ -0,0 +1 @@
|
||||
[]
|
@ -1,6 +0,0 @@
|
||||
---
|
||||
---
|
||||
|
||||
# 插件广场
|
||||
|
||||
<Plugins></Plugins>
|
6
pages/store.md
Normal file
6
pages/store.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
---
|
||||
|
||||
# 商店
|
||||
|
||||
<Store></Store>
|
Loading…
Reference in New Issue
Block a user