Compare commits
2 commits
750f91452b
...
23a094c36e
Author | SHA1 | Date | |
---|---|---|---|
23a094c36e | |||
5ebb7e02a7 |
3 changed files with 10 additions and 7 deletions
|
@ -20,4 +20,3 @@ COPY --from=builder /src/vite.config.js .
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
CMD [ "yarn", "preview", "--host", "--port", "8080" ]
|
CMD [ "yarn", "preview", "--host", "--port", "8080" ]
|
||||||
# CMD [ "env" ]
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
export const API_ROOT_URL = "http://techgames.gnetx.com/infoscreen";
|
export const API_ROOT_URL = new URL("http://techgames.gnetx.com/infoscreen");
|
||||||
export const CONTENT_ROOT_URL = `${API_ROOT_URL}/listings`;
|
export const CONTENT_ROOT_URL = new URL("/listings", API_ROOT_URL);
|
||||||
|
|
||||||
export enum ListingType {
|
export enum ListingType {
|
||||||
IMAGE = "IMAGE",
|
IMAGE = "IMAGE",
|
||||||
|
@ -25,6 +25,6 @@ export async function fetchData(): Promise<Data> {
|
||||||
return await response.json();
|
return await response.json();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function generateContentURL(content: string): string {
|
export function generateContentURL(content: string): URL {
|
||||||
return `${CONTENT_ROOT_URL}/${encodeURIComponent(content)}`;
|
return new URL(encodeURIComponent(content), CONTENT_ROOT_URL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,9 @@
|
||||||
{#if data.listings[listingIndex].type == api.ListingType.IMAGE}
|
{#if data.listings[listingIndex].type == api.ListingType.IMAGE}
|
||||||
<img
|
<img
|
||||||
class="center dynamic-size"
|
class="center dynamic-size"
|
||||||
src={api.generateContentURL(data.listings[listingIndex].content)}
|
src={api
|
||||||
|
.generateContentURL(data.listings[listingIndex].content)
|
||||||
|
.toString()}
|
||||||
alt={data.listings[listingIndex].name}
|
alt={data.listings[listingIndex].name}
|
||||||
on:load={() =>
|
on:load={() =>
|
||||||
handleTime(
|
handleTime(
|
||||||
|
@ -63,7 +65,9 @@
|
||||||
on:ended={() => updateListingIndex(data.listings.length)}
|
on:ended={() => updateListingIndex(data.listings.length)}
|
||||||
>
|
>
|
||||||
<source
|
<source
|
||||||
src={api.generateContentURL(data.listings[listingIndex].content)}
|
src={api
|
||||||
|
.generateContentURL(data.listings[listingIndex].content)
|
||||||
|
.toString()}
|
||||||
/>
|
/>
|
||||||
<track kind="captions" />
|
<track kind="captions" />
|
||||||
<b class="error">Videos are not supported!</b>
|
<b class="error">Videos are not supported!</b>
|
||||||
|
|
Loading…
Reference in a new issue