> {
@@ -39,8 +41,8 @@ class EmbeddingVisualizer(
val vectorFileName = "vectors.tsv"
val metadataFileName = "metadata.tsv"
val configFileName = "projector-config.json"
- sessionDataStorage.getSessionDir(sessionID).resolve(vectorFileName).writeText(vectorTsv)
- sessionDataStorage.getSessionDir(sessionID).resolve(metadataFileName).writeText(metadataTsv)
+ dataStorage.getSessionDir(session.userId, sessionID).resolve(vectorFileName).writeText(vectorTsv)
+ dataStorage.getSessionDir(session.userId, sessionID).resolve(metadataFileName).writeText(metadataTsv)
// projector-config.json
val projectorConfig = JsonUtil.toJson(
mapOf(
@@ -54,7 +56,7 @@ class EmbeddingVisualizer(
)
)
)
- sessionDataStorage.getSessionDir(sessionID).resolve(configFileName).writeText(projectorConfig)
+ dataStorage.getSessionDir(session.userId, sessionID).resolve(configFileName).writeText(projectorConfig)
return """
Projector Config
Vectors
diff --git a/webui/src/main/resources/simpleSession/chat.css b/webui/src/main/resources/simpleSession/chat.css
index 0162e987..bb8708d2 100644
--- a/webui/src/main/resources/simpleSession/chat.css
+++ b/webui/src/main/resources/simpleSession/chat.css
@@ -276,3 +276,15 @@ pre {
max-height: 0;
transition: max-height 0.2s ease-out;
}
+
+.error {
+ color: red;
+}
+
+.verbose {
+ display: block;
+}
+
+.verbose-hidden {
+ display: none;
+}
\ No newline at end of file
diff --git a/webui/src/main/resources/simpleSession/index.html b/webui/src/main/resources/simpleSession/index.html
index f96c6feb..0c64f797 100644
--- a/webui/src/main/resources/simpleSession/index.html
+++ b/webui/src/main/resources/simpleSession/index.html
@@ -19,6 +19,7 @@
Session Settings
Files
Usage
+ Hide Verbose
diff --git a/webui/src/main/resources/simpleSession/main.js b/webui/src/main/resources/simpleSession/main.js
index 2eb82a5e..9e495c58 100644
--- a/webui/src/main/resources/simpleSession/main.js
+++ b/webui/src/main/resources/simpleSession/main.js
@@ -59,11 +59,31 @@ function onWebSocketText(event) {
Prism.highlightAll();
}
+function toggleVerbose() {
+ let verboseToggle = document.getElementById('verbose');
+ if(verboseToggle.innerText === 'Hide Verbose') {
+ const elements = document.getElementsByClassName('verbose');
+ for (let i = 0; i < elements.length; i++) {
+ elements[i].classList.add('verbose-hidden'); // Add the 'verbose-hidden' class to hide
+ }
+ verboseToggle.innerText = 'Show Verbose';
+ } else if(verboseToggle.innerText === 'Show Verbose') {
+ const elements = document.getElementsByClassName('verbose');
+ for (let i = 0; i < elements.length; i++) {
+ elements[i].classList.remove('verbose-hidden'); // Remove the 'verbose-hidden' class to show
+ }
+ verboseToggle.innerText = 'Hide Verbose';
+ } else {
+ console.log("Error: Unknown state for verbose button");
+ }
+}
+
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('history').addEventListener('click', () => showModal('sessions'));
document.getElementById('settings').addEventListener('click', () => showModal('settings'));
document.getElementById('usage').addEventListener('click', () => showModal('usage'));
+ document.getElementById('verbose').addEventListener('click', () => toggleVerbose());
document.querySelector('.close').addEventListener('click', closeModal);
window.addEventListener('click', (event) => {
diff --git a/webui/src/test/kotlin/com/simiacryptus/skyenet/ActorTestAppServer.kt b/webui/src/test/kotlin/com/simiacryptus/skyenet/ActorTestAppServer.kt
index f99c9c79..29c27d68 100644
--- a/webui/src/test/kotlin/com/simiacryptus/skyenet/ActorTestAppServer.kt
+++ b/webui/src/test/kotlin/com/simiacryptus/skyenet/ActorTestAppServer.kt
@@ -3,6 +3,9 @@ package com.simiacryptus.skyenet
import com.simiacryptus.skyenet.actors.CodingActor
import com.simiacryptus.skyenet.actors.ParsedActor
import com.simiacryptus.skyenet.actors.SimpleActor
+import com.simiacryptus.skyenet.config.ApplicationServices
+import com.simiacryptus.skyenet.config.AuthenticationManager
+import com.simiacryptus.skyenet.config.AuthorizationManager
import com.simiacryptus.skyenet.heart.GroovyInterpreter
import com.simiacryptus.skyenet.heart.KotlinInterpreter
import com.simiacryptus.skyenet.heart.ScalaLocalInterpreter
@@ -33,6 +36,24 @@ object ActorTestAppServer : ApplicationDirectory(port = 8082) {
@JvmStatic
fun main(args: Array) {
+ val mockUser = AuthenticationManager.UserInfo(
+ "1",
+ "user@mock.test",
+ "Test User",
+ ""
+ )
+ ApplicationServices.authenticationManager = object : AuthenticationManager() {
+ override fun getUser(sessionId: String?) = mockUser
+ override fun containsKey(value: String) = true
+ override fun setUser(sessionId: String, userInfo: UserInfo) = throw UnsupportedOperationException()
+ }
+ ApplicationServices.authorizationManager = object : AuthorizationManager() {
+ override fun isAuthorized(
+ applicationClass: Class<*>?,
+ user: String?,
+ operationType: OperationType
+ ): Boolean = true
+ }
super._main(args)
}
}