Skip to content

Commit a38b60f

Browse files
committed
temp
1 parent 0bfcc85 commit a38b60f

17 files changed

Lines changed: 232 additions & 241 deletions

File tree

app/app.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
export default defineAppConfig({
22
ui: {
33
colors: {
4-
primary: 'blue',
5-
neutral: 'slate'
4+
primary: 'blue'
65
}
76
}
87
})

app/components/AppFooter.vue

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,17 @@
11
<script setup lang="ts">
2-
const colorMode = useColorMode()
3-
const isDark = computed(() => colorMode.value === 'dark')
4-
5-
function toggleDark() {
6-
colorMode.preference = isDark.value ? 'light' : 'dark'
7-
}
82
</script>
93

104
<template>
115
<nav class="py-4">
12-
<div class="inline-flex gap-2 text-xl">
13-
<div
14-
class="icon-btn cursor-pointer outline-none!"
15-
@click="toggleDark()"
16-
>
17-
<div
18-
v-if="isDark"
19-
class="i-carbon-moon"
20-
/>
21-
<div
22-
v-else
23-
class="i-carbon-sun"
24-
/>
25-
</div>
26-
27-
<a
28-
class="icon-btn i-carbon-logo-github"
6+
<div class="inline-flex">
7+
<UColorModeButton />
8+
<UButton
9+
class="text-default"
10+
icon="i-lucide-github"
2911
rel="noreferrer"
30-
href="https://github.com/Weilence/systemctl-quick"
12+
to="https://github.com/Weilence/systemctl-quick"
3113
target="_blank"
14+
variant="link"
3215
title="GitHub"
3316
/>
3417
</div>

app/pages/crypto/components/CipherSection.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,17 @@ const aesKeySizes = [
158158
<div class="flex flex-col gap-2">
159159
<USelect
160160
v-model="cryptoConfig.aes.mode"
161-
:options="cryptoModes"
161+
:items="cryptoModes"
162162
placeholder="选择加密模式"
163163
/>
164164
<USelect
165165
v-model="cryptoConfig.aes.padding"
166-
:options="paddingModes"
166+
:items="paddingModes"
167167
placeholder="选择填充方式"
168168
/>
169169
<USelect
170170
v-model="cryptoConfig.aes.keySize"
171-
:options="aesKeySizes"
171+
:items="aesKeySizes"
172172
placeholder="选择密钥长度"
173173
/>
174174
<UInput

app/pages/crypto/components/OutputSection.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const displayValue = computed(() => {
3232
3333
function copy() {
3434
navigator.clipboard.writeText(props.value)
35-
toast.add({ title: '已复制', color: 'success' })
35+
toast.add({ title: '已复制' })
3636
}
3737
3838
function download() {

app/pages/crypto/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ const outputEncoding = ref<OutputEncoding>('Hex')
2525
2626
// 添加模式选项
2727
const modeOptions = [
28-
{ label: '编码转换', value: 'encode', icon: 'i-carbon-code' },
29-
{ label: '哈希计算', value: 'hash', icon: 'i-carbon-data-1' },
30-
{ label: '加密/解密', value: 'cipher', icon: 'i-carbon-locked' }
28+
{ label: '编码转换', value: 'encode', icon: 'i-lucide-code-xml' },
29+
{ label: '哈希计算', value: 'hash', icon: 'i-lucide-calculator' },
30+
{ label: '加密/解密', value: 'cipher', icon: 'i-lucide-lock' }
3131
]
3232
3333
// 添加状态跟踪输出是否过大

app/pages/password-generator/index.vue

Lines changed: 16 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,18 @@ const strengthText = computed(() => {
5353
})
5454
5555
// 密码强度颜色
56-
const strengthColor = computed<'error' | 'warning' | 'success'>(() => {
57-
const colors: Array<'error' | 'warning' | 'success'> = [
56+
const strengthColor = computed<'error' | 'warning' | 'primary'>(() => {
57+
const colors: Array<'error' | 'warning' | 'primary'> = [
5858
'error',
5959
'error',
6060
'warning',
61-
'success',
62-
'success',
63-
'success'
61+
'primary',
62+
'primary',
63+
'primary'
6464
]
6565
return colors[passwordStrength.value] || 'error'
6666
})
6767
68-
// 密码强度颜色(用于Badge)
69-
const strengthColorHex = computed(() => {
70-
const colors = [
71-
'#ed3f14',
72-
'#ed3f14',
73-
'#ff9900',
74-
'#19be6b',
75-
'#19be6b',
76-
'#19be6b'
77-
]
78-
return colors[passwordStrength.value]
79-
})
80-
8168
function generatePassword() {
8269
if (data.value.types.length === 0) {
8370
toast.add({ title: '请至少选择一种字符类型', color: 'error' })
@@ -108,7 +95,7 @@ function generatePassword() {
10895
10996
function copy() {
11097
navigator.clipboard.writeText(data.value.password)
111-
toast.add({ title: '密码已复制', color: 'success' })
98+
toast.add({ title: '密码已复制' })
11299
}
113100
114101
generatePassword()
@@ -141,12 +128,13 @@ generatePassword()
141128
<div class="flex items-center gap-2">
142129
<div class="flex-1">
143130
<UProgress
144-
:value="passwordStrength * 20"
145-
:color="strengthColor"
131+
v-model="passwordStrength"
132+
:max="5"
146133
size="sm"
134+
:color="strengthColor"
147135
/>
148136
</div>
149-
<UBadge :style="{ backgroundColor: strengthColorHex, color: '#FFF' }">
137+
<UBadge :color="strengthColor">
150138
{{ strengthText }}
151139
</UBadge>
152140
</div>
@@ -187,27 +175,12 @@ generatePassword()
187175
<div class="flex flex-col gap-2">
188176
<span class="text-sm text-gray-500">字符类型</span>
189177
<div class="flex flex-wrap gap-4">
190-
<UCheckbox
191-
v-for="option in typeOptions"
192-
:key="option.value"
193-
:model-value="data.types.includes(option.value)"
194-
@update:model-value="
195-
(checked) => {
196-
if (checked) {
197-
data.types.push(option.value)
198-
}
199-
else {
200-
data.types = data.types.filter((t) => t !== option.value)
201-
}
202-
generatePassword()
203-
}
204-
"
205-
>
206-
<div class="flex items-center gap-1">
207-
<div :class="option.icon" />
208-
{{ option.label }}
209-
</div>
210-
</UCheckbox>
178+
<UCheckboxGroup
179+
v-model="data.types"
180+
:items="typeOptions"
181+
orientation="horizontal"
182+
@change=" generatePassword()"
183+
/>
211184
</div>
212185
</div>
213186

app/pages/systemctl/components/Preview.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const serviceData = computed(() => generate(props.config))
1313
1414
function copyContent() {
1515
navigator.clipboard.writeText(serviceData.value)
16-
toast.add({ title: 'Copied to clipboard', color: 'success' })
16+
toast.add({ title: 'Copied to clipboard' })
1717
}
1818
1919
function copyCommand() {
@@ -24,7 +24,7 @@ function copyCommand() {
2424
navigator.clipboard.writeText(
2525
`cat > /etc/systemd/system/${props.config.name}.service <<EOF\n${serviceData.value}\nEOF\n`
2626
)
27-
toast.add({ title: 'Copied to clipboard', color: 'success' })
27+
toast.add({ title: 'Copied to clipboard' })
2828
}
2929
</script>
3030

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,17 @@
11
<script setup lang="ts">
2+
import type { TableColumn } from '@nuxt/ui'
3+
import type { CellData } from '../data'
24
import { restartTableColumns, restartTableData } from '../data'
35
4-
interface CellData {
5-
'type': string
6-
'no'?: string
7-
'always'?: string
8-
'on-success'?: string
9-
'on-failure'?: string
10-
'on-abnormal'?: string
11-
'on-abort'?: string
12-
'on-watchdog'?: string
13-
}
14-
15-
interface Column {
16-
key: string
17-
label: string
18-
}
19-
20-
const columns: Column[] = restartTableColumns.map(col => ({
21-
key: col === 'Restart settings/Exit causes' ? 'type' : col,
22-
label: col
6+
const columns: TableColumn<CellData>[] = restartTableColumns.map(col => ({
7+
accessorKey: col === 'Restart settings/Exit causes' ? 'type' : col,
8+
header: col
239
}))
2410
</script>
2511

2612
<template>
2713
<UTable
2814
:columns="columns"
29-
:rows="restartTableData"
30-
>
31-
<template #type-data="{ row }">
32-
{{ (row as unknown as CellData).type }}
33-
</template>
34-
<template #no-data="{ row }">
35-
{{ (row as unknown as CellData).no || '' }}
36-
</template>
37-
<template #always-data="{ row }">
38-
{{ (row as unknown as CellData).always || '' }}
39-
</template>
40-
<template #on-success-data="{ row }">
41-
{{ (row as unknown as CellData)['on-success'] || '' }}
42-
</template>
43-
<template #on-failure-data="{ row }">
44-
{{ (row as unknown as CellData)['on-failure'] || '' }}
45-
</template>
46-
<template #on-abnormal-data="{ row }">
47-
{{ (row as unknown as CellData)['on-abnormal'] || '' }}
48-
</template>
49-
<template #on-abort-data="{ row }">
50-
{{ (row as unknown as CellData)['on-abort'] || '' }}
51-
</template>
52-
<template #on-watchdog-data="{ row }">
53-
{{ (row as unknown as CellData)['on-watchdog'] || '' }}
54-
</template>
55-
</UTable>
15+
:data="restartTableData"
16+
/>
5617
</template>

app/pages/systemctl/components/SectionInstall.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const data = defineModel<{
1818
>
1919
<USelectMenu
2020
v-model="data.wantedBy"
21-
:options="preDefinedTarget"
21+
value-key="value"
22+
:items="preDefinedTarget"
2223
placeholder="Please Select or Input"
2324
multiple
2425
searchable
@@ -31,7 +32,8 @@ const data = defineModel<{
3132
>
3233
<USelectMenu
3334
v-model="data.requiredBy"
34-
:options="preDefinedTarget"
35+
value-key="value"
36+
:items="preDefinedTarget"
3537
placeholder="Please Select or Input"
3638
multiple
3739
searchable

app/pages/systemctl/components/SectionService.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ function removeEnvironment(index: number) {
3535
target="_blank"
3636
class="text-primary"
3737
>
38-
<div class="i-carbon-help-filled" />
38+
<UIcon name="i-carbon-help-filled" />
3939
</a>
4040
</div>
4141
</template>
4242
<USelect
4343
v-model="data.type"
44-
:options="restartTypeOptions"
44+
:items="restartTypeOptions"
4545
/>
4646
</UFormField>
4747
<UFormField
@@ -73,7 +73,7 @@ function removeEnvironment(index: number) {
7373
target="_blank"
7474
class="text-primary"
7575
>
76-
<div class="i-carbon-help-filled" />
76+
<UIcon name="i-carbon-help-filled" />
7777
</a>
7878
</template>
7979
<template #content>
@@ -84,7 +84,7 @@ function removeEnvironment(index: number) {
8484
</template>
8585
<USelect
8686
v-model="data.restart"
87-
:options="[
87+
:items="[
8888
{ label: 'no', value: 'no' },
8989
{ label: 'always', value: 'always' },
9090
{ label: 'on-success', value: 'on-success' },

0 commit comments

Comments
 (0)