Skip to content

Commit

Permalink
Merge pull request #450 from dfpc-coe/video-lease-papercuts
Browse files Browse the repository at this point in the history
Video Lease Papercuts
  • Loading branch information
ingalls authored Dec 17, 2024
2 parents d27a857 + 440066b commit 12fe5ad
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 44 deletions.
1 change: 1 addition & 0 deletions api/routes/video-lease.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export default async function router(schema: Schema, config: Config) {
const lease = await videoControl.generate({
name: req.body.name,
ephemeral: req.body.ephemeral,
channel: req.body.channel,
expiration: req.body.permanent ? null : moment().add(req.body.duration, 'seconds').toISOString(),
path: req.body.path || randomUUID(),
username: user.email,
Expand Down
60 changes: 30 additions & 30 deletions api/web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/web/src/components/Admin/Videos/AdminVideoTask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<div class='mx-2'>
Video Server
<span
class='mx-2'
v-if='video'
class='mx-2'
v-text='video.id'
/>
</div>
Expand Down
5 changes: 5 additions & 0 deletions api/web/src/components/CloudTAK/Menu/Videos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@
style='margin-left: 42px;'
class='subheader text-red'
>Expired Lease</span>
<span
v-else-if='l.expiration === null'
style='margin-left: 42px;'
class='subheader text-blue'
>Permanent</span>
<span
v-else
style='margin-left: 42px;'
Expand Down
71 changes: 58 additions & 13 deletions api/web/src/components/CloudTAK/Menu/Videos/VideoLeaseModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,25 @@
</div>
</div>

<div class='col-12'>
<label>Lease Expiration</label>

<div class='col-12'>
<span
v-if='expired(editLease.expiration)'
class='badge bg-red text-white mt-2'
>Expired</span>
<span
v-else-if='editLease.expiration === null'
class='badge bg-blue text-white mt-2'
>Permanent</span>
<CopyField
v-else-if='editLease.expiration'
:model-value='editLease.expiration'
/>
</div>
</div>

<div class='col-12'>
<label
class='subheader mt-3 cursor-pointer'
Expand All @@ -184,20 +203,45 @@

<div
v-if='advanced'
class='col-12'
class='col-12 row'
>
<!-- NOT SUPPORTED IN iTAK-->
<TablerInput
v-model='editLease.stream_user'
:disabled='true'
label='Stream Username'
/>
<div
class='alert alert-info'
role='alert'
>
<div class='d-flex'>
<div class='me-2'>
<IconInfoCircle
:size='32'
stroke='1'
/>
</div>
<div>
<h4 class='alert-title'>
Stream Username & Password Disabled
</h4>
<div class='text-secondary'>
iTAK Does not currently support in URL username/passwords so this option is currently disabled
</div>
</div>
</div>
</div>

<TablerInput
v-model='editLease.stream_pass'
:disabled='true'
label='Stream Password'
/>
<!-- NOT SUPPORTED IN iTAK-->
<div class='col-md-6'>
<TablerInput
v-model='editLease.stream_user'
:disabled='true'
label='Stream Username'
/>
</div>
<div class='col-md-6'>
<TablerInput
v-model='editLease.stream_pass'
:disabled='true'
label='Stream Password'
/>
</div>
</div>
</div>

Expand Down Expand Up @@ -285,6 +329,7 @@ import {
IconPencil,
IconWand,
IconAffiliate,
IconInfoCircle,
IconSquareChevronRight,
IconChevronRight,
IconChevronLeft,
Expand Down Expand Up @@ -400,7 +445,7 @@ async function deleteLease() {
try {
loading.value = true;
await std(`/api/video/lease/${props.lease.id}`, {
await std(`/api/video/lease/${editLease.value.id}`, {
method: 'DELETE',
});
Expand Down

0 comments on commit 12fe5ad

Please sign in to comment.