Skip to content

Commit

Permalink
feat: 新增 monitor 导航
Browse files Browse the repository at this point in the history
  • Loading branch information
ikxin committed Aug 12, 2023
1 parent 1c7063a commit 108f0eb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
10 changes: 10 additions & 0 deletions src/assets/icons/others/monitor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/components/custom-header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const navItems = computed(() => [
label: t('main.module.tools'),
icon: 'i-icons:tools',
},
{
name: 'monitor',
label: t('main.module.monitor'),
icon: 'i-icons:monitor',
},
])
const router = useRouter()
Expand Down
9 changes: 5 additions & 4 deletions src/locales/en/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ export default {
author: 'ikxin',
module: {
activate: 'Activate',
tools: 'Tools'
monitor: 'Monitor',
tools: 'Tools',
},
theme: {
auto: 'Auto Mode',
dark: 'Dark Mode',
light: 'Light Mode'
light: 'Light Mode',
},
languages: {
en: 'English',
zhCn: 'Simplified Chinese'
}
zhCn: 'Simplified Chinese',
},
}
5 changes: 3 additions & 2 deletions src/store/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ export const useMonitorStore = defineStore('monitor', async () => {
'm794366683-525bb3bcd660d58d54fd8045',
'm791948435-e8e6c704d43fac76fb6cd3ea',
'm794992994-7688fbdc23c247ff8f2cd07d',
'm790633514-8e1d658a806daa670799a6f5',
]

const timestamps = Array.from({ length: 90 }, (_, num) => {
const timestamps = Array.from({ length: 120 }, (_, num) => {
return (
dayjs().startOf('day').subtract(num, 'day').unix() +
'_' +
Expand All @@ -21,7 +22,7 @@ export const useMonitorStore = defineStore('monitor', async () => {
}).reverse()

const params = {
api_key: apiKey[0],
api_key: apiKey[5],
custom_uptime_ranges: timestamps.join('-'),
}

Expand Down

0 comments on commit 108f0eb

Please sign in to comment.