create-halo-plugin-template 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.gradle
CHANGED
|
@@ -7,7 +7,7 @@ plugins {
|
|
|
7
7
|
group 'run.halo.plugintemplate'
|
|
8
8
|
|
|
9
9
|
ext {
|
|
10
|
-
haloPlatformVersion = '2.
|
|
10
|
+
haloPlatformVersion = '2.24.0'
|
|
11
11
|
javaReleaseVersion = 21
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -71,7 +71,7 @@ if (file('scripts/verify-template.mjs').exists()) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
halo {
|
|
74
|
-
version = '2.
|
|
74
|
+
version = '2.24.0'
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
haloPlugin {
|
package/package.json
CHANGED
package/ui/build.gradle
CHANGED
|
@@ -5,6 +5,14 @@ plugins {
|
|
|
5
5
|
|
|
6
6
|
group 'run.halo.plugintemplate.ui'
|
|
7
7
|
|
|
8
|
+
node {
|
|
9
|
+
// Use a managed Node runtime so Gradle does not depend on shell-initialized nvm PATH.
|
|
10
|
+
download = true
|
|
11
|
+
version = '22.22.0'
|
|
12
|
+
pnpmVersion = '10.33.1'
|
|
13
|
+
nodeProjectDir = layout.projectDirectory.asFile
|
|
14
|
+
}
|
|
15
|
+
|
|
8
16
|
tasks.register('pnpmBuild', PnpmTask) {
|
|
9
17
|
group = 'build'
|
|
10
18
|
description = 'Build the UI project using pnpm'
|
package/ui/src/assets/index.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { ElSkeleton, ElSwitch } from 'element-plus'
|
|
3
3
|
import { computed, onMounted, ref } from 'vue'
|
|
4
4
|
import { templateConsoleApi } from '@/api'
|
|
5
5
|
import type { PluginTemplateOverview } from '@/types'
|
|
@@ -16,47 +16,127 @@ const load = async () => {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const primaryStat = computed(() => overview.value?.stats?.[0] ?? null)
|
|
20
|
+
const features = computed(() => overview.value?.features?.slice(0, 4) ?? [])
|
|
20
21
|
|
|
21
|
-
const
|
|
22
|
-
window.location.assign(`/console${overview.value?.consolePath || '/halo-plugin-template'}`)
|
|
23
|
-
}
|
|
22
|
+
const accentCycle = ['#f97316', '#22c55e']
|
|
24
23
|
|
|
25
24
|
onMounted(load)
|
|
26
25
|
</script>
|
|
27
26
|
|
|
28
27
|
<template>
|
|
29
|
-
<div class="
|
|
30
|
-
|
|
31
|
-
<div>
|
|
32
|
-
<h3 class="halo-plugin-template-admin-widget-title">模板工作台</h3>
|
|
33
|
-
<p class="halo-plugin-template-admin-widget-description">
|
|
34
|
-
直接复用模板默认 API、路由和扩展点,作为新插件的第一块控制台仪表盘。
|
|
35
|
-
</p>
|
|
36
|
-
</div>
|
|
37
|
-
<ElButton type="primary" plain @click="openConsole">
|
|
38
|
-
打开页面
|
|
39
|
-
</ElButton>
|
|
40
|
-
</div>
|
|
41
|
-
|
|
28
|
+
<div class="dw">
|
|
29
|
+
<!-- Metric hero -->
|
|
42
30
|
<ElSkeleton :loading="loading" animated :rows="3">
|
|
43
31
|
<template #default>
|
|
44
|
-
<div class="
|
|
32
|
+
<div v-if="primaryStat" class="dw__hero">
|
|
33
|
+
<div class="dw__hero-top">
|
|
34
|
+
<div class="dw__hero-copy">
|
|
35
|
+
<span class="dw__hero-value">{{ primaryStat.value }}</span>
|
|
36
|
+
<span class="dw__hero-label">{{ primaryStat.label }}</span>
|
|
37
|
+
</div>
|
|
38
|
+
<ElSwitch size="small" />
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<!-- Feature grid -->
|
|
43
|
+
<div class="dw__grid">
|
|
45
44
|
<div
|
|
46
|
-
v-for="item in
|
|
45
|
+
v-for="(item, index) in features"
|
|
47
46
|
:key="item.key"
|
|
48
|
-
class="
|
|
47
|
+
class="dw__card"
|
|
48
|
+
:style="{ '--dw-accent': accentCycle[index % accentCycle.length] }"
|
|
49
49
|
>
|
|
50
|
-
<
|
|
51
|
-
<p class="
|
|
52
|
-
{{ item.value }}
|
|
53
|
-
</p>
|
|
54
|
-
<p class="halo-plugin-template-admin-card-description" style="margin-top: 8px">
|
|
55
|
-
{{ item.helper }}
|
|
56
|
-
</p>
|
|
50
|
+
<h4 class="dw__card-title">{{ item.title }}</h4>
|
|
51
|
+
<p class="dw__card-desc">{{ item.description }}</p>
|
|
57
52
|
</div>
|
|
58
53
|
</div>
|
|
59
54
|
</template>
|
|
60
55
|
</ElSkeleton>
|
|
61
56
|
</div>
|
|
62
57
|
</template>
|
|
58
|
+
|
|
59
|
+
<style scoped>
|
|
60
|
+
.dw {
|
|
61
|
+
background: #fff;
|
|
62
|
+
border-radius: 14px;
|
|
63
|
+
padding: 24px;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
gap: 20px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* ── Hero metric ── */
|
|
70
|
+
.dw__hero {
|
|
71
|
+
background: #f5f7ff;
|
|
72
|
+
border-radius: 12px;
|
|
73
|
+
padding: 24px 28px 20px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.dw__hero-top {
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: flex-start;
|
|
79
|
+
justify-content: space-between;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.dw__hero-copy {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
gap: 4px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.dw__hero-value {
|
|
89
|
+
font-size: 42px;
|
|
90
|
+
font-weight: 800;
|
|
91
|
+
color: #111827;
|
|
92
|
+
line-height: 1;
|
|
93
|
+
letter-spacing: -0.02em;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.dw__hero-label {
|
|
97
|
+
font-size: 13px;
|
|
98
|
+
color: #6b7280;
|
|
99
|
+
line-height: 1.4;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* ── Feature grid ── */
|
|
103
|
+
.dw__grid {
|
|
104
|
+
display: grid;
|
|
105
|
+
grid-template-columns: repeat(2, 1fr);
|
|
106
|
+
gap: 12px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.dw__card {
|
|
110
|
+
position: relative;
|
|
111
|
+
padding: 16px 18px 16px 22px;
|
|
112
|
+
background: #fff;
|
|
113
|
+
border-radius: 10px;
|
|
114
|
+
border: 1px solid #f0f0f0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.dw__card::before {
|
|
118
|
+
content: '';
|
|
119
|
+
position: absolute;
|
|
120
|
+
left: 0;
|
|
121
|
+
top: 12px;
|
|
122
|
+
bottom: 12px;
|
|
123
|
+
width: 3px;
|
|
124
|
+
border-radius: 0 2px 2px 0;
|
|
125
|
+
background: var(--dw-accent, #f97316);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.dw__card-title {
|
|
129
|
+
font-size: 14px;
|
|
130
|
+
font-weight: 700;
|
|
131
|
+
color: #111827;
|
|
132
|
+
margin: 0 0 4px;
|
|
133
|
+
line-height: 1.3;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.dw__card-desc {
|
|
137
|
+
font-size: 12px;
|
|
138
|
+
color: #9ca3af;
|
|
139
|
+
margin: 0;
|
|
140
|
+
line-height: 1.5;
|
|
141
|
+
}
|
|
142
|
+
</style>
|
package/ui/src/index.ts
CHANGED
|
@@ -8,43 +8,47 @@ import 'element-plus/dist/index.css'
|
|
|
8
8
|
import 'element-plus/theme-chalk/dark/css-vars.css'
|
|
9
9
|
import './assets/index.css'
|
|
10
10
|
import './assets/element.scss'
|
|
11
|
+
import ConsoleDashboardView from "@/views/console/ConsoleDashboardView.vue";
|
|
12
|
+
import UcDashboardView from "@/views/uc/UcDashboardView.vue";
|
|
11
13
|
|
|
12
14
|
export default definePlugin({
|
|
13
15
|
components: {},
|
|
14
16
|
routes: [
|
|
15
17
|
{
|
|
16
|
-
parentName:
|
|
18
|
+
parentName: "Root",
|
|
17
19
|
route: {
|
|
18
20
|
path: '/halo-plugin-template',
|
|
19
|
-
name:
|
|
20
|
-
component:
|
|
21
|
-
import(/* webpackChunkName: "PluginTemplateConsoleDashboard" */ './views/console/ConsoleDashboardView.vue'),
|
|
21
|
+
name: "PluginTemplateConsoleRoot",
|
|
22
|
+
component: ConsoleDashboardView,
|
|
22
23
|
meta: {
|
|
23
|
-
title:
|
|
24
|
+
title: "模板工作台",
|
|
24
25
|
searchable: true,
|
|
25
26
|
permissions: ['plugin:halo-plugin-template:view'],
|
|
26
27
|
menu: {
|
|
27
|
-
name:
|
|
28
|
-
group:
|
|
28
|
+
name: "模板工作台",
|
|
29
|
+
group: "插件模板",
|
|
29
30
|
icon: markRaw(IconPlug),
|
|
30
|
-
priority:
|
|
31
|
+
priority: 40,
|
|
31
32
|
},
|
|
32
|
-
}
|
|
33
|
+
}
|
|
33
34
|
},
|
|
34
35
|
},
|
|
35
36
|
],
|
|
36
37
|
ucRoutes: [
|
|
37
38
|
{
|
|
38
|
-
parentName:
|
|
39
|
+
parentName: "Root",
|
|
39
40
|
route: {
|
|
40
41
|
path: '/halo-plugin-template',
|
|
41
|
-
name:
|
|
42
|
-
component:
|
|
43
|
-
import(/* webpackChunkName: "PluginTemplateUcDashboard" */ './views/uc/UcDashboardView.vue'),
|
|
42
|
+
name: "PluginTemplateUcRoot",
|
|
43
|
+
component: UcDashboardView,
|
|
44
44
|
meta: {
|
|
45
|
-
title: '模板中心',
|
|
46
|
-
searchable: true,
|
|
47
45
|
permissions: ['plugin:halo-plugin-template:uc'],
|
|
46
|
+
menu: {
|
|
47
|
+
name: "模板中心",
|
|
48
|
+
group: "插件模板",
|
|
49
|
+
icon: markRaw(IconPlug),
|
|
50
|
+
priority: 40
|
|
51
|
+
},
|
|
48
52
|
},
|
|
49
53
|
},
|
|
50
54
|
},
|