+
+ )}
);
}
diff --git a/src/lang/en.json b/src/lang/en.json
index a5ea65f..ca14cdf 100644
--- a/src/lang/en.json
+++ b/src/lang/en.json
@@ -1,5 +1,6 @@
{
"header.title.noChat": "New Chat",
+ "header.title.settings": "Settings",
"chatScreen": {
"welcome": "Hi,",
"welcomeNote": "how can I help you?"
@@ -143,12 +144,12 @@
"note": "DRY sampling reduces repetition in generated text even across long contexts. This parameter sets DRY penalty for the last n tokens."
},
"custom": {
- "label": "",
- "note": ""
+ "label": "Custom JSON config",
+ "note": "For more info, refer to server documentation"
},
"pyIntepreterEnabled": {
- "label": "",
- "note": ""
+ "label": "Enable Python interpreter",
+ "note": "This feature uses pyodide, downloaded from CDN. To use this feature, ask the LLM to generate Python code inside a Markdown code block. You will see a \"Run\" button on the code block, near the \"Copy\" button."
},
"ttsPitch": {
"label": "Pitch",
@@ -192,6 +193,11 @@
"label": "Syntax Theme",
"note": "Choose the color theme for code blocks."
}
+ },
+ "actionButtons": {
+ "saveBtnLabel": "Save",
+ "cancelBtnLabel": "Close",
+ "resetBtnLabel": "Reset"
}
},
"newVersion": {
diff --git a/src/components/SettingDialog.tsx b/src/pages/Settings.tsx
similarity index 76%
rename from src/components/SettingDialog.tsx
rename to src/pages/Settings.tsx
index f9e80ea..193398f 100644
--- a/src/components/SettingDialog.tsx
+++ b/src/pages/Settings.tsx
@@ -26,7 +26,22 @@ import {
TrashIcon,
TvIcon,
} from '@heroicons/react/24/outline';
-import React, { FC, ReactElement, useEffect, useMemo, useState } from 'react';
+import React, {
+ FC,
+ ReactElement,
+ useCallback,
+ useEffect,
+ useMemo,
+ useState,
+} from 'react';
+import { useNavigate } from 'react-router';
+import { Dropdown } from '../components/common';
+import { useModals } from '../components/ModalProvider';
+import TextToSpeech, {
+ getSpeechSynthesisVoiceByName,
+ getSpeechSynthesisVoices,
+ IS_SPEECH_SYNTHESIS_SUPPORTED,
+} from '../components/TextToSpeech';
import {
CONFIG_DEFAULT,
INFERENCE_PROVIDERS,
@@ -34,6 +49,7 @@ import {
THEMES,
} from '../config';
import { useAppContext } from '../context/app';
+import { useChatContext } from '../context/chat';
import { useInferenceContext } from '../context/inference';
import StorageUtils from '../database';
import { useDebouncedCallback } from '../hooks/useDebouncedCallback';
@@ -54,13 +70,6 @@ import {
isString,
normalizeUrl,
} from '../utils';
-import { Dropdown, OpenInNewTab } from './common';
-import { useModals } from './ModalProvider';
-import TextToSpeech, {
- getSpeechSynthesisVoiceByName,
- getSpeechSynthesisVoices,
- IS_SPEECH_SYNTHESIS_SUPPORTED,
-} from './TextToSpeech';
// --- Type Definitions ---
enum SettingInputType {
@@ -473,19 +482,7 @@ const getSettingTabsConfiguration = (
/* Custom */
DELIMETER,
toSection('Custom', ),
- {
- type: SettingInputType.LONG_INPUT,
- label: (
- <>
- Custom JSON config (For more info, refer to{' '}
-
- server documentation
-
- )
- >
- ),
- key: 'custom',
- },
+ toInput(SettingInputType.LONG_INPUT, 'custom'),
],
},
@@ -502,56 +499,45 @@ const getSettingTabsConfiguration = (
type: SettingInputType.CUSTOM,
key: 'custom', // dummy key, won't be used
component: () => (
- <>
-
- Experimental features are not guaranteed to work correctly.
-
-
+
+
Experimental features are not guaranteed to work correctly.
+
If you encounter any problems, create a{' '}
-
+
Bug (misc.)
- {' '}
+ {' '}
report on Github. Please also specify webui/experimental on
the report title and include screenshots.
-
-
+
+
Some features may require packages downloaded from CDN, so they
need internet connection.
- >
- ),
- },
- {
- type: SettingInputType.CHECKBOX,
- label: (
- <>
- Enable Python interpreter
-
-
- This feature uses{' '}
- pyodide,
- downloaded from CDN. To use this feature, ask the LLM to generate
- Python code inside a Markdown code block. You will see a "Run"
- button on the code block, near the "Copy" button.
-
- >
+