style: improved layout and functionality for the prompt editing field.

This commit is contained in:
kangfenmao 2024-10-17 16:52:18 +08:00
parent 414e5dc6c3
commit b8a6a69849
2 changed files with 20 additions and 16 deletions

View File

@ -109,21 +109,25 @@ const AgentEditPage: FC = () => {
<Form.Item name="name" label={t('agents.add.name')} rules={[{ required: true }]}> <Form.Item name="name" label={t('agents.add.name')} rules={[{ required: true }]}>
<Input placeholder={t('agents.add.name.placeholder')} spellCheck={false} allowClear /> <Input placeholder={t('agents.add.name.placeholder')} spellCheck={false} allowClear />
</Form.Item> </Form.Item>
<div style={{ position: 'relative' }}> <Form.Item
<Form.Item name="prompt"
name="prompt" label={
label={t('agents.add.prompt')} <>
rules={[{ required: true }]} {t('agents.add.prompt')}{' '}
style={{ position: 'relative' }}> <Button
<TextArea placeholder={t('agents.add.prompt.placeholder')} spellCheck={false} rows={10} /> size="small"
</Form.Item> style={{ marginLeft: 5 }}
<Button type="text"
icon={loading ? <LoadingOutlined /> : <ThunderboltOutlined />} icon={loading ? <LoadingOutlined /> : <ThunderboltOutlined />}
onClick={handleButtonClick} onClick={handleButtonClick}
style={{ position: 'absolute', top: 8, right: 8 }} disabled={loading}
disabled={loading} />
/> </>
</div> }
rules={[{ required: true }]}
style={{ position: 'relative' }}>
<TextArea placeholder={t('agents.add.prompt.placeholder')} spellCheck={false} rows={10} />
</Form.Item>
<Form.Item wrapperCol={{ span: 16 }}> <Form.Item wrapperCol={{ span: 16 }}>
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
{t('common.save')} {t('common.save')}

View File

@ -161,7 +161,7 @@ const Assistants: FC<Props> = ({
suffix={<CommandKey>+K</CommandKey>} suffix={<CommandKey>+K</CommandKey>}
value={search} value={search}
onChange={(e) => setSearch(e.target.value)} onChange={(e) => setSearch(e.target.value)}
style={{ borderRadius: 4, borderWidth: 0.5 }} style={{ borderRadius: 16, borderWidth: 0.5 }}
onKeyDown={onSearch} onKeyDown={onSearch}
ref={searchRef} ref={searchRef}
onFocus={() => dispatch(setSearching(true))} onFocus={() => dispatch(setSearching(true))}