Merge branch 'dev' into richardchien-patch-1

This commit is contained in:
Ju4tCode
2021-05-29 18:15:32 +08:00
committed by GitHub
63 changed files with 1492 additions and 823 deletions

View File

@ -1,7 +1,7 @@
<template>
<v-card flat class="adapters">
<v-row>
<v-col cols="12" sm="4">
<v-row class="justify-center">
<v-col cols="12" sm="6">
<v-text-field
v-model="filterText"
dense
@ -9,7 +9,7 @@
outlined
clearable
hide-details
label="Filter Adapter"
label="搜索适配器"
>
<template v-slot:prepend-inner>
<div class="v-input__icon v-input__icon--prepend-inner">
@ -18,16 +18,16 @@
</template>
</v-text-field>
</v-col>
<v-col cols="12" sm="4">
<v-col cols="12" sm="6">
<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>
<span class="headline">适配器信息</span>
</v-card-title>
<v-card-text>
<v-form ref="newAdapterForm" v-model="valid" lazy-validation>
@ -49,14 +49,14 @@
</v-col>
<v-col cols="12">
<v-text-field
v-model="newAdapter.id"
v-model="newAdapter.link"
label="PyPI 项目名"
required
></v-text-field>
</v-col>
<v-col cols="12">
<v-text-field
v-model="newAdapter.link"
v-model="newAdapter.id"
label="协议 import 包名"
required
></v-text-field>
@ -75,7 +75,7 @@
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" text @click="dialog = false">
Close
关闭
</v-btn>
<v-btn
:disabled="!valid"
@ -86,22 +86,23 @@
publishAdapter();
"
>
Publish
发布
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-col>
<v-col cols="12" sm="4">
</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-pagination
></v-col>
</v-row>
<hr />
<v-row>
<v-col
cols="12"
@ -138,7 +139,7 @@ import adapters from "../public/adapters.json";
export default {
name: "Adapters",
components: {
PublishCard
PublishCard,
},
data() {
return {
@ -152,8 +153,8 @@ export default {
desc: null,
id: null,
link: null,
repo: null
}
repo: null,
},
};
},
computed: {
@ -161,7 +162,7 @@ export default {
return Math.ceil(this.filteredAdapters.length / 10);
},
filteredAdapters() {
return this.adapters.filter(adapter => {
return this.adapters.filter((adapter) => {
return (
adapter.id.indexOf(this.filterText || "") != -1 ||
adapter.name.indexOf(this.filterText || "") != -1 ||
@ -173,7 +174,7 @@ export default {
displayAdapters() {
return this.filteredAdapters.slice((this.page - 1) * 10, this.page * 10);
},
publishPlugin() {
publishAdapter() {
if (!this.$refs.newAdapterForm.validate()) {
return;
}
@ -215,7 +216,7 @@ ${this.newAdapter.repo}
window.open(
`https://github.com/nonebot/nonebot2/issues/new?title=${title}&body=${body}&labels=Adapter`
);
}
}
},
},
};
</script>

View File

@ -1,7 +1,7 @@
<template>
<v-card flat class="bots">
<v-row>
<v-col cols="12" sm="4">
<v-col cols="12" sm="6">
<v-text-field
v-model="filterText"
dense
@ -9,7 +9,7 @@
outlined
clearable
hide-details
label="Filter Bot"
label="搜索机器人"
>
<template v-slot:prepend-inner>
<div class="v-input__icon v-input__icon--prepend-inner">
@ -18,16 +18,16 @@
</template>
</v-text-field>
</v-col>
<v-col cols="12" sm="4">
<v-col cols="12" sm="6">
<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>
<span class="headline">机器人信息</span>
</v-card-title>
<v-card-text>
<v-form ref="newBotForm" v-model="valid" lazy-validation>
@ -61,7 +61,7 @@
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" text @click="dialog = false">
Close
关闭
</v-btn>
<v-btn
:disabled="!valid"
@ -72,13 +72,15 @@
publishBot();
"
>
Publish
发布
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-col>
<v-col cols="12" sm="4">
</v-row>
<v-row>
<v-col cols="12">
<v-pagination
v-model="page"
:length="pageNum"
@ -87,7 +89,6 @@
></v-pagination>
</v-col>
</v-row>
<hr />
<v-row>
<v-col cols="12" sm="6" v-for="(bot, index) in displayBots" :key="index">
<PublishCard
@ -118,7 +119,7 @@ import bots from "../public/bots.json";
export default {
name: "Bots",
components: {
PublishCard
PublishCard,
},
data() {
return {
@ -130,8 +131,8 @@ export default {
newBot: {
name: null,
desc: null,
repo: null
}
repo: null,
},
};
},
computed: {
@ -139,7 +140,7 @@ export default {
return Math.ceil(this.filteredBots.length / 10);
},
filteredBots() {
return this.bots.filter(bot => {
return this.bots.filter((bot) => {
return (
bot.name.indexOf(this.filterText || "") != -1 ||
bot.desc.indexOf(this.filterText || "") != -1 ||
@ -183,7 +184,7 @@ ${this.newBot.repo}
window.open(
`https://github.com/nonebot/nonebot2/issues/new?title=${title}&body=${body}&labels=Bot`
);
}
}
},
},
};
</script>

View File

@ -136,8 +136,8 @@ export default {
props: {
messages: {
type: Array,
default: () => []
}
default: () => [],
},
},
methods: {
initWOW: function() {
@ -146,13 +146,13 @@ export default {
animateClass: "animate__animated",
offset: 0,
mobile: true,
live: true
live: true,
}).init();
}
},
},
mounted() {
this.initWOW();
}
},
};
</script>

View File

@ -1,7 +1,7 @@
<template>
<v-card flat class="plugins">
<v-row>
<v-col cols="12" sm="4">
<v-col cols="12" sm="6">
<v-text-field
v-model="filterText"
dense
@ -9,7 +9,7 @@
outlined
clearable
hide-details
label="Filter Plugin"
label="搜索插件"
>
<template v-slot:prepend-inner>
<div class="v-input__icon v-input__icon--prepend-inner">
@ -18,16 +18,16 @@
</template>
</v-text-field>
</v-col>
<v-col cols="12" sm="4">
<v-col cols="12" sm="6">
<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>
<span class="headline">插件信息</span>
</v-card-title>
<v-card-text>
<v-form ref="newPluginForm" v-model="valid" lazy-validation>
@ -75,7 +75,7 @@
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" text @click="dialog = false">
Close
关闭
</v-btn>
<v-btn
:disabled="!valid"
@ -86,13 +86,15 @@
publishPlugin();
"
>
Publish
发布
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-col>
<v-col cols="12" sm="4">
</v-row>
<v-row>
<v-col cols="12">
<v-pagination
v-model="page"
:length="pageNum"
@ -101,7 +103,6 @@
></v-pagination>
</v-col>
</v-row>
<hr />
<v-row>
<v-col
cols="12"
@ -115,7 +116,7 @@
:id="plugin.id"
:author="plugin.author"
:link="plugin.repo"
text="copy nb install command"
text="点此复制安装命令"
:command="`nb plugin install ${plugin.id}`"
></PublishCard>
</v-col>
@ -140,7 +141,7 @@ import plugins from "../public/plugins.json";
export default {
name: "Plugins",
components: {
PublishCard
PublishCard,
},
data() {
return {
@ -154,8 +155,8 @@ export default {
desc: null,
id: null,
link: null,
repo: null
}
repo: null,
},
};
},
computed: {
@ -163,7 +164,7 @@ export default {
return Math.ceil(this.filteredPlugins.length / 10);
},
filteredPlugins() {
return this.plugins.filter(plugin => {
return this.plugins.filter((plugin) => {
return (
plugin.id.indexOf(this.filterText || "") != -1 ||
plugin.name.indexOf(this.filterText || "") != -1 ||
@ -217,7 +218,7 @@ ${this.newPlugin.repo}
window.open(
`https://github.com/nonebot/nonebot2/issues/new?title=${title}&body=${body}&labels=Plugin`
);
}
}
},
},
};
</script>

View File

@ -28,7 +28,7 @@
{{ text }}
<v-icon right small>fa-copy</v-icon>
</v-btn>
<v-snackbar v-model="snackbar">Copied!</v-snackbar>
<v-snackbar v-model="snackbar">复制成功</v-snackbar>
</v-card-actions>
</v-card>
</template>
@ -44,17 +44,17 @@ export default {
author: String,
link: String,
text: String,
command: String
command: String,
},
data() {
return {
snackbar: false
snackbar: false,
};
},
computed: {
showCommand() {
return this.text && this.command;
}
},
},
methods: {
repoLink(repo) {
@ -65,11 +65,11 @@ export default {
},
copyCommand() {
copy(this.command, {
format: "text/plain"
format: "text/plain",
});
this.snackbar = true;
}
}
},
},
};
</script>

View File

@ -10,7 +10,7 @@
}}</v-tab>
</v-tabs>
</v-toolbar>
<v-tabs-items class="sub-item" v-model="tab">
<v-tabs-items class="sub-item pt-1" v-model="tab">
<v-tab-item>
<Adapter></Adapter>
</v-tab-item>
@ -37,7 +37,7 @@ export default {
components: {
Adapter,
Plugin,
Bot
Bot,
},
data() {
return {
@ -45,12 +45,12 @@ export default {
tabs: {
0: "协议",
1: "插件",
2: "机器人"
}
2: "机器人",
},
};
},
computed: {},
methods: {}
methods: {},
};
</script>