added missing static assets

This commit is contained in:
ArabCoders 2024-12-17 19:47:12 +03:00
parent daea07c678
commit 88ecfbb516
7 changed files with 42 additions and 10 deletions

View file

@ -44,7 +44,7 @@ COPY entrypoint.sh /
RUN sed -i 's/\r$//g' /entrypoint.sh && chmod +x /entrypoint.sh
COPY --chown=app:app ./app /app/app
COPY --chown=app:app --from=node_builder /app/exported /app/ui/dist
COPY --chown=app:app --from=node_builder /app/exported /app/ui/exported
COPY --chown=app:app --from=python_builder /app/.venv /opt/python
COPY --chown=app:app ./healthcheck.sh /usr/local/bin/healthcheck

View file

@ -68,7 +68,7 @@ class HttpAPI(common):
async def staticFile(self, req: Request) -> Response:
"""
Preload static files from the ui/dist folder.
Preload static files from the ui/exported folder.
"""
path = req.path
if req.path not in self.staticHolder:
@ -85,9 +85,14 @@ class HttpAPI(common):
def preloadStatic(self, app: web.Application):
"""
Preload static files from the ui/dist folder.
Preload static files from the ui/exported folder.
"""
staticDir = os.path.join(self.rootPath, 'ui', 'dist')
staticDir = os.path.join(self.rootPath, 'ui', 'exported')
if not os.path.exists(staticDir):
raise ValueError(f"Could not find the frontend UI static assets. '{staticDir}'.")
preloaded = 0
for root, _, files in os.walk(staticDir):
for file in files:
if file.endswith('.map'):
@ -102,6 +107,7 @@ class HttpAPI(common):
self.staticHolder[urlPath] = {'content': content, 'content_type': contentType}
LOG.debug(f"Preloading '{urlPath}'.")
app.router.add_get(urlPath, self.staticFile)
preloaded += 1
if urlPath.endswith('/index.html') and urlPath != '/index.html':
parentSlash = urlPath.replace('/index.html', '/')
@ -110,6 +116,12 @@ class HttpAPI(common):
self.staticHolder[parentNoSlash] = {'content': content, 'content_type': contentType}
app.router.add_get(parentSlash, self.staticFile)
app.router.add_get(parentNoSlash, self.staticFile)
preloaded += 2
if preloaded < 1:
raise ValueError(f"Could not find the frontend UI static assets. '{staticDir}'.")
LOG.info(f"Preloaded {preloaded} static files.")
def attach(self, app: web.Application):
if self.config.auth_username and self.config.auth_password:
@ -149,7 +161,7 @@ class HttpAPI(common):
app.add_routes(self.routes)
app.on_response_prepare.append(on_prepare)
except ValueError as e:
if 'ui/dist' in str(e):
if 'ui/exported' in str(e):
raise RuntimeError(f"Could not find the frontend UI static assets. '{e}'.") from e
raise e

View file

@ -98,8 +98,8 @@
</div>
</header>
<div v-if="item.thumbnail && false === hideThumbnail" class="card-image">
<figure class="image is-3by1">
<div v-if="false === hideThumbnail" class="card-image">
<figure class="image is-3by1" v-if="item.thumbnail">
<template v-if="item.status === 'finished'">
<a v-tooltip="`Play: ${item.title}`" :href="makeDownload(config, item, 'm3u8')"
@click.prevent="playVideo(item)">
@ -116,6 +116,21 @@
</NuxtLink>
</template>
</figure>
<figure class="image is-3by1" v-else>
<template v-if="item.status === 'finished'">
<a v-tooltip="`Play: ${item.title}`" :href="makeDownload(config, item, 'm3u8')"
@click.prevent="playVideo(item)">
<img :src="config.app.url_host + config.app.url_prefix + 'images/placeholder.png'"
:alt="item.title" />
</a>
</template>
<template v-else>
<NuxtLink target="_blank" :href="item.url" v-tooltip="`Open: ${item.title} link`">
<img :src="config.app.url_host + config.app.url_prefix + 'images/placeholder.png'"
:alt="item.title" />
</NuxtLink>
</template>
</figure>
</div>
<div class="card-content">
<div class="columns is-mobile is-multiline">

View file

@ -42,20 +42,25 @@
<div class="card-header-title has-text-centered is-text-overflow is-block">
{{ item.title }}
</div>
<div class="card-header-icon" v-if="item.filename">
<div class="card-header-icon">
<button @click="hideThumbnail = !hideThumbnail">
<span class="icon"><i class="fa-solid"
:class="{ 'fa-arrow-down': hideThumbnail, 'fa-arrow-up': !hideThumbnail, }" /></span>
</button>
</div>
</header>
<div v-if="item.thumbnail && false === hideThumbnail" class="card-image">
<figure class="image is-3by1">
<div v-if="false === hideThumbnail" class="card-image">
<figure class="image is-3by1" v-if="item.thumbnail">
<NuxtLink v-tooltip="item.title" :href="item.url" target="_blank">
<img :src="config.app.url_host + config.app.url_prefix + 'thumbnail?url=' + encodePath(item.thumbnail)"
:alt="item.title" />
</NuxtLink>
</figure>
<figure class="image is-3by1" v-else>
<NuxtLink target="_blank" :href="item.url" v-tooltip="`Open: ${item.title} link`">
<img :src="config.app.url_host + config.app.url_prefix + 'images/placeholder.png'" :alt="item.title" />
</NuxtLink>
</figure>
</div>
<div class="card-content">
<div class="columns is-multiline is-mobile">

BIN
ui/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
ui/public/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB