Skip to content

Commit 31f2f81

Browse files
Sidebar: show name of currently loaded file in sidebar
1 parent 20a8c8a commit 31f2f81

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/components/Globals.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export var store = {
1414
show_radio: false,
1515
show_messages: false,
1616
flight_mode_changes: [],
17+
file: null,
1718
events: [],
1819
cssColors: [],
1920
colors: [],

src/components/SideBarFileManager.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default {
6565
onLoadSample (file) {
6666
let url
6767
if (file === 'sample') {
68+
this.state.file = 'sample'
6869
url = require('../assets/vtol.tlog')
6970
this.state.log_type = 'tlog'
7071
} else {
@@ -120,6 +121,7 @@ export default {
120121
})
121122
},
122123
process: function (file) {
124+
this.state.file = file.name
123125
this.state.processStatus = 'Pre-processing...'
124126
this.state.processPercentage = 100
125127
this.file = file

src/components/Sidebar.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<!-- TABHOLDER -->
1111
<i class="fa fa-bars fa-2x toggle-btn" v-b-toggle.menucontent></i>
1212
<b-collapse class="menu-content collapse out" id="menucontent" visible>
13+
<span v-if="state.file" class="filename">Current file: {{state.file}}</span>
1314
<div class="tabholder">
1415
<!-- Home -->
1516
<a :class="selected === 'home' ? 'selected' : ''" @click="selected='home'" v-if="!state.processDone">
@@ -334,7 +335,7 @@ a.centered-section {
334335
flex-flow: row wrap;
335336
justify-content: space-evenly;
336337
overflow: hidden;
337-
padding: 12px 0px 12px 0px;
338+
padding: 0px 0px 12px 0px;
338339
cursor: pointer;
339340
font-size: 16px;
340341
}
@@ -467,4 +468,11 @@ a.centered-section {
467468
max-width: 85% !important;
468469
}
469470
}
471+
472+
.filename {
473+
display: block;
474+
text-align: center;
475+
opacity: 0.8;
476+
margin: 6px;
477+
}
470478
</style>

0 commit comments

Comments
 (0)