Skip to content

Commit

Permalink
Use Stroke & use server vs lease api
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Jun 29, 2024
1 parent 81b490a commit 27dc0e0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions api/routes/videos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { StandardResponse, VideoResponse } from '../lib/types.js';
export default async function router(schema: Schema, config: Config) {
const video = new ECSVideo(config);

await schema.get('/video', {
await schema.get('/video/server', {
name: 'List Video Servers',
group: 'Video',
description: 'Let Admins list video servers',
Expand Down Expand Up @@ -57,7 +57,7 @@ export default async function router(schema: Schema, config: Config) {
}
});

await schema.post('/video', {
await schema.post('/video/server', {
name: 'Create Server',
group: 'Video',
description: 'Create a new Media Server',
Expand All @@ -78,14 +78,14 @@ export default async function router(schema: Schema, config: Config) {
memory: Number(item.memory),
cpu: Number(item.cpu)
}
return res.json(i);

return res.json(i);
} catch (err) {
return Err.respond(err, res);
}
});

await schema.get('/video/:serverid', {
await schema.get('/video/server/:serverid', {
name: 'Get Server',
group: 'Video',
description: 'Get all info about a particular video server',
Expand Down Expand Up @@ -127,7 +127,7 @@ export default async function router(schema: Schema, config: Config) {
}
});

await schema.delete('/video/:serverid', {
await schema.delete('/video/server/:serverid', {
name: 'Delete Server',
group: 'Video',
description: 'Shut down an existing video server',
Expand Down
12 changes: 6 additions & 6 deletions api/web/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
target='_blank'
rel='noreferrer'
>
<IconCode size='32' />Docs
<IconCode :size='32' :stroke='1' />Docs
</a>
<div class='dropdown'>
<div
Expand All @@ -45,7 +45,7 @@
aria-expanded='false'
class='btn btn-dark'
>
<IconUser size='32' />
<IconUser :size='32' :stroke='1' />
</div>
<ul
class='dropdown-menu'
Expand All @@ -55,29 +55,29 @@
class='d-flex dropdown-item cursor-pointer hover-dark'
@click='$router.push("/profile")'
>
<IconUser size='32' />
<IconUser :size='32' :stroke='1' />
<span class='mx-2'>Profile</span>
</div>
<div
class='d-flex dropdown-item cursor-pointer hover-dark'
@click='$router.push("/connection")'
>
<IconNetwork size='32' />
<IconNetwork :size='32' :stroke='1' />
<span class='mx-2'>Connections</span>
</div>
<div
class='d-flex dropdown-item cursor-pointer hover-dark'
@click='$router.push("/admin")'
>
<IconSettings size='32' />
<IconSettings :size='32' :stroke='1' />
<span class='mx-2'>Server</span>
<span class='ms-auto badge border border-red bg-red text-white'>Admin</span>
</div>
<div
class='d-flex dropdown-item cursor-pointer hover-dark'
@click='logout'
>
<IconLogout size='32' />
<IconLogout :size='32' :stroke='1'/>
<span class='mx-2'>Logout</span>
</div>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions api/web/src/components/Admin/AdminVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export default {
methods: {
fetchDelete: async function() {
this.loading = true;
const url = stdurl(`/api/video/${this.$route.params.video}`);
const url = stdurl(`/api/video/server/${this.$route.params.video}`);
await std(url, {
method: 'DELETE'
});
Expand All @@ -154,7 +154,7 @@ export default {
fetch: async function() {
this.loading = true;
try {
const url = stdurl(`/api/video/${this.$route.params.video}`);
const url = stdurl(`/api/video/server/${this.$route.params.video}`);
this.video = await std(url);
} catch (err) {
if (err.message === 'Could not find Media Server with that ID') this.$router.push('/admin/video');
Expand Down
4 changes: 2 additions & 2 deletions api/web/src/components/Admin/AdminVideos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ export default {
methods: {
fetchList: async function() {
this.loading = true;
const url = stdurl('/api/video');
const url = stdurl('/api/video/server');
this.list = await std(url);
this.loading = false;
},
createServer: async function() {
this.loading = true;
const url = stdurl('/api/video');
const url = stdurl('/api/video/server');
const server = await std(url, {
method: 'POST',
body: {}
Expand Down

0 comments on commit 27dc0e0

Please sign in to comment.