Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video Lease Papercuts #450

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading