Skip to content

Commit ff2c2a8

Browse files
committed
machine-setup: use notification
1 parent fa4e062 commit ff2c2a8

File tree

2 files changed

+47
-27
lines changed

2 files changed

+47
-27
lines changed
Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
<template>
2-
<n-config-provider :theme="osTheme === 'dark' ? darkTheme : undefined">
3-
<n-grid x-gap="12" :cols="2">
4-
<n-gi>
5-
<basic-info />
6-
<heartbeat-info />
7-
<video-info />
8-
</n-gi>
9-
<n-gi>
10-
<system-info />
11-
<network-info />
12-
</n-gi>
13-
</n-grid>
14-
</n-config-provider>
15-
</template>
16-
17-
<script setup lang="ts">
18-
import {
19-
NGrid, NGi, darkTheme, NConfigProvider, useOsTheme,
20-
} from 'naive-ui';
21-
import BasicInfo from './components/BasicInfo.vue';
22-
import HeartbeatInfo from './components/HeartbeatInfo.vue';
23-
import SystemInfo from './components/SystemInfo.vue';
24-
import NetworkInfo from './components/NetworkInfo.vue';
25-
import VideoInfo from './components/VideoInfo.vue';
26-
27-
const osTheme = useOsTheme();
28-
</script>
2+
<n-config-provider :theme="osTheme === 'dark' ? darkTheme : undefined">
3+
<n-notification-provider>
4+
<provider />
5+
<n-grid x-gap="12" :cols="2">
6+
<n-gi>
7+
<basic-info />
8+
<heartbeat-info />
9+
<video-info />
10+
</n-gi>
11+
<n-gi>
12+
<system-info />
13+
<network-info />
14+
</n-gi>
15+
</n-grid>
16+
</n-notification-provider>
17+
</n-config-provider>
18+
</template>
19+
20+
<script setup lang="ts">
21+
import {
22+
NGrid, NGi, darkTheme, NConfigProvider, useOsTheme, NNotificationProvider,
23+
} from 'naive-ui';
24+
import BasicInfo from './components/BasicInfo.vue';
25+
import HeartbeatInfo from './components/HeartbeatInfo.vue';
26+
import SystemInfo from './components/SystemInfo.vue';
27+
import NetworkInfo from './components/NetworkInfo.vue';
28+
import VideoInfo from './components/VideoInfo.vue';
29+
import Provider from './components/Provider.vue';
30+
31+
const osTheme = useOsTheme();
32+
</script>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<template>
2+
<div></div>
3+
</template>
4+
5+
<script setup lang="ts">
6+
import { useNotification } from 'naive-ui';
7+
8+
// Declare a global property on the Window interface
9+
declare global {
10+
interface Window {
11+
$notification: ReturnType<typeof useNotification>;
12+
}
13+
}
14+
15+
window.$notification = useNotification();
16+
</script>

0 commit comments

Comments
 (0)