-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.html
115 lines (100 loc) · 5.24 KB
/
options.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Настройки AI Text Tools</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
label, input, select, textarea, button { display: block; margin: 10px 0; }
#menu-items { margin-top: 20px; }
#menu-items label { font-weight: bold; margin-top: 20px; }
.menu-item { display: flex; align-items: center; margin-bottom: 10px; }
.menu-item input[type="text"] { flex: 1; margin-right: 10px; }
.menu-item textarea { flex: 2; margin-right: 10px; }
.menu-item button { margin-left: 5px; }
#import-section { margin-top: 20px; }
.move-buttons { display: flex; flex-direction: column; }
.move-buttons button {
padding: 2px 5px;
margin-bottom: 2px;
cursor: pointer;
font-size: 12px;
}
#history-link {
margin-top: 20px;
}
#history-link a {
color: #1e90ff;
text-decoration: none;
}
#history-link a:hover {
text-decoration: underline;
}
/* Стили для нового раздела настроек истории */
#history-settings {
margin-top: 20px;
}
#history-settings label {
font-weight: bold;
margin-bottom: 5px;
}
#history-settings input[type="number"] {
width: 100px;
padding: 5px;
font-size: 14px;
}
</style>
</head>
<body>
<!-- Секция для ссылки на историю запросов -->
<div id="history-link">
<h1>История запросов</h1>
<p>
<a href="history.html" target="_blank">Просмотреть последние запросы и ответы</a>
</p>
</div>
<h1>Настройки</h1>
<p>Здесь вы можете настроить параметры работы расширения и управлять пунктами контекстного меню.</p>
<label for="apiServer">Сервер API OpenAI (или совместимый):</label>
<input id="apiServer" type="text" placeholder="https://api.openai.com/v1" />
<label for="apiKey">API-ключ OpenAI:</label>
<input id="apiKey" type="password" placeholder="API-ключ" />
<label for="apiModel">Модель API:</label>
<input id="apiModel" type="text" placeholder="Модель, например, gpt-4o" />
<h2>Рекомендации</h2>
<p>
<b>Рекомендую назначить горячие клавиши в настройках:</b><br>
1) "chrome://extensions/shortcuts" - скопируйте, вставьте в браузер и перейдите по ссылке.<br>
2) Установите горячие клавиши на активацию расширения "AI Text Tools" на клавиши "Ctrl + Space".<br>
3) Выделите нужный текст на сайте, нажмите "Ctrl + Space" и введите ваш запрос. Текст можно не выделять, тогда запрос будет без контекста.<br>
<b>ВНИМАНИЕ!</b> Запросы не работают в настройках расширений и настройках браузера! Это ограничения браузера.
</p>
<h2>Пункты контекстного меню</h2>
<p>
Чтобы добавить новый пункт контекстного меню, нажмите кнопку "Добавить пункт меню".<br><br>
<b>Важно:</b> пункты меню, не содержащие <code>{{selectionText}}</code>, не появятся в контекстном меню.
Чтобы обратиться к AI без контекста, нажмите правой кнопкой мыши в свободном месте и выберите пункт "Спросить AI".<br>
Так же вы можете нажать на значок расширения или использовать горячие клавиши.<br><br>
</p>
<div id="menu-items"></div>
<button id="add-menu-item">Добавить пункт меню</button>
<button id="save">Сохранить</button>
<!-- Секция для экспорта и импорта настроек -->
<div id="import-section">
<h2>Экспорт и импорт настроек</h2>
<button id="export">Экспортировать настройки</button>
<label for="import-file">Импортировать настройки:</label>
<input type="file" id="import-file" accept=".json" />
<button id="import">Импортировать</button>
</div>
<!-- Секция для настройки количества записей в истории -->
<div id="history-settings">
<h2>Настройки Истории</h2>
<label for="historyLimit">Количество записей в истории (0-1000):</label>
<input id="historyLimit" type="number" min="0" max="1000" value="20" />
<p>Установите 0 для отключения сохранения истории.</p>
<button id="saveHistoryLimit">Сохранить</button>
</div>
<script src="options.js"></script>
</body>
</html>