mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-19 06:45:50 +00:00
style: 完成所有文件的lint
This commit is contained in:
@@ -1,61 +1,54 @@
|
||||
import React, { useCallback } from 'react'
|
||||
import { logEvent } from 'src/services/analytics/index.js'
|
||||
import { Box, Link, Newline, Text } from '@anthropic/ink'
|
||||
import { gracefulShutdownSync } from '../utils/gracefulShutdown.js'
|
||||
import { updateSettingsForSource } from '../utils/settings/settings.js'
|
||||
import { Select } from './CustomSelect/index.js'
|
||||
import { Dialog } from '@anthropic/ink'
|
||||
import React, { useCallback } from 'react';
|
||||
import { logEvent } from 'src/services/analytics/index.js';
|
||||
import { Box, Link, Newline, Text } from '@anthropic/ink';
|
||||
import { gracefulShutdownSync } from '../utils/gracefulShutdown.js';
|
||||
import { updateSettingsForSource } from '../utils/settings/settings.js';
|
||||
import { Select } from './CustomSelect/index.js';
|
||||
import { Dialog } from '@anthropic/ink';
|
||||
|
||||
type Props = {
|
||||
onAccept(): void
|
||||
}
|
||||
onAccept(): void;
|
||||
};
|
||||
|
||||
export function BypassPermissionsModeDialog({
|
||||
onAccept,
|
||||
}: Props): React.ReactNode {
|
||||
export function BypassPermissionsModeDialog({ onAccept }: Props): React.ReactNode {
|
||||
React.useEffect(() => {
|
||||
logEvent('tengu_bypass_permissions_mode_dialog_shown', {})
|
||||
}, [])
|
||||
logEvent('tengu_bypass_permissions_mode_dialog_shown', {});
|
||||
}, []);
|
||||
|
||||
function onChange(value: 'accept' | 'decline') {
|
||||
switch (value) {
|
||||
case 'accept': {
|
||||
logEvent('tengu_bypass_permissions_mode_dialog_accept', {})
|
||||
logEvent('tengu_bypass_permissions_mode_dialog_accept', {});
|
||||
|
||||
updateSettingsForSource('userSettings', {
|
||||
skipDangerousModePermissionPrompt: true,
|
||||
})
|
||||
onAccept()
|
||||
break
|
||||
});
|
||||
onAccept();
|
||||
break;
|
||||
}
|
||||
case 'decline': {
|
||||
gracefulShutdownSync(1)
|
||||
break
|
||||
gracefulShutdownSync(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const handleEscape = useCallback(() => {
|
||||
gracefulShutdownSync(0)
|
||||
}, [])
|
||||
gracefulShutdownSync(0);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
title="WARNING: Claude Code running in Bypass Permissions mode"
|
||||
color="error"
|
||||
onCancel={handleEscape}
|
||||
>
|
||||
<Dialog title="WARNING: Claude Code running in Bypass Permissions mode" color="error" onCancel={handleEscape}>
|
||||
<Box flexDirection="column" gap={1}>
|
||||
<Text>
|
||||
In Bypass Permissions mode, Claude Code will not ask for your approval
|
||||
before running potentially dangerous commands.
|
||||
In Bypass Permissions mode, Claude Code will not ask for your approval before running potentially dangerous
|
||||
commands.
|
||||
<Newline />
|
||||
This mode should only be used in a sandboxed container/VM that has
|
||||
restricted internet access and can easily be restored if damaged.
|
||||
This mode should only be used in a sandboxed container/VM that has restricted internet access and can easily
|
||||
be restored if damaged.
|
||||
</Text>
|
||||
<Text>
|
||||
By proceeding, you accept all responsibility for actions taken while
|
||||
running in Bypass Permissions mode.
|
||||
By proceeding, you accept all responsibility for actions taken while running in Bypass Permissions mode.
|
||||
</Text>
|
||||
|
||||
<Link url="https://code.claude.com/docs/en/security" />
|
||||
@@ -69,5 +62,5 @@ export function BypassPermissionsModeDialog({
|
||||
onChange={value => onChange(value as 'accept' | 'decline')}
|
||||
/>
|
||||
</Dialog>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user