-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55394db
commit 3ec61dc
Showing
17 changed files
with
118 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 7 additions & 8 deletions
15
webui/src/main/kotlin/com/simiacryptus/skyenet/webui/application/ApplicationInterface.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
package com.simiacryptus.skyenet.webui.application | ||
|
||
import com.simiacryptus.skyenet.webui.session.SessionMessage | ||
import com.simiacryptus.skyenet.webui.session.SocketManagerBase | ||
import com.simiacryptus.jopenai.describe.Description | ||
import com.simiacryptus.skyenet.webui.session.SessionTask | ||
import java.util.function.Consumer | ||
|
||
class ApplicationInterface(private val inner: ApplicationSocketManager) { | ||
fun send(html: String) = inner.send(html) | ||
@Description("Returns html for a link that will trigger the given handler when clicked.") | ||
fun hrefLink(linkText: String, classname: String = """href-link""", handler: Consumer<Unit>) = | ||
inner.hrefLink(linkText, classname, handler) | ||
|
||
@Description("Returns html for a text input form that will trigger the given handler when submitted.") | ||
fun textInput(handler: Consumer<String>): String = | ||
inner.textInput(handler) | ||
|
||
fun newMessage( | ||
operationID: String = SocketManagerBase.randomID(), | ||
spinner: String = SessionMessage.spinner, | ||
cancelable: Boolean = false | ||
): SessionMessage = inner.newMessage(operationID, spinner, cancelable) | ||
fun newTask( | ||
//cancelable: Boolean = false | ||
): SessionTask = inner.newTask(false) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.