Unify the display of novel streaming checkbox

11751d3893793b551179c96fd0de6fe1c05151d2

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +33 -40Ignore whitespace
public/index.html+26 -29
@@ -218,22 +218,6 @@
218 </div>218 </div>
219 </div>219 </div>
220 </div>220 </div>
221 <div id="ai_module_block_novel" class="width100p">
222 <div class="range-block">
223 <div class="range-block-title justifyLeft" data-i18n="AI Module">
224 AI Module
225 </div>
226 <div class="toggle-description justifyLeft" data-i18n="Changes the style of the generated text.">
227 Changes the style of the generated text.
228 </div>
229 <select id="nai_prefix">
230 <option value="vanilla" data-i18n="No Module">No Module</option>
231 <option value="special_instruct" data-i18n="Instruct">Instruct</option>
232 <option value="special_proseaugmenter" data-i18n="Prose Augmenter">Prose Augmenter</option>
233 <option value="theme_textadventure" data-i18n="Text Adventure">Text Adventure</option>
234 </select>
235 </div>
236 </div>
237 <div id="common-gen-settings-block" class="width100p">221 <div id="common-gen-settings-block" class="width100p">
238 <div id="pro-settings-block" class="flex-container gap10h5v justifyCenter">222 <div id="pro-settings-block" class="flex-container gap10h5v justifyCenter">
239 <div id="amount_gen_block" class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0">223 <div id="amount_gen_block" class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0">
@@ -258,6 +242,14 @@
258 </small>242 </small>
259 </label>243 </label>
260 </div>244 </div>
245 <div id="streaming_novel_block" class="flex-container alignitemscenter justifyCenter marginTop5">
246 <label class="checkbox_label" for="streaming_novel">
247 <input type="checkbox" id="streaming_novel" />
248 <small><span data-i18n="Streaming">Streaming</span>
249 <div class="margin5 fa-solid fa-circle-info opacity50p" data-i18n="[title]Streaming_desc" title="Display the response bit by bit as it is generated.&#13;When this is off, responses will be displayed all at once when they are complete."></div>
250 </small>
251 </label>
252 </div>
261 </div>253 </div>
262 <div id="max_context_block" class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0">254 <div id="max_context_block" class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0">
263 <small data-i18n="context size(tokens)">Context (tokens)</small>255 <small data-i18n="context size(tokens)">Context (tokens)</small>
@@ -278,6 +270,22 @@
278 <span data-i18n="Max prompt cost:">Max prompt cost:</span> <span id="or_prompt_cost">&ndash;</span>270 <span data-i18n="Max prompt cost:">Max prompt cost:</span> <span id="or_prompt_cost">&ndash;</span>
279 </small>271 </small>
280 </div>272 </div>
273 <div id="ai_module_block_novel" class="width100p">
274 <div class="range-block">
275 <div class="range-block-title justifyLeft" data-i18n="AI Module">
276 AI Module
277 </div>
278 <div class="toggle-description justifyLeft" data-i18n="Changes the style of the generated text.">
279 Changes the style of the generated text.
280 </div>
281 <select id="nai_prefix">
282 <option value="vanilla" data-i18n="No Module">No Module</option>
283 <option value="special_instruct" data-i18n="Instruct">Instruct</option>
284 <option value="special_proseaugmenter" data-i18n="Prose Augmenter">Prose Augmenter</option>
285 <option value="theme_textadventure" data-i18n="Text Adventure">Text Adventure</option>
286 </select>
287 </div>
288 </div>
281 <hr>289 <hr>
282 </div>290 </div>
283 <div id="respective-ranges-and-temps" class="width100p">291 <div id="respective-ranges-and-temps" class="width100p">
@@ -287,19 +295,6 @@
287 -->295 -->
288 <div id="range_block_novel">296 <div id="range_block_novel">
289 <div class="range-block">297 <div class="range-block">
290 <label class="checkbox_label widthFreeExpand">
291 <input id="streaming_novel" type="checkbox" />
292 <span data-i18n="Streaming">Streaming</span>
293 </label>
294 <div class="toggle-description justifyLeft">
295 <span data-i18n="Display the response bit by bit as it is generated.">
296 Display the response bit by bit as it is generated.</span><br>
297 <span data-i18n="When this is off, responses will be displayed all at once when they are complete.">
298 When this is off, responses will be displayed all at once when they are complete.
299 </span>
300 </div>
301 </div>
302 <div class="range-block">
303 <div class="range-block-title" data-i18n="Temperature">298 <div class="range-block-title" data-i18n="Temperature">
304 Temperature299 Temperature
305 </div>300 </div>
@@ -5160,6 +5155,8 @@
5160 </div>5155 </div>
5161 <!-- various fullscreen popups -->5156 <!-- various fullscreen popups -->
5162 <div name="templatesAndPopupsWrapper"> <!--this div is just for IDE sanity for quick collapsing-->5157 <div name="templatesAndPopupsWrapper"> <!--this div is just for IDE sanity for quick collapsing-->
5158 <!-- Point to this element when you need a no-op selector -->
5159 <template id="NULL_SELECTOR" class="displayNone"></template>
5163 <div id="export_format_popup" class="list-group">5160 <div id="export_format_popup" class="list-group">
5164 <div class="export_format list-group-item" data-format="png">PNG</div>5161 <div class="export_format list-group-item" data-format="png">PNG</div>
5165 <div class="export_format list-group-item" data-format="json">JSON</div>5162 <div class="export_format list-group-item" data-format="json">JSON</div>
public/script.js+7 -11
@@ -6360,6 +6360,7 @@ export function changeMainAPI() {
6360 //console.log(selectedVal);6360 //console.log(selectedVal);
6361 const apiElements = {6361 const apiElements = {
6362 'koboldhorde': {6362 'koboldhorde': {
6363 apiStreaming: $('#NULL_SELECTOR'),
6363 apiSettings: $('#kobold_api-settings'),6364 apiSettings: $('#kobold_api-settings'),
6364 apiConnector: $('#kobold_horde'),6365 apiConnector: $('#kobold_horde'),
6365 apiPresets: $('#kobold_api-presets'),6366 apiPresets: $('#kobold_api-presets'),
@@ -6368,6 +6369,7 @@ export function changeMainAPI() {
6368 amountGenElem: $('#amount_gen_block'),6369 amountGenElem: $('#amount_gen_block'),
6369 },6370 },
6370 'kobold': {6371 'kobold': {
6372 apiStreaming: $('#streaming_kobold_block'),
6371 apiSettings: $('#kobold_api-settings'),6373 apiSettings: $('#kobold_api-settings'),
6372 apiConnector: $('#kobold_api'),6374 apiConnector: $('#kobold_api'),
6373 apiPresets: $('#kobold_api-presets'),6375 apiPresets: $('#kobold_api-presets'),
@@ -6376,6 +6378,7 @@ export function changeMainAPI() {
6376 amountGenElem: $('#amount_gen_block'),6378 amountGenElem: $('#amount_gen_block'),
6377 },6379 },
6378 'textgenerationwebui': {6380 'textgenerationwebui': {
6381 apiStreaming: $('#streaming_textgenerationwebui_block'),
6379 apiSettings: $('#textgenerationwebui_api-settings'),6382 apiSettings: $('#textgenerationwebui_api-settings'),
6380 apiConnector: $('#textgenerationwebui_api'),6383 apiConnector: $('#textgenerationwebui_api'),
6381 apiPresets: $('#textgenerationwebui_api-presets'),6384 apiPresets: $('#textgenerationwebui_api-presets'),
@@ -6384,6 +6387,7 @@ export function changeMainAPI() {
6384 amountGenElem: $('#amount_gen_block'),6387 amountGenElem: $('#amount_gen_block'),
6385 },6388 },
6386 'novel': {6389 'novel': {
6390 apiStreaming: $('#streaming_novel_block'),
6387 apiSettings: $('#novel_api-settings'),6391 apiSettings: $('#novel_api-settings'),
6388 apiConnector: $('#novel_api'),6392 apiConnector: $('#novel_api'),
6389 apiPresets: $('#novel_api-presets'),6393 apiPresets: $('#novel_api-presets'),
@@ -6392,6 +6396,7 @@ export function changeMainAPI() {
6392 amountGenElem: $('#amount_gen_block'),6396 amountGenElem: $('#amount_gen_block'),
6393 },6397 },
6394 'openai': {6398 'openai': {
6399 apiStreaming: $('#NULL_SELECTOR'),
6395 apiSettings: $('#openai_settings'),6400 apiSettings: $('#openai_settings'),
6396 apiConnector: $('#openai_api'),6401 apiConnector: $('#openai_api'),
6397 apiPresets: $('#openai_api-presets'),6402 apiPresets: $('#openai_api-presets'),
@@ -6414,12 +6419,14 @@ export function changeMainAPI() {
6414 apiObj.apiConnector.css('display', 'none');6419 apiObj.apiConnector.css('display', 'none');
6415 apiObj.apiRanges.css('display', 'none');6420 apiObj.apiRanges.css('display', 'none');
6416 apiObj.apiPresets.css('display', 'none');6421 apiObj.apiPresets.css('display', 'none');
6422 apiObj.apiStreaming.css('display', 'none');
6417 }6423 }
64186424
6419 //then, find and enable the active item.6425 //then, find and enable the active item.
6420 //This is split out of the loop so that different apis can share settings divs6426 //This is split out of the loop so that different apis can share settings divs
6421 let activeItem = apiElements[selectedVal];6427 let activeItem = apiElements[selectedVal];
64226428
6429 activeItem.apiStreaming.css('display', 'block');
6423 activeItem.apiSettings.css('display', 'block');6430 activeItem.apiSettings.css('display', 'block');
6424 activeItem.apiConnector.css('display', 'block');6431 activeItem.apiConnector.css('display', 'block');
6425 activeItem.apiRanges.css('display', 'block');6432 activeItem.apiRanges.css('display', 'block');
@@ -6436,17 +6443,6 @@ export function changeMainAPI() {
6436 }6443 }
64376444
6438 //custom because streaming has been moved up under response tokens, which exists inside common settings block6445 //custom because streaming has been moved up under response tokens, which exists inside common settings block
6439 if (selectedVal === 'textgenerationwebui') {
6440 $('#streaming_textgenerationwebui_block').css('display', 'block');
6441 } else {
6442 $('#streaming_textgenerationwebui_block').css('display', 'none');
6443 }
6444 if (selectedVal === 'kobold') {
6445 $('#streaming_kobold_block').css('display', 'block');
6446 } else {
6447 $('#streaming_kobold_block').css('display', 'none');
6448 }
6449
6450 if (selectedVal === 'novel') {6446 if (selectedVal === 'novel') {
6451 $('#ai_module_block_novel').css('display', 'block');6447 $('#ai_module_block_novel').css('display', 'block');
6452 } else {6448 } else {