连续任务下发列表 取消连续任务 增加模式切换 方向盘手柄 加一个提示 切换模式控件 加一个高亮效果 任务监控界面 数据完善
This commit is contained in:
@@ -39,6 +39,14 @@ const KEY_MAP: Record<string, string> = {
|
||||
A: 'left',
|
||||
D: 'right',
|
||||
};
|
||||
const KEY_LABELS: Record<string, string> = {
|
||||
up: 'W/↑',
|
||||
down: 'S/↓',
|
||||
left: 'A/←',
|
||||
right: 'D/→',
|
||||
center: 'SPACE'
|
||||
};
|
||||
|
||||
|
||||
const DIRECTIONS = ['up', 'down', 'left', 'right'];
|
||||
|
||||
@@ -340,7 +348,7 @@ const DPadControl: React.FC<DPadControlProps> = ({
|
||||
type="button"
|
||||
aria-label={ariaLabel}
|
||||
disabled={disabled}
|
||||
className={`${btnBase} ${pressed[key] ? btnActive : btnIdle
|
||||
className={`${btnBase} relative ${pressed[key] ? btnActive : btnIdle
|
||||
} ${disabled
|
||||
? 'opacity-40 cursor-not-allowed'
|
||||
: 'cursor-pointer'
|
||||
@@ -371,6 +379,9 @@ const DPadControl: React.FC<DPadControlProps> = ({
|
||||
onContextMenu={(e) => e.preventDefault()}
|
||||
>
|
||||
{icon}
|
||||
<span className="absolute -top-4 -right+1 px-1 bg-slate-900/80 text-[8px] text-slate-400 rounded border border-slate-700 pointer-events-none group-hover:text-cyan-400 transition-colors">
|
||||
{KEY_LABELS[key]}
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
|
||||
@@ -379,7 +390,7 @@ const DPadControl: React.FC<DPadControlProps> = ({
|
||||
type="button"
|
||||
aria-label={t('devices.emergencyStop')}
|
||||
disabled={disabled}
|
||||
className={`${btnBase} ${pressed.center
|
||||
className={`${btnBase} relative ${pressed.center
|
||||
? 'border-red-500 bg-red-500/40 text-white shadow-[0_0_16px_rgba(239,68,68,0.6)]'
|
||||
: 'border-red-500/70 bg-red-500/10 text-red-400 hover:bg-red-500/20'
|
||||
} ${disabled
|
||||
@@ -389,6 +400,9 @@ const DPadControl: React.FC<DPadControlProps> = ({
|
||||
onClick={startEmergency}
|
||||
>
|
||||
<ShieldAlert className="w-5 h-5" />
|
||||
<span className="absolute -top-1 -right-1 px-1 bg-slate-900/80 text-[8px] text-red-400/80 rounded border border-red-500/30 pointer-events-none">
|
||||
{KEY_LABELS.center}
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user