SimpleChat:UI:Add settings button and bring in settings ui
This commit is contained in:
parent
e17f5e0204
commit
0dae12ba6b
2 changed files with 8 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
<div class="sameline">
|
<div class="sameline">
|
||||||
<p class="heading flex-grow" > <b> SimpleChat </b> </p>
|
<p class="heading flex-grow" > <b> SimpleChat </b> </p>
|
||||||
|
<button id="settings">Settings</button>
|
||||||
<div class="sameline">
|
<div class="sameline">
|
||||||
<label for="api-ep">Mode:</label>
|
<label for="api-ep">Mode:</label>
|
||||||
<select name="api-ep" id="api-ep">
|
<select name="api-ep" id="api-ep">
|
||||||
|
|
|
@ -134,7 +134,6 @@ class SimpleChat {
|
||||||
if (bClear) {
|
if (bClear) {
|
||||||
div.innerHTML = gUsageMsg;
|
div.innerHTML = gUsageMsg;
|
||||||
gMe.show_info(div);
|
gMe.show_info(div);
|
||||||
gMe.show_settings(div);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -266,12 +265,14 @@ class MultiChatUI {
|
||||||
this.elInUser = /** @type{HTMLInputElement} */(document.getElementById("user-in"));
|
this.elInUser = /** @type{HTMLInputElement} */(document.getElementById("user-in"));
|
||||||
this.elSelectApiEP = /** @type{HTMLSelectElement} */(document.getElementById("api-ep"));
|
this.elSelectApiEP = /** @type{HTMLSelectElement} */(document.getElementById("api-ep"));
|
||||||
this.elDivSessions = /** @type{HTMLDivElement} */(document.getElementById("sessions-div"));
|
this.elDivSessions = /** @type{HTMLDivElement} */(document.getElementById("sessions-div"));
|
||||||
|
this.elBtnSettings = /** @type{HTMLButtonElement} */(document.getElementById("settings"));
|
||||||
|
|
||||||
this.validate_element(this.elInSystem, "system-in");
|
this.validate_element(this.elInSystem, "system-in");
|
||||||
this.validate_element(this.elDivChat, "chat-div");
|
this.validate_element(this.elDivChat, "chat-div");
|
||||||
this.validate_element(this.elInUser, "user-in");
|
this.validate_element(this.elInUser, "user-in");
|
||||||
this.validate_element(this.elSelectApiEP, "api-ep");
|
this.validate_element(this.elSelectApiEP, "api-ep");
|
||||||
this.validate_element(this.elDivChat, "sessions-div");
|
this.validate_element(this.elDivChat, "sessions-div");
|
||||||
|
this.validate_element(this.elBtnSettings, "settings");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -312,6 +313,11 @@ class MultiChatUI {
|
||||||
this.handle_session_switch(this.curChatId);
|
this.handle_session_switch(this.curChatId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.elBtnSettings.addEventListener("click", (ev)=>{
|
||||||
|
this.elDivChat.replaceChildren();
|
||||||
|
gMe.show_settings(this.elDivChat);
|
||||||
|
});
|
||||||
|
|
||||||
this.elBtnUser.addEventListener("click", (ev)=>{
|
this.elBtnUser.addEventListener("click", (ev)=>{
|
||||||
if (this.elInUser.disabled) {
|
if (this.elInUser.disabled) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue