Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1bd9bf0
remove inner border on input fields
AnthonyMarin Jun 25, 2025
52eb7a7
removed background color on inputs with icons
AnthonyMarin Jun 25, 2025
de84b72
create styling for Password Fields
AnthonyMarin Jun 25, 2025
b198bb0
replaced password fields with styled ones
AnthonyMarin Jun 25, 2025
0b42220
replace InputField with InputWithPrefix
AnthonyMarin Jun 25, 2025
455f8fb
create regular input field component
AnthonyMarin Jun 25, 2025
5bb495c
increase padding on input fields
AnthonyMarin Jun 25, 2025
e3c8872
replace remaining regular input fields
AnthonyMarin Jun 25, 2025
efe8b43
create styling for number input
AnthonyMarin Jun 25, 2025
fb2cc22
replace number fields with styled ones
AnthonyMarin Jun 25, 2025
79f33e9
create styling for select component
AnthonyMarin Jun 25, 2025
8088ee7
replace select fields with styled components
AnthonyMarin Jun 25, 2025
b946c35
basic upload field
AnthonyMarin Jun 25, 2025
0f91f9f
place upload field for images
AnthonyMarin Jun 25, 2025
6e32d1d
add UI for uploading images
AnthonyMarin Jun 25, 2025
d7d7829
Merge branch 'main' into ui/advanced-settings-input-fields
AnthonyMarin Jul 3, 2025
8549872
Merge branch 'ui/allowed-users-improvements' into ui/advanced-setting…
AnthonyMarin Jul 3, 2025
fe72245
wrap RelayIcon form item with ComingSoonWrapper
AnthonyMarin Jul 3, 2025
97f0baa
change color of remove icon on supported nips
AnthonyMarin Jul 3, 2025
f22e9dc
Merge branch 'main' into ui/advanced-settings-input-fields
AnthonyMarin Jul 3, 2025
825900c
Merge branch 'main' into ui/advanced-settings-input-fields
AnthonyMarin Jul 3, 2025
014da9a
Merge branch 'main' into ui/advanced-settings-input-fields
AnthonyMarin Jul 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/components/settings/ContentFilterSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, { useEffect, useState } from 'react';
import { Form, InputNumber, Switch, Select, Tooltip } from 'antd';
import { Form, Switch, Select, Tooltip } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import useGenericSettings from '@app/hooks/useGenericSettings';
import { SettingsGroupType } from '@app/types/settings.types';
import BaseSettingsForm from './BaseSettingsForm';
import { InputNumberField } from './Settings.styles';

const { Option } = Select;

Expand Down Expand Up @@ -115,7 +116,7 @@ const ContentFilterSettings: React.FC = () => {
{ type: 'number', min: 100, message: 'Value must be at least 100' }
]}
>
<InputNumber min={100} style={{ width: '100%' }} />
<InputNumberField min={100} style={{ width: '100%' }} />
</Form.Item>

<Form.Item
Expand All @@ -133,7 +134,7 @@ const ContentFilterSettings: React.FC = () => {
{ type: 'number', min: 1, message: 'Value must be at least 1' }
]}
>
<InputNumber min={1} style={{ width: '100%' }} />
<InputNumberField min={1} style={{ width: '100%' }} />
</Form.Item>

<Form.Item
Expand Down
9 changes: 5 additions & 4 deletions src/components/settings/GeneralSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { QuestionCircleOutlined, LockOutlined, DatabaseOutlined, TagOutlined } f
import useGenericSettings from '@app/hooks/useGenericSettings';
import { SettingsGroupType } from '@app/types/settings.types';
import BaseSettingsForm from './BaseSettingsForm';
import * as S from './Settings.styles';

const GeneralSettings: React.FC = () => {
const {
Expand Down Expand Up @@ -58,7 +59,7 @@ const GeneralSettings: React.FC = () => {
{ pattern: /^\d+$/, message: 'Port must be a number' }
]}
>
<Input placeholder="8080" />
<S.InputField placeholder="8080" />
</Form.Item>

<Form.Item
Expand All @@ -75,7 +76,7 @@ const GeneralSettings: React.FC = () => {
{ required: true, message: 'Please enter the private key' }
]}
>
<Input.Password
<S.PasswordField
prefix={<LockOutlined />}
placeholder="Enter private key"
/>
Expand All @@ -92,7 +93,7 @@ const GeneralSettings: React.FC = () => {
</span>
}
>
<Input
<S.InputFieldWithPrefix
prefix={<TagOutlined />}
placeholder="Enter service tag"
/>
Expand All @@ -109,7 +110,7 @@ const GeneralSettings: React.FC = () => {
</span>
}
>
<Input
<S.InputFieldWithPrefix
prefix={<DatabaseOutlined />}
placeholder="./data/stats.db"
/>
Expand Down
96 changes: 43 additions & 53 deletions src/components/settings/ImageModerationSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
import React, { useEffect, useState } from 'react';
import { Form, Input, InputNumber, Switch, Select, Tooltip } from 'antd';
import { Form, Switch, Tooltip } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import useGenericSettings from '@app/hooks/useGenericSettings';
import { ImageModerationSettings as ImageModerationSettingsType, SettingsGroupType } from '@app/types/settings.types';
import BaseSettingsForm from './BaseSettingsForm';

const { Option } = Select;
import * as S from './Settings.styles';
const { Option } = S.SelectField;

const ImageModerationSettings: React.FC = () => {
const {
settings,
loading,
error,
fetchSettings,
updateSettings,
saveSettings,
} = useGenericSettings('image_moderation');
const { settings, loading, error, fetchSettings, updateSettings, saveSettings } =
useGenericSettings('image_moderation');

const [form] = Form.useForm();
const [isUserEditing, setIsUserEditing] = useState(false);
Expand All @@ -24,13 +18,13 @@ const ImageModerationSettings: React.FC = () => {
useEffect(() => {
if (settings && !isUserEditing) {
console.log('ImageModerationSettings - Received settings:', settings);

// The useGenericSettings hook now returns properly prefixed field names
// so we can use the settings directly without transformation
const settingsObj = settings as Record<string, any>;

console.log('ImageModerationSettings - Setting form values directly:', settingsObj);

// Set form values directly since they're already properly prefixed
form.setFieldsValue(settingsObj);
console.log('ImageModerationSettings - Form values after set:', form.getFieldsValue());
Expand Down Expand Up @@ -70,11 +64,7 @@ const ImageModerationSettings: React.FC = () => {
setIsUserEditing(false);
}}
>
<Form.Item
name="image_moderation_enabled"
label="Enable Image Moderation"
valuePropName="checked"
>
<Form.Item name="image_moderation_enabled" label="Enable Image Moderation" valuePropName="checked">
<Switch />
</Form.Item>

Expand All @@ -89,27 +79,35 @@ const ImageModerationSettings: React.FC = () => {
</span>
}
>
<Select
allowClear={true}
placeholder="Select a moderation mode"
>
<S.SelectField allowClear={true} placeholder="Select a moderation mode">
<Option value="basic">Basic Mode (Fastest, detects explicit content only)</Option>
<Option value="strict">Strict Mode (Fast, blocks all buttocks)</Option>
<Option value="full">Full Mode (Most accurate, uses Llama Vision)</Option>
</Select>
</S.SelectField>
</Form.Item>

<Form.Item>
<div style={{
backgroundColor: 'rgba(0, 0, 0, 0.1)',
padding: '12px',
borderRadius: '4px',
marginBottom: '16px'
}}>
<div
style={{
backgroundColor: 'rgba(0, 0, 0, 0.1)',
padding: '12px',
borderRadius: '4px',
marginBottom: '16px',
}}
>
<h4 style={{ marginTop: 0 }}>Moderation Mode Details:</h4>
<p><strong>Basic Mode:</strong> Only detects genitals, anus, and exposed breasts. Fastest processing (no Llama Vision). Best for high-volume applications.</p>
<p><strong>Strict Mode:</strong> Includes all &quot;basic&quot; detection plus automatic blocking of all detected buttocks. Fast processing. Best for zero-tolerance platforms.</p>
<p><strong>Full Mode (Default):</strong> Complete analysis with contextual evaluation. Slower due to Llama Vision, but most accurate. Reduces false positives.</p>
<p>
<strong>Basic Mode:</strong> Only detects genitals, anus, and exposed breasts. Fastest processing (no
Llama Vision). Best for high-volume applications.
</p>
<p>
<strong>Strict Mode:</strong> Includes all &quot;basic&quot; detection plus automatic blocking of all
detected buttocks. Fast processing. Best for zero-tolerance platforms.
</p>
<p>
<strong>Full Mode (Default):</strong> Complete analysis with contextual evaluation. Slower due to Llama
Vision, but most accurate. Reduces false positives.
</p>
</div>
</Form.Item>

Expand All @@ -118,14 +116,11 @@ const ImageModerationSettings: React.FC = () => {
label="API Endpoint"
rules={[{ required: true, message: 'Please enter the API endpoint' }]}
>
<Input placeholder="http://localhost:8000/moderate" />
<S.InputField placeholder="http://localhost:8000/moderate" />
</Form.Item>

<Form.Item
name="image_moderation_temp_dir"
label="Temporary Directory"
>
<Input placeholder="./data/moderation/temp" />
<Form.Item name="image_moderation_temp_dir" label="Temporary Directory">
<S.InputField placeholder="./data/moderation/temp" />
</Form.Item>

<Form.Item
Expand All @@ -140,48 +135,43 @@ const ImageModerationSettings: React.FC = () => {
}
rules={[
{ required: true, message: 'Please enter a threshold value' },
{ type: 'number', min: 0, max: 1, message: 'Value must be between 0 and 1' }
{ type: 'number', min: 0, max: 1, message: 'Value must be between 0 and 1' },
]}
>
<InputNumber
step={0.1}
min={0}
max={1}
style={{ width: '100%' }}
/>
<S.InputNumberField step={0.1} min={0} max={1} style={{ width: '100%' }} />
</Form.Item>

<Form.Item
name="image_moderation_check_interval"
label="Check Interval (seconds)"
rules={[
{ required: true, message: 'Please enter a check interval' },
{ type: 'number', min: 1, message: 'Value must be at least 1' }
{ type: 'number', min: 1, message: 'Value must be at least 1' },
]}
>
<InputNumber min={1} style={{ width: '100%' }} />
<S.InputNumberField min={1} style={{ width: '100%' }} />
</Form.Item>

<Form.Item
name="image_moderation_concurrency"
label="Concurrency"
rules={[
{ required: true, message: 'Please enter a concurrency value' },
{ type: 'number', min: 1, message: 'Value must be at least 1' }
{ type: 'number', min: 1, message: 'Value must be at least 1' },
]}
>
<InputNumber min={1} style={{ width: '100%' }} />
<S.InputNumberField min={1} style={{ width: '100%' }} />
</Form.Item>

<Form.Item
name="image_moderation_timeout"
label="Timeout (seconds)"
rules={[
{ required: true, message: 'Please enter a timeout value' },
{ type: 'number', min: 1, message: 'Value must be at least 1' }
{ type: 'number', min: 1, message: 'Value must be at least 1' },
]}
>
<InputNumber min={1} style={{ width: '100%' }} />
<S.InputNumberField min={1} style={{ width: '100%' }} />
</Form.Item>
</Form>
</BaseSettingsForm>
Expand Down
13 changes: 7 additions & 6 deletions src/components/settings/OllamaSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect, useState } from 'react';
import { Form, Input, InputNumber, Select, Tooltip } from 'antd';
import { Form, Tooltip } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import useGenericSettings from '@app/hooks/useGenericSettings';
import { SettingsGroupType } from '@app/types/settings.types';
import BaseSettingsForm from './BaseSettingsForm';
import { InputField, InputNumberField, SelectField } from './Settings.styles';

const { Option } = Select;
const { Option } = SelectField;

const OllamaSettings: React.FC = () => {
const {
Expand Down Expand Up @@ -113,7 +114,7 @@ const OllamaSettings: React.FC = () => {
{ type: 'url', message: 'Please enter a valid URL' }
]}
>
<Input placeholder="http://localhost:11434" />
<InputField placeholder="http://localhost:11434" />
</Form.Item>

<Form.Item
Expand All @@ -130,7 +131,7 @@ const OllamaSettings: React.FC = () => {
{ required: true, message: 'Please select an Ollama model' }
]}
>
<Select
<SelectField
placeholder="Select a model"
allowClear
showSearch
Expand All @@ -143,7 +144,7 @@ const OllamaSettings: React.FC = () => {
{option.label}
</Option>
))}
</Select>
</SelectField>
</Form.Item>

<Form.Item
Expand All @@ -161,7 +162,7 @@ const OllamaSettings: React.FC = () => {
{ type: 'number', min: 1, message: 'Value must be at least 1' }
]}
>
<InputNumber min={1} style={{ width: '100%' }} />
<InputNumberField min={1} style={{ width: '100%' }} />
</Form.Item>
</Form>
</BaseSettingsForm>
Expand Down
Loading
Loading