-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathCmdTlmServer.vue
More file actions
193 lines (183 loc) · 4.69 KB
/
CmdTlmServer.vue
File metadata and controls
193 lines (183 loc) · 4.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!--
# Copyright 2022 Ball Aerospace & Technologies Corp.
# All Rights Reserved.
#
# This program is free software; you can modify and/or redistribute it
# under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation; version 3 with
# attribution addendums as found in the LICENSE.txt
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# Modified by OpenC3, Inc.
# All changes Copyright 2025, OpenC3, Inc.
# All Rights Reserved
#
# This file may also be used under the terms of a commercial license
# if purchased from OpenC3, Inc.
-->
<template>
<top-bar :menus="menus" :title="title" />
<!-- .v-table--fixed-header>.v-table__wrapper>table>thead has z-index: 2
which makes the LogMessages table header go above the raw dialogs
so we must increase the z-index of the card above 2 -->
<v-card style="z-index: 4 !important">
<v-expansion-panels v-model="panel">
<v-expansion-panel>
<v-expansion-panel-title>
<v-tabs v-model="curTab" fixed-tabs grow align-tabs="start">
<v-tab
v-for="(tab, index) in tabs"
:key="index"
:to="tab.path"
:text="tab.name"
@click.stop
/>
</v-tabs>
</v-expansion-panel-title>
<v-expansion-panel-text>
<router-view :refresh-interval="refreshInterval" />
</v-expansion-panel-text>
</v-expansion-panel>
</v-expansion-panels>
</v-card>
<div style="height: 15px" />
<log-messages :time-zone="timeZone" />
<!-- This dialog updates at time of input, so it does not need to be persistent -->
<v-dialog v-model="optionsDialog" max-width="300">
<v-card>
<v-toolbar height="24">
<v-spacer />
<span>Options</span>
<v-spacer />
</v-toolbar>
<div class="mt-6 pa-3">
<v-text-field
min="0"
max="10000"
step="100"
type="number"
label="Refresh Interval (ms)"
:model-value="refreshInterval"
@update:model-value="refreshInterval = $event"
/>
</div>
</v-card>
</v-dialog>
</template>
<script>
import { OpenC3Api } from '@openc3/js-common/services'
import { LogMessages, TopBar } from '@openc3/vue-common/components'
export default {
components: {
LogMessages,
TopBar,
},
data() {
return {
api: null,
title: 'CmdTlmServer',
timeZone: 'local',
panel: 0,
curTab: 0,
tabs: [
{
name: 'Interfaces',
path: { name: 'InterfacesTab' },
},
{
name: 'Targets',
path: { name: 'TargetsTab' },
},
{
name: 'Cmd packets',
path: { name: 'CmdPacketsTab' },
},
{
name: 'Tlm packets',
path: { name: 'TlmPacketsTab' },
},
{
name: 'Routers',
path: { name: 'RoutersTab' },
},
{
name: 'Data Flows',
path: { name: 'DataFlowsTab' },
},
{
name: 'Status',
path: { name: 'StatusTab' },
},
],
updater: null,
refreshInterval: 1000,
optionsDialog: false,
menus: [
{
label: 'File',
items: [
{
label: 'Options',
icon: 'mdi-cog',
command: () => {
this.optionsDialog = true
},
},
{
label: 'Clear Counters',
icon: 'mdi-eraser',
command: () => {
this.clearCounters()
},
},
],
},
],
}
},
created() {
this.api = new OpenC3Api()
this.api
.get_setting('time_zone')
.then((response) => {
if (response) {
this.timeZone = response
}
})
.catch((error) => {
// Do nothing
})
},
methods: {
clearCounters() {
this.api.get_interface_names().then((response) => {
for (const name of response) {
this.api.interface_cmd(name, 'clear_counters')
}
})
},
},
}
</script>
<style scoped>
.v-expansion-panel-text :deep(.v-expansion-panel-text__wrapper) {
padding: 0px;
}
.v-list :deep(.v-label) {
margin-left: 5px;
}
.v-list-item__icon {
/* For some reason the default margin-right is huge */
margin-right: 15px !important;
}
.v-list-item__title {
color: white;
}
.v-expansion-panel-title {
min-height: initial;
padding: 0px;
}
</style>