mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'dev-settings-on-top' into dev
This commit is contained in:
@ -117,6 +117,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="novel_api" style="display: none;position: relative;"> <!-- shows the novel settings -->
|
<div id="novel_api" style="display: none;position: relative;"> <!-- shows the novel settings -->
|
||||||
|
<form action="javascript:void(null);" method="post" enctype="multipart/form-data">
|
||||||
|
|
||||||
|
<h4>API key</h4>
|
||||||
|
<h5>Where to get (<a href="/notes/6" target="_blank">?</a>)</h5>
|
||||||
|
<input id="api_key_novel" name="api_key_novel" class="text_pole" maxlength="500" size="35" value="" autocomplete="off">
|
||||||
|
<input id="api_button_novel" type="submit" value="Connect">
|
||||||
|
<img id="api_loading_novel" src="img/load.svg">
|
||||||
|
</form>
|
||||||
|
<div id="online_status3">
|
||||||
|
<div id="online_status_indicator3"></div>
|
||||||
|
<div id="online_status_text3">No connection...</div>
|
||||||
|
</div>
|
||||||
<h4>Novel AI Model
|
<h4>Novel AI Model
|
||||||
<a href="/notes/8" class="notes-link" target="_blank">
|
<a href="/notes/8" class="notes-link" target="_blank">
|
||||||
<span class="note-link-span">?</span>
|
<span class="note-link-span">?</span>
|
||||||
|
@ -201,12 +201,18 @@ function RA_checkOnlineStatus() {
|
|||||||
//Auto-connect to API (when set to kobold, API URL exists, and auto_connect is true)
|
//Auto-connect to API (when set to kobold, API URL exists, and auto_connect is true)
|
||||||
|
|
||||||
function RA_autoconnect() {
|
function RA_autoconnect() {
|
||||||
|
console.log(main_api);
|
||||||
if (typeof online_status !== 'undefined' && (api_server !== '' || api_key_novel !== '')) {
|
if (typeof online_status !== 'undefined' && (api_server !== '' || api_key_novel !== '')) {
|
||||||
if (online_status === "no_connection" && LoadLocalBool('AutoConnectEnabled')) {
|
if (online_status === "no_connection" && LoadLocalBool('AutoConnectEnabled')) {
|
||||||
if (isUrlOrAPIKey(api_server) && main_api === "kobold") {
|
if (isUrlOrAPIKey(api_server) && main_api === "kobold") {
|
||||||
$("#api_url_text").val(api_server);
|
|
||||||
$("#api_button").click();
|
$("#api_button").click();
|
||||||
}
|
}
|
||||||
|
if (main_api === "novel") {
|
||||||
|
$("#api_button_novel").click();
|
||||||
|
}
|
||||||
|
if (isUrlOrAPIKey(api_server) && main_api === "textgenerationwebui") {
|
||||||
|
$("#api_button_textgenerationwebui").click();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setTimeout(RA_autoconnect, 100);
|
setTimeout(RA_autoconnect, 100);
|
||||||
@ -214,7 +220,6 @@ function RA_autoconnect() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isUrlOrAPIKey(string) {
|
function isUrlOrAPIKey(string) {
|
||||||
//const pattern = /^\d{3}-\d{3}-\d{3}-\d{3}$/; //need a sample novelAI key to set this format
|
|
||||||
try {
|
try {
|
||||||
new URL(string);
|
new URL(string);
|
||||||
return true;
|
return true;
|
||||||
@ -312,8 +317,17 @@ $("document").ready(function () {
|
|||||||
}
|
}
|
||||||
if (event.ctrlKey && event.key == "ArrowUp") {
|
if (event.ctrlKey && event.key == "ArrowUp") {
|
||||||
//Ctrl+UpArrow for Connect to last server
|
//Ctrl+UpArrow for Connect to last server
|
||||||
|
console.log(main_api);
|
||||||
if (online_status === "no_connection") {
|
if (online_status === "no_connection") {
|
||||||
document.getElementById("api_button").click();
|
if (main_api == "kobold") {
|
||||||
|
document.getElementById("api_button").click();
|
||||||
|
}
|
||||||
|
if (main_api == "novel") {
|
||||||
|
document.getElementById("api_button_novel").click();
|
||||||
|
}
|
||||||
|
if (main_api == "textgenerationwebui") {
|
||||||
|
document.getElementById("api_button_textgenerationwebui").click();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (event.ctrlKey && event.key == "ArrowLeft") { //for debug, show all local stored vars
|
if (event.ctrlKey && event.key == "ArrowLeft") { //for debug, show all local stored vars
|
||||||
|
@ -224,6 +224,7 @@ margin-top:5px;
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 1px auto 10px auto;
|
margin: 1px auto 10px auto;
|
||||||
|
z-index: 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#send_form {
|
#send_form {
|
||||||
|
Reference in New Issue
Block a user