Skip to content

Commit 29e75fb

Browse files
committed
feat: visual improvements
1 parent 95e494d commit 29e75fb

File tree

5 files changed

+98
-28
lines changed

5 files changed

+98
-28
lines changed

src/assets/style.css

-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ span.copy::selection {
181181

182182
#search-input {
183183
float: right;
184-
display: inline-block;
185184
width: 25%;
186185
margin-right: 10px;
187186
}

src/components/HeaderBar.vue

+29
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@
4141
>
4242
<i class="bi bi-floppy2-fill"></i>
4343
</button>
44+
<button
45+
class="btn btn-sm btn-danger"
46+
style="float: right"
47+
v-if="page === 'stream' && selectedStream.manual"
48+
title="Delete Stream"
49+
@click="deleteStream(selectedStream.id)"
50+
>
51+
<i class="bi bi-trash3-fill"></i>
52+
</button>
53+
<button
54+
class="btn btn-sm btn-primary me-2"
55+
style="float: right"
56+
v-if="page === 'stream'"
57+
title="Copy SDP to Clipboard"
58+
@click="copyClip(selectedStream.raw)"
59+
>
60+
<i class="bi bi-copy"></i>
61+
</button>
4462
</div>
4563
</template>
4664

@@ -56,6 +74,7 @@ import {
5674
persistentData,
5775
saveSDP,
5876
rawSDP,
77+
selectedStream,
5978
} from "../app.js";
6079
6180
export default {
@@ -72,8 +91,18 @@ export default {
7291
goBack,
7392
saveSDP,
7493
rawSDP,
94+
selectedStream,
7595
};
7696
},
97+
methods: {
98+
deleteStream(id) {
99+
window.electronAPI.sendMessage({ type: "delete", data: id });
100+
page.value = "streams";
101+
},
102+
copyClip(sdp) {
103+
navigator.clipboard.writeText(sdp);
104+
},
105+
},
77106
};
78107
</script>
79108

src/components/pages/StreamPage.vue

+40-6
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,45 @@
2929
selectedStream.dante ||
3030
selectedStream.manual ||
3131
selectedStream.announce ||
32+
(stream.groups &&
33+
stream.groups[0] &&
34+
stream.groups[0].type == 'DUP') ||
3235
!selectedStream.isSupported
3336
"
3437
>
3538
<b>Tags</b><br />
36-
<span class="badge bg-primary me-1" v-if="selectedStream.dante"
39+
<span
40+
class="badge bg-primary me-1"
41+
title="Dante device"
42+
v-if="selectedStream.dante"
3743
>Dante</span
3844
>
39-
<span class="badge bg-primary me-1" v-if="selectedStream.manual"
45+
<span
46+
class="badge bg-primary me-1"
47+
title="ST 2022-7 redundant stream"
48+
v-if="
49+
selectedStream.groups &&
50+
selectedStream.groups[0] &&
51+
selectedStream.groups[0].type == 'DUP'
52+
"
53+
>2022-7</span
54+
>
55+
<span
56+
class="badge bg-secondary me-1"
57+
title="Manually added stream"
58+
v-if="selectedStream.manual"
4059
>Manual</span
4160
>
42-
<span class="badge bg-primary me-1" v-if="selectedStream.announce"
61+
<span
62+
class="badge bg-secondary me-1"
63+
title="Stream is broadcasted on the network via SAP"
64+
v-if="selectedStream.announce"
4365
>SAP</span
4466
>
45-
<span class="badge bg-danger me-1" v-if="!selectedStream.isSupported"
67+
<span
68+
class="badge bg-danger me-1"
69+
:title="selectedStream.unsupportedReason"
70+
v-if="!selectedStream.isSupported"
4671
>Unsupported</span
4772
>
4873
</li>
@@ -61,7 +86,10 @@
6186
v-for="(media, index) in selectedStream.media"
6287
:key="index"
6388
>
64-
<h5>Media {{ index + 1 }}</h5>
89+
<h5>
90+
Media
91+
<span v-if="selectedStream.media.length > 1">#{{ index + 1 }}</span>
92+
</h5>
6593
<ul class="ul-hidden">
6694
<li v-if="media.mid">
6795
<b>Stream Identification</b><br />
@@ -88,7 +116,13 @@
88116
</li>
89117
<li>
90118
<b>Codec</b><br />
91-
<span class="copy">{{ media.rtp[0].codec }}</span>
119+
<span v-if="media.rtp[0].codec == 'L24'" class="copy"
120+
>24-bit PCM</span
121+
>
122+
<span v-else-if="media.rtp[0].codec == 'L16'" class="copy"
123+
>16-bit PCM</span
124+
>
125+
<span v-else class="copy">{{ media.rtp[0].codec }}</span>
92126
</li>
93127
<li v-if="media.ptime">
94128
<b>Packet Time</b><br />

src/components/pages/StreamsPage.vue

+28-20
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
<th v-if="streamCount > 0">Channel</th>
4949
<th></th>
5050
<th></th>
51-
<th></th>
5251
</tr>
5352
</thead>
5453
<tbody>
@@ -77,11 +76,32 @@
7776
>
7877
</td>
7978
<td>
80-
<span class="badge bg-primary me-1" v-if="stream.dante">Dante</span>
81-
<span class="badge bg-primary me-1" v-if="stream.manual"
79+
<span
80+
class="badge bg-primary me-1"
81+
title="Dante device"
82+
v-if="stream.dante"
83+
>Dante</span
84+
>
85+
<span
86+
class="badge bg-primary me-1"
87+
title="ST 2022-7 redundant stream"
88+
v-if="
89+
stream.groups &&
90+
stream.groups[0] &&
91+
stream.groups[0].type == 'DUP'
92+
"
93+
>2022-7</span
94+
>
95+
<span
96+
class="badge bg-secondary me-1"
97+
title="Manually added stream"
98+
v-if="stream.manual"
8299
>Manual</span
83100
>
84-
<span class="badge bg-primary me-1" v-if="stream.announce"
101+
<span
102+
class="badge bg-secondary me-1"
103+
title="Stream is broadcasted on the network via SAP"
104+
v-if="stream.announce"
85105
>SAP</span
86106
>
87107
</td>
@@ -129,21 +149,13 @@
129149
@click="playStream(stream)"
130150
v-if="stream.isSupported"
131151
>
132-
{{ stream.id === playing ? "Stop" : "Play" }}
152+
<i v-if="stream.id === playing" class="bi bi-stop-fill"></i>
153+
<i v-else class="bi bi-play-fill"></i>
133154
</button>
134155
</td>
135156
<td>
136157
<button class="btn btn-sm btn-primary" @click="viewStream(stream)">
137-
View
138-
</button>
139-
</td>
140-
<td>
141-
<button
142-
class="btn btn-sm btn-danger"
143-
v-if="stream.manual"
144-
@click="deleteStream(stream.id)"
145-
>
146-
Delete
158+
<i class="bi bi-info-circle-fill"></i>
147159
</button>
148160
</td>
149161
</tr>
@@ -202,6 +214,7 @@ export default {
202214
if (stream.dante) tags += "Dante ";
203215
if (stream.manual) tags += "Manual ";
204216
if (stream.announce) tags += "SAP ";
217+
if (stream.groups && stream.groups[0] && stream.groups[0].type == 'DUP') tags += "2022-7 ";
205218
return tags.trim();
206219
default:
207220
return stream[key];
@@ -239,11 +252,6 @@ export default {
239252
streamIndex,
240253
};
241254
},
242-
methods: {
243-
deleteStream(id) {
244-
window.electronAPI.sendMessage({ type: "delete", data: id });
245-
},
246-
},
247255
};
248256
</script>
249257

src/lib/sdp.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ const addStream = function (rawSDP, announce) {
237237
};
238238

239239
const deleteStream = function (id) {
240-
if (sessions[id].announce) {
240+
if (sessions[id] && sessions[id].announce) {
241241
announceStream(
242242
sessions[id].raw,
243243
sessions[id].origin.address,

0 commit comments

Comments
 (0)