things
This commit is contained in:
@@ -12,7 +12,7 @@ import kotlin.random.Random
|
||||
|
||||
//átlagos JAVA alapú fejlesztő
|
||||
|
||||
val httpPort: Int = System.getenv("HTTP_PORT")?.toInt() ?: 80
|
||||
val httpPort: Int = System.getenv("HTTP_PORT")?.toInt() ?: 8080
|
||||
val resourcesPath: String = System.getenv("RESOURCES") ?: "src/main/resources/"
|
||||
|
||||
|
||||
@@ -35,13 +35,13 @@ object ConversationHandler {
|
||||
{
|
||||
val stringBuilder = StringBuilder()
|
||||
|
||||
|
||||
|
||||
for (conversation in conversations)
|
||||
{
|
||||
stringBuilder.append(conversation.list())
|
||||
}
|
||||
|
||||
println(stringBuilder.toString())
|
||||
|
||||
return stringBuilder.toString()
|
||||
|
||||
}
|
||||
@@ -70,7 +70,7 @@ class Conversation(val ID: Int)
|
||||
<p style="flex-grow: 1;">$ID</p>
|
||||
<p style="flex-grow: 9;">${messages.last().text}</p>
|
||||
<button style="flex-grow: 1;" onclick="open_message($ID)">reply</button>
|
||||
<div>
|
||||
</div>
|
||||
""".trimIndent()
|
||||
}
|
||||
|
||||
@@ -194,8 +194,12 @@ fun runEmbeddedServer()
|
||||
}
|
||||
|
||||
get("/api/reinit/{id}") {
|
||||
ConversationHandler.newConv(call.parameters["id"]?.toInt() ?: -1)
|
||||
println(ConversationHandler.conversations.last().ID)
|
||||
if (ConversationHandler.conversations.filter { it.ID == call.parameters["id"]?.toInt()}.size != 1)
|
||||
{
|
||||
ConversationHandler.newConv(call.parameters["id"]?.toInt() ?: -1)
|
||||
println(ConversationHandler.conversations.last().ID)
|
||||
}
|
||||
|
||||
call.respond(HttpStatusCode.OK)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</head>
|
||||
<body onload="javascript:fetch_data()">
|
||||
<h2>Conversations:</h2>
|
||||
<div id="messages">
|
||||
<div id="messages" style="display: flex; flex-direction: column;">
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
<div id="messages" class="messages">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
@@ -147,7 +146,7 @@
|
||||
console.error('Error:', error);
|
||||
});
|
||||
|
||||
await sleep(6000);
|
||||
await sleep(3000);
|
||||
|
||||
if (recursive) fetch_data("messages");
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ body {
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
box-sizing: border-box;*/
|
||||
margin-top: 5%;
|
||||
margin-bottom: 0;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
height: 80vh;
|
||||
@@ -40,7 +42,9 @@ body {
|
||||
|
||||
.message {
|
||||
margin: auto;
|
||||
margin-top: 10px;
|
||||
position: relative;
|
||||
bottom: 0px;
|
||||
margin-bottom: 10px;
|
||||
padding: 0px 25px;
|
||||
text-align: left;
|
||||
width: 60%;
|
||||
@@ -57,8 +61,9 @@ body {
|
||||
}
|
||||
|
||||
.messages {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
margin: 10px auto 0px auto;
|
||||
margin: 0px auto 0px auto;
|
||||
padding: 10px 0px;
|
||||
flex-direction: column-reverse;
|
||||
width: 80%;
|
||||
|
||||
Reference in New Issue
Block a user