Skip to content

Commit 389fc16

Browse files
author
AiQL.com
authored
Support clear input box
1 parent 8159ba0 commit 389fc16

File tree

1 file changed

+37
-29
lines changed

1 file changed

+37
-29
lines changed

index.html

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@
8080
display: flex;
8181
flex-direction: column;
8282
position: relative;
83-
margin-bottom: 122px;
83+
}
84+
85+
.fill-area {
86+
height: 10px
8487
}
8588

8689
.dialog-card {
@@ -96,7 +99,7 @@
9699

97100
.input-config {
98101
width: auto;
99-
position: absolute;
102+
position: fixed;
100103
margin-left: 19px;
101104
bottom: 0;
102105
border-radius: 20px;
@@ -130,19 +133,14 @@
130133
margin-bottom: 1px;
131134
}
132135

133-
.input-fab {
134-
margin: 0 10px 37px 10px;
135-
/* top left bot right*/
136-
}
137-
138136
.input-icon {
139-
margin-bottom: 30px;
140-
margin-right: 20px;
137+
margin: 0 10px 34px 10px;
138+
/* top left bot right*/
141139
}
142140
}
143141

144142
.chat-images {
145-
width: 30px;
143+
width: 25px;
146144
max-height: 40px;
147145
transition: all 0.2s;
148146
/* margin-bottom: 20px; */
@@ -309,21 +307,31 @@
309307
</v-row>
310308
</v-col>
311309

312-
<v-sheet elevation="0" class="input-panel d-flex align-end px-1">
313310

314-
<v-textarea class="input-box" dirty color="primary" type="text" variant="solo" counter
315-
@keydown="messageStore.handleKeydown" v-model="messageStore.userMessage" :label=""
316-
@focus="settingStore.setInputRow(3,0)" @blur="settingStore.setInputRow(1,150)"
317-
:rows="settingStore.inputRow" auto-grow max-rows="15">
318-
<template v-slot:prepend-inner>
319-
<v-img v-show=messageStore.base64 class="chat-images" :src="messageStore.base64"
320-
@click="messageStore.images=[]"></v-img>
321-
</template>
322-
</v-textarea>
323311

324-
<div class="input-fab">
325-
<v-file-input accept="image/*" hide-input v-model="messageStore.images"></v-file-input>
326-
</div>
312+
<v-sheet elevation="0" class="input-panel d-flex align-end px-1">
313+
<v-container>
314+
<v-row>
315+
<v-spacer></v-spacer>
316+
<v-div class='ma-1'>
317+
<v-file-input accept="image/*" hide-input v-model="messageStore.images"
318+
prepend-icon="mdi-plus-circle-outline"></v-file-input>
319+
</v-div>
320+
<v-btn class='ma-1' size="21" icon="$error" @click="messageStore.clear()">
321+
</v-btn>
322+
</v-row>
323+
<v-row>
324+
<v-textarea class="input-box" dirty color="primary" type="text" variant="solo" counter
325+
@keydown="messageStore.handleKeydown" v-model="messageStore.userMessage" :label=""
326+
@focus="settingStore.setInputRow(2,0)" @blur="settingStore.setInputRow(1,150)"
327+
:rows="settingStore.inputRow" auto-grow max-rows="15">
328+
<template v-slot:prepend-inner>
329+
<v-img v-show=messageStore.base64 class="chat-images" :src="messageStore.base64"
330+
@click="messageStore.images=[]"></v-img>
331+
</template>
332+
</v-textarea>
333+
</v-row>
334+
</v-container>
327335
<div class="input-icon">
328336
<v-btn v-if="messageStore.userMessage" size="small" color="primary" variant="elevated"
329337
@click="messageStore.sendMessage" icon="mdi-arrow-up">
@@ -334,11 +342,9 @@
334342
variant="elevated" @click="messageStore.resendMessage" icon="mdi-autorenew"></v-btn>
335343
<v-btn v-else size="small" color="grey" variant="elevated" icon="mdi-arrow-up">
336344
</v-btn>
337-
</div>
338-
339345

346+
</div>
340347
</v-sheet>
341-
342348
</div>
343349

344350
<!-- snackbar -->
@@ -1046,6 +1052,10 @@ <h5 class="font-weight-bold">{{ column.key }}</h5>
10461052
snackbarStore.showSuccessMessage("Added new session.")
10471053
}
10481054
},
1055+
clear() {
1056+
this.userMessage = "";
1057+
this.images = [];
1058+
},
10491059
handleKeydown(e) {
10501060
if (e.key === "Enter" && (e.altKey || e.shiftKey || e.ctrlKey)) {
10511061
// Alt/Shift + Enter, insert a \n
@@ -1099,9 +1109,7 @@ <h5 class="font-weight-bold">{{ column.key }}</h5>
10991109
}
11001110
},
11011111
startInference: async function () {
1102-
this.userMessage = "";
1103-
this.images = [];
1104-
1112+
this.clear();
11051113
// Clear the input
11061114
// Create a completion
11071115
if (this.conversation.length == 1) {

0 commit comments

Comments
 (0)