mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 22:35:51 +00:00
style: 完成所有文件的lint
This commit is contained in:
@@ -1,52 +1,40 @@
|
||||
import React from 'react'
|
||||
import { useExitOnCtrlCDWithKeybindings } from '../../hooks/useExitOnCtrlCDWithKeybindings.js'
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
import { useKeybinding } from '../../keybindings/useKeybinding.js'
|
||||
import type { SettingsJson } from '../../utils/settings/types.js'
|
||||
import { Select } from '../CustomSelect/index.js'
|
||||
import { PermissionDialog } from '../permissions/PermissionDialog.js'
|
||||
import {
|
||||
extractDangerousSettings,
|
||||
formatDangerousSettingsList,
|
||||
} from './utils.js'
|
||||
import React from 'react';
|
||||
import { useExitOnCtrlCDWithKeybindings } from '../../hooks/useExitOnCtrlCDWithKeybindings.js';
|
||||
import { Box, Text } from '@anthropic/ink';
|
||||
import { useKeybinding } from '../../keybindings/useKeybinding.js';
|
||||
import type { SettingsJson } from '../../utils/settings/types.js';
|
||||
import { Select } from '../CustomSelect/index.js';
|
||||
import { PermissionDialog } from '../permissions/PermissionDialog.js';
|
||||
import { extractDangerousSettings, formatDangerousSettingsList } from './utils.js';
|
||||
|
||||
type Props = {
|
||||
settings: SettingsJson
|
||||
onAccept: () => void
|
||||
onReject: () => void
|
||||
}
|
||||
settings: SettingsJson;
|
||||
onAccept: () => void;
|
||||
onReject: () => void;
|
||||
};
|
||||
|
||||
export function ManagedSettingsSecurityDialog({
|
||||
settings,
|
||||
onAccept,
|
||||
onReject,
|
||||
}: Props): React.ReactNode {
|
||||
const dangerous = extractDangerousSettings(settings)
|
||||
const settingsList = formatDangerousSettingsList(dangerous)
|
||||
export function ManagedSettingsSecurityDialog({ settings, onAccept, onReject }: Props): React.ReactNode {
|
||||
const dangerous = extractDangerousSettings(settings);
|
||||
const settingsList = formatDangerousSettingsList(dangerous);
|
||||
|
||||
const exitState = useExitOnCtrlCDWithKeybindings()
|
||||
const exitState = useExitOnCtrlCDWithKeybindings();
|
||||
|
||||
useKeybinding('confirm:no', onReject, { context: 'Confirmation' })
|
||||
useKeybinding('confirm:no', onReject, { context: 'Confirmation' });
|
||||
|
||||
function onChange(value: 'accept' | 'exit'): void {
|
||||
if (value === 'exit') {
|
||||
onReject()
|
||||
return
|
||||
onReject();
|
||||
return;
|
||||
}
|
||||
onAccept()
|
||||
onAccept();
|
||||
}
|
||||
|
||||
return (
|
||||
<PermissionDialog
|
||||
color="warning"
|
||||
titleColor="warning"
|
||||
title="Managed settings require approval"
|
||||
>
|
||||
<PermissionDialog color="warning" titleColor="warning" title="Managed settings require approval">
|
||||
<Box flexDirection="column" gap={1} paddingTop={1}>
|
||||
<Text>
|
||||
Your organization has configured managed settings that could allow
|
||||
execution of arbitrary code or interception of your prompts and
|
||||
responses.
|
||||
Your organization has configured managed settings that could allow execution of arbitrary code or interception
|
||||
of your prompts and responses.
|
||||
</Text>
|
||||
|
||||
<Box flexDirection="column">
|
||||
@@ -62,8 +50,8 @@ export function ManagedSettingsSecurityDialog({
|
||||
</Box>
|
||||
|
||||
<Text>
|
||||
Only accept if you trust your organization's IT administration
|
||||
and expect these settings to be configured.
|
||||
Only accept if you trust your organization's IT administration and expect these settings to be
|
||||
configured.
|
||||
</Text>
|
||||
|
||||
<Select
|
||||
@@ -76,13 +64,9 @@ export function ManagedSettingsSecurityDialog({
|
||||
/>
|
||||
|
||||
<Text dimColor>
|
||||
{exitState.pending ? (
|
||||
<>Press {exitState.keyName} again to exit</>
|
||||
) : (
|
||||
<>Enter to confirm · Esc to exit</>
|
||||
)}
|
||||
{exitState.pending ? <>Press {exitState.keyName} again to exit</> : <>Enter to confirm · Esc to exit</>}
|
||||
</Text>
|
||||
</Box>
|
||||
</PermissionDialog>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user