Skip to content

Commit

Permalink
Merge pull request #26 from HibiKier/dev
Browse files Browse the repository at this point in the history
版本更新
  • Loading branch information
HibiKier authored Oct 21, 2024
2 parents 46f9e0b + 3c74fa7 commit 44a71bf
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/command/LeftInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<el-divider />
<div class="base-info-box">
<div class="base-info-box-item">
<p class="base-info-item-text">{{ 34 }}</p>
<p class="base-info-item-text">{{ botInfo.connect_count }}</p>
<p class="base-small-title">累计登录</p>
</div>
<el-divider direction="vertical" />
Expand Down
2 changes: 1 addition & 1 deletion src/components/command/MidInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ export default {
var loading = this.getLoading(".ch-count")
}
this.getRequest(`${this.$root.prefix}/main/get_all_ch_count`, {
this.getRequest(`${this.$root.prefix}/main/get_all_chat_count`, {
bot_id,
}).then((resp) => {
if (resp.suc) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboard/LeftInfo.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="left-info">
<div class="top-text">在线小真寻</div>
<div class="top-text">在线小真寻({{ botList.length }})</div>
<div class="bot-list">
<div v-for="bot in botList" :key="bot.id" class="bot-item">
<div style="width: 100%">
Expand Down
34 changes: 26 additions & 8 deletions src/components/dashboard/RightInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default {
data() {
return {
botInfo: null,
botConfig: {},
botConfig: { driver: "" },
selectGroupType: "all",
selectHotPluginType: "all",
groupChart: null,
Expand Down Expand Up @@ -215,17 +215,11 @@ export default {
},
created() {
this.botInfo = this.$store.state.botInfo || {}
if (this.botInfo) {
this.botConfig = this.botInfo.config || {}
this.botConfig.nicknames = ""
if (this.botConfig.nickname) {
this.botConfig.nicknames = this.botConfig.nickname.join(",")
}
}
},
mounted() {
this.groupChart = this.$echarts.init(this.$refs.groupChart)
this.hotPluginChart = this.$echarts.init(this.$refs.hotPluginChart)
this.getNonebotConfig()
this.getActiveGroupData()
this.getHotPlugin()
this.groupCntInterval = setInterval(() => {
Expand All @@ -238,6 +232,30 @@ export default {
}
},
methods: {
getNonebotConfig() {
console.log("ttttttttt")
const loading = this.getLoading(".base-border")
this.getRequest(`${this.$root.prefix}/dashboard/get_nonebot_config`).then(
(resp) => {
if (resp.suc) {
if (resp.warning) {
this.$message.warning(resp.info)
} else {
this.$message.success(resp.info)
this.botConfig = resp.data
this.botConfig.nicknames = ""
if (this.botConfig.nickname) {
this.botConfig.nicknames = this.botConfig.nickname.join(",")
}
}
} else {
this.$message.error(resp.info)
}
loading.close()
}
)
},
clickGroupType(type) {
this.selectGroupType = type
this.getActiveGroupData(type)
Expand Down
4 changes: 4 additions & 0 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ export default {
this.botInfo = this.$store.state.botInfo
for (const bot of this.botList) {
bot.is_select = bot.self_id == this.botInfo.self_id
if (bot.is_select) {
this.botInfo = bot
this.$store.commit("SET_BOT", bot)
}
}
} else {
for (const bot of this.botList) {
Expand Down

0 comments on commit 44a71bf

Please sign in to comment.