🎨 format files

This commit is contained in:
StarHeartHunt 2021-04-05 13:44:19 +08:00
parent 20e1bf9624
commit 1c6711355e
10 changed files with 174 additions and 174 deletions

View File

@ -82,8 +82,8 @@
color="blue darken-1"
text
@click="
dialog = false;
publishAdapter();
dialog = false
publishAdapter()
"
>
发布
@ -99,7 +99,8 @@
:length="pageNum"
prev-icon="fa-caret-left"
next-icon="fa-caret-right"
></v-pagination></v-col>
></v-pagination
></v-col>
<v-row>
<v-col
cols="12"
@ -128,18 +129,18 @@
</template>
<script>
import PublishCard from "./PublishCard.vue";
import adapters from "../public/adapters.json";
import PublishCard from './PublishCard.vue'
import adapters from '../public/adapters.json'
export default {
name: "Adapters",
name: 'Adapters',
components: {
PublishCard
PublishCard,
},
data() {
return {
adapters: adapters,
filterText: "",
filterText: '',
page: 1,
dialog: false,
valid: false,
@ -148,34 +149,34 @@ export default {
desc: null,
id: null,
link: null,
repo: null
repo: null,
},
}
};
},
computed: {
pageNum() {
return Math.ceil(this.filteredAdapters.length / 10);
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 ||
adapter.desc.indexOf(this.filterText || "") != -1 ||
adapter.author.indexOf(this.filterText || "") != -1
);
});
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);
return this.filteredAdapters.slice((this.page - 1) * 10, this.page * 10)
},
publishPlugin() {
if (!this.$refs.newAdapterForm.validate()) {
return;
return
}
const title = encodeURIComponent(
`Adapter: ${this.newAdapter.name}`
).replace(/%2B/gi, "+");
).replace(/%2B/gi, '+')
const body = encodeURIComponent(
`
**协议名称**
@ -207,11 +208,11 @@ ${this.newAdapter.repo}
- repo: ${this.newAdapter.repo}
-->
`.trim()
).replace(/%2B/gi, "+");
).replace(/%2B/gi, '+')
window.open(
`https://github.com/nonebot/nonebot2/issues/new?title=${title}&body=${body}&labels=Adapter`
);
)
},
},
}
}
};
</script>

View File

@ -68,8 +68,8 @@
color="blue darken-1"
text
@click="
dialog = false;
publishBot();
dialog = false
publishBot()
"
>
发布
@ -109,52 +109,52 @@
</template>
<script>
import PublishCard from "./PublishCard.vue";
import bots from "../public/bots.json";
import PublishCard from './PublishCard.vue'
import bots from '../public/bots.json'
export default {
name: "Bots",
name: 'Bots',
components: {
PublishCard
PublishCard,
},
data() {
return {
bots: bots,
filterText: "",
filterText: '',
page: 1,
dialog: false,
valid: false,
newBot: {
name: null,
desc: null,
repo: null
repo: null,
},
}
};
},
computed: {
pageNum() {
return Math.ceil(this.filteredBots.length / 10);
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 ||
bot.author.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);
return this.filteredBots.slice((this.page - 1) * 10, this.page * 10)
},
publishBot() {
if (!this.$refs.newBotForm.validate()) {
return;
return
}
const title = encodeURIComponent(`Bot: ${this.newBot.name}`).replace(
/%2B/gi,
"+"
);
'+'
)
const body = encodeURIComponent(
`
**机器人名称**
@ -176,11 +176,11 @@ ${this.newBot.repo}
- repo: ${this.newBot.repo}
-->
`.trim()
).replace(/%2B/gi, "+");
).replace(/%2B/gi, '+')
window.open(
`https://github.com/nonebot/nonebot2/issues/new?title=${title}&body=${body}&labels=Bot`
);
)
},
},
}
}
};
</script>

View File

@ -128,32 +128,32 @@
</template>
<script>
import { WOW } from "wowjs";
import "animate.css/animate.min.css";
import { WOW } from 'wowjs'
import 'animate.css/animate.min.css'
export default {
name: "Messenger",
name: 'Messenger',
props: {
messages: {
type: Array,
default: () => []
}
default: () => [],
},
},
methods: {
initWOW: function () {
new WOW({
noxClass: "wow",
animateClass: "animate__animated",
noxClass: 'wow',
animateClass: 'animate__animated',
offset: 0,
mobile: true,
live: true
}).init();
}
live: true,
}).init()
},
},
mounted() {
this.initWOW();
this.initWOW()
},
}
};
</script>
<style scoped>
@ -183,7 +183,7 @@ export default {
background-color: #fff;
}
.message .message-box::after {
content: "";
content: '';
position: absolute;
right: 100%;
top: 0;

View File

@ -82,8 +82,8 @@
color="blue darken-1"
text
@click="
dialog = false;
publishPlugin();
dialog = false
publishPlugin()
"
>
发布
@ -131,18 +131,18 @@
</template>
<script>
import PublishCard from "./PublishCard.vue";
import plugins from "../public/plugins.json";
import PublishCard from './PublishCard.vue'
import plugins from '../public/plugins.json'
export default {
name: "Plugins",
name: 'Plugins',
components: {
PublishCard
PublishCard,
},
data() {
return {
plugins: plugins,
filterText: "",
filterText: '',
page: 1,
dialog: false,
valid: false,
@ -151,34 +151,34 @@ export default {
desc: null,
id: null,
link: null,
repo: null
repo: null,
},
}
};
},
computed: {
pageNum() {
return Math.ceil(this.filteredPlugins.length / 10);
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 ||
plugin.desc.indexOf(this.filterText || "") != -1 ||
plugin.author.indexOf(this.filterText || "") != -1
);
});
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);
return this.filteredPlugins.slice((this.page - 1) * 10, this.page * 10)
},
publishPlugin() {
if (!this.$refs.newPluginForm.validate()) {
return;
return
}
const title = encodeURIComponent(
`Plugin: ${this.newPlugin.name}`
).replace(/%2B/gi, "+");
).replace(/%2B/gi, '+')
const body = encodeURIComponent(
`
**插件名称**
@ -210,11 +210,11 @@ ${this.newPlugin.repo}
- repo: ${this.newPlugin.repo}
-->
`.trim()
).replace(/%2B/gi, "+");
).replace(/%2B/gi, '+')
window.open(
`https://github.com/nonebot/nonebot2/issues/new?title=${title}&body=${body}&labels=Plugin`
);
)
},
},
}
}
};
</script>

View File

@ -34,7 +34,7 @@
</template>
<script>
import copy from "copy-to-clipboard";
import copy from 'copy-to-clipboard'
export default {
props: {
@ -44,33 +44,33 @@ 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;
}
return this.text && this.command
},
},
methods: {
repoLink(repo) {
if (repo) {
return /^https?:/.test(repo) ? repo : `https://github.com/${repo}`;
return /^https?:/.test(repo) ? repo : `https://github.com/${repo}`
}
return null;
return null
},
copyCommand() {
copy(this.command, {
format: "text/plain"
});
this.snackbar = true;
format: 'text/plain',
})
this.snackbar = true
},
},
}
}
};
</script>
<style scoped>

View File

@ -28,30 +28,30 @@
</template>
<script>
import Adapter from "./Adapter.vue";
import Plugin from "./Plugin.vue";
import Bot from "./Bot.vue";
import Adapter from './Adapter.vue'
import Plugin from './Plugin.vue'
import Bot from './Bot.vue'
export default {
name: "Store",
name: 'Store',
components: {
Adapter,
Plugin,
Bot
Bot,
},
data() {
return {
tab: 1,
tabs: {
0: "协议",
1: "插件",
2: "机器人"
0: '协议',
1: '插件',
2: '机器人',
},
}
};
},
computed: {},
methods: {}
};
methods: {},
}
</script>
<style>

View File

@ -1,2 +1 @@
# 权限控制

View File

@ -37,7 +37,7 @@ AweSome-Bot
:::warning 提示
如果您使用如 `VSCode` / `PyCharm` 等 IDE 启动 nonebot请检查 IDE 当前工作空间目录是否与当前侧边栏打开目录一致。
* 在二者不一致的环境下可能导致 nonebot 读取配置文件和插件等不符合预期
- 注意:在二者不一致的环境下可能导致 nonebot 读取配置文件和插件等不符合预期
:::
通过 `nb-cli`