Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien8261 committed Aug 1, 2024
1 parent 2567a3a commit 324c1cc
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/request/remote/amiyabotServer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import HttpRequest from '@/lib/http'
import { StringDict } from '@/lib/common'

export const amiyaBotServerHost = 'https://server.amiyabot.com:8020'
export const amiyaBotServerHost = 'https://server.amiyabot.com:10001'
export const uploadPluginUrl = amiyaBotServerHost + '/uploadPlugin'

export const amiyaBotServer = new HttpRequest({
Expand Down
30 changes: 1 addition & 29 deletions src/views/app/dashboard/dashboard.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
<template>
<div>
<div style="padding-bottom: 15px" ref="noticeArea" v-if="notice">
<el-alert type="warning">
<template #title>
<div style="display: flex;align-items: center;">
<el-icon>
<BellFilled/>
</el-icon>
<span style="padding-left: 5px">公告</span>
</div>
</template>
<div v-html="notice"></div>
</el-alert>
</div>
<community/>
<el-card class="content-area" :class="{ 'no-notice': !notice }">
<el-tabs v-model="page">
Expand All @@ -39,44 +26,29 @@

<script lang="ts">
import { Options, Vue } from 'vue-class-component'
import { BellFilled } from '@element-plus/icons-vue'
import Logger from '@/views/app/dashboard/elem/logger.vue'
import Community from '@/views/app/dashboard/elem/community.vue'
import MessageAnalysis from '@/views/app/dashboard/elem/messageAnalysis.vue'
import FuncUsage from '@/views/app/dashboard/elem/funcUsage.vue'
import { getNotice } from '@/request/remote/cosServer'
@Options({
components: {
Logger,
Community,
MessageAnalysis,
FuncUsage,
BellFilled
FuncUsage
},
methods: {
pagePosition () {
return {
transform: `translateX(-${100 / 3 * (parseInt(this.page) - 1)}%)`
}
}
},
mounted () {
this.getNotice()
}
})
export default class Dashboard extends Vue {
private notice = ''
private page = '1'
public async getNotice () {
const res = await getNotice()
if (res) {
this.notice = res
}
}
}
</script>

Expand Down
8 changes: 7 additions & 1 deletion src/views/main/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,14 @@

.app-con {
width: calc(100% - 260px);
display: flex;
flex-direction: column;

& > div:first-child {
padding-bottom: 15px;
}

& > div:nth-child(2) {
height: 40px;
margin-bottom: 15px;
display: flex;
Expand All @@ -81,7 +87,7 @@
}

& > div:last-child {
height: calc(100% - 55px);
flex: 2;
position: relative;
}

Expand Down
32 changes: 29 additions & 3 deletions src/views/main/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@
<main-nav @on-selected="name => this.name = name"></main-nav>
</div>
<div class="app-con">
<div>
<el-alert type="error" v-if="notice">
<template #title>
<div style="display: flex;align-items: center;">
<el-icon>
<BellFilled/>
</el-icon>
<span style="padding-left: 5px">公告</span>
</div>
</template>
<div v-html="notice"></div>
</el-alert>
</div>
<div>
<div style="font-size: 20px;display: flex;">
<el-icon class="icon">
Expand Down Expand Up @@ -94,15 +107,18 @@

<script lang="ts">
import { Options, Vue } from 'vue-class-component'
import { Setting } from '@element-plus/icons-vue'
import MainNav, { navName, navIcon } from '@/views/main/mainNav.vue'
import { BellFilled, Setting } from '@element-plus/icons-vue'
import MainNav, { navIcon, navName } from '@/views/main/mainNav.vue'
import Common from '@/lib/common'
import HttpRequest from '@/lib/http'
import { getNotice } from '@/request/remote/cosServer'
@Options({
components: {
MainNav,
Setting
Setting,
BellFilled
},
methods: {
originHost () {
Expand All @@ -116,13 +132,16 @@ import HttpRequest from '@/lib/http'
},
mounted () {
this.ready = !!this.settingForm.host
this.getNotice()
}
})
export default class Main extends Vue {
public name = ''
public navName = navName
public navIcon = navIcon
private notice = ''
private ready = false
private setting = false
private settingForm = {
Expand Down Expand Up @@ -165,6 +184,13 @@ export default class Main extends Vue {
this.ready = true
}
}
public async getNotice () {
const res = await getNotice()
if (res) {
this.notice = res
}
}
}
</script>

Expand Down

0 comments on commit 324c1cc

Please sign in to comment.