Skip to content

Commit

Permalink
feat: refactor routing and menu, as well as fix #6
Browse files Browse the repository at this point in the history
  • Loading branch information
jipengfei01 committed Jul 13, 2023
1 parent 31b6745 commit 0c2a0a2
Show file tree
Hide file tree
Showing 54 changed files with 2,636 additions and 3,504 deletions.
158 changes: 158 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"dependencies": {
"@types/diff": "^5.0.3",
"@vueuse/core": "^10.2.1",
"axios": "^1.2.2",
"dayjs": "^1.11.7",
"diff": "^5.1.0",
Expand All @@ -27,6 +28,7 @@
"less": "^4.1.3",
"md5": "^2.3.0",
"normalize.css": "^8.0.1",
"nprogress": "^0.2.0",
"pinia": "^2.0.30",
"postcss-preset-env": "^7.8.3",
"qs": "^6.11.1",
Expand All @@ -46,6 +48,7 @@
"@types/js-cookie": "^3.0.3",
"@types/js-md5": "^0.7.0",
"@types/node": "^18.11.18",
"@types/nprogress": "^0.2.0",
"@types/qs": "^6.9.7",
"@types/url-parse": "^1.4.8",
"@typescript-eslint/eslint-plugin": "^5.60.1",
Expand Down
6 changes: 6 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
</template>
<script setup lang="ts">
import { NConfigProvider, NMessageProvider, zhCN } from 'naive-ui'
import { useUserStore } from '@/store/user'
const userStore = useUserStore()
userStore.getUserInfo()
const themeColor = 'rgba(22, 125, 255, 0.8)'
const themeOverrides = {
common: {
Expand Down
21 changes: 8 additions & 13 deletions src/api/alert.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { AlertMsgData, GetAlertMsgsParams } from '@/model/alert'
import type {
AlertMsgData,
GetAlertMsgsParams,
PostAlertConfig,
} from '@/model/alert'
import type { Res } from '@/utils/_fetch'
import _fetch from '@/utils/_fetch'

Expand All @@ -13,7 +17,7 @@ export const getAlertMessageApi = (data: GetAlertMsgsParams) => {

//获取用户未读告警数量
export const getUnreadAlertMessageApi = () => {
return _fetch<Res<{ result: any }>>({
return _fetch<Res<number>>({
method: 'GET',
url: `/curvebs?method=alert.unread.num.get`,
})
Expand Down Expand Up @@ -60,7 +64,7 @@ export const updateAlertCandidateApi = (data: Object) => {
}

//更新告警配置
export const updateAlertRuleApi = (data: Object) => {
export const updateAlertRuleApi = (data: PostAlertConfig) => {
return _fetch<Res<{ result: any }>>({
method: 'POST',
url: `/curvebs?method=alert.conf.update`,
Expand All @@ -70,17 +74,8 @@ export const updateAlertRuleApi = (data: Object) => {

//获取告警联系人候选人
export const getAlertCandidateApi = () => {
return _fetch<Res<{ result: any }>>({
return _fetch<Res<string[]>>({
method: 'GET',
url: `/curvebs?method=alert.candidate.get`,
})
}

//更新告警联系人
export const updateAlertUserApi = (data: Object) => {
return _fetch<Res<{ result: any }>>({
method: 'POST',
url: `/curvebs?method=alert.user.update`,
data,
})
}
Loading

0 comments on commit 0c2a0a2

Please sign in to comment.