9
9
<div class =" flex items-center" >
10
10
<SelectControl
11
11
v-if =" logs.length > 1"
12
- :selected =" selectedLogFile.value "
13
- @update: selected =" handleLogChange"
12
+ v-model =" selectedLogFile"
13
+ @selected =" handleLogChange"
14
14
:options =" logs"
15
15
size =" sm"
16
16
>
19
19
</option >
20
20
</SelectControl >
21
21
<p v-else-if =" logs.length == 1" class =" font-bold truncate" >
22
- {{ selectedLogFile.value }}
22
+ {{ selectedLogFile }}
23
23
</p >
24
24
<p v-else >
25
25
&mdash ;
@@ -96,7 +96,7 @@ export default {
96
96
content: null ,
97
97
lastLine: 0 ,
98
98
interval: null ,
99
- selectedLogFile: ' ' ,
99
+ selectedLogFile: null ,
100
100
numberOfLines: 0 ,
101
101
scrolledToBottom: false ,
102
102
}),
@@ -130,7 +130,7 @@ export default {
130
130
},
131
131
132
132
selectFirstLog () {
133
- this .selectedLogFile = this .logs [0 ]
133
+ this .selectedLogFile = this .logs [0 ]. value
134
134
},
135
135
136
136
updateScrollPosition () {
@@ -144,11 +144,9 @@ export default {
144
144
}
145
145
},
146
146
147
- handleLogChange (val ) {
147
+ handleLogChange (option ) {
148
148
const wasPlaying = this .playing
149
149
this .playing = false
150
- const options = this .logs .filter (l => l .value == val)
151
- this .selectedLogFile = options[0 ]
152
150
this .replaceContent ()
153
151
if (wasPlaying) {
154
152
this .playing = true
@@ -157,7 +155,7 @@ export default {
157
155
158
156
requestContent () {
159
157
return Nova .request ().get (' /nova-vendor/logs' , {
160
- params: { log: this .selectedLogFile . value , lastLine: this .lastLine },
158
+ params: { log: this .selectedLogFile , lastLine: this .lastLine },
161
159
})
162
160
},
163
161
0 commit comments