fix: add aria-label to components to resolve accessibility warnings

This commit is contained in:
pompurin404 2025-02-03 08:27:35 +08:00
parent 35c239e02d
commit 7c8661ec0b
4 changed files with 6 additions and 0 deletions

View File

@ -303,6 +303,7 @@ const ProfileItem: React.FC<Props> = (props) => {
{extra && ( {extra && (
<Progress <Progress
className="w-full" className="w-full"
aria-label="流量使用进度"
classNames={{ classNames={{
indicator: isCurrent ? 'bg-primary-foreground' : 'bg-foreground' indicator: isCurrent ? 'bg-primary-foreground' : 'bg-foreground'
}} }}

View File

@ -204,6 +204,7 @@ const ProfileCard: React.FC<Props> = (props) => {
{extra && ( {extra && (
<Progress <Progress
className="w-full" className="w-full"
aria-label="流量使用进度"
classNames={{ indicator: match ? 'bg-primary-foreground' : 'bg-foreground' }} classNames={{ indicator: match ? 'bg-primary-foreground' : 'bg-foreground' }}
value={calcPercent(extra?.upload, extra?.download, extra?.total)} value={calcPercent(extra?.upload, extra?.download, extra?.total)}
/> />

View File

@ -232,6 +232,7 @@ const Connections: React.FC = () => {
classNames={{ trigger: 'data-[hover=true]:bg-default-200' }} classNames={{ trigger: 'data-[hover=true]:bg-default-200' }}
size="sm" size="sm"
className="w-[180px] min-w-[120px]" className="w-[180px] min-w-[120px]"
aria-label="连接排序方式"
selectedKeys={new Set([connectionOrderBy])} selectedKeys={new Set([connectionOrderBy])}
onSelectionChange={async (v) => { onSelectionChange={async (v) => {
await patchAppConfig({ await patchAppConfig({

View File

@ -114,6 +114,7 @@ const Mihomo: React.FC = () => {
classNames={{ trigger: 'data-[hover=true]:bg-default-200' }} classNames={{ trigger: 'data-[hover=true]:bg-default-200' }}
className="w-[100px]" className="w-[100px]"
size="sm" size="sm"
aria-label="选择内核版本"
selectedKeys={new Set([core])} selectedKeys={new Set([core])}
onSelectionChange={async (v) => { onSelectionChange={async (v) => {
try { try {
@ -650,6 +651,7 @@ const Mihomo: React.FC = () => {
classNames={{ trigger: 'data-[hover=true]:bg-default-200' }} classNames={{ trigger: 'data-[hover=true]:bg-default-200' }}
className="w-[100px]" className="w-[100px]"
size="sm" size="sm"
aria-label="选择日志等级"
selectedKeys={new Set([logLevel])} selectedKeys={new Set([logLevel])}
onSelectionChange={(v) => { onSelectionChange={(v) => {
onChangeNeedRestart({ 'log-level': v.currentKey as LogLevel }) onChangeNeedRestart({ 'log-level': v.currentKey as LogLevel })
@ -667,6 +669,7 @@ const Mihomo: React.FC = () => {
classNames={{ trigger: 'data-[hover=true]:bg-default-200' }} classNames={{ trigger: 'data-[hover=true]:bg-default-200' }}
className="w-[100px]" className="w-[100px]"
size="sm" size="sm"
aria-label="选择进程查找模式"
selectedKeys={new Set([findProcessMode])} selectedKeys={new Set([findProcessMode])}
onSelectionChange={(v) => { onSelectionChange={(v) => {
onChangeNeedRestart({ 'find-process-mode': v.currentKey as FindProcessMode }) onChangeNeedRestart({ 'find-process-mode': v.currentKey as FindProcessMode })