Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
27ed042c
Commit
27ed042c
authored
Jan 04, 2026
by
墨颜
Browse files
Merge branch 'feat/apikey-group-remarks'
parents
e78c8646
6708f400
Changes
3
Show whitespace changes
Inline
Side-by-side
frontend/src/components/common/GroupOptionItem.vue
0 → 100644
View file @
27ed042c
<
template
>
<div
class=
"flex min-w-0 flex-1 items-center justify-between gap-2"
>
<div
class=
"flex min-w-0 flex-1 flex-col items-start gap-1"
:title=
"description || undefined"
>
<GroupBadge
:name=
"name"
:platform=
"platform"
:subscription-type=
"subscriptionType"
:rate-multiplier=
"rateMultiplier"
/>
<span
v-if=
"description"
class=
"w-full truncate text-left text-xs text-gray-500 dark:text-gray-400"
>
{{
description
}}
</span>
</div>
<svg
v-if=
"showCheckmark && selected"
class=
"h-4 w-4 shrink-0 text-primary-600 dark:text-primary-400"
fill=
"none"
stroke=
"currentColor"
viewBox=
"0 0 24 24"
stroke-width=
"2"
>
<path
stroke-linecap=
"round"
stroke-linejoin=
"round"
d=
"M5 13l4 4L19 7"
/>
</svg>
</div>
</
template
>
<
script
setup
lang=
"ts"
>
import
GroupBadge
from
'
./GroupBadge.vue
'
import
type
{
SubscriptionType
,
GroupPlatform
}
from
'
@/types
'
interface
Props
{
name
:
string
platform
:
GroupPlatform
subscriptionType
?:
SubscriptionType
rateMultiplier
?:
number
description
?:
string
|
null
selected
?:
boolean
showCheckmark
?:
boolean
}
withDefaults
(
defineProps
<
Props
>
(),
{
subscriptionType
:
'
standard
'
,
selected
:
false
,
showCheckmark
:
true
})
</
script
>
frontend/src/views/user/KeysView.vue
View file @
27ed042c
...
@@ -335,12 +335,14 @@
...
@@ -335,12 +335,14 @@
/>
/>
<span
v-else
class=
"text-gray-400"
>
{{
t
(
'
keys.selectGroup
'
)
}}
</span>
<span
v-else
class=
"text-gray-400"
>
{{
t
(
'
keys.selectGroup
'
)
}}
</span>
</
template
>
</
template
>
<
template
#option=
"{ option }"
>
<
template
#option=
"{ option
, selected
}"
>
<Group
Badge
<Group
OptionItem
:name=
"(option as unknown as GroupOption).label"
:name=
"(option as unknown as GroupOption).label"
:platform=
"(option as unknown as GroupOption).platform"
:platform=
"(option as unknown as GroupOption).platform"
:subscription-type=
"(option as unknown as GroupOption).subscriptionType"
:subscription-type=
"(option as unknown as GroupOption).subscriptionType"
:rate-multiplier=
"(option as unknown as GroupOption).rate"
:rate-multiplier=
"(option as unknown as GroupOption).rate"
:description=
"(option as unknown as GroupOption).description"
:selected=
"selected"
/>
/>
</
template
>
</
template
>
</Select>
</Select>
...
@@ -516,26 +518,19 @@
...
@@ -516,26 +518,19 @@
? 'bg-primary-50 dark:bg-primary-900/20'
? 'bg-primary-50 dark:bg-primary-900/20'
: 'hover:bg-gray-100 dark:hover:bg-dark-700'
: 'hover:bg-gray-100 dark:hover:bg-dark-700'
]"
]"
:title=
"option.description || undefined"
>
>
<Group
Badge
<Group
OptionItem
:name=
"option.label"
:name=
"option.label"
:platform=
"option.platform"
:platform=
"option.platform"
:subscription-type=
"option.subscriptionType"
:subscription-type=
"option.subscriptionType"
:rate-multiplier=
"option.rate"
:rate-multiplier=
"option.rate"
/>
:description=
"option.description"
<svg
:selected=
"
v-if=
"
selectedKeyForGroup?.group_id === option.value ||
selectedKeyForGroup?.group_id === option.value ||
(!selectedKeyForGroup?.group_id && option.value === null)
(!selectedKeyForGroup?.group_id && option.value === null)
"
"
class=
"h-4 w-4 shrink-0 text-primary-600 dark:text-primary-400"
/>
fill=
"none"
stroke=
"currentColor"
viewBox=
"0 0 24 24"
stroke-width=
"2"
>
<path
stroke-linecap=
"round"
stroke-linejoin=
"round"
d=
"M5 13l4 4L19 7"
/>
</svg>
</button>
</button>
</div>
</div>
</div>
</div>
...
@@ -562,6 +557,7 @@ import EmptyState from '@/components/common/EmptyState.vue'
...
@@ -562,6 +557,7 @@ import EmptyState from '@/components/common/EmptyState.vue'
import
Select
from
'
@/components/common/Select.vue
'
import
Select
from
'
@/components/common/Select.vue
'
import
UseKeyModal
from
'
@/components/keys/UseKeyModal.vue
'
import
UseKeyModal
from
'
@/components/keys/UseKeyModal.vue
'
import
GroupBadge
from
'
@/components/common/GroupBadge.vue
'
import
GroupBadge
from
'
@/components/common/GroupBadge.vue
'
import
GroupOptionItem
from
'
@/components/common/GroupOptionItem.vue
'
import
type
{
ApiKey
,
Group
,
PublicSettings
,
SubscriptionType
,
GroupPlatform
}
from
'
@/types
'
import
type
{
ApiKey
,
Group
,
PublicSettings
,
SubscriptionType
,
GroupPlatform
}
from
'
@/types
'
import
type
{
Column
}
from
'
@/components/common/types
'
import
type
{
Column
}
from
'
@/components/common/types
'
import
type
{
BatchApiKeyUsageStats
}
from
'
@/api/usage
'
import
type
{
BatchApiKeyUsageStats
}
from
'
@/api/usage
'
...
@@ -570,6 +566,7 @@ import { formatDateTime } from '@/utils/format'
...
@@ -570,6 +566,7 @@ import { formatDateTime } from '@/utils/format'
interface
GroupOption
{
interface
GroupOption
{
value
:
number
value
:
number
label
:
string
label
:
string
description
:
string
|
null
rate
:
number
rate
:
number
subscriptionType
:
SubscriptionType
subscriptionType
:
SubscriptionType
platform
:
GroupPlatform
platform
:
GroupPlatform
...
@@ -665,6 +662,7 @@ const groupOptions = computed(() =>
...
@@ -665,6 +662,7 @@ const groupOptions = computed(() =>
groups
.
value
.
map
((
group
)
=>
({
groups
.
value
.
map
((
group
)
=>
({
value
:
group
.
id
,
value
:
group
.
id
,
label
:
group
.
name
,
label
:
group
.
name
,
description
:
group
.
description
,
rate
:
group
.
rate_multiplier
,
rate
:
group
.
rate_multiplier
,
subscriptionType
:
group
.
subscription_type
,
subscriptionType
:
group
.
subscription_type
,
platform
:
group
.
platform
platform
:
group
.
platform
...
...
frontend/vite.config.js
deleted
100644 → 0
View file @
e78c8646
import
{
defineConfig
}
from
'
vite
'
;
import
vue
from
'
@vitejs/plugin-vue
'
;
import
checker
from
'
vite-plugin-checker
'
;
import
{
resolve
}
from
'
path
'
;
export
default
defineConfig
({
plugins
:
[
vue
(),
checker
({
typescript
:
true
,
vueTsc
:
true
})
],
resolve
:
{
alias
:
{
'
@
'
:
resolve
(
__dirname
,
'
src
'
)
}
},
build
:
{
outDir
:
'
../backend/internal/web/dist
'
,
emptyOutDir
:
true
},
server
:
{
host
:
'
0.0.0.0
'
,
port
:
3000
,
proxy
:
{
'
/api
'
:
{
target
:
'
http://localhost:8080
'
,
changeOrigin
:
true
},
'
/setup
'
:
{
target
:
'
http://localhost:8080
'
,
changeOrigin
:
true
}
}
}
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment