Skip to content

Commit 1ea21ca

Browse files
committed
[ui] change: use online font
1 parent 7887ff0 commit 1ea21ca

16 files changed

Lines changed: 121 additions & 6919 deletions

packages/shared/rsbuild.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,14 @@ export const config: RsbuildConfig = {
3535
favicon: "../../packages/shared/src/assets/MCSL.png",
3636
title: "MCSL Future Web-like",
3737
mountId: "app",
38+
tags: [
39+
{
40+
tag: "link",
41+
attrs: {
42+
rel: "stylesheet",
43+
href: "https://cdn-font.hyperos.mi.com/font/css?family=MiSans_VF:VF:Latin,Chinese_Simplify,Chinese_Traditional_TW&display=swap",
44+
},
45+
},
46+
],
3847
},
3948
};

packages/shared/src/App.vue

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import NotificationTemplate from "@repo/ui/src/components/overlay/notification/N
33
import NotificationOverlay from "@repo/ui/src/components/overlay/notification/NotificationOverlay.vue";
44
import DashboardLayout from "./layouts/DashboardLayout.vue";
55
import SetupLayout from "./layouts/SetupLayout.vue";
6+
import Button from "@repo/ui/src/components/form/button/Button.vue";
67
import { computed } from "vue";
78
import { usePageData } from "./utils/stores.ts";
89
import LoadingOverlay from "./components/overlay/LoadingOverlay.vue";
10+
import { useI18n } from "vue-i18n";
911
1012
const layout = computed(() => {
1113
switch (usePageData().data.layout) {
@@ -16,6 +18,8 @@ const layout = computed(() => {
1618
}
1719
return undefined;
1820
});
21+
22+
const t = useI18n().t;
1923
</script>
2024

2125
<template>
@@ -27,11 +31,36 @@ const layout = computed(() => {
2731
</RouterView>
2832
<LoadingOverlay />
2933
<NotificationTemplate id="default">
30-
<template v-slot="data">
31-
<p>{{ (data as any).message }}</p>
34+
<template v-slot="notif">
35+
<p>{{ notif.settings.data.message }}</p>
36+
</template>
37+
</NotificationTemplate>
38+
<NotificationTemplate id="do-not-show-again">
39+
<template v-slot="notif">
40+
<div>
41+
<p>{{ notif.settings.data.message }}</p>
42+
<Button
43+
class="app__notif-btn"
44+
type="primary"
45+
:color="notif.settings.data.color"
46+
@click="
47+
() => {
48+
notif.settings.data.onClick();
49+
notif.close();
50+
}
51+
"
52+
size="small"
53+
>
54+
{{ t("ui.common.do-not-show-again") }}
55+
</Button>
56+
</div>
3257
</template>
3358
</NotificationTemplate>
3459
<NotificationOverlay />
3560
</template>
3661

37-
<style scoped></style>
62+
<style scoped>
63+
.app__notif-btn {
64+
margin: var(--mcsl-spacing-4xs) var(--mcsl-spacing-2xs) 0 auto;
65+
}
66+
</style>

packages/shared/src/utils/tasks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { sleep } from "@repo/ui/src/utils/utils.ts";
33
import type { LoadingStatus } from "@repo/ui/src/components/progress/ProgressBar.vue";
44

55
export class SimpleTask {
6-
static lastId = -1;
6+
private static idCounter = -1;
77

88
public readonly name: Ref<string>;
99
public readonly desc: Ref<string>;
@@ -24,7 +24,7 @@ export class SimpleTask {
2424
this.desc = ref(desc);
2525
this.status = ref("loading");
2626
this.createTime = Date.now();
27-
this.id = ++SimpleTask.lastId;
27+
this.id = ++SimpleTask.idCounter;
2828
this._progress = progress;
2929
watch(progress, (newValue) => {
3030
if (newValue >= 100 && this.status.value == "loading" && autoSuccess) {

packages/ui/.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ node_modules
1010
.env
1111
.env.*
1212
!.env.example
13+
14+
# Assets
15+
src/assets/css/fontawesome.min.css

0 commit comments

Comments
 (0)