Merge pull request #762 from jb-alvarado/master

merge frontend into main repo, rename ffplayout folder
This commit is contained in:
jb-alvarado 2024-09-24 15:55:47 +02:00 committed by GitHub
commit 39d4a449f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
129 changed files with 22912 additions and 39 deletions

28
.gitignore vendored
View File

@ -29,3 +29,31 @@ assets/playlist_template.json
advanced*.toml
ffplayout*.toml
template.json
# frontend stuff
node_modules
.nuxt
.nitro
.cache
.output
.env
dist
.eslintcache
*.tgz
.yarn-integrity
sw.*
.DS_Store
*.swp
master.m3u8
tv-media
tv-media/
Videos
Videos/
*.tar*
home
home/
live1
live1/
Musik
Musik/
test.vue

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "frontend"]
path = frontend
url = https://github.com/ffplayout/ffplayout-frontend.git

8
.ignore Normal file
View File

@ -0,0 +1,8 @@
assets/
debian/
docker/
docs/
frontend/
migrations/
scripts/
tests/

View File

@ -1,7 +1,13 @@
{
"recommendations": [
"bradlc.vscode-tailwindcss",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"hollowtree.vue-snippets",
"rust-lang.rust-analyzer",
"statiolake.vscode-rustfmt",
"tamasfe.even-better-toml",
"vue.volar",
"wscats.vue",
]
}

30
.vscode/settings.json vendored
View File

@ -1,4 +1,15 @@
{
"eslint.useFlatConfig": true,
"prettier.tabWidth": 4,
"prettier.printWidth": 120,
"vue3snippets.semi": false,
"vue3snippets.singleQuote": true,
"vue3snippets.jsxSingleQuote": true,
"vue3snippets.printWidth": 120,
"vue3snippets.tabWidth": 4,
"prettier.jsxSingleQuote": true,
"prettier.semi": false,
"prettier.singleQuote": true,
"rust-analyzer.cargo.target": null,
"rust-analyzer.checkOnSave": true,
"rust-analyzer.cargo.buildScripts.overrideCommand": null,
@ -10,6 +21,24 @@
"[dockercompose]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[rust]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "statiolake.vscode-rustfmt"
@ -23,6 +52,7 @@
"flexi",
"lettre",
"libc",
"nuxt",
"neli",
"paris",
"reqwest",

View File

@ -1,6 +1,5 @@
[workspace]
members = ["ffplayout", "tests"]
default-members = ["ffplayout", "tests"]
members = ["engine", "tests"]
resolver = "2"
[workspace.package]

View File

@ -13,13 +13,13 @@ Check the [releases](https://github.com/ffplayout/ffplayout/releases/latest) for
### Features
- start program with [web based frontend](https://github.com/ffplayout/ffplayout-frontend), or run playout in foreground mode without frontend
- start program with [web based frontend](/frontend/), or run playout in foreground mode without frontend
- dynamic playlist
- replace missing playlist or clip with single filler or multiple fillers from folder, if no filler exists, create dummy clip
- playing clips in [watched](/docs/folder_mode.md) folder mode
- send emails with error message
- overlay a logo
- overlay text, controllable through [web frontend](https://github.com/ffplayout/ffplayout-frontend) (needs ffmpeg with libzmq and enabled JSON RPC server)
- overlay text, controllable through [web frontend](/frontend/) (needs ffmpeg with libzmq and enabled JSON RPC server)
- loop playlist infinitely
- [remote source](/docs/remote_source.md)
- trim and fade the last clip, to get full 24 hours

View File

@ -1,6 +1,6 @@
FROM alpine:latest
ARG FFPLAYOUT_VERSION=0.24.0-beta4
ARG FFPLAYOUT_VERSION=0.24.0-rc1
ARG SHARED_STORAGE=false
ENV DB=/db

View File

@ -1,6 +1,6 @@
FROM alpine:latest
ARG FFPLAYOUT_VERSION=0.24.0-beta4
ARG FFPLAYOUT_VERSION=0.24.0-rc1
ARG SHARED_STORAGE=false
ENV DB=/db

View File

@ -1,6 +1,6 @@
FROM nvidia/cuda:12.5.0-runtime-rockylinux9
ARG FFPLAYOUT_VERSION=0.24.0-beta4
ARG FFPLAYOUT_VERSION=0.24.0-rc1
ARG SHARED_STORAGE=false
ENV DB=/db

View File

@ -68,3 +68,42 @@ cargo deb --no-build --target=aarch64-unknown-linux-gnu --variant=arm64 -p ffpla
# for rhel based systems:
cargo generate-rpm --target=x86_64-unknown-linux-musl
```
## Setup Frontend
Make sure to install the dependencies:
```bash
# yarn
yarn install
# npm
npm install
# pnpm
pnpm install --shamefully-hoist
```
## Development Server
Start the development server on http://localhost:3000
```bash
npm run dev
```
## Production
Build the application for production:
```bash
npm run build
```
Locally preview production build:
```bash
npm run preview
```
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

BIN
docs/images/config-gui.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
docs/images/dasboard.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

BIN
docs/images/logging.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

BIN
docs/images/login.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
docs/images/media.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

BIN
docs/images/message.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
docs/images/player.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

View File

@ -53,6 +53,29 @@ pub async fn init_globales(conn: &Pool<Sqlite>) {
INSTANCE.set(config).unwrap();
}
#[derive(Clone, Debug, Default, Deserialize, Serialize, sqlx::FromRow)]
pub struct Channel {
#[serde(default = "default_id", skip_deserializing)]
pub id: i32,
pub name: String,
pub preview_url: String,
pub extra_extensions: String,
pub active: bool,
pub hls_path: String,
pub playlist_path: String,
pub storage_path: String,
pub last_date: Option<String>,
pub time_shift: f64,
#[sqlx(default)]
#[serde(default)]
pub utc_offset: i32,
}
fn default_id() -> i32 {
1
}
// #[serde_as]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct User {
@ -232,29 +255,6 @@ where
deserializer.deserialize_any(StringOrNumberVisitor)
}
#[derive(Clone, Debug, Default, Deserialize, Serialize, sqlx::FromRow)]
pub struct Channel {
#[serde(default = "default_id", skip_deserializing)]
pub id: i32,
pub name: String,
pub preview_url: String,
pub extra_extensions: String,
pub active: bool,
pub hls_path: String,
pub playlist_path: String,
pub storage_path: String,
pub last_date: Option<String>,
pub time_shift: f64,
#[sqlx(default)]
#[serde(default)]
pub utc_offset: i32,
}
fn default_id() -> i32 {
1
}
#[derive(Clone, Debug, Deserialize, Serialize, sqlx::FromRow)]
pub struct Configuration {
pub id: i32,

@ -1 +0,0 @@
Subproject commit c897226188cc289b0744bb721691a438dba0f5fd

27
frontend/README.md Normal file
View File

@ -0,0 +1,27 @@
ffplayout-frontend
=====
The interface is mostly designed for 24/7 streaming. Other scenarios like streaming in folder mode or playlists with no start time will work but will not be displayed correctly.
For a better understanding of the functionality, take a look at the screenshots below.
### Login
![login](/docs/images/login.png)
### System Dashboard
![login](/docs/images/dasboard.png)
### Control Page
![player](/docs/images/player.png)
### Media Page
![media](/docs/images/media.png)
### Message Page
![message](/docs/images/message.png)
### Logging Page
![logging](/docs/images/logging.png)
### Configuration Page
![config-gui](/docs/images/config-gui.png)

12
frontend/app.vue Normal file
View File

@ -0,0 +1,12 @@
<template>
<div>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</div>
</template>
<script setup lang="ts">
const configStore = useConfig()
await useAsyncData('init', () => configStore.configInit())
</script>

Binary file not shown.

View File

@ -0,0 +1,93 @@
Copyright (c) 2015, Stephan Ahlf (https://github.com/s-a/digital-numbers-font stephan.ahlf@googlemail.com)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,124 @@
@import 'bootstrap-icons/font/bootstrap-icons.css';
#__nuxt,
#__nuxt > div,
main,
main > div {
height: 100%;
width: 100%;
}
@font-face {
font-family: 'DigitalNumbers';
src: url('@/assets/fonts/DigitalNumbers-Regular.woff') format('woff');
font-weight: normal;
font-style: normal;
}
.splitpanes--horizontal > .splitpanes__splitter {
position: relative;
border-top: 1px solid var(--my-gray);
border-bottom: 1px solid var(--my-gray);
height: 6px !important;
}
.splitpanes--vertical > .splitpanes__splitter {
position: relative;
border-left: 1px solid var(--my-gray);
border-right: 1px solid var(--my-gray);
width: 6px !important;
}
.splitpanes--horizontal > .splitpanes__splitter::before {
content: '';
position: absolute;
background-color: var(--my-gray);
transform: translateY(-50%);
top: 50%;
left: 50%;
height: 2px;
width: 30px;
transition: background-color 0.3s;
margin-left: -1px;
}
.splitpanes--vertical > .splitpanes__splitter::before {
content: '';
position: absolute;
background-color: var(--my-gray);
transform: translateY(-50%);
top: 50%;
left: 50%;
width: 2px;
height: 30px;
transition: background-color 0.3s;
margin-left: -1px;
}
/* ----------------------------------------------------------------------------
multiselect customization
-----------------------------------------------------------------------------*/
.multiselect-caret {
background-image: none !important;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 320 512' fill='currentColor' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z'%3E%3C/path%3E%3C/svg%3E");
background-position: center;
mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 320 512' fill='currentColor' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z'%3E%3C/path%3E%3C/svg%3E");
background-repeat: no-repeat;
-webkit-mask-position: center;
mask-position: center;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: contain;
mask-size: contain;
background-color: var(--my-gray);
opacity: 1 !important;
}
.multiselect-clear-icon {
background-image: none !important;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 320 512' fill='currentColor' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z'%3E%3C/path%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 320 512' fill='currentColor' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z'%3E%3C/path%3E%3C/svg%3E");
-webkit-mask-position: center;
mask-position: center;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: contain;
mask-size: contain;
background-color: var(--my-gray);
opacity: 1 !important;
transition: 0.3s;
}
.bg-multiselect-remove {
background-image: none !important;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 320 512' fill='currentColor' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z'%3E%3C/path%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 320 512' fill='currentColor' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z'%3E%3C/path%3E%3C/svg%3E");
-webkit-mask-position: center;
mask-position: center;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: contain;
mask-size: contain;
background-color: var(--my-gray);
opacity: 1 !important;
transition: 0.3s;
}
.multiselect-tag-remove-icon {
display: inline-block;
height: 0.75rem;
width: 0.75rem;
background-image: none !important;
-webkit-mask-image: url("data:image/svg+xml,%3csvg viewBox='0 0 320 512' fill='currentColor' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z'%3e%3c/path%3e%3c/svg%3e");
mask-image: url("data:image/svg+xml,%3csvg viewBox='0 0 320 512' fill='currentColor' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z'%3e%3c/path%3e%3c/svg%3e");
-webkit-mask-position: center;
mask-position: center;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: contain;
mask-size: contain;
background-color: var(--my-gray);
opacity: 1 !important;
transition: 0.3s;
}

View File

@ -0,0 +1,33 @@
<template>
<div
v-if="indexStore.showAlert"
role="alert"
class="alert fixed top-20 right-3 z-40 w-auto min-w-64 max-w-[90%] md:max-w-[50%] xl:max-w-[40%]"
:class="`alert-${indexStore.alertVariant}`"
>
<SvgIcon :name="indexStore.alertVariant" />
{{ indexStore.alertMsg }}
</div>
<!-- HACK: init alerts to get the right colors, can be remove when bug is fixed -->
<div class="alert alert-success w-auto max-w-[700px] justify-start py-2 rounded hidden">
<SvgIcon name="success" />
<span class="truncate w-full">bla bla bla</span>
</div>
<div class="alert alert-warning w-auto max-w-[700px] justify-start py-2 rounded hidden">
<SvgIcon name="warning" />
<span class="truncate w-full">bla bla bla</span>
</div>
<div class="alert alert-info w-auto max-w-[700px] justify-start py-2 rounded hidden">
<SvgIcon name="info" />
<span class="truncate w-full">bla bla bla</span>
</div>
<div class="alert alert-error w-auto max-w-[700px] justify-start py-2 rounded hidden">
<SvgIcon name="error" />
<span class="truncate w-full">bla bla bla</span>
</div>
</template>
<script setup lang="ts">
const indexStore = useIndex()
</script>

View File

@ -0,0 +1,104 @@
<template>
<div class="min-w-[200px] pe-8 w-[768px]">
<h2 class="pt-3 text-3xl">{{ t('advanced.title') }}</h2>
<p class="mt-5 font-bold text-orange-500">{{ t('advanced.warning') }}</p>
<form
v-if="configStore.advanced"
class="mt-10 grid md:grid-cols-[180px_auto] gap-5"
@submit.prevent="onSubmitAdvanced"
>
<template v-for="(item, key) in configStore.advanced" :key="key">
<div class="text-xl pt-3 text-right">{{ setTitle(key.toString()) }}:</div>
<div class="md:pt-4">
<label
v-for="(_, name) in (item as Record<string, any>)"
:key="name"
class="form-control w-full"
>
<div class="label">
<span class="label-text !text-md font-bold">{{ name }}</span>
</div>
<input
:id="name"
v-model="item[name]"
type="text"
class="input input-sm input-bordered w-full"
/>
</label>
</div>
</template>
<div class="mt-5 mb-10">
<button class="btn btn-primary" type="submit">{{ t('config.save') }}</button>
</div>
</form>
</div>
<GenericModal
:title="t('config.restartTile')"
:text="t('config.restartText')"
:show="showModal"
:modal-action="restart"
/>
</template>
<script setup lang="ts">
const { t } = useI18n()
const authStore = useAuth()
const configStore = useConfig()
const indexStore = useIndex()
const showModal = ref(false)
function setTitle(input: string): string {
switch (input) {
case 'decoder':
return t('advanced.decoder')
case 'encoder':
return t('advanced.encoder')
case 'filter':
return t('advanced.filter')
case 'ingest':
return t('advanced.ingest')
default:
return input
}
}
async function onSubmitAdvanced() {
const update = await configStore.setAdvancedConfig()
configStore.onetimeInfo = true
if (update.status === 200) {
indexStore.msgAlert('success', t('advanced.updateSuccess'), 2)
const channel = configStore.channels[configStore.id].id
await $fetch(`/api/control/${channel}/process/`, {
method: 'POST',
headers: { ...configStore.contentType, ...authStore.authHeader },
body: JSON.stringify({ command: 'status' }),
}).then((response: any) => {
if (response === 'active') {
showModal.value = true
}
})
} else {
indexStore.msgAlert('error', t('advanced.updateFailed'), 2)
}
}
async function restart(res: boolean) {
if (res) {
const channel = configStore.channels[configStore.id].id
await $fetch(`/api/control/${channel}/process/`, {
method: 'POST',
headers: { ...configStore.contentType, ...authStore.authHeader },
body: JSON.stringify({ command: 'restart' }),
})
}
showModal.value = false
}
</script>

View File

@ -0,0 +1,172 @@
<template>
<div v-if="configStore.channels && configStore.channels[configStore.id]" class="w-full max-w-[800px]">
<h2 class="pt-3 text-3xl">{{ t('config.channelConf') }} ({{ configStore.channels[configStore.id].id }})</h2>
<div class="w-full flex justify-end my-4">
<button v-if="authStore.role === 'GlobalAdmin'" class="btn btn-sm btn-primary" @click="newChannel()">
{{ t('config.addChannel') }}
</button>
</div>
<div class="w-full">
<label class="form-control w-full">
<div class="label">
<span class="label-text">{{ t('config.name') }}</span>
</div>
<input
v-model="configStore.channels[configStore.id].name"
type="text"
placeholder="Type here"
class="input input-bordered w-full"
/>
</label>
<label class="form-control w-full mt-5">
<div class="label">
<span class="label-text">{{ t('config.previewUrl') }}</span>
</div>
<input
v-model="configStore.channels[configStore.id].preview_url"
type="text"
class="input input-bordered w-full"
/>
</label>
<label class="form-control w-full mt-5">
<div class="label">
<span class="label-text">{{ t('config.extensions') }}</span>
</div>
<input
v-model="configStore.channels[configStore.id].extra_extensions"
type="text"
class="input input-bordered w-full"
/>
</label>
<template v-if="authStore.role === 'GlobalAdmin'">
<div class="mt-7 font-bold h-3">
<p v-if="configStore.playout.storage.shared_storage">
<SvgIcon name="warning" classes="inline mr-2" />
<span>{{ t('config.sharedStorage') }}</span>
</p>
</div>
<label class="form-control w-full mt-3">
<div class="label">
<span class="label-text">{{ t('config.hlsPath') }}</span>
</div>
<input
v-model="configStore.channels[configStore.id].hls_path"
type="text"
class="input input-bordered w-full"
/>
</label>
<label class="form-control w-full mt-5">
<div class="label">
<span class="label-text">{{ t('config.playlistPath') }}</span>
</div>
<input
v-model="configStore.channels[configStore.id].playlist_path"
type="text"
class="input input-bordered w-full"
/>
</label>
<label class="form-control w-full mt-5">
<div class="label">
<span class="label-text">{{ t('config.storagePath') }}</span>
</div>
<input
v-model="configStore.channels[configStore.id].storage_path"
type="text"
class="input input-bordered w-full"
/>
</label>
</template>
<div class="join my-4">
<button class="join-item btn btn-primary" @click="addUpdateChannel()">
{{ t('config.save') }}
</button>
<button
v-if="
authStore.role === 'GlobalAdmin' &&
configStore.channels.length > 1 &&
configStore.channels[configStore.id].id > 1
"
class="join-item btn btn-primary"
@click="deleteChannel()"
>
{{ t('config.delete') }}
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
const { $_ } = useNuxtApp()
const { t } = useI18n()
const authStore = useAuth()
const configStore = useConfig()
const indexStore = useIndex()
function rmId(path: string) {
return path.replace(/\/\d+$/, '')
}
function newChannel() {
const channels = $_.cloneDeep(configStore.channels)
const newChannel = $_.cloneDeep(configStore.channels[configStore.channels.length - 1])
newChannel.id = channels.length + 1
newChannel.name = `Channel ${newChannel.id}`
newChannel.preview_url = `${window.location.protocol}//${window.location.host}/live/${newChannel.id}/stream.m3u8`
newChannel.hls_path = `${rmId(newChannel.hls_path)}/${newChannel.id}`
newChannel.playlist_path = `${rmId(newChannel.playlist_path)}/${newChannel.id}`
newChannel.storage_path = `${rmId(newChannel.storage_path)}/${newChannel.id}`
channels.push(newChannel)
configStore.channels = channels
configStore.id = configStore.channels.length - 1
}
async function addUpdateChannel() {
/*
Save channel settings.
*/
const update = await configStore.setChannelConfig(configStore.channels[configStore.id])
if (update.status && update.status < 400) {
indexStore.msgAlert('success', t('config.updateChannelSuccess'), 2)
} else {
indexStore.msgAlert('error', t('config.updateChannelFailed'), 2)
}
}
async function deleteChannel() {
const config = $_.cloneDeep(configStore.channels)
const id = config[configStore.id].id
if (id === 1) {
indexStore.msgAlert('warning', t('config.errorChannelDelete'), 2)
return
}
const response = await fetch(`/api/channel/${id}`, {
method: 'DELETE',
headers: authStore.authHeader,
})
config.splice(configStore.id, 1)
configStore.channels = config
configStore.id = configStore.channels.length - 1
await configStore.getPlayoutConfig()
if (response.status === 200) {
indexStore.msgAlert('success', t('config.errorChannelDelete'), 2)
} else {
indexStore.msgAlert('error', t('config.deleteChannelFailed'), 2)
}
}
</script>

View File

@ -0,0 +1,204 @@
<template>
<div class="max-w-[1200px] pe-8">
<h2 class="pt-3 text-3xl">{{ t('config.playoutConf') }}</h2>
<form
v-if="configStore.playout"
class="mt-10 grid md:grid-cols-[180px_auto] gap-5"
@submit.prevent="onSubmitPlayout"
>
<template v-for="(item, key) in configStore.playout" :key="key">
<div class="text-xl pt-3 text-right">{{ setTitle(key.toString()) }}:</div>
<div class="md:pt-4">
<label
v-for="(prop, name) in (item as Record<string, any>)"
:key="name"
class="form-control w-full"
:class="[typeof prop === 'boolean' && 'flex-row', name.toString() !== 'help_text' && 'mt-2']"
>
<template v-if="name.toString() !== 'startInSec' && name.toString() !== 'lengthInSec' && !(name.toString() === 'path' && key.toString() === 'storage')" >
<div v-if="name.toString() !== 'help_text'" class="label">
<span class="label-text !text-md font-bold">{{ name }}</span>
</div>
<div v-if="name.toString() === 'help_text'" class="whitespace-pre-line">
{{ setHelp(key.toString(), prop) }}
</div>
<input
v-else-if="name.toString() === 'sender_pass'"
v-model="item[name]"
type="password"
:placeholder="t('config.placeholderPass')"
class="input input-sm input-bordered w-full"
/>
<textarea
v-else-if="name.toString() === 'output_param' || name.toString() === 'custom_filter'"
v-model="item[name]"
class="textarea textarea-bordered"
rows="3"
/>
<input
v-else-if="typeof prop === 'number' && prop % 1 === 0"
v-model="item[name]"
type="number"
class="input input-sm input-bordered w-full"
/>
<input
v-else-if="typeof prop === 'number'"
v-model="item[name]"
type="number"
class="input input-sm input-bordered w-full"
step="0.0001"
style="max-width: 250px"
/>
<input
v-else-if="typeof prop === 'boolean'"
v-model="item[name]"
type="checkbox"
class="checkbox checkbox-sm ms-2 mt-2"
/>
<input
v-else-if="name === 'ignore_lines'"
v-model="formatIgnoreLines"
type="text"
class="input input-sm input-bordered w-full"
/>
<input
v-else
:id="name"
v-model="item[name]"
type="text"
class="input input-sm input-bordered w-full"
/>
</template>
</label>
</div>
</template>
<div class="mt-5 mb-10">
<button class="btn btn-primary" type="submit">{{ t('config.save') }}</button>
</div>
</form>
</div>
<GenericModal
:title="t('config.restartTile')"
:text="t('config.restartText')"
:show="showModal"
:modal-action="restart"
/>
</template>
<script setup lang="ts">
const { t } = useI18n()
const authStore = useAuth()
const configStore = useConfig()
const indexStore = useIndex()
const showModal = ref(false)
const formatIgnoreLines = computed({
get() {
return configStore.playout.logging.ignore_lines.join(';')
},
set(value) {
configStore.playout.logging.ignore_lines = value.split(';')
},
})
function setTitle(input: string): string {
switch (input) {
case 'general':
return t('config.general')
case 'rpc_server':
return t('config.rpcServer')
case 'mail':
return t('config.mail')
case 'logging':
return t('config.logging')
case 'processing':
return t('config.processing')
case 'ingest':
return t('config.ingest')
case 'playlist':
return t('config.playlist')
case 'storage':
return t('config.storage')
case 'text':
return t('config.text')
case 'task':
return t('config.task')
case 'output':
return t('config.output')
default:
return input
}
}
function setHelp(key: string, text: string): string {
switch (key) {
case 'general':
return t('config.generalText')
case 'rpc_server':
return t('config.rpcText')
case 'mail':
return t('config.mailText')
case 'logging':
return t('config.logText')
case 'processing':
return t('config.processingText')
case 'ingest':
return t('config.ingestText')
case 'playlist':
return t('config.playlistText')
case 'storage':
return t('config.storageText')
case 'text':
return t('config.textText')
case 'task':
return t('config.taskText')
case 'output':
return t('config.outputText')
default:
return text
}
}
async function onSubmitPlayout() {
const update = await configStore.setPlayoutConfig(configStore.playout)
configStore.onetimeInfo = true
if (update.status === 200) {
indexStore.msgAlert('success', t('config.updatePlayoutSuccess'), 2)
const channel = configStore.channels[configStore.id].id
await $fetch(`/api/control/${channel}/process/`, {
method: 'POST',
headers: { ...configStore.contentType, ...authStore.authHeader },
body: JSON.stringify({ command: 'status' }),
}).then(async (response: any) => {
if (response === 'active') {
showModal.value = true
}
await configStore.getPlayoutConfig()
})
} else {
indexStore.msgAlert('error', t('config.updatePlayoutFailed'), 2)
}
}
async function restart(res: boolean) {
if (res) {
const channel = configStore.channels[configStore.id].id
await $fetch(`/api/control/${channel}/process/`, {
method: 'POST',
headers: { ...configStore.contentType, ...authStore.authHeader },
body: JSON.stringify({ command: 'restart' }),
})
}
showModal.value = false
}
</script>

View File

@ -0,0 +1,267 @@
<template>
<div class="w-full max-w-[800px] pe-8">
<h2 class="pt-3 text-3xl">{{ t('user.title') }}</h2>
<div v-if="authStore.role === 'GlobalAdmin'" class="flex flex-col xs:flex-row gap-2 w-full mb-5 mt-10">
<div class="grow">
<select v-model="selected" class="select select-bordered w-full max-w-xs" @change="onChange($event)">
<option v-for="item in users" :key="item.username" :value="item.id">{{ item.username }}</option>
</select>
</div>
<div class="flex-none join">
<button class="join-item btn btn-primary" title="Add new User" @click="showUserModal = true">
{{ t('user.add') }}
</button>
<button class="join-item btn btn-primary" title="Delete selected user" @click="deleteUser()">
{{ t('user.delete') }}
</button>
</div>
</div>
<form v-if="configStore.configUser" class="mt-5" @submit.prevent="onSubmitUser">
<label class="form-control w-full max-w-md">
<div class="label">
<span class="label-text">{{ t('user.name') }}</span>
</div>
<input
v-model="configStore.configUser.username"
type="text"
class="input input-bordered w-full !bg-base-100"
disabled
/>
</label>
<label class="form-control w-full max-w-md mt-3">
<div class="label">
<span class="label-text">{{ t('user.mail') }}</span>
</div>
<input v-model="configStore.configUser.mail" type="email" class="input input-bordered w-full" />
</label>
<label class="form-control w-full max-w-md mt-3">
<div class="label">
<span class="label-text">{{ t('user.newPass') }}</span>
</div>
<input v-model="newPass" type="password" class="input input-bordered w-full" />
</label>
<label class="form-control w-full max-w-md mt-3">
<div class="label">
<span class="label-text">{{ t('user.confirmPass') }}</span>
</div>
<input v-model="confirmPass" type="password" class="input input-bordered w-full" />
</label>
<div v-if="authStore.role === 'GlobalAdmin'" class="form-control w-full max-w-md mt-5">
<Multiselect
v-model="configStore.configUser.channel_ids"
:options="configStore.channels"
mode="tags"
:close-on-select="true"
:can-clear="false"
label="name"
value-prop="id"
:classes="multiSelectClasses"
:disabled="configStore.configUser.role_id === 1"
/>
</div>
<div>
<button class="btn btn-primary mt-5" type="submit">{{ t('user.save') }}</button>
</div>
</form>
</div>
<GenericModal :show="showUserModal" title="Add user" :modal-action="addUser">
<div class="w-full max-w-[500px] h-[490px]">
<label class="form-control w-full">
<div class="label">
<span class="label-text">{{ t('user.name') }}</span>
</div>
<input v-model="user.username" name="username" type="text" class="input input-bordered w-full" />
</label>
<label class="form-control w-full mt-3">
<div class="label">
<span class="label-text">{{ t('user.mail') }}</span>
</div>
<input v-model="user.mail" name="mail" type="email" class="input input-bordered w-full" />
</label>
<label class="form-control w-full mt-3">
<div class="label">
<span class="label-text">{{ t('user.password') }}</span>
</div>
<input v-model="user.password" type="password" class="input input-bordered w-full" />
</label>
<label class="form-control w-full mt-3">
<div class="label">
<span class="label-text">{{ t('user.confirmPass') }}</span>
</div>
<input v-model="user.confirm" type="password" class="input input-bordered w-full" />
</label>
<div class="form-control mt-5">
<Multiselect
v-model="user.channel_ids"
:options="configStore.channels"
mode="tags"
:close-on-select="true"
:can-clear="false"
label="name"
value-prop="id"
:classes="multiSelectClasses"
/>
</div>
<div class="form-control mt-3">
<label class="label cursor-pointer w-1/2">
<span class="label-text">{{ t('user.admin') }}</span>
<input v-model.number="user.admin" type="checkbox" class="checkbox" />
</label>
</div>
</div>
</GenericModal>
</template>
<script setup lang="ts">
const { t } = useI18n()
const { multiSelectClasses } = useVariables()
const authStore = useAuth()
const configStore = useConfig()
const indexStore = useIndex()
const selected = ref(null as null | number)
const users = ref([] as User[])
const showUserModal = ref(false)
const newPass = ref('')
const confirmPass = ref('')
const user = ref({
id: 0,
username: '',
mail: '',
password: '',
confirm: '',
admin: false,
channel_ids: [1],
role_id: 3,
} as User)
onMounted(() => {
getUsers()
})
async function getUsers() {
fetch('/api/users', {
method: 'GET',
headers: authStore.authHeader,
})
.then((response) => response.json())
.then((data) => {
users.value = data
selected.value = configStore.currentUser
})
}
function onChange(event: any) {
selected.value = event.target.value
getUserConfig()
}
async function getUserConfig() {
await fetch(`/api/user/${selected.value}`, {
method: 'GET',
headers: authStore.authHeader,
})
.then((response) => response.json())
.then((data) => {
configStore.configUser = data
})
}
async function deleteUser() {
if (configStore.configUser.id === configStore.currentUser) {
indexStore.msgAlert('error', t('user.deleteNotPossible'), 2)
} else {
await fetch(`/api/user/${configStore.configUser.id}`, {
method: 'DELETE',
headers: authStore.authHeader,
})
.then(async () => {
indexStore.msgAlert('success', t('user.deleteSuccess'), 2)
await configStore.getUserConfig()
await getUsers()
})
.catch((e) => {
indexStore.msgAlert('error', `${t('user.deleteError')}: ${e}`, 2)
})
}
}
function clearUser() {
user.value.id = 0
user.value.username = ''
user.value.mail = ''
user.value.password = ''
user.value.confirm = ''
user.value.admin = false
user.value.channel_ids = [1]
user.value.role_id = 3
}
async function addUser(add: boolean) {
if (add) {
if (user.value.admin) {
user.value.role_id = 2
} else {
user.value.role_id = 3
}
delete user.value.admin
if (user.value.username && user.value.password && user.value.password === user.value.confirm) {
authStore.inspectToken()
const update = await configStore.addNewUser(user.value)
showUserModal.value = false
if (update.status === 200) {
indexStore.msgAlert('success', t('user.addSuccess'), 2)
await getUsers()
await getUserConfig()
} else {
indexStore.msgAlert('error', t('user.addFailed'), 2)
}
clearUser()
} else {
indexStore.msgAlert('error', t('user.mismatch'), 2)
}
} else {
showUserModal.value = false
clearUser()
}
}
async function onSubmitUser() {
if (newPass.value && newPass.value === confirmPass.value) {
configStore.configUser.password = newPass.value
}
authStore.inspectToken()
const update = await configStore.setUserConfig(configStore.configUser)
if (update.status === 200) {
indexStore.msgAlert('success', t('user.updateSuccess'), 2)
} else {
indexStore.msgAlert('error', t('user.updateFailed'), 2)
}
newPass.value = ''
confirmPass.value = ''
}
</script>

View File

@ -0,0 +1,14 @@
<template>
<div class="flex items-center ps-4 pe-1">
<div
class="w-2 h-2 rounded-full"
:class="indexStore.sseConnected ? 'bg-success shadow shadow-success' : 'bg-error shadow shadow-error'"
:title="indexStore.sseConnected ? t('socketConnected') : t('socketDisconnected')"
/>
</div>
</template>
<script setup lang="ts">
const { t } = useI18n()
const indexStore = useIndex()
</script>

View File

@ -0,0 +1,59 @@
<template>
<div v-if="show" class="z-50 fixed top-0 bottom-0 left-0 right-0 flex justify-center items-center bg-black/30 overflow-auto m-auto max-h-screen space-y-1">
<div class="flex flex-col bg-base-100 min-w-[400px] max-w-[90%] h-auto rounded-md p-5 shadow-xl">
<div class="inline-block">
<div class="flex gap-2">
<div class="font-bold text-lg truncate flex-1 w-0">{{ title }}</div>
<button v-if="hideButtons" class="btn btn-sm w-8 h-8 rounded-full" @click="modalAction(false)">
<i class="bi bi-x-lg" />
</button>
</div>
<div class="grow mt-3">
<slot>
<div v-html="text" />
</slot>
</div>
</div>
<div v-if="!hideButtons" class="flex justify-end mt-3">
<div class="join">
<button class="btn btn-sm bg-base-300 hover:bg-base-300/50 join-item" @click="modalAction(false)">
{{ t('cancel') }}
</button>
<button class="btn btn-sm bg-base-300 hover:bg-base-300/50 join-item" @click="modalAction(true)">
{{ t('ok') }}
</button>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
const { t } = useI18n()
defineProps({
title: {
type: String,
default: '',
},
text: {
type: String,
default: '',
},
modalAction: {
type: Function,
default() {
return ''
},
},
show: {
type: Boolean,
default: false,
},
hideButtons: {
type: Boolean,
default: false,
},
})
</script>

View File

@ -0,0 +1,192 @@
<template>
<div class="navbar bg-base-100 min-h-[52px] p-0 shadow">
<NuxtLink class="navbar-brand min-w-[46px] p-2" href="/">
<img src="~/assets/images/ffplayout-small.png" class="img-fluid" alt="Logo" width="30" height="30" />
</NuxtLink>
<EventStatus v-if="route.name?.toString().includes('player__')" class="z-10" />
<div class="navbar-end w-1/5 grow">
<label class="swap swap-rotate me-2 2sm:hidden">
<input type="checkbox" :checked="indexStore.darkMode" @change="toggleDarkTheme" />
<SvgIcon name="swap-on" classes="w-5 h-5" />
<SvgIcon name="swap-off" classes="w-5 h-5" />
</label>
<details ref="menuDropdown" tabindex="0" class="dropdown dropdown-end z-50">
<summary class="btn btn-ghost 2sm:hidden" @click="clickMenu()" @blur="blurMenu()">
<SvgIcon name="burger" classes="w-5 h-5" />
</summary>
<ul class="menu menu-sm dropdown-content mt-1 z-[1] p-2 shadow bg-base-100 rounded-box w-52">
<li v-for="item in menuItems" :key="item.name" class="bg-base-100 rounded-md">
<NuxtLink
:to="item.link"
class="h-[27px] text-base"
exact-active-class="is-active"
@click="closeMenu()"
>
<span>
{{ item.name }}
</span>
</NuxtLink>
</li>
<li v-if="configStore.channels.length > 1">
<details tabindex="0" @focusout="closeDropdown">
<summary>
<div class="h-[19px] text-base">
<span> {{ configStore.channels[configStore.id].name }} </span>
</div>
</summary>
<ul class="p-2">
<li v-for="(channel, index) in configStore.channels" :key="index">
<span>
<a class="dropdown-item cursor-pointer" @click="selectChannel(index)">{{ channel.name }}</a>
</span>
</li>
</ul>
</details>
</li>
<li class="bg-base-100 rounded-md">
<button class="h-[27px] text-base" exactActiveClass="is-active" @click="logout()">
{{ t('button.logout') }}
</button>
</li>
</ul>
</details>
</div>
<div class="navbar-end hidden 2sm:flex w-4/5 min-w-[750px]">
<ul class="menu menu-sm menu-horizontal px-1">
<li v-for="item in menuItems" :key="item.name" class="bg-base-100 rounded-md p-0">
<NuxtLink
:to="item.link"
class="px-2 h-[27px] relative text-base text-base-content"
active-class="is-active"
>
<span>
{{ item.name }}
</span>
</NuxtLink>
</li>
<li v-if="configStore.channels.length > 1">
<details tabindex="0" @focusout="closeDropdown">
<summary>
<div class="h-[19px] text-base">
<span> {{ configStore.channels[configStore.id].name }} </span>
</div>
</summary>
<ul class="p-2 bg-base-100 rounded-md !mt-1 w-36" tabindex="0">
<li v-for="(channel, index) in configStore.channels" :key="index">
<a class="dropdown-item cursor-pointer" @click="selectChannel(index)">
{{ channel.name }}
</a>
</li>
</ul>
</details>
</li>
<li class="bg-base-100 rounded-md p-0">
<button class="h-[27px] pt-[4px] text-base" @click="logout()">
{{ t('button.logout') }}
</button>
</li>
<li class="p-0">
<label class="swap swap-rotate">
<input type="checkbox" :checked="indexStore.darkMode" @change="toggleDarkTheme" />
<SvgIcon name="swap-on" classes="w-5 h-5" />
<SvgIcon name="swap-off" classes="w-5 h-5" />
</label>
</li>
</ul>
</div>
</div>
</template>
<script setup lang="ts">
const colorMode = useColorMode()
const { t } = useI18n()
const localePath = useLocalePath()
const route = useRoute()
const router = useRouter()
const authStore = useAuth()
const configStore = useConfig()
const indexStore = useIndex()
const menuDropdown = ref()
const isOpen = ref(false)
const menuItems = ref([
{ name: t('button.home'), link: localePath({ name: 'index' }) },
{ name: t('button.player'), link: localePath({ name: 'player' }) },
{ name: t('button.media'), link: localePath({ name: 'media' }) },
{ name: t('button.message'), link: localePath({ name: 'message' }) },
{ name: t('button.logging'), link: localePath({ name: 'logging' }) },
{ name: t('button.configure'), link: localePath({ name: 'configure' }) },
])
if (colorMode.value === 'dark') {
indexStore.darkMode = true
}
function closeMenu() {
setTimeout(() => {
isOpen.value = false
menuDropdown.value.removeAttribute('open')
console.log('close')
}, 200)
}
function clickMenu() {
console.log('close')
isOpen.value = !isOpen.value
if (!isOpen.value) {
menuDropdown.value.removeAttribute('open')
}
}
function blurMenu() {
if (isOpen.value) {
isOpen.value = !isOpen.value
} else {
setTimeout(() => {
menuDropdown.value.removeAttribute('open')
}, 200)
}
}
function closeDropdown($event: any) {
setTimeout(() => {
$event.target.parentNode.removeAttribute('open')
}, 200)
}
function logout() {
authStore.removeToken()
router.push(localePath({ name: 'index' }))
}
function selectChannel(index: number) {
configStore.id = index
configStore.getPlayoutConfig()
}
function toggleDarkTheme() {
indexStore.darkMode = !indexStore.darkMode
if (indexStore.darkMode) {
colorMode.preference = 'dark'
} else {
colorMode.preference = 'light'
}
}
</script>
<style lang="scss" scoped>
.is-active > span::after {
background: var(--my-accent);
position: relative;
left: 0px;
content: ' ';
width: inherit;
height: 2px;
color: red;
display: block;
border-radius: 0.15em;
}
</style>

View File

@ -0,0 +1,108 @@
<template>
<div v-if="mediaStore.isLoading" class="h-full w-full absolute z-10 flex justify-center bg-base-100/70">
<span class="loading loading-spinner loading-lg" />
</div>
<div class="bg-base-100 border-b border-my-gray">
<div v-if="mediaStore.folderTree.parent && mediaStore.crumbs">
<nav class="breadcrumbs px-2">
<ul>
<li v-for="(crumb, index) in mediaStore.crumbs" :key="index">
<button
v-if="mediaStore.crumbs.length > 1 && mediaStore.crumbs.length - 1 > index"
class="flex items-center"
@click="mediaStore.getTree(crumb.path)"
>
<i class="bi-folder-fill me-1" />
<span class="text-xs font-bold text-base-content/60 leading-tight">{{ crumb.text }}</span>
</button>
<div v-else class="flex items-center">
<i class="bi-folder-fill me-1" />
<span class="text-xs font-bold text-base-content/60">{{ crumb.text }}</span>
</div>
</li>
</ul>
</nav>
</div>
</div>
<div class="w-full h-[calc(100%-40px)] overflow-auto">
<div
v-for="folder in mediaStore.folderTree.folders"
:key="folder.uid"
class="flex px-2 py-[2px] bg-base-200"
>
<button class="truncate" @click="mediaStore.getTree(`/${mediaStore.folderTree.source}/${folder.name}`)">
<i class="bi-folder-fill" />
{{ folder.name }}
</button>
</div>
<table class="w-full table table-zebra table-fixed">
<Sortable :list="mediaStore.folderTree.files" :options="browserSortOptions" item-key="name" tag="tbody">
<template #item="{ element, index }">
<tr
:id="`file-${index}`"
:key="element.name"
class="w-full border-b border-t border-base-content/20"
:class="{ 'grabbing cursor-grab': width > 768 && configStore.playout.processing.mode === 'playlist' }"
>
<td class="ps-2 py-1 w-[20px]" :class="{'timeHidden': configStore.playout.playlist.infinit}">
<i v-if="mediaType(element.name) === 'audio'" class="bi-music-note-beamed" />
<i v-else-if="mediaType(element.name) === 'video'" class="bi-film" />
<i v-else-if="mediaType(element.name) === 'image'" class="bi-file-earmark-image" />
<i v-else class="bi-file-binary" />
</td>
<td class="px-[1px] py-1 truncate">
{{ element.name }}
</td>
<td class="px-1 py-1 w-[30px] text-center leading-3">
<button @click="preview(element.name)">
<i class="bi-play-fill" />
</button>
</td>
<td class="px-0 py-1 w-[65px] text-nowrap">
{{ secToHMS(element.duration) }}
</td>
<td class="py-1 hidden">00:00:00</td>
<td class="py-1 hidden">{{ secToHMS(element.duration) }}</td>
<td class="py-1 hidden">&nbsp;</td>
<td class="py-1 hidden">&nbsp;</td>
<td class="py-1 hidden">&nbsp;</td>
</tr>
</template>
</Sortable>
</table>
</div>
</template>
<script setup lang="ts">
const { width } = useWindowSize({ initialWidth: 800 })
const { secToHMS, mediaType } = stringFormatter()
const configStore = useConfig()
const mediaStore = useMedia()
const { id } = storeToRefs(useConfig())
const browserSortOptions = {
group: { name: 'playlist', pull: 'clone', put: false },
handle: '.grabbing',
sort: false,
}
defineProps({
preview: {
type: Function,
default() {
return ''
},
},
})
onMounted(async () => {
if (!mediaStore.folderTree.parent || !mediaStore.currentPath) {
await mediaStore.getTree('')
}
})
watch([id], () => {
mediaStore.getTree('')
})
</script>

View File

@ -0,0 +1,344 @@
<template>
<div class="w-full">
<div class="grid grid-cols-1 md:grid-cols-[auto_512px] xl:grid-cols-[512px_auto_450px]">
<div class="order-1 p-1">
<div class="bg-base-100 w-full h-full rounded shadow flex items-center p-2">
<div class="w-full aspect-video">
<video v-if="streamExtension === 'flv'" ref="httpStreamFlv" controls />
<VideoPlayer
v-else-if="configStore.showPlayer && configStore.channels[configStore.id]"
:key="configStore.id"
class="live-player"
reference="httpStream"
:options="{
liveui: true,
controls: true,
suppressNotSupportedError: true,
autoplay: false,
preload: 'auto',
sources: [
{
type: 'application/x-mpegURL',
src: configStore.channels[configStore.id].preview_url,
},
],
}"
/>
</div>
</div>
</div>
<div
class="order-3 xl:order-2 col-span-1 md:col-span-2 xl:col-span-1 bg-base-200 h-full grid grid-cols-1 xs:grid-cols-2"
>
<div class="col-span-1 p-1">
<div
class="w-full h-full bg-base-100 rounded font-['DigitalNumbers'] p-6 text-3xl md:text-2xl 2xl:text-5xl 4xl:text-7xl tracking-tighter flex justify-center items-center shadow"
>
{{ timeStr }}
</div>
</div>
<div class="col-span-1 p-1 min-h-[50%]">
<div
class="w-full h-full bg-base-100 rounded font-['DigitalNumbers'] p-6 text-3xl md:text-2xl 2xl:text-5xl 4xl:text-7xl tracking-tighter flex justify-center items-center shadow"
>
{{ secToHMS(timeRemaining()) }}
</div>
</div>
<div class="col-span-1 xs:col-span-2 p-1">
<div class="w-full h-full bg-base-100 rounded flex items-center p-3 shadow">
<div class="w-full h-full flex flex-col">
<div v-if="playlistStore.ingestRuns" class="h-1/3 font-bold truncate">
{{ t('control.ingest') }}
</div>
<div
v-else
class="h-1/3 font-bold text truncate"
:class="{'text-base-content/60': playlistStore.current.category === 'advertisement'}"
:title="playlistStore.current.title || filename(playlistStore.current.source)"
>
{{
playlistStore.current.title ||
filename(playlistStore.current.source) ||
t('control.noClip')
}}
</div>
<div class="grow">
<strong>{{ t('player.duration') }}:</strong>
{{ secToHMS(playlistStore.current.duration) }} |
<strong>{{ t('player.in') }}:</strong> {{ secToHMS(playlistStore.current.in) }} |
<strong>{{ t('player.out') }}:</strong>
{{ secToHMS(playlistStore.current.out) }}
<template v-if="playlistStore.shift !== 0">
| <strong>{{ t('player.shift') }}:</strong>
{{ secToHMS(playlistStore.shift) }}
</template>
</div>
<div class="h-1/3">
<progress
class="progress progress-accent w-full"
:value="playlistStore.progressValue"
max="100"
/>
</div>
</div>
</div>
</div>
</div>
<div class="order-2 xl:order-3 p-1">
<div class="bg-base-100 h-full flex justify-center rounded shadow">
<div class="w-full h-full grid grid-cols-3">
<div class="text-center">
<div class="w-full h-1/2 aspect-square p-2">
<button
:title="t('control.start')"
class="btn btn-primary h-full w-full text-7xl text-lime-600"
:class="playlistStore.playoutIsRunning && 'shadow-glow shadow-lime-600'"
@click="controlProcess('start')"
>
<i class="bi-play" />
</button>
</div>
<div class="w-full h-1/2 aspect-square p-2">
<button
:title="t('control.last')"
class="btn btn-primary h-full w-full text-7xl text-cyan-600"
@click="controlPlayout('back')"
>
<i class="bi-skip-start" />
</button>
</div>
</div>
<div class="text-center">
<div class="w-full h-1/2 aspect-square p-2">
<button
:title="t('control.stop')"
class="btn btn-primary h-full w-full text-7xl text-red-600"
@click="controlProcess('stop')"
>
<i class="bi-stop" />
</button>
</div>
<div class="w-full h-1/2 aspect-square p-2">
<button
:title="t('control.reset')"
class="btn btn-primary h-full w-full text-6xl text-cyan-600"
@click="controlPlayout('reset')"
>
<i class="bi-arrow-repeat" />
</button>
</div>
</div>
<div class="text-center">
<div class="w-full h-1/2 aspect-square p-2">
<button
:title="t('control.restart')"
class="btn btn-primary h-full w-full text-6xl text-yellow-500"
@click="controlProcess('restart')"
>
<i class="bi-arrow-clockwise" />
</button>
</div>
<div class="w-full h-1/2 aspect-square p-2">
<button
:title="t('control.next')"
class="btn btn-primary h-full w-full text-7xl text-cyan-600"
@click="controlPlayout('next')"
>
<i class="bi-skip-end" />
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { storeToRefs } from 'pinia'
import mpegts from 'mpegts.js'
const { t } = useI18n()
const { $dayjs } = useNuxtApp()
const authStore = useAuth()
const configStore = useConfig()
const indexStore = useIndex()
const playlistStore = usePlaylist()
const { filename, secToHMS } = stringFormatter()
const { id } = storeToRefs(useConfig())
const currentDefault = {
uid: '',
title: t('control.noClip'),
source: t('control.noClip'),
duration: 0,
in: 0,
out: 0,
} as PlaylistItem
playlistStore.current = currentDefault
const timeStr = ref('00:00:00')
const timer = ref()
const errorCounter = ref(0)
const streamExtension = ref(configStore.channels[configStore.id].preview_url.split('.').pop())
const httpStreamFlv = ref(null)
const httpFlvSource = ref({
type: 'flv',
isLive: true,
url: configStore.channels[configStore.id].preview_url,
})
const mpegtsOptions = ref({
lazyLoadMaxDuration: 3 * 60,
liveBufferLatencyChasing: true,
})
const streamUrl = ref(
`/data/event/${configStore.channels[configStore.id].id}?endpoint=playout&uuid=${authStore.uuid}`
)
// 'http://127.0.0.1:8787/data/event/1?endpoint=playout&uuid=f2f8c29b-712a-48c5-8919-b535d3a05a3a'
const { status, data, error, close } = useEventSource(streamUrl, [], {
autoReconnect: {
retries: -1,
delay: 1000,
onFailed() {
indexStore.sseConnected = false
},
},
})
onMounted(() => {
let player: any = null
if (streamExtension.value === 'flv' && mpegts.getFeatureList().mseLivePlayback) {
if (typeof player !== 'undefined' && player != null) {
player.unload()
player.detachMediaElement()
player.destroy()
player = null
}
player = mpegts.createPlayer(httpFlvSource.value, mpegtsOptions.value)
player.attachMediaElement(httpStreamFlv.value)
player.load()
}
clock()
})
onBeforeUnmount(() => {
indexStore.sseConnected = false
close()
if (timer.value) {
clearTimeout(timer.value)
}
})
watch([status, error], async () => {
if (status.value === 'OPEN') {
indexStore.sseConnected = true
errorCounter.value = 0
} else {
indexStore.sseConnected = false
errorCounter.value += 1
if (errorCounter.value > 11) {
await authStore.obtainUuid()
streamUrl.value = `/data/event/${
configStore.channels[configStore.id].id
}?endpoint=playout&uuid=${authStore.uuid}`
errorCounter.value = 0
}
}
})
watch([data], () => {
if (data.value) {
try {
const playout_status = JSON.parse(data.value)
playlistStore.setStatus(playout_status)
} catch {
indexStore.sseConnected = true
playlistStore.playoutIsRunning = false
resetStatus()
}
}
})
watch([id], () => {
resetStatus()
streamUrl.value = `/data/event/${configStore.channels[configStore.id].id}?endpoint=playout&uuid=${
authStore.uuid
}`
if (timer.value) {
clearTimeout(timer.value)
}
})
function timeRemaining() {
let remaining = playlistStore.current.out - playlistStore.elapsedSec
if (remaining < 0) {
remaining = 0
}
return remaining
}
async function clock() {
async function setTime(resolve: any) {
timeStr.value = $dayjs().utcOffset(configStore.utcOffset).format('HH:mm:ss')
timer.value = setTimeout(() => setTime(resolve), 1000)
}
return new Promise((resolve) => setTime(resolve))
}
function resetStatus() {
playlistStore.elapsedSec = 0
playlistStore.shift = 0
playlistStore.current = currentDefault
}
async function controlProcess(state: string) {
/*
Control playout (start, stop, restart)
*/
const channel = configStore.channels[configStore.id].id
await $fetch(`/api/control/${channel}/process/`, {
method: 'POST',
headers: { ...configStore.contentType, ...authStore.authHeader },
body: JSON.stringify({ command: state }),
})
}
async function controlPlayout(state: string) {
/*
Control playout:
- jump to next clip
- jump to last clip
- reset playout state
*/
const channel = configStore.channels[configStore.id].id
await $fetch(`/api/control/${channel}/playout/`, {
method: 'POST',
headers: { ...configStore.contentType, ...authStore.authHeader },
body: JSON.stringify({ control: state }),
})
}
</script>

View File

@ -0,0 +1,425 @@
<template>
<div
class="z-50 fixed top-0 bottom-0 w-full h-full left-0 right-0 flex justify-center items-center bg-black/30 overflow-y-auto"
>
<div
class="relative flex flex-col bg-base-100 w-[800px] min-w-[300px] max-w-[90vw] h-[680px] rounded-md p-5 shadow-xl"
>
<div class="font-bold text-lg">{{ t('player.generateProgram') }}</div>
<div class="h-[calc(100%-95px)] mt-3">
<div role="tablist" class="tabs tabs-bordered">
<input
type="radio"
name="my_tabs_2"
role="tab"
class="tab"
:aria-label="t('player.simple')"
checked
@change="advancedGenerator = false"
/>
<div role="tabpanel" class="tab-content w-full pt-3">
<div class="w-full">
<div class="grid">
<nav class="breadcrumbs px-3 pt-0">
<ul>
<li v-for="(crumb, index) in mediaStore.folderCrumbs" :key="index">
<button
v-if="
mediaStore.folderCrumbs.length > 1 &&
mediaStore.folderCrumbs.length - 1 > index
"
@click="mediaStore.getTree(crumb.path, true)"
>
<i class="bi-folder-fill me-1" />
{{ crumb.text }}
</button>
<span v-else><i class="bi-folder-fill me-1" />{{ crumb.text }}</span>
</li>
</ul>
</nav>
</div>
<ul class="h-[475px] border border-my-gray rounded overflow-auto bg-base-300 m-1 py-1">
<li
v-for="folder in mediaStore.folderList.folders"
:key="folder.uid"
class="even:bg-base-200 px-2 w-full"
>
<div class="grid grid-cols-[auto_24px]">
<button
class="truncate text-left"
@click="
;[
(selectedFolders = []),
mediaStore.getTree(
`/${mediaStore.folderList.source}/${folder.name}`.replace(
/\/[/]+/g,
'/'
),
true
),
]
"
>
<i class="bi-folder-fill" />
{{ folder.name }}
</button>
<div v-if="!generateFromAll" class="text-center">
<input
class="checkbox checkbox-xs rounded"
type="checkbox"
@change="
setSelectedFolder(
$event,
`/${mediaStore.folderList.source}/${folder.name}`.replace(
/\/[/]+/g,
'/'
)
)
"
/>
</div>
</div>
</li>
</ul>
</div>
</div>
<input
type="radio"
name="my_tabs_2"
role="tab"
class="tab"
:aria-label="t('player.advanced')"
@change=";(advancedGenerator = true), resetCheckboxes()"
/>
<div role="tabpanel" class="tab-content pt-3">
<div class="w-full">
<div class="grid grid-cols-[auto_48px] px-3 pt-0">
<nav class="breadcrumbs pt-0">
<ul>
<li v-for="(crumb, index) in mediaStore.folderCrumbs" :key="index">
<button
v-if="
mediaStore.folderCrumbs.length > 1 &&
mediaStore.folderCrumbs.length - 1 > index
"
@click="mediaStore.getTree(crumb.path, true)"
>
<i class="bi-folder-fill me-1" />
{{ crumb.text }}
</button>
<span v-else><i class="bi-folder-fill me-1" />{{ crumb.text }}</span>
</li>
</ul>
</nav>
<div class="flex justify-end">
<button
type="button"
class="btn btn-sm btn-primary"
:title="t('player.addBlock')"
@click="addTemplate()"
>
<i class="bi bi-folder-plus" />
</button>
</div>
</div>
<div
class="h-[475px] border border-my-gray rounded grid bg-base-300 m-1"
:class="width < 740 ? 'grid-cols-1' : 'grid-cols-[300px_auto]'"
>
<Sortable
:list="mediaStore.folderList.folders"
:options="templateBrowserSortOptions"
item-key="uid"
class="overflow-auto py-1 border-my-gray"
:class="width < 740 ? 'h-[240px] border-b' : 'border-e'"
tag="ul"
>
<template #item="{ element, index }">
<li
:id="`adv_folder_${index}`"
:key="element.uid"
class="even:bg-base-200 draggable px-2 w-full"
>
<button
class="w-full truncate text-left"
@click="
;[
(selectedFolders = []),
mediaStore.getTree(
`/${mediaStore.folderList.source}/${element.name}`.replace(
/\/[/]+/g,
'/'
),
true
),
]
"
>
<i class="bi-folder-fill" />
{{ element.name }}
</button>
</li>
</template>
</Sortable>
<ul class="overflow-auto px-1 pb-1">
<li
v-for="item in template.sources"
:key="item.start"
class="flex flex-col gap-1 justify-center items-center border border-my-gray rounded mt-1 p-1"
>
<div class="flex flex-wrap xs:grid xs:grid-cols-[58px_64px_67px_64px_67px] xs:join">
<div
class="input input-sm input-bordered join-item px-1 text-center bg-base-200 leading-7"
>
{{ t('player.start') }}:
</div>
<input
v-model="item.start"
type="text"
class="input input-sm input-bordered join-item px-1 text-center"
/>
<div
class="input input-sm input-bordered join-item px-1 text-center bg-base-200 leading-7"
>
{{ t('player.duration') }}:
</div>
<input
v-model="item.duration"
type="text"
class="input input-sm input-bordered join-item px-1 text-center"
/>
<button
class="btn btn-sm input-bordered join-item"
:class="item.shuffle ? 'bg-base-100' : 'bg-base-300'"
@click="item.shuffle = !item.shuffle"
>
{{ item.shuffle ? t('player.shuffle') : t('player.sorted') }}
</button>
</div>
<Sortable
:list="item.paths"
item-key="index"
class="w-full border border-my-gray rounded"
:style="`height: ${item.paths ? item.paths.length * 23 + 31 : 300}px`"
tag="ul"
:options="templateTargetSortOptions"
@add="addFolderToTemplate($event, item)"
>
<template #item="{ element, index }">
<li
:id="`path_${index}`"
:key="index"
class="draggable grabbing py-0 even:bg-base-200 px-2"
>
<i class="bi-folder-fill" />
{{ element.split(/[\\/]+/).pop() }}
</li>
</template>
</Sortable>
<div class="w-full flex justify-end">
<button
type="button"
class="btn btn-sm bg-base-100"
@click="removeTemplate(item)"
>
<i class="bi-trash" />
</button>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="flex h-14 pt-6 justify-end items-center">
<div v-if="!advancedGenerator" class="form-control">
<label class="label cursor-pointer w-12">
<span class="label-text">{{ t('player.all') }}</span>
<input
v-model="generateFromAll"
type="checkbox"
class="checkbox checkbox-xs rounded"
@change="resetCheckboxes()"
/>
</label>
</div>
<div class="join ms-2">
<button
type="button"
class="btn btn-sm btn-primary join-item"
@click="resetCheckboxes(), resetTemplate(), close()"
>
{{ t('cancel') }}
</button>
<button type="button" class="btn btn-sm btn-primary join-item" @click="generatePlaylist(), close()">
{{ t('ok') }}
</button>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
const { $dayjs } = useNuxtApp()
const { t } = useI18n()
const { width } = useWindowSize({ initialWidth: 800 })
const authStore = useAuth()
const configStore = useConfig()
const indexStore = useIndex()
const mediaStore = useMedia()
const playlistStore = usePlaylist()
const { processPlaylist } = playlistOperations()
const prop = defineProps({
close: {
type: Function,
default() {
return ''
},
},
switchClass: {
type: Function,
default() {
return ''
},
},
})
const advancedGenerator = ref(false)
const selectedFolders = ref([] as string[])
const generateFromAll = ref(false)
const template = ref({
sources: [
{
start: configStore.playout.playlist.day_start,
duration: '02:00:00',
shuffle: false,
paths: [],
},
],
} as Template)
const templateBrowserSortOptions = {
group: { name: 'folder', pull: 'clone', put: false },
sort: false,
}
const templateTargetSortOptions = {
group: 'folder',
animation: 100,
handle: '.grabbing',
}
function setSelectedFolder(event: any, folder: string) {
if (event.target.checked) {
selectedFolders.value.push(folder)
} else {
const index = selectedFolders.value.indexOf(folder)
if (index > -1) {
selectedFolders.value.splice(index, 1)
}
}
}
function resetCheckboxes() {
selectedFolders.value = []
const checkboxes = document.getElementsByClassName('folder-check') as HTMLCollectionOf<HTMLInputElement>
if (checkboxes) {
for (const box of checkboxes) {
box.checked = false
}
}
}
function addFolderToTemplate(event: any, item: TemplateItem) {
const o = event.oldIndex
const n = event.newIndex
event.item.remove()
const storagePath = configStore.channels[configStore.id].storage_path
const navPath = mediaStore.folderCrumbs[mediaStore.folderCrumbs.length - 1].path
const sourcePath = `${storagePath}/${navPath}/${mediaStore.folderList.folders[o].name}`.replace(/\/[/]+/g, '/')
if (!item.paths.includes(sourcePath)) {
item.paths.splice(n, 0, sourcePath)
}
}
function resetTemplate() {
template.value.sources = []
}
function removeTemplate(item: TemplateItem) {
const index = template.value.sources.indexOf(item)
template.value.sources.splice(index, 1)
}
function addTemplate() {
const last = template.value.sources[template.value.sources.length - 1]
let start = $dayjs('2000-01-01T00:00:00')
if (last) {
const t = $dayjs(`2000-01-01T${last.duration}`)
start = $dayjs(`2000-01-01T${last.start}`)
.add(t.hour(), 'hour')
.add(t.minute(), 'minute')
.add(t.second(), 'second')
}
template.value.sources.push({
start: start.format('HH:mm:ss'),
duration: '02:00:00',
shuffle: false,
paths: [],
})
}
async function generatePlaylist() {
playlistStore.isLoading = true
let body = null as BodyObject | null
if (selectedFolders.value.length > 0 && !generateFromAll.value) {
body = { paths: selectedFolders.value }
}
if (advancedGenerator.value) {
if (body) {
body.template = template.value
} else {
body = { template: template.value }
}
}
await $fetch(`/api/playlist/${configStore.channels[configStore.id].id}/generate/${playlistStore.listDate}`, {
method: 'POST',
headers: { ...configStore.contentType, ...authStore.authHeader },
body,
})
.then((response: any) => {
playlistStore.playlist = processPlaylist(playlistStore.listDate, response.program, false)
prop.switchClass()
indexStore.msgAlert('success', t('player.generateDone'), 2)
})
.catch((e: any) => {
indexStore.msgAlert('error', e.data ? e.data : e, 4)
})
// reset selections
resetCheckboxes()
resetTemplate()
playlistStore.isLoading = false
}
</script>

View File

@ -0,0 +1,359 @@
<template>
<div
id="playlist-container"
ref="playlistContainer"
class="relative w-full h-full !bg-base-300 rounded-e overflow-auto"
>
<div v-if="playlistStore.isLoading" class="w-full h-full absolute z-10 flex justify-center bg-base-100/70">
<span class="loading loading-spinner loading-lg" />
</div>
<table class="table table-zebra table-fixed">
<thead class="top-0 sticky z-10">
<tr class="bg-base-100 rounded-tr-lg">
<th v-if="!configStore.playout.playlist.infinit" class="w-[85px] p-0 text-left">
<div class="border-b border-my-gray px-4 py-3 -mb-[2px]">
{{ t('player.start') }}
</div>
</th>
<th class="w-full p-0 text-left">
<div class="border-b border-my-gray px-4 py-3 -mb-[2px]">
{{ t('player.file') }}
</div>
</th>
<th class="w-[85px] p-0 text-center">
<div class="border-b border-my-gray px-4 py-3 -mb-[2px]">
{{ t('player.play') }}
</div>
</th>
<th class="w-[85px] p-0 text-center hidden md:table-cell">
<div class="border-b border-my-gray px-4 py-3 -mb-[2px]">
{{ t('player.duration') }}
</div>
</th>
<th class="w-[85px] p-0 text-center hidden xl:table-cell">
<div class="border-b border-my-gray px-4 py-3 -mb-[2px]">
{{ t('player.in') }}
</div>
</th>
<th class="w-[85px] p-0 text-center hidden xl:table-cell">
<div class="border-b border-my-gray px-4 py-3 -mb-[2px]">
{{ t('player.out') }}
</div>
</th>
<th class="w-[85px] p-0 text-center hidden xl:table-cell justify-center">
<div class="border-b border-my-gray px-4 py-3 -mb-[2px]">
{{ t('player.ad') }}
</div>
</th>
<th class="w-[85px] p-0 text-center">
<div class="border-b border-my-gray px-4 py-3 -mb-[2px]">
{{ t('player.edit') }}
</div>
</th>
<th class="w-[85px] p-0 text-center hidden md:table-cell justify-center">
<div class="border-b border-my-gray px-4 py-3 -mb-[2px]">
{{ t('player.delete') }}
</div>
</th>
</tr>
</thead>
<Sortable
id="sort-container"
ref="sortContainer"
:list="playlistStore.playlist"
item-key="uid"
tag="tbody"
:options="playlistSortOptions"
@add="addClip"
@start="addBG"
@end="moveItemInArray"
>
<template #item="{ element, index }">
<tr
:id="`clip-${index}`"
:key="element.uid"
class="draggable border-t border-b border-base-content/20 duration-1000 transition-all"
:class="{
'!bg-lime-500/30':
playlistStore.playoutIsRunning && listDate === todayDate && index === currentIndex,
'!bg-amber-600/40': element.overtime,
'text-base-content/50': element.category === 'advertisement'
}"
>
<td v-if="!configStore.playout.playlist.infinit" class="ps-4 py-2 text-left">
{{ secondsToTime(element.begin) }}
</td>
<td class="py-2 text-left truncate" :class="{ 'grabbing cursor-grab': width > 768 }">
{{ element.title || filename(element.source) }}
</td>
<td class="py-2 text-center hover:text-base-content/70">
<button @click="preview(element.source)">
<i class="bi-play-fill" />
</button>
</td>
<td class="py-2 text-center hidden md:table-cell">{{ secToHMS(element.duration) }}</td>
<td class="py-2 text-center hidden xl:table-cell">
{{ secToHMS(element.in) }}
</td>
<td class="py-2 text-center hidden xl:table-cell">
{{ secToHMS(element.out) }}
</td>
<td class="py-2 text-center hidden xl:table-cell leading-3">
<input
class="checkbox checkbox-xs rounded"
type="checkbox"
:checked="element.category && element.category === 'advertisement' ? true : false"
@change="setCategory($event, element)"
/>
</td>
<td class="py-2 text-center hover:text-base-content/70">
<button @click="editItem(index)">
<i class="bi-pencil-square" />
</button>
</td>
<td class="py-2 text-center hidden md:table-cell justify-center hover:text-base-content/70">
<button @click="deletePlaylistItem(index)">
<i class="bi-x-circle-fill" />
</button>
</td>
</tr>
</template>
</Sortable>
</table>
</div>
</template>
<script setup lang="ts">
import { storeToRefs } from 'pinia'
const { t } = useI18n()
const { $dayjs } = useNuxtApp()
const { width } = useWindowSize({ initialWidth: 800 })
const configStore = useConfig()
const mediaStore = useMedia()
const playlistStore = usePlaylist()
const { secToHMS, filename, secondsToTime } = stringFormatter()
const { processPlaylist, genUID } = playlistOperations()
const playlistContainer = ref()
const sortContainer = ref()
const todayDate = ref($dayjs().utcOffset(configStore.utcOffset).format('YYYY-MM-DD'))
const { id } = storeToRefs(useConfig())
const { currentIndex, listDate, playoutIsRunning } = storeToRefs(usePlaylist())
const playlistSortOptions = {
group: 'playlist',
animation: 100,
handle: '.grabbing',
}
defineProps({
editItem: {
type: Function,
default() {
return ''
},
},
preview: {
type: Function,
default() {
return ''
},
},
})
onMounted(() => {
setTimeout(() => {
getPlaylist()
}, 150)
})
watch([listDate, id], () => {
setTimeout(() => {
getPlaylist()
}, 800)
})
watch([playoutIsRunning], () => {
setTimeout(() => {
scrollTo(currentIndex.value)
}, 400)
})
defineExpose({
classSwitcher,
getPlaylist,
})
function scrollTo(index: number) {
const child = document.getElementById(`clip-${index}`)
const parent = document.getElementById('playlist-container')
if (child && parent) {
const topPos = child.offsetTop
parent.scrollTop = topPos - 50
}
}
function classSwitcher() {
if (playlistStore.playlist.length === 0) {
sortContainer.value?.sortable.el.classList.add('is-empty')
} else {
const lastItem = playlistStore.playlist[playlistStore.playlist.length - 1]
if (
configStore.playout.playlist.startInSec + configStore.playout.playlist.lengthInSec >
lastItem.begin + lastItem.out - lastItem.in ||
configStore.playout.playlist.infinit
) {
sortContainer.value?.sortable.el.classList.add('add-space')
} else {
sortContainer.value?.sortable.el.classList.remove('add-space')
}
sortContainer.value?.sortable.el.classList.remove('is-empty')
}
}
async function getPlaylist() {
playlistStore.isLoading = true
await playlistStore.getPlaylist(listDate.value)
playlistStore.isLoading = false
if (listDate.value === todayDate.value) {
await until(currentIndex).toMatch((v) => v > 0, { timeout: 1500 })
scrollTo(currentIndex.value)
} else {
scrollTo(0)
}
classSwitcher()
}
function setCategory(event: any, item: PlaylistItem) {
if (event.target.checked) {
item.category = 'advertisement'
} else {
item.category = ''
}
}
function addBG(obj: any) {
if (obj.item) {
obj.item.classList.add('!bg-fuchsia-900/30')
} else {
obj?.classList?.add('!bg-fuchsia-900/30')
}
}
function removeBG(item: any) {
setTimeout(() => {
item?.classList?.remove('!bg-fuchsia-900/30')
}, 100)
}
function addClip(event: any) {
const o = event.oldIndex
const n = event.newIndex
const uid = genUID()
event.item?.remove()
const storagePath = configStore.channels[configStore.id].storage_path
const sourcePath = `${storagePath}/${mediaStore.folderTree.source}/${mediaStore.folderTree.files[o].name}`.replace(
/\/[/]+/g,
'/'
)
playlistStore.playlist.splice(n, 0, {
uid,
begin: 0,
source: sourcePath,
in: 0,
out: mediaStore.folderTree.files[o].duration,
duration: mediaStore.folderTree.files[o].duration,
})
processPlaylist(listDate.value, playlistStore.playlist, false)
classSwitcher()
nextTick(() => {
const newNode = document.getElementById(`clip-${n}`)
addBG(newNode)
removeBG(newNode)
if (n > playlistStore.playlist.length - 3) {
playlistContainer.value.scroll({ top: playlistContainer.value.scrollHeight, behavior: 'smooth' })
}
})
}
function moveItemInArray(event: any) {
playlistStore.playlist.splice(event.newIndex, 0, playlistStore.playlist.splice(event.oldIndex, 1)[0])
processPlaylist(listDate.value, playlistStore.playlist, false)
removeBG(event.item)
}
function deletePlaylistItem(index: number) {
playlistStore.playlist.splice(index, 1)
processPlaylist(listDate.value, playlistStore.playlist, false)
classSwitcher()
}
</script>
<style>
#sort-container.is-empty:not(:has(.sortable-ghost)):after {
content: '\f1bc';
font-family: 'bootstrap-icons';
opacity: 0.3;
font-size: 50px;
width: 100%;
height: 210px;
display: flex;
position: absolute;
justify-content: center;
align-items: center;
}
#sort-container.add-space:after {
content: ' ';
width: 100%;
height: 37px;
display: flex;
position: absolute;
}
#sort-container .timeHidden {
display: none !important;
}
/*
format dragging element
*/
#playlist-container .sortable-ghost {
background-color: #701a754b !important;
min-height: 37px !important;
height: 37px !important;
}
#playlist-container .sortable-ghost td {
padding-left: 1rem;
padding-right: 1rem;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
#playlist-container .sortable-ghost td:nth-last-child(3) {
display: table-cell !important;
}
@media (min-width: 1280px) {
#playlist-container .sortable-ghost td:nth-last-child(5),
#playlist-container .sortable-ghost td:nth-last-child(4),
#playlist-container .sortable-ghost td:nth-last-child(-n + 2) {
display: table-cell !important;
}
}
</style>

View File

@ -0,0 +1,109 @@
<template>
<svg
v-if="name === 'swap-on'"
class="swap-on fill-current"
:class="classes"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 22 22"
>
<path
d="M5.64,17l-.71.71a1,1,0,0,0,0,1.41,1,1,0,0,0,1.41,0l.71-.71A1,1,0,0,0,5.64,17ZM5,12a1,1,0,0,0-1-1H3a1,1,0,0,0,0,2H4A1,1,0,0,0,5,12Zm7-7a1,1,0,0,0,1-1V3a1,1,0,0,0-2,0V4A1,1,0,0,0,12,5ZM5.64,7.05a1,1,0,0,0,.7.29,1,1,0,0,0,.71-.29,1,1,0,0,0,0-1.41l-.71-.71A1,1,0,0,0,4.93,6.34Zm12,.29a1,1,0,0,0,.7-.29l.71-.71a1,1,0,1,0-1.41-1.41L17,5.64a1,1,0,0,0,0,1.41A1,1,0,0,0,17.66,7.34ZM21,11H20a1,1,0,0,0,0,2h1a1,1,0,0,0,0-2Zm-9,8a1,1,0,0,0-1,1v1a1,1,0,0,0,2,0V20A1,1,0,0,0,12,19ZM18.36,17A1,1,0,0,0,17,18.36l.71.71a1,1,0,0,0,1.41,0,1,1,0,0,0,0-1.41ZM12,6.5A5.5,5.5,0,1,0,17.5,12,5.51,5.51,0,0,0,12,6.5Zm0,9A3.5,3.5,0,1,1,15.5,12,3.5,3.5,0,0,1,12,15.5Z"
/>
</svg>
<svg
v-else-if="name === 'swap-off'"
class="swap-off fill-current"
:class="classes"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 22 22"
>
<path
d="M21.64,13a1,1,0,0,0-1.05-.14,8.05,8.05,0,0,1-3.37.73A8.15,8.15,0,0,1,9.08,5.49a8.59,8.59,0,0,1,.25-2A1,1,0,0,0,8,2.36,10.14,10.14,0,1,0,22,14.05,1,1,0,0,0,21.64,13Zm-9.5,6.69A8.14,8.14,0,0,1,7.08,5.22v.27A10.15,10.15,0,0,0,17.22,15.63a9.79,9.79,0,0,0,2.1-.22A8.11,8.11,0,0,1,12.14,19.73Z"
/>
</svg>
<svg
v-else-if="name === 'error'"
xmlns="http://www.w3.org/2000/svg"
class="stroke-current shrink-0 h-6 w-6"
fill="none"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
<svg
v-if="name === 'success'"
xmlns="http://www.w3.org/2000/svg"
class="stroke-current shrink-0 h-6 w-6"
fill="none"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
<svg
v-if="name === 'warning'"
xmlns="http://www.w3.org/2000/svg"
class="stroke-current shrink-0 h-6 w-6"
:class="classes"
fill="none"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
/>
</svg>
<svg
v-if="name === 'info'"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
class="stroke-current shrink-0 w-6 h-6"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
<svg
v-else-if="name === 'burger'"
xmlns="http://www.w3.org/2000/svg"
:class="classes"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h8m-8 6h16" />
</svg>
</template>
<script setup lang="ts">
defineProps({
name: {
type: String,
default: '',
},
classes: {
type: String,
default: '',
},
})
</script>

View File

@ -0,0 +1,159 @@
<template>
<div class="grid grid-cols-1 xs:grid-cols-2 border-4 rounded-md border-primary text-left shadow min-w-[320px] max-w-[960px] mt-5 xs:mt-0">
<div class="p-4 bg-base-100">
<span class="text-3xl">{{ sysStat.system.name }} {{ sysStat.system.version }}</span>
<span v-if="sysStat.system.kernel">
<br />
{{ sysStat.system.kernel }}
</span>
</div>
<div class="p-4 bg-base-100 flex items-center">
<span v-if="sysStat.system.ffp_version">
<strong>ffplayout:</strong>
v{{ sysStat.system.ffp_version }}
</span>
</div>
<div class="p-4 border border-primary">
<div class="text-xl">{{ t('system.cpu') }}</div>
<div class="grid grid-cols-2 gap-2">
<div>
<strong>{{ t('system.cores') }}:</strong> {{ sysStat.cpu.cores }}
</div>
<div>
<strong>{{ t('system.usage') }}:</strong> {{ sysStat.cpu.usage.toFixed(2) }}%
</div>
</div>
</div>
<div class="p-4 border border-primary">
<div class="text-xl">{{ t('system.load') }}</div>
<div class="grid grid-cols-3 gap-2">
<div>{{ sysStat.load.one }}</div>
<div>{{ sysStat.load.five }}</div>
<div>{{ sysStat.load.fifteen }}</div>
</div>
</div>
<div class="p-4 border border-primary">
<div class="text-xl">{{ t('system.memory') }}</div>
<div class="grid grid-cols-2 gap-2">
<div>
<strong>{{ t('system.total') }}:</strong> {{ fileSize(sysStat.memory.total) }}
</div>
<div>
<strong>{{ t('system.usage') }}:</strong> {{ fileSize(sysStat.memory.used) }}
</div>
</div>
</div>
<div class="p-4 border border-primary">
<div class="text-xl">{{ t('system.swap') }}</div>
<div class="grid grid-cols-2 gap-2">
<div>
<strong>{{ t('system.total') }}:</strong> {{ fileSize(sysStat.swap.total) }}
</div>
<div>
<strong>{{ t('system.usage') }}:</strong> {{ fileSize(sysStat.swap.used) }}
</div>
</div>
</div>
<div class="p-4 border border-primary">
<div class="text-xl">
{{ t('system.network') }} <span v-if="sysStat.network" class="fs-6">{{ sysStat.network?.name }}</span>
</div>
<div class="grid grid-cols-2 gap-2">
<div>
<strong>{{ t('system.in') }}:</strong> {{ fileSize(sysStat.network?.current_in) }}
</div>
<div>
<strong>{{ t('system.out') }}:</strong> {{ fileSize(sysStat.network?.current_out) }}
</div>
<div>{{ fileSize(sysStat.network?.total_in) }}</div>
<div>{{ fileSize(sysStat.network?.total_out) }}</div>
</div>
</div>
<div v-if="sysStat.storage?.path" class="p-4 border border-primary">
<div class="text-xl">{{ t('system.storage') }}</div>
<div v-if="sysStat.storage" class="grid grid-cols-2 gap-2">
<div v-if="sysStat.storage" class="col-span-2">
<strong>{{ t('system.device') }}:</strong> {{ sysStat.storage?.path }}
</div>
<div>
<strong>{{ t('system.size') }}:</strong> {{ fileSize(sysStat.storage?.total) }}
</div>
<div>
<strong>{{ t('system.used') }}:</strong> {{ fileSize(sysStat.storage?.used) }}
</div>
</div>
</div>
<div v-else class="col-6 bg-primary p-2 border" />
</div>
</template>
<script setup lang="ts">
const { fileSize } = stringFormatter()
const { t } = useI18n()
const authStore = useAuth()
const configStore = useConfig()
const indexStore = useIndex()
const streamUrl = ref(
`/data/event/${configStore.channels[configStore.id].id}?endpoint=system&uuid=${authStore.uuid}`
)
// 'http://127.0.0.1:8787/data/event/1?endpoint=system&uuid=f2f8c29b-712a-48c5-8919-b535d3a05a3a'
const { status, data, error, close } = useEventSource(streamUrl, [], {
autoReconnect: {
retries: -1,
delay: 1000,
onFailed() {
indexStore.sseConnected = false
},
},
})
const errorCounter = ref(0)
const defaultStat = {
cpu: { cores: 1, usage: 0.0 },
load: { one: 0.0, five: 0.0, fifteen: 0.0 },
memory: { total: 0.0, used: 0.0, free: 0.0 },
network: { name: '...', current_in: 0.0, current_out: 0.0, total_in: 0.0, total_out: 0.0 },
storage: { path: '', total: 0.0, used: 0.0 },
swap: { total: 0.0, used: 0.0, free: 0.0 },
system: { name: '...', kernel: '...', version: '...', ffp_version: '...' },
} as SystemStatistics
const sysStat = ref(defaultStat)
onBeforeUnmount(() => {
close()
indexStore.sseConnected = false
})
watch([status, error], async () => {
if (status.value === 'OPEN') {
indexStore.sseConnected = true
errorCounter.value = 0
} else {
indexStore.sseConnected = false
errorCounter.value += 1
sysStat.value = defaultStat
if (errorCounter.value > 15) {
await authStore.obtainUuid()
streamUrl.value = `/data/event/${configStore.channels[configStore.id].id}?endpoint=system&uuid=${
authStore.uuid
}`
errorCounter.value = 0
}
}
})
watch([data], () => {
if (data.value) {
try {
sysStat.value = JSON.parse(data.value)
} catch {
indexStore.sseConnected = true
}
}
})
</script>

View File

@ -0,0 +1,120 @@
<template>
<div id="timeField" class="input input-sm input-bordered flex px-3 py-0">
<div class="grow">
<input
ref="timeInput"
:value="secToTime(props.modelValue)"
type="text"
pattern="([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]{1,3})?"
class="w-full px-1 py-0"
@click="setCursorPos"
@change="$emit('update:modelValue', timeToSec($event))"
/>
</div>
<div class="w-auto">
<div class="flex flex-col text-xs py-[2px]">
<button
class="bg-base-300 hover:bg-base-300/50 px-1 text-[9px] h-[13px] rounded-t"
tabindex="0"
@click="countUp"
>
<i class="bi-chevron-up" />
</button>
<button class="bg-base-300 hover:bg-base-300/50 px-1 text-[9px] h-[13px] rounded-b" @click="countDown">
<i class="bi-chevron-down" />
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
const emit = defineEmits(['update:modelValue'])
const props = defineProps({
modelValue: {
type: Number,
required: true,
},
})
const timeInput = ref()
const cursorPos = ref(8)
function secToTime(sec: number) {
const hours = Math.floor(sec / 3600)
sec %= 3600
const minutes = Math.floor(sec / 60)
const seconds = Math.floor(sec % 60)
const ms = Math.round((sec - Math.floor(sec)) * 1000) / 1000
const secFmt = (seconds + ms).toFixed(3)
const m = String(minutes).padStart(2, '0')
const h = String(hours).padStart(2, '0')
const s = secFmt.padStart(6, '0')
return `${h}:${m}:${s}`
}
function timeToSec(event: any) {
const time = event.target?.value ?? 0
const [h, m, s] = time.split(':').map((val: string) => Number(val) || 0)
return h * 3600 + m * 60 + s
}
function setCursorPos() {
cursorPos.value = timeInput.value?.selectionStart
}
function countUp() {
let count = 0
if (cursorPos.value && cursorPos.value >= 6) {
count = 1
} else if (cursorPos.value && cursorPos.value >= 3) {
count = 60
} else {
count = 3600
}
emit('update:modelValue', props.modelValue + count)
nextTick(() => {
timeInput.value?.focus()
timeInput.value?.setSelectionRange(cursorPos.value, cursorPos.value)
})
}
function countDown() {
let sec = props.modelValue
let count = 0
if (cursorPos.value && cursorPos.value >= 6) {
count = 1
} else if (cursorPos.value && cursorPos.value >= 3) {
count = 60
} else {
count = 3600
}
sec -= count
if (sec < 0) {
emit('update:modelValue', 0)
} else {
emit('update:modelValue', sec)
}
nextTick(() => {
timeInput.value?.focus()
timeInput.value?.setSelectionRange(cursorPos.value, cursorPos.value)
})
}
</script>
<style scoped>
#timeField:has(> div > input:invalid) {
border: red solid 1px;
}
</style>

View File

@ -0,0 +1,77 @@
<template>
<div>
<div v-if="options.sources">
<video
:id="reference"
class="video-js vjs-default-skin vjs-big-play-centered vjs-16-9"
width="1024"
height="576"
/>
</div>
</div>
</template>
<script setup lang="ts">
import videojs from 'video.js'
import 'video.js/dist/video-js.css'
const configStore = useConfig()
const player = ref()
const props = defineProps({
options: {
type: Object,
required: true,
},
reference: {
type: String,
required: true,
},
})
onMounted(() => {
const volume = localStorage.getItem('volume')
player.value = videojs(props.reference, props.options, function onPlayerReady() {
// console.log('onPlayerReady', this);
})
if (volume !== null) {
player.value.volume(volume)
}
player.value.on('volumechange', () => {
localStorage.setItem('volume', player.value.volume())
})
player.value.on('error', () => {
setTimeout(() => {
configStore.showPlayer = false
nextTick(() => {
configStore.showPlayer = true
})
}, 2000)
})
})
onBeforeUnmount(() => {
if (player.value) {
player.value.dispose()
}
})
</script>
<style>
.video-js .vjs-volume-panel.vjs-volume-panel-horizontal {
width: 10em;
}
.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal {
width: 5em;
height: 3em;
margin-right: 0;
opacity: 1;
}
</style>

View File

@ -0,0 +1,254 @@
export const stringFormatter = () => {
function fileSize(bytes: number | undefined, dp = 2) {
if (!bytes) {
return 0.0
}
const thresh = 1024
if (Math.abs(bytes) < thresh) {
return bytes + ' B'
}
const units = ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']
let u = -1
const r = 10 ** dp
do {
bytes /= thresh
++u
} while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1)
return bytes.toFixed(dp) + ' ' + units[u]
}
function formatLog(text: string): string {
return text
.replace(/<yellow>(.*?)<\/>/g, '<span class="log-number">$1</span>')
.replace(/<b><magenta>(.*?)<\/><\/b>/g, '<span class="log-addr">$1</span>')
.replace(/<bright-blue>(.*?)<\/>/g, '<span class="log-cmd">$1</span>')
.replace(/\x1B\[90m(.*?)\x1B\[0m/g, '<span class="log-debug">$1</span>')
.replace(/(\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.[\d]+\])/g, '<span class="log-time">$1</span>')
.replace(/\[ INFO\]/g, '<span class="log-info">[ INFO]</span>')
.replace(/\[ WARN\]/g, '<span class="log-warning">[ WARN]</span>')
.replace(/\[ERROR\]/g, '<span class="log-error">[ERROR]</span>')
.replace(/\[DEBUG\]/g, '<span class="log-debug">[DEBUG]</span>')
.replace(/\[Decoder\]/g, '<span class="log-decoder">[Decoder]</span>')
.replace(/\[Encoder\]/g, '<span class="log-encoder">[Encoder]</span>')
.replace(/\[Server\]/g, '<span class="log-server">[Server]</span>')
.replace(/\[Validator\]/g, '<span class="log-server">[Validator]</span>')
}
function timeToSeconds(time: string) {
const t = time.split(':')
return parseInt(t[0]) * 3600 + parseInt(t[1]) * 60 + parseInt(t[2])
}
function secToHMS(sec: number) {
const sign = Math.sign(sec)
sec = Math.abs(sec)
const hours = Math.floor(sec / 3600)
sec %= 3600
const minutes = Math.floor(sec / 60)
const seconds = Math.round(sec % 60)
const m = String(minutes).padStart(2, '0')
const h = String(hours).padStart(2, '0')
const s = String(seconds).padStart(2, '0')
const hString = (sign === -1 ? '-' : '') + h
return `${hString}:${m}:${s}`
}
function numberToHex(num: number) {
return '0x' + Math.round(num * 255).toString(16)
}
function hexToNumber(num: string): number {
return parseFloat((parseFloat(parseInt(num, 16).toString()) / 255).toFixed(2))
}
function filename(path: string) {
if (path) {
const pathArr = path.split('/')
const name = pathArr[pathArr.length - 1]
if (name) {
return name
} else {
return path
}
} else {
return ''
}
}
function parent(path: string) {
if (path) {
const pathArr = path.split('/')
pathArr.pop()
if (pathArr.length > 0) {
return pathArr.join('/')
} else {
return '/'
}
} else {
return ''
}
}
function toMin(sec: number) {
if (sec) {
const minutes = Math.floor(sec / 60)
const seconds = Math.round(sec - minutes * 60)
return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')} min`
} else {
return ''
}
}
function secondsToTime(sec: number) {
return new Date(sec * 1000 || 0).toISOString().substring(11, 19)
}
function mediaType(path: string) {
const liveType = ['m3u8']
const videoType = [
'avi',
'flv',
'm2v',
'm4v',
'mkv',
'mov',
'mp4',
'mpeg',
'mpg',
'mts',
'mxf',
'ts',
'vob',
'ogv',
'webm',
'wmv',
]
const audioType = ['aac', 'aiff', 'flac', 'm4a', 'mp2', 'mp3', 'ogg', 'opus', 'wav', 'wma']
const imageType = [
'apng',
'avif',
'bmp',
'exr',
'gif',
'jpeg',
'jpg',
'png',
'psd',
'tga',
'tif',
'tiff',
'webp',
]
const ext = path.split('.').pop()
if (ext) {
if (liveType.includes(ext.toLowerCase())) {
return 'live'
} else if (videoType.includes(ext.toLowerCase())) {
return 'video'
} else if (audioType.includes(ext.toLowerCase())) {
return 'audio'
} else if (imageType.includes(ext.toLowerCase())) {
return 'image'
}
}
return null
}
return {
fileSize,
formatLog,
timeToSeconds,
secToHMS,
numberToHex,
hexToNumber,
filename,
parent,
toMin,
secondsToTime,
mediaType,
}
}
export const playlistOperations = () => {
function genUID() {
return String(Date.now().toString(32) + Math.random().toString(16)).replace(/\./g, '')
}
function processPlaylist(date: string, list: PlaylistItem[], forSave: boolean) {
const configStore = useConfig()
let begin = configStore.playout.playlist.startInSec
const newList = []
for (const item of list) {
if (configStore.playout.playlist.startInSec === begin) {
item.date = date
}
if (forSave) {
delete item.date
if (!item.audio) {
delete item.audio
}
if (!item.category) {
delete item.category
}
if (!item.custom_filter) {
delete item.custom_filter
}
if (!item.title) {
delete item.title
}
if (
begin + (item.out - item.in) >
configStore.playout.playlist.startInSec + configStore.playout.playlist.lengthInSec
) {
item.out =
configStore.playout.playlist.startInSec + configStore.playout.playlist.lengthInSec - begin
}
} else {
if (!item.uid) {
item.uid = genUID()
}
if (
begin >= configStore.playout.playlist.startInSec + configStore.playout.playlist.lengthInSec &&
!configStore.playout.playlist.infinit
) {
item.overtime = true
} else if (item.overtime) {
delete item.overtime
}
item.begin = begin
}
newList.push(item)
begin += item.out - item.in
}
return newList
}
return { processPlaylist, genUID }
}

View File

@ -0,0 +1,70 @@
export const useVariables = () => {
const multiSelectClasses = {
container: 'relative input input-bordered w-full flex items-center justify-end px-0 min-h-[32px]',
containerDisabled: 'cursor-default !bg-base-100',
containerOpen: 'rounded-b-none',
containerOpenTop: 'rounded-t-none',
containerActive: 'ring ring-green-500 ring-opacity-30',
wrapper: 'relative mx-auto w-full flex items-center justify-end box-border cursor-pointer outline-none',
singleLabel:
'flex items-center h-full max-w-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5 pr-16 box-border rtl:left-auto rtl:right-0 rtl:pl-0 rtl:pr-3.5',
singleLabelText: 'overflow-ellipsis overflow-hidden block whitespace-nowrap max-w-full',
multipleLabel:
'flex items-center h-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5 rtl:left-auto rtl:right-0 rtl:pl-0 rtl:pr-3.5',
search: 'w-full absolute inset-0 outline-none focus:ring-0 appearance-none box-border border-0 text-base font-sans bg-base-100 rounded pl-3.5 rtl:pl-0 rtl:pr-3.5',
tags: 'flex-grow flex-shrink flex flex-wrap items-center mt-0 pl-2 min-w-0 rtl:pl-0 rtl:pr-2',
tag: 'bg-base-300 h-6 text-base-content text-sm font-bold py-0.5 pl-2 rounded mr-1 my-0.5 flex items-center whitespace-nowrap min-w-0 rtl:pl-0 rtl:pr-2 rtl:mr-0 rtl:ml-1',
tagDisabled: 'pr-2 opacity-50 rtl:pl-2',
tagWrapper: 'whitespace-nowrap overflow-hidden overflow-ellipsis',
tagWrapperBreak: 'whitespace-normal break-all',
tagRemove: 'flex items-center justify-center p-1 mx-0.5 rounded-sm hover:bg-black hover:bg-opacity-10 group',
tagRemoveIcon:
'bg-multiselect-remove bg-center bg-no-repeat opacity-30 inline-block w-3 h-3 group-hover:opacity-60',
tagsSearchWrapper: 'inline-block relative mx-1 flex-grow flex-shrink h-[24px]',
tagsSearch:
'absolute inset-0 border-0 outline-none focus:ring-0 appearance-none p-0 text-base font-sans box-border w-full h-full',
tagsSearchCopy: 'invisible whitespace-pre-wrap inline-block h-px',
placeholder:
'flex items-center h-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5 text-gray-400 rtl:left-auto rtl:right-0 rtl:pl-0 rtl:pr-3.5',
caret: 'multiselect-caret bg-center bg-no-repeat w-2.5 h-4 py-px box-content mr-3.5 relative z-10 flex-shrink-0 flex-grow-0 transition-transform transform pointer-events-none rtl:mr-0 rtl:ml-3.5',
caretOpen: 'rotate-180 pointer-events-auto',
clear: 'pr-3.5 relative z-10 transition duration-300 flex-shrink-0 flex-grow-0 flex hover:opacity-80 rtl:pr-0 rtl:pl-3.5',
clearIcon: 'multiselect-clear-icon bg-center bg-no-repeat w-2.5 h-4 py-px box-content inline-block',
spinner:
'bg-multiselect-spinner bg-center bg-no-repeat w-4 h-4 z-10 mr-3.5 animate-spin flex-shrink-0 flex-grow-0 rtl:mr-0 rtl:ml-3.5',
infinite: 'flex items-center justify-center w-full',
infiniteSpinner:
'bg-multiselect-spinner bg-center bg-no-repeat w-4 h-4 z-10 animate-spin flex-shrink-0 flex-grow-0 m-3.5',
dropdown:
'max-h-60 absolute -left-px -right-px bottom-0 transform translate-y-full border border-gray-300 -mt-px overflow-y-scroll z-50 bg-base-100 flex flex-col rounded-b',
dropdownTop: '-translate-y-full top-px bottom-auto rounded-b-none rounded-t',
dropdownHidden: 'hidden',
options: 'flex flex-col p-0 m-0 list-none',
optionsTop: '',
group: 'p-0 m-0',
groupLabel:
'flex text-sm box-border items-center justify-start text-left py-1 px-3 font-bold bg-gray-200 cursor-default leading-normal',
groupLabelPointable: 'cursor-pointer',
groupLabelPointed: 'bg-gray-300 text-gray-700',
groupLabelSelected: 'bg-accent text-my-text',
groupLabelDisabled: 'bg-gray-100 text-gray-300 cursor-not-allowed',
groupLabelSelectedPointed: 'bg-accent text-my-text opacity-90',
groupLabelSelectedDisabled: 'text-green-100 bg-green-600 bg-opacity-50 cursor-not-allowed',
groupOptions: 'p-0 m-0',
option: 'flex items-center justify-start box-border text-left cursor-pointer text-base leading-snug py-2 px-3',
optionPointed: 'text-gray-800 bg-secondary',
optionSelected: 'text-my-text bg-accent',
optionDisabled: 'text-gray-300 cursor-not-allowed',
optionSelectedPointed: 'text-my-text bg-link-hover',
optionSelectedDisabled: 'text-green-100 bg-green-500 bg-opacity-50 cursor-not-allowed',
noOptions: 'py-2 px-3 text-gray-600 bg-base-100 text-left rtl:text-right',
noResults: 'py-2 px-3 text-gray-600 bg-base-100 text-left rtl:text-right',
fakeInput:
'bg-transparent absolute left-0 right-0 -bottom-px w-full h-px border-0 p-0 appearance-none outline-none text-transparent',
assist: 'absolute -m-px w-px h-px overflow-hidden',
spacer: 'h-6 py-px box-content',
}
return {
multiSelectClasses,
}
}

43
frontend/error.vue Normal file
View File

@ -0,0 +1,43 @@
<template>
<NuxtLayout>
<div class="w-full h-full flex justify-center items-center mt-20">
<div v-if="props.error?.statusCode === 404">
<h1 class="text-center text-6xl">404</h1>
<p class="text-center font-bold mt-6">
{{ $t('error.notFound') }}
</p>
</div>
<div v-else-if="props.error?.statusCode === 500">
<h1 class="text-center text-6xl">{{ props.error.statusCode }}</h1>
<p class="text-center font-bold mt-6">
{{ $t('error.serverError') }}
</p>
</div>
</div>
</NuxtLayout>
</template>
<script setup lang="ts">
import type { NuxtError } from '#app'
const localePath = useLocalePath()
const props = defineProps({
error: {
type: Object,
default: {} as NuxtError,
},
})
// onMounted(() => {
// const statusCode = props.error?.statusCode || 400
// if (statusCode >= 400) {
// setTimeout(() => {
// reloadNuxtApp({
// path: localePath({ name: 'index' }),
// ttl: 1000,
// })
// }, 3000)
// }
// })
</script>

View File

@ -0,0 +1,22 @@
import withNuxt from './frontend/.nuxt/eslint.config.mjs'
export default withNuxt(
// your custom flat configs go here, for example:
// {
// files: ['**/*.ts', '**/*.tsx'],
// rules: {
// 'no-console': 'off' // allow console.log in TypeScript files
// }
// },
// {
// ...
// }
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'no-control-regex': 'off',
'vue/html-self-closing': 'off',
'vue/no-v-html': 'off',
},
}
)

View File

@ -0,0 +1,44 @@
## Add Language
You are very welcome to add more languages! Just copy en-US.js to the correct target Country code and modify the content.
When you are done with the translation add the filename to [nuxt.config.ts](../nuxt.config.ts), in section:
```DIFF
i18n: {
locales: [
{
code: 'de',
name: 'Deutsch',
file: 'de-DE.js',
},
{
code: 'en',
name: 'English',
file: 'en-US.js',
},
+ {
+ code: '<SHORT CODE>',
+ name: '<NAME>',
+ file: '<CODE>.js',
+ },
],
...
```
And also add the new link paths:
```DIFF
i18n: {
locales: [...],
...
pages: {
'player': {
de: '/wiedergabe',
en: '/player',
+ <CODE>: /<PATH>,
},
...
```

View File

@ -0,0 +1,228 @@
export default {
ok: 'Ok',
cancel: 'Abbrechen',
socketConnected: 'Event Stream verbunden',
socketDisconnected: 'Event Stream nicht verbunden',
alert: {
wrongLogin: 'Falsche Anmeldedaten!',
},
button: {
login: 'Anmelden',
home: 'Start',
player: 'Wiedergabe',
media: 'Medien',
message: 'Nachrichten',
logging: 'Protokollierung',
channels: 'Kanäle',
configure: 'Einstellungen',
logout: 'Abmelden',
},
error: {
notFound: 'Seite nicht gefunden',
serverError: 'Interner Server Fehler',
},
input: {
username: 'Benutzername',
password: 'Passwort',
},
system: {
cpu: 'CPU',
cores: 'Kerne',
load: 'Auslastung',
memory: 'Arbeitsspeicher',
swap: 'Auslagerungsspeicher',
total: 'Gesamt',
usage: 'Verwendung',
network: 'Netzwerk',
in: 'Eingehend',
out: 'Ausgehend',
storage: 'Speicher',
device: 'Gerät',
size: 'Größe',
used: 'Genutzt',
},
control: {
noClip: 'Es wird kein Clip abgespielt',
ingest: 'Live-Übertragung',
start: 'Playout-Dienst starten',
last: 'Zum letzten Clip springen',
stop: 'Playout-Dienst stoppen',
reset: 'Playout-Zustand zurücksetzen',
restart: 'Playout-Dienst neu starten',
next: 'Zum nächsten Clip springen',
},
player: {
start: 'Start',
file: 'Datei',
play: 'Abspielen',
title: 'Titel',
duration: 'Dauer',
in: 'Eingang',
out: 'Ausgang',
ad: 'Werbung',
edit: 'Bearbeiten',
delete: 'Löschen',
copy: 'Wiedergabeliste kopieren',
loop: 'Clips in {date} Wiedergabeliste wiederholen',
remote: 'Externe Quelle zur Wiedergabeliste hinzufügen',
import: 'Text-/m3u-Datei importieren',
generate: 'Einfacher und erweiterter Wiedergabelisten-Generator',
reset: 'Wiedergabeliste zurücksetzen',
save: 'Wiedergabeliste speichern',
deletePlaylist: 'Wiedergabeliste löschen',
unsavedProgram: 'Es existiert Programm das nicht gespeichert ist!',
copyTo: 'Kopiere aktuelles Programm nach',
addEdit: 'Quelle hinzufügen/bearbeiten',
audio: 'Audio',
customFilter: 'Benutzerdefinierter Filter',
deleteFrom: 'Programm löschen von',
deleteSuccess: 'Wiedergabeliste gelöscht...',
generateProgram: 'Programm generieren',
simple: 'Einfach',
advanced: 'Erweitert',
sorted: 'Sortiert',
shuffle: 'Zufall',
shift: 'Zeitverschiebung',
all: 'Alle',
addBlock: 'Zeitblock hinzufügen',
infinitInfo: 'Die Wiedergabe läuft im unendlichen Modus. Es sind keine zeitbasierten Informationen möglich.',
generateDone: 'Wiedergabeliste generieren erledigt...',
dateYesterday: 'Aktuelle Uhrzeit liegt vor der Playlist-Startzeit!',
},
media: {
notExists: 'Speicher existiert nicht!',
create: 'Ordner erstellen',
upload: 'Dateien hochladen',
deleteTitle: 'Datei/Ordner löschen',
deleteQuestion: 'Sind Sie sicher, dass Sie löschen möchten',
preview: 'Vorschau',
rename: 'Datei umbenennen',
newFile: 'Neuer Dateiname',
createFolder: 'Ordner erstellen',
foldername: 'Ordnername',
current: 'Aktuell',
overall: 'Insgesamt',
uploading: 'Hochladen',
moveError: 'Fehler beim Verschieben',
deleteError: 'Löschfehler',
folderExists: 'Ordner existiert bereits',
folderCreate: 'Ordner erstellen abgeschlossen...',
folderError: 'Fehler beim Erstellen des Ordners',
uploadError: 'Fehler beim Hochladen',
fileExists: 'Datei existiert bereits!',
},
message: {
savePreset: 'Voreinstellung speichern',
newPreset: 'Neue Voreinstellung',
delPreset: 'Voreinstellung löschen',
delText: 'Sind Sie sicher, dass Sie die Voreinstellung löschen möchten',
placeholder: 'Nachricht',
xAxis: 'X-Achse',
yAxis: 'Y-Achse',
showBox: 'Box anzeigen',
boxColor: 'Boxfarbe',
boxAlpha: 'Box-Transparenz',
size: 'Größe',
spacing: 'Abstand',
overallAlpha: 'Gesamttransparenz',
fontColor: 'Schriftfarbe',
fontAlpha: 'Schrifttransparenz',
borderWidth: 'Rahmenbreite',
send: 'Senden',
name: 'Name',
saveDone: 'Voreinstellung gespeichert!',
saveFailed: 'Voreinstellung speichern fehlgeschlagen!',
sendDone: 'Erfolgreich gesendet...',
sendFailed: 'Senden fehlgeschlagen...',
},
log: {
download: 'Protokoll herunterladen',
},
advanced: {
title: 'Advanced Configuration',
decoder: 'Decoder',
encoder: 'Encoder',
filter: 'Filter',
ingest: 'Ingest',
updateSuccess: 'Update advanced config success!',
updateFailed: 'Update advanced config failed!',
warning: 'Warning! These settings are experimental and only intended for advanced users who are familiar with ffmpeg. Only change the settings here if you are sure of what you are doing! The settings can make the system unstable.',
},
config: {
channel: 'Kanal',
user: 'Benutzer',
channelConf: 'Kanal-Konfiguration',
addChannel: 'Neuen Kanal hinzufügen',
name: 'Name',
previewUrl: 'Vorschau-URL',
extensions: 'Zusätzliche Erweiterungen',
save: 'Speichern',
delete: 'Löschen',
updateChannelSuccess: 'Kanal-Konfiguration erfolgreich aktualisiert!',
updateChannelFailed: 'Fehler beim Aktualisieren der Kanal-Konfiguration!',
errorChannelDelete: 'Der erste Kanal kann nicht gelöscht werden!',
deleteChannelSuccess: 'Kanal-Konfiguration erfolgreich gelöscht!',
deleteChannelFailed: 'Fehler beim Löschen der Kanal-Konfiguration!',
playoutConf: 'Playout-Konfiguration',
general: 'Allgemein',
rpcServer: 'RPC Server',
mail: 'EMail',
logging: 'Protokollierung',
processing: 'Verarbeitung',
ingest: 'Live-Eingang',
playlist: 'Wiedergabeliste',
storage: 'Speicher',
text: 'Text',
task: 'Aufgabe',
output: 'Ausgabe',
placeholderPass: 'Passwort',
help: 'Hilfe',
generalText: `Manchmal kann es vorkommen, dass eine Datei beschädigt, aber noch abspielbar ist, was einen Streaming-Fehler bei allen folgenden Dateien verursachen kann. Die einzige Möglichkeit, dies zu beheben, besteht darin, ffplayout anzuhalten und neu zu starten. Wir sagen hier nur, wann es gestoppt werden muss, der Startvorgang ist Ihnen überlassen. Der beste Weg ist ein systemd-Dienst unter Linux.
'stop_threshold' wird ffplayout stoppen, wenn es zeitlich über diesem Wert liegt. Eine Zahl kleiner als 3 kann zu unerwarteten Fehlern führen.`,
rpcText:
'Führe einen JSON-RPC-Server aus, um Informationen über die Wiedergabe und einige Kontrollfunktionen zu erhalten.',
mailText: `Senden Sie Fehlermeldungen an die E-Mail-Adresse, z. B. fehlende Playlist, ungültiges json-Format, fehlender Clip-Pfad. Lassen Sie den Empfänger leer, wenn Sie keine Benachrichtigung benötigen. 'mail_level' kann INFO, WARNING oder ERROR sein. 'interval' bedeutet Sekunden, bis eine neue E-Mail gesendet wird.`,
logText: `Wenn 'log_to_file' true ist, wird in eine Datei protokolliert, wenn false, in die Konsole. 'local_time' auf false setzt die Log-Zeitstempel auf UTC. Pfad zu /var/log/ nur, wenn Sie dies als Daemon ausführen.
'level' kann DEBUG, INFO, WARNING, ERROR sein. 'ffmpeg_level' kann INFO, WARNING, ERROR sein. 'detect_silence' protokolliert eine Fehlermeldung, wenn die Audiospur während des Validierungsprozesses 15 Sekunden lang still ist.`,
processingText: `Standardverarbeitung für alle Clips, um sie einheitlich zu machen. Modus kann "playlist" oder "folder" sein. 'aspect' muss eine Fließkommazahl sein. 'logo' wird nur verwendet, wenn der Pfad existiert.
'logo_scale' skaliert das Logo auf die Zielgröße, leer lassen, wenn keine Skalierung erforderlich ist, Format ist 'width:height', zum Beispiel '100:-1' für proportionale Skalierung. Mit 'logo_opacity' können Sie das Logo transparent machen.
Mit 'audio_tracks' kann man einstellen, wie viele Audiospuren verarbeitet werden sollen. 'audio_channels' kann verwendet werden, wenn das Audio mehr Kanäle als nur Stereo hat. Mit 'logo_position' im Format 'x:y' wird die Position des Logos festgelegt. Mit 'custom_filter' ist es möglich, zusätzliche Filter anzuwenden. Die Filterausgänge sollten mit [c_v_out] für Videofilter und [c_a_out] für Audiofilter enden.`,
ingestText: `Startet einen Server für einen Live-Eingangsstream. Dieser Stream hat Vorrang vor dem normalen Streaming, bis er fertig ist. Es gibt nur einen sehr einfachen Authentifizierungsmechanismus, um zu prüfen, ob der Streamname korrekt ist. 'custom_filter' kann auf die gleiche Weise wie im Abschnitt Verarbeitung verwendet werden.`,
playlistText: `'path' kann ein Pfad zu einer einzelnen Datei oder einem Verzeichnis sein. Bei Verzeichnissen geben Sie nur das Stammverzeichnis an, z. B. '/playlists', Unterverzeichnisse werden vom Program gelesen. Unterverzeichnisse benötigen diese Struktur '/playlists/2018/01'.
'day_start' ist die Uhrzeit, zu der die Wiedergabeliste beginnen soll; lassen Sie 'day_start' leer, wenn die Wiedergabeliste immer am Anfang beginnen soll. 'length' steht für die Ziellänge der Wiedergabeliste; wenn leer, wird die tatsächliche Länge nicht berücksichtigt. 'infinit: true' arbeitet mit einer einzelnen Wiedergabelistendatei und spielt diese in einer Endlosschleife.`,
storageText: `Spielt geordnete oder zufällige Dateien aus dem Pfad ab. 'filler_clip' ist zum Füllen des Endes, um 24 Stunden zu erreichen, es wird eine Schleife abgespielt, wenn nötig. Setzen Sie 'extensions', um nur nach Dateien mit dieser Erweiterung zu suchen. Setzen Sie 'shuffle' auf 'true', um Dateien zufällig auszuwählen.`,
textText: `Überlagernder Text in Kombination mit libzmq für die Remote-Textmanipulation. Unter Windows muss der Pfad der Schriftartdatei 'C\\:/WINDOWS/fonts/DejaVuSans.ttf' sein. 'text_from_filename' aktiviert die Textextraktion aus einem Dateinamen. Mit 'style' können Sie die Zeichentext-Parameter wie Position, Farbe, etc. festlegen. Post Text via API wird dies überschreiben. Mit 'regex' können Sie den Dateinamen formatieren, um einen Titel zu erhalten.`,
taskText: `Führt ein externes Programm mit einem bestimmten Medienobjekt aus. Das Medienobjekt liegt im json-Format vor und enthält alle Informationen über den aktuellen Clip. Das externe Programm kann ein Skript oder eine Binärdatei sein. oder eine Binärdatei, sollte aber nur für kurze Zeit laufen.`,
outputText: `Die endgültige Playout-Kompression. Passen Sie die Einstellungen entsprechend Ihren Bedürfnissen an. 'mode' hat die Optionen 'desktop', 'hls', 'null', 'stream'. Verwenden Sie 'stream' und passen Sie die 'output_param:'-Einstellungen an, wenn Sie zu einem rtmp/rtsp/srt/... Server streamen wollen. In der Produktion sollten Sie die hls-Wiedergabeliste nicht mit ffpapi ausliefern, sondern nginx oder einen anderen Webserver verwenden!`,
restartTile: 'Playout neustarten',
restartText: 'ffplayout neustarten um Einstellungen anzuwenden?',
updatePlayoutSuccess: 'Update der Playout-Konfiguration erfolgreich!',
updatePlayoutFailed: 'Update playout config fehlgeschlagen!',
forbiddenPlaylistPath: 'Zugriff untersagt: Playlist-Ordner kann nicht geöffnet werden.',
noPlayoutConfig: 'Keine Playout-Konfiguration gefunden!',
hlsPath: 'HLS-Pfad',
playlistPath: 'Wiedergabelistenpfad',
storagePath: 'Speicherpfad',
sharedStorage: 'Gemeinsamer Speicher ist aktiviert, verwende denselben Speicherstamm für alle Kanäle!',
},
user: {
title: 'Benutzer-Konfiguration',
add: 'Benutzer hinzufügen',
delete: 'Löschen',
name: 'Benutzername',
mail: 'E-Mail',
password: 'Passwort',
newPass: 'Neues Passwort',
confirmPass: 'Passwort bestätigen',
save: 'Speichern',
admin: 'Administrator',
deleteNotPossible: 'Löschen des aktuellen Benutzers nicht möglich!',
deleteSuccess: 'Benutzer erfolgreich gelöscht!',
deleteError: 'Fehler beim Löschen des Benutzers',
addSuccess: 'Benutzer erfolgreich hinzugefügt!',
addFailed: 'Fehler beim Hinzufügen des Benutzers!',
mismatch: 'Passwort stimmt nicht überein!',
updateSuccess: 'Benutzerprofil erfolgreich aktualisiert!',
updateFailed: 'Fehler beim Aktualisieren des Benutzerprofils!',
},
}

View File

@ -0,0 +1,227 @@
export default {
ok: 'Ok',
cancel: 'Cancel',
socketConnected: 'Event stream connected',
socketDisconnected: 'Event stream disconnected',
alert: {
wrongLogin: 'Incorrect login data!',
},
button: {
login: 'Login',
home: 'Home',
player: 'Player',
media: 'Media',
message: 'Message',
logging: 'Logging',
channels: 'Channels',
configure: 'Configure',
logout: 'Logout',
},
error: {
notFound: 'Page not found',
serverError: 'Internal server error',
},
input: {
username: 'Username',
password: 'Password',
},
system: {
cpu: 'CPU',
cores: 'Cores',
load: 'Load',
memory: 'Memory',
swap: 'Swap',
total: 'Total',
usage: 'Usage',
network: 'Network',
in: 'In',
out: 'Out',
storage: 'Storage',
device: 'Device',
size: 'Size',
used: 'Used',
},
control: {
noClip: 'No clip is playing',
ingest: 'Live Ingest',
start: 'Start Playout Service',
last: 'Jump to last Clip',
stop: 'Stop Playout Service',
reset: 'Reset Playout State',
restart: 'Restart Playout Service',
next: 'Jump to next Clip',
},
player: {
start: 'Start',
file: 'File',
play: 'Play',
title: 'Title',
duration: 'Duration',
in: 'In',
out: 'Out',
ad: 'Ad',
edit: 'Edit',
delete: 'Delete',
copy: 'Copy Playlist',
loop: 'Loop Clips in Playlist',
remote: 'Add (remote) Source to Playlist',
import: 'Import text/m3u file',
generate: 'Simple and advanced playlist generator',
reset: 'Reset Playlist',
save: 'Save Playlist',
deletePlaylist: 'Delete Playlist',
unsavedProgram: 'There is a program that is not saved!',
copyTo: 'Copy current Program to',
addEdit: 'Add/Edit Source',
audio: 'Audio',
customFilter: 'Custom Filter',
deleteFrom: 'Delete program from',
deleteSuccess: 'Playlist deleted...',
generateProgram: 'Generate Program',
simple: 'Simple',
advanced: 'Advanced',
sorted: 'Sorted',
shuffle: 'Shuffle',
shift: 'Shift',
all: 'All',
addBlock: 'Add time block',
infinitInfo: 'Playout runs in infinite mode. No time based information is possible.',
generateDone: 'Generate Playlist done...',
dateYesterday: 'Current time is before the playlist start time!',
},
media: {
notExists: 'Storage not exist!',
create: 'Create Folder',
upload: 'Upload Files',
deleteTitle: 'Delete File/Folder',
deleteQuestion: 'Are you sure that you want to delete',
preview: 'Preview',
rename: 'Rename File',
newFile: 'New filename',
createFolder: 'Create Folder',
foldername: 'Foldername',
current: 'Current',
overall: 'Overall',
uploading: 'Uploading',
moveError: 'Move error',
deleteError: 'Delete error',
folderExists: 'Folder exists already',
folderCreate: 'Folder create done...',
folderError: 'Folder create error',
uploadError: 'Upload error',
fileExists: 'File exists already!',
},
message: {
savePreset: 'Save Preset',
newPreset: 'New Preset',
delPreset: 'Delete Preset',
delText: 'Are you sure that you want to delete preset',
placeholder: 'Message',
xAxis: 'X Axis',
yAxis: 'Y Axis',
showBox: 'Show Box',
boxColor: 'Box Color',
boxAlpha: 'Box Alpha',
size: 'Size',
spacing: 'Spacing',
overallAlpha: 'Overall Alpha',
fontColor: 'Font Color',
fontAlpha: 'Font Alpha',
borderWidth: 'Border Width',
send: 'Send',
name: 'Name',
saveDone: 'Save Preset done!',
saveFailed: 'Save Preset failed!',
sendDone: 'Sending success...',
sendFailed: 'Sending failed...',
},
log: {
download: 'Download log file',
},
advanced: {
title: 'Advanced Configuration',
decoder: 'Decoder',
encoder: 'Encoder',
filter: 'Filter',
ingest: 'Ingest',
updateSuccess: 'Update advanced config success!',
updateFailed: 'Update advanced config failed!',
warning: 'Warning! These settings are experimental and only intended for advanced users who are familiar with ffmpeg. Only change the settings here if you are sure of what you are doing! The settings can make the system unstable.',
},
config: {
channel: 'Channel',
user: 'User',
channelConf: 'Channel Configuration',
addChannel: 'Add new Channel',
name: 'Name',
previewUrl: 'Preview URL',
extensions: 'Extra Extensions',
save: 'Save',
delete: 'Delete',
updateChannelSuccess: 'Update channel config success!',
updateChannelFailed: 'Update channel config failed!',
errorChannelDelete: 'First channel can not be deleted!',
deleteChannelSuccess: 'Delete channel config success!',
deleteChannelFailed: 'Delete channel config failed!',
playoutConf: 'Playout Configuration',
general: 'General',
rpcServer: 'RPC Server',
mail: 'Email',
logging: 'Logging',
processing: 'Processing',
ingest: 'Ingest',
playlist: 'Playlist',
storage: 'Storage',
text: 'Text',
task: 'Task',
output: 'Output',
placeholderPass: 'Password',
help: 'Help',
generalText: `Sometimes it can happen that a file is corrupted but still playable, this can cause a streaming error on all following files. The only way to fix this is to stop and restart ffplayout. Here we only say when to stop, the starting process is up to you. The best way is a systemd service on Linux.
'stop_threshold' will stop ffplayout if it is async in time above this value. A number less than 3 may cause unexpected errors.`,
rpcText: 'Run a JSON RPC server to get information about what is playing and for some control functions.',
mailText: `Send error messages to the email address, such as missing playlist; invalid json format; missing clip path. Leave the recipient blank if you don't need it. 'mail_level' can be INFO, WARNING or ERROR. 'interval' means seconds until a new mail is sent.`,
logText: `If 'log_to_file' is true, log to file, if false, log to console. 'local_time' to false will set log timestamps to UTC. Path to /var/log/ only if you are running this as a daemon.
'level' can be DEBUG, INFO, WARNING, ERROR. 'ffmpeg_level' can be INFO, WARNING, ERROR. 'detect_silence' logs an error message if the audio line is silent for 15 seconds during the validation process.`,
processingText: `Default processing for all clips to make them unique. Mode can be Playlist or Folder. 'aspect' must be a float number. 'logo' is only used if the path exists.
'logo_scale' scales the logo to the target size, leave empty if no scaling is needed, format is 'width:height', for example '100:-1' for proportional scaling. With 'logo_opacity' you can make the logo transparent.
With 'audio_tracks' it is possible to configure how many audio tracks should be processed. 'audio_channels' can be used if the audio has more channels than just stereo. With 'logo_position' in 'x:y' format you set the logo position. With 'custom_filter' it is possible to apply additional filters. The filter outputs should end with [c_v_out] for video filters and [c_a_out] for audio filters.`,
ingestText: `Run a server for an ingest stream. This stream will override the normal streaming until it is done. There is only a very simple authentication mechanism to check if the stream name is correct. 'custom_filter' can be used in the same way as in the process section.`,
playlistText: `'path' can be a path to a single file or a directory. For directory specify only the root folder, for example '/playlists', subdirectories will be read by the program. Subdirectories need this structure '/playlists/2018/01'.
'day_start' is the time at which the playlist should start, leave 'day_start' empty if the playlist should always start at the beginning. 'length' represents the target length of the playlist, if empty, real length will not be considered. 'infinit: true' works with single playlist file and loops it infinitely.`,
storageText: `Play ordered or random files from path. 'filler_clip' is for filling the end to reach 24 hours, it will loop when necessary. Set 'extensions' to search only for files with that extension. Set 'shuffle' to 'true' to select files randomly.`,
textText: `Overlay text in combination with libzmq for remote text manipulation. On Windows, the font file path must be 'C\\:/WINDOWS/fonts/DejaVuSans.ttf'. 'text_from_filename' activates text extraction from a filename. With 'style' you can set the drawtext parameters like position, color, etc. Post Text via API will override this. With 'regex' you can format the filename to get a title.`,
taskText: `Run an external program with a given media object. The media object is in json format and contains all the information about the current clip. The external program can be a script or a binary. or a binary, but should only run for a short time.`,
outputText: `The final playout compression. Adjust the settings according to your needs. 'mode' has the options 'desktop', 'hls', 'null', 'stream'. Use 'stream' and adjust the 'output_param:' settings if you want to stream to an rtmp/rtsp/srt/... server. In production don't serve hls playlist with ffpapi, use nginx or another web server!`,
restartTile: 'Restart Playout',
restartText: 'Restart ffplayout to apply changes?',
updatePlayoutSuccess: 'Update playout config success!',
updatePlayoutFailed: 'Update playout config failed!',
forbiddenPlaylistPath: 'Access forbidden: Playlist folder cannot be opened.',
noPlayoutConfig: 'No playout config found!',
hlsPath: 'HLS Path',
playlistPath: 'Playlist Path',
storagePath: 'Storage Path',
sharedStorage: 'Shared storage is enabled, use the same storage root for all channels!',
},
user: {
title: 'User Configuration',
add: 'Add User',
delete: 'Delete',
name: 'Username',
mail: 'Email',
password: 'Password',
newPass: 'New Password',
confirmPass: 'Confirm Password',
save: 'Save',
admin: 'Admin',
deleteNotPossible: 'Delete current user not possible!',
deleteSuccess: 'Delete user done!',
deleteError: 'Delete user error',
addSuccess: 'Add user success!',
addFailed: 'Add user failed!',
mismatch: 'Password mismatch!',
updateSuccess: 'Update user profile success!',
updateFailed: 'Update user profile failed!',
},
}

View File

@ -0,0 +1,227 @@
export default {
ok: 'Ok',
cancel: 'Cancelar',
socketConnected: 'Aviso! stream conectada.',
socketDisconnected: 'Aviso! stream desconectado.',
alert: {
wrongLogin: 'Dados incorretos!',
},
button: {
login: 'Logar',
home: 'Início',
player: 'Player',
media: 'Armazenamento',
message: 'Legenda',
logging: 'Registro',
channels: 'Canais',
configure: 'Configurar',
logout: 'Sair',
},
error: {
notFound: 'Página não encontrada',
serverError: 'Erro do servidor interno',
},
input: {
username: 'Usuário',
password: 'Senha',
},
system: {
cpu: 'CPU',
cores: 'Núcleos',
load: 'Carga de CPU',
memory: 'Memória',
swap: 'Swap',
total: 'Total',
usage: 'Uso',
network: 'Rede',
in: 'Entrada',
out: 'Saída',
storage: 'Armazenamento',
device: 'Dispositivo',
size: 'Tamanho total',
used: 'Disponível',
},
control: {
noClip: 'Nenhum clipe está sendo reproduzido',
ingest: 'Ingestão ao Vivo',
start: 'Iniciar Serviço do Playout',
last: 'Ir para o último Clipe',
stop: 'Parar Serviço do Playout',
reset: 'Redefinir Estado do Playout',
restart: 'Reiniciar Serviço do Playout',
next: 'Ir para o próximo Clipe',
},
player: {
start: 'Horário',
file: 'Arquivo',
play: 'Play',
title: 'Título',
duration: 'Duração',
in: 'Início',
out: 'Fim',
ad: 'Ad',
edit: 'Editar',
delete: 'Deletar',
copy: 'Copiar playlist',
loop: 'Repetir Clipes na Playlist',
remote: 'Adicionar fonte (remota) à Playlist',
import: 'Importar arquivo de texto/.m3u8',
generate: 'Gerador de Playlist simples e avançado',
reset: 'Resetar Playlist',
save: 'Salvar Playlist',
deletePlaylist: 'Deletar Playlist',
unsavedProgram: 'Existe uma Programação que não está salva!',
copyTo: 'Copiar Programação atual para',
addEdit: 'Adicionar/Editar Fonte',
audio: 'Áudio',
customFilter: 'Filtro Personalizado',
deleteFrom: 'Excluir programação de',
deleteSuccess: 'Lista de reprodução excluída...',
generateProgram: 'Gerar Programação',
simple: 'Simples',
advanced: 'Avançado',
sorted: 'Ordenado',
shuffle: 'Aleatório',
shift: 'Diferença horária',
all: 'Todos',
addBlock: 'Adicionar bloco de tempo',
infinitInfo: 'O playout é executado no modo infinito. Nenhuma informação baseada em tempo é possível',
generateDone: 'Gerar lista de reprodução concluída...',
dateYesterday: 'A hora atual é anterior à hora de início da lista de reprodução!',
},
media: {
notExists: 'O armazenamento não existe!',
create: 'Criar Pasta',
upload: 'Enviar Arquivos',
deleteTitle: 'Deletar Arquivo/Pasta',
deleteQuestion: 'Tem certeza que deseja deletar?',
preview: 'Visualizar',
rename: 'Renomear Arquivo',
newFile: 'Novo nome de arquivo',
createFolder: 'Criar Pasta',
foldername: 'Nome da Pasta',
current: 'Atual',
overall: 'Total',
uploading: 'Enviando',
moveError: 'Erro ao mover',
deleteError: 'Erro ao deletar!',
folderExists: 'A pasta já existe',
folderCreate: 'Criação da pasta concluída...',
folderError: 'Erro ao criar pasta',
uploadError: 'Erro ao carregar',
fileExists: 'O arquivo já existe!',
},
message: {
savePreset: 'Salvar predefinição',
newPreset: 'Nova predefinição',
delPreset: 'Excluir predefinição',
delText: 'Tem certeza de que deseja excluir a predefinição?',
placeholder: 'Mensagem',
xAxis: 'Eixo X',
yAxis: 'Eixo Y',
showBox: 'Mostrar caixa',
boxColor: 'Cor da caixa',
boxAlpha: 'Caixa Alfa',
size: 'Tamanho',
spacing: 'Espaçamento',
overallAlpha: 'Alfa geral',
fontColor: 'Cor da fonte',
fontAlpha: 'Fonte Alfa',
borderWidth: 'Largura da borda',
send: 'Enviar',
name: 'Nome',
saveDone: 'Salvar predefinição concluída!',
saveFailed: 'Falha ao salvar a predefinição!',
sendDone: 'Enviando com sucesso...',
sendFailed: 'O envio falhou...',
},
log: {
download: 'Baixar arquivo de registro',
},
advanced: {
title: 'Configurações avançadas',
decoder: 'Decoder',
encoder: 'Encoder',
filter: 'Filter',
ingest: 'Ingest',
updateSuccess: 'Configurações avançadas salva!',
updateFailed: 'Configurações avançadas foi falhado!',
warning: 'Aviso! Essas configurações são experimentais e destinadas apenas a usuários avançados familiarizados com o ffmpeg. Altere as configurações aqui apenas se tiver certeza do que está fazendo! As configurações podem tornar o sistema instável.',
},
config: {
channel: 'Canal',
user: 'Usuário',
channelConf: 'Configuração do Canal',
addChannel: 'Adicionar novo Canal',
name: 'Nome',
previewUrl: 'URL de Visualização',
extensions: 'Extensões Extras',
save: 'Salvar',
delete: 'Deletar',
updateChannelSuccess: 'Atualização da configuração do canal bem-sucedida!',
updateChannelFailed: 'Falha na atualização da configuração do canal!',
errorChannelDelete: 'O primeiro canal não pode ser deletado!',
deleteChannelSuccess: 'Exclusão da configuração da canal bem-sucedida!',
deleteChannelFailed: 'Falha na exclusão da configuração da canal!',
playoutConf: 'Configuração de Playout',
general: 'Geral',
rpcServer: 'RPC Server',
mail: 'Email',
logging: 'Registro',
processing: 'Processamento',
ingest: 'Ingestão',
playlist: 'Playlist',
storage: 'Armazenamento',
text: 'Texto',
task: 'Tarefa',
output: 'Saída',
placeholderPass: 'Senha',
help: 'Ajuda',
generalText: `Às vezes pode acontecer que um arquivo esteja corrompido mas ainda assim ele pode ser reproduzido, isso pode causar um erro de transmissão em todos os arquivos seguintes. A única maneira de corrigir isso é parar e reiniciar o ffplayout. Aqui só dizemos quando parar, o processo de início é por sua conta. A melhor maneira é um serviço systemd no Linux.
'stop_threshold' vai parar o ffplayout se estiver assíncrono em um tempo acima deste valor. Um número menor que 3 pode causar erros inesperados.`,
rpcText: 'Execute um servidor JSON RPC para obter informações sobre o que está sendo reproduzido e para algumas funções de controle.',
mailText: `Envie mensagens de erro para o endereço de email, como lista de reprodução faltando; formato JSON inválido; caminho do clipe ausente. Deixe o destinatário em branco se não for necessário. 'mail_level' pode ser INFO, WARNING ou ERROR. 'interval' é o tempo em segundos até que um novo e-mail seja enviado.`,
logText: `Se 'log_to_file' estiver ativado (true), o registro de log será salvo em um arquivo de texto, e se desativado (false), registrará o log no console. Se 'local_time' estiver desativado (false) o sistema definirá os carimbos de data/hora do registro para UTC. Defina o caminho para /var/log/ apenas se você estiver executando o programa como daemon.
'level' pode ser DEBUG, INFO, WARNING, ERROR. 'ffmpeg_level' pode ser INFO, WARNING, ERROR. 'detect_silence' registra uma mensagem de erro se a linha de áudio ficar silenciosa por 15 segundos durante o processo de validação.`,
processingText: `Processamento padrão para todos os clipes para torná-los únicos. O modo ('mode') pode ser Playlist ou Folder. 'aspect' deve ser um número de ponto flutuante. 'logo' é usado apenas se o caminho existir.
'logo_scale' dimensiona o logo para o tamanho desejado, deixe esse campo de configuração vazio se nenhum dimensionamento for necessário, o formato é 'largura:altura', por exemplo '100:-1' para dimensionamento proporcional. Com 'logo_opacity' você pode tornar o logo transparente.
Com 'audio_tracks' é possível configurar quantas faixas de áudio devem ser processadas. 'audio_channels' pode ser usado se o áudio tiver mais canais do que apenas estéreo. Com 'logo_position' no formato 'x:y' você define a posição do logo. Com 'custom_filter' é possível aplicar filtros adicionais. As saídas do filtro devem terminar com [c_v_out] para filtros de vídeo e [c_a_out] para filtros de áudio.`,
ingestText: `Execute um servidor de ingestão para poder receber um fluxo de stream a partir de uma fonte externa, como por exemplo um software de streaming como o OBS Studio. Este stream substituirá o streaming normal até que seja concluído. Existe apenas um mecanismo de autenticação muito simples para verificar se o nome do stream está correto. 'custom_filter' pode ser usado da mesma forma que na seção de processo.`,
playlistText: `'path' é o caminho para o arquivo de playlist. 'path' pode ser um caminho para um único arquivo ou um diretório. Se um diretório for especificado, defina apenas a pasta raiz desse diretório, por exemplo '/playlists', subdiretórios serão lidos pelo programa. Subdiretórios precisam seguir a seguinte estrutura de diretórios: '/playlists/2018/01'.
'day_start' é o horário fixo, inicial, em que a playlist será reproduzida, deixe 'day_start' vazio se a lista de reprodução sempre deve começar do início. 'length' representa a duração desejada da playlist, se vazio, a duração real não será considerada. 'infinit: true' funciona com um arquivo de lista de reprodução único e o repete infinitamente.`,
storageText: `Reproduza arquivos de mídia de maneira ordenada ou aleatória a partir de um caminho de diretório ('path') especificado. 'filler_clip' define um "clipe de preenchimento", cuja função é preencher a lacuna de tempo de uma playlist com duração inferior a 24 horas completas, esse clipe ou conjunto de clipes também será repetido quando algum arquivo de mídia não puder ser reproduzido, quando estiver indisponível ou se nenhuma playlist válida estiver sendo reproduzida. Defina 'extensions' para delimitar a busca interna de arquivos de mídia apenas por arquivos com a extensão adicionada. Defina 'shuffle' como 'true' para selecionar arquivos aleatoriamente.`,
textText: `Sobreponha texto (legenda) em combinação com o libzmq, para manipulação remota de texto. No Windows, o caminho do arquivo de fonte deve ser 'C\\:/WINDOWS/fonts/DejaVuSans.ttf'. 'text_from_filename' ativa a extração de texto (legenda) a partir de um arquivo de texto especificado. Com 'style' você pode definir os parâmetros drawtext como posição, cor, etc. Postar Texto via API irá substituir isso. Com 'regex' você pode formatar o nome do arquivo para obter um título.`,
taskText: `Execute um programa externo em conjunto com um determinado objeto de mídia. O objeto de mídia está no formato JSON e contém todas as informações sobre o clipe atual. O programa externo pode ser um script ou um binário. ou um binário, mas deve ser executado apenas por um curto período de tempo.`,
outputText: `A compressão final do stream gerado pelo playout. Ajuste as configurações de acordo com suas necessidades. 'mode' possui as opções 'desktop', 'hls', 'null', 'stream'. Use 'stream' e ajuste as configurações de 'output_param:' se você desejar retransmitir o stream para um servidor rtmp/rtsp/srt/... Em ambiente de produção não sirva a playlist hls com ffpapi, use nginx ou outro servidor web!`,
restartTile: 'Reiniciar Playout',
restartText: 'Reiniciar o ffplayout para aplicar as alterações?',
updatePlayoutSuccess: 'Sucesso na atualização da configuração do playout!',
updatePlayoutFailed: 'Falha na atualização da configuração do playout!',
forbiddenPlaylistPath: 'Acesso proibido: A pasta da lista de reprodução não pode ser aberta',
noPlayoutConfig: 'Nenhuma configuração de playout encontrada!',
hlsPath: 'HLS Path',
playlistPath: 'Playlist Path',
storagePath: 'Storage Path',
sharedStorage: 'O armazenamento compartilhado está ativado, use a mesma raiz de armazenamento para todos os canais',
},
user: {
title: 'Configuração de usuário',
add: 'Adicionar usuário',
delete: 'Deletar',
name: 'Nome de usuário',
mail: 'Email',
password: 'Senha',
newPass: 'Nova Senha',
confirmPass: 'Confirmar Senha',
save: 'Salvar',
admin: 'Administrador',
deleteNotPossible: 'Excluir o usuário atual não é possível!',
deleteSuccess: 'Usuário deletado com sucesso!',
deleteError: 'Erro ao deletar usuário',
addSuccess: 'Usuário adicionado com sucesso!',
addFailed: 'Falha ao adicionar usuário!',
mismatch: 'Senhas não coincidem!',
updateSuccess: 'Atualização do perfil do usuário bem-sucedida! ',
updateFailed: 'Atualização do perfil do usuário falhou!',
},
}

View File

@ -0,0 +1,227 @@
export default {
ok: 'ОК',
cancel: 'Отмена',
socketConnected: 'Event stream connected',
socketDisconnected: 'Event stream disconnected',
alert: {
wrongLogin: 'Неверные данные для входа!',
},
button: {
login: 'Логин',
home: 'Домашняя страница',
player: 'Плеер',
media: 'Файлы',
message: 'Сообщение',
logging: 'Логи',
channels: 'Каналы',
configure: 'Конфигурация',
logout: 'Выйти',
},
error: {
notFound: 'Страница не найдена',
serverError: 'Внутреняя серверная ошибка',
},
input: {
username: 'Логин',
password: 'Пароль',
},
system: {
cpu: 'Процессор',
cores: 'Ядра',
load: 'Нагрузка',
memory: 'Оперативная память',
swap: 'Swap',
total: 'Всего',
usage: 'Используется',
network: 'Интернет',
in: 'Прием',
out: 'Отдача',
storage: 'Хранилище',
device: 'Устройство',
size: 'Размер',
used: 'Использовано',
},
control: {
noClip: 'На данный момент ни один файл не воспроизводится',
ingest: 'Прямой эфир/Перехват эфира',
start: 'Запустить Playout Service',
last: 'Переключить на предыдущий файл',
stop: 'Остановить Playout Service',
reset: 'Сбросить Playout State',
restart: 'Перезапустить Playout Service',
next: 'Переключить на следующий файл',
},
player: {
start: 'Начало',
file: 'Файл',
play: 'Проиграть',
title: 'Название файла',
duration: 'Длительность',
in: 'Начало',
out: 'Конец',
ad: 'Реклама',
edit: 'Редактировать',
delete: 'Удалить',
copy: 'Скопировать плейлист',
loop: 'Повторить все видео в плейлисте',
remote: 'Добавить (удаленно) файл в плейлист',
import: 'Загрузить text/m3u файл',
generate: 'Простой и продвинутый генератор плейлистов',
reset: 'Сбросить плейлист',
save: 'Сохранить плейлист',
deletePlaylist: 'Удалить плейлист',
unsavedProgram: 'Этот плейлист не сохранен!',
copyTo: 'Скопировать текущую программу за',
addEdit: 'Добавить/Редактировать файл',
audio: 'Звук',
customFilter: 'Пользовательский фильтр',
deleteFrom: 'Удалить плейлист за',
deleteSuccess: 'Плейлист удален...',
generateProgram: 'Генерация плейлиста',
simple: 'Простой',
advanced: 'Расширенный',
sorted: 'Отсортировать',
shuffle: 'Перемещать/Перетасовать',
shift: 'Перемотка',
all: 'Все',
addBlock: 'Добавить время начало передачи',
infinitInfo: 'Воспроизведение работает в бесконечном режиме. Никакая информация, основанная на времени, невозможна.',
generateDone: 'Генерация плейлиста завершена...',
dateYesterday: 'Current time is before the playlist start time!',
},
media: {
notExists: 'Папки не существует!',
create: 'Сделать папку',
upload: 'Загрузить файлы',
deleteTitle: 'Удалить Файл/Папку',
deleteQuestion: 'Вы уверены что хотите это удалить',
preview: 'Просмотр',
rename: 'Переименовать файл',
newFile: 'Название нового файла',
createFolder: 'Сделать папку',
foldername: 'Имя папки',
current: 'Процесс загрузки',
overall: 'Всего',
uploading: 'Загружается',
moveError: 'Move error',
deleteError: 'Ошишка удаления',
folderExists: 'Папка уже имеется!',
folderCreate: 'Создание папки готово...',
folderError: 'Ошибка Создания папки',
uploadError: 'Ошибка Загрузки',
fileExists: 'Файл уже имеется!',
},
message: {
savePreset: 'Сохранить шаблон',
newPreset: 'Новый шаблон',
delPreset: 'Удалить шаблон',
delText: 'Вы уверены что хотите удалить шаблон',
placeholder: 'Текст',
xAxis: 'X Axis',
yAxis: 'Y Axis',
showBox: 'Текст с фоном',
boxColor: 'Цвет фона для текста',
boxAlpha: 'Прозрачность фона для текста',
size: 'Размер',
spacing: 'Spacing',
overallAlpha: 'Overall Alpha',
fontColor: 'Цвет текста',
fontAlpha: 'Font Alpha',
borderWidth: 'Border Width',
send: 'Отправить в эфир',
name: 'Название',
saveDone: 'Сохранение предустановки выполнено!',
saveFailed: 'Сохранить пресет не удалось!',
sendDone: 'Отправка успешна...',
sendFailed: 'Отправка не удалась...',
},
log: {
download: 'Скачать лог файл',
},
advanced: {
title: 'Advanced Configuration',
decoder: 'Decoder',
encoder: 'Encoder',
filter: 'Filter',
ingest: 'Ingest',
updateSuccess: 'Update advanced config success!',
updateFailed: 'Update advanced config failed!',
warning: 'Warning! These settings are experimental and only intended for advanced users who are familiar with ffmpeg. Only change the settings here if you are sure of what you are doing! The settings can make the system unstable.',
},
config: {
channel: 'Канал',
user: 'Юзер',
channelConf: 'Конфигурация канала',
addChannel: 'Сделать новый канал',
name: 'Название канала',
previewUrl: 'Предварительный просмотр эфира канала по URL',
extensions: 'Дополнительные расширения',
save: 'Сохранить',
delete: 'Удалить',
updateChannelSuccess: 'Обновление конфигурации канала успешно!',
updateChannelFailed: 'Обновление конфигурации канала не получилось!',
errorChannelDelete: 'Первый канал не может быть удален!',
deleteChannelSuccess: 'Удаление канала успешно!',
deleteChannelFailed: 'Удаление канала неуспешно!',
playoutConf: 'Настройки Конфигурации',
general: 'Главное',
rpcServer: 'RPC Сервер',
mail: 'Электронная почта',
logging: 'Логирование',
processing: 'Настройки эфира',
ingest: 'Ingest',
playlist: 'Плейлист',
storage: 'Storage',
text: 'Текст',
task: 'Task',
output: 'Out',
placeholderPass: 'Password',
help: 'Help',
generalText: `Sometimes it can happen that a file is corrupted but still playable, this can cause a streaming error on all following files. The only way to fix this is to stop and restart ffplayout. Here we only say when to stop, the starting process is up to you. The best way is a systemd service on Linux.
'stop_threshold' will stop ffplayout if it is async in time above this value. A number less than 3 may cause unexpected errors.`,
rpcText: 'Запустите сервер JSON RPC, чтобы получить информацию о том, что воспроизводится, а также о некоторых функциях управления.',
mailText: `Отправлять сообщения об ошибках на адрес электронной почты, например об отсутствии списка воспроизведения; неверный формат json; отсутствует путь к клипу. Оставьте получателя пустым, если он вам не нужен. 'mail_level' может быть ИНФОРМАЦИЯ, ПРЕДУПРЕЖДЕНИЕ или ОШИБКА. 'interval' означает секунды до отправки нового письма.`,
logText: `If 'log_to_file' is true, log to file, if false, log to console. 'local_time' to false will set log timestamps to UTC. Path to /var/log/ only if you are running this as a daemon.
'level' can be DEBUG, INFO, WARNING, ERROR. 'ffmpeg_level' can be INFO, WARNING, ERROR. 'detect_silence' logs an error message if the audio line is silent for 15 seconds during the validation process.`,
processingText: `Default processing for all clips to make them unique. Mode can be Playlist or Folder. 'aspect' must be a float number. 'logo' is only used if the path exists.
'logo_scale' scales the logo to the target size, leave empty if no scaling is needed, format is 'width:height', for example '100:-1' for proportional scaling. With 'logo_opacity' you can make the logo transparent.
With 'audio_tracks' it is possible to configure how many audio tracks should be processed. 'audio_channels' can be used if the audio has more channels than just stereo. With 'logo_position' in 'x:y' format you set the logo position. With 'custom_filter' it is possible to apply additional filters. The filter outputs should end with [c_v_out] for video filters and [c_a_out] for audio filters.`,
ingestText: `Запустите сервер для получения входящего потока. Этот поток будет переопределять обычную потоковую передачу до тех пор, пока она не будет завершена. Существует только очень простой механизм аутентификации, позволяющий проверить правильность имени потока. 'custom_filter' можно использовать так же, как в разделе "Настройки эфира".`,
playlistText: `'path' can be a path to a single file or a directory. For directory specify only the root folder, for example '/playlists', subdirectories will be read by the program. Subdirectories need this structure '/playlists/2018/01'.
'day_start' is the time at which the playlist should start, leave 'day_start' empty if the playlist should always start at the beginning. 'length' represents the target length of the playlist, if empty, real length will not be considered. 'infinit: true' works with single playlist file and loops it infinitely.`,
storageText: `Play ordered or random files from path. 'filler_clip' is for filling the end to reach 24 hours, it will loop when necessary. Set 'extensions' to search only for files with that extension. Set 'shuffle' to 'true' to select files randomly.`,
textText: `Overlay text in combination with libzmq for remote text manipulation. On Windows, the font file path must be 'C\\:/WINDOWS/fonts/DejaVuSans.ttf'. 'text_from_filename' activates text extraction from a filename. With 'style' you can set the drawtext parameters like position, color, etc. Post Text via API will override this. With 'regex' you can format the filename to get a title.`,
taskText: `Run an external program with a given media object. The media object is in json format and contains all the information about the current clip. The external program can be a script or a binary. or a binary, but should only run for a short time.`,
outputText: `The final playout compression. Adjust the settings according to your needs. 'mode' has the options 'desktop', 'hls', 'null', 'stream'. Use 'stream' and adjust the 'output_param:' settings if you want to stream to an rtmp/rtsp/srt/... server. In production don't serve hls playlist with ffpapi, use nginx or another web server!`,
restartTile: 'Перезапуск Playout',
restartText: 'Перезапустить ffplayout для применения изменений?',
updatePlayoutSuccess: 'Обновление конфигурации воспроизведения прошло успешно!',
updatePlayoutFailed: 'Обновление конфигурации воспроизведения не удалось!',
forbiddenPlaylistPath: 'Доступ запрещен: Папка плейлиста не может быть открыта.',
noPlayoutConfig: 'Конфигурация воспроизведения не найдена!',
hlsPath: 'HLS Path',
playlistPath: 'Playlist Path',
storagePath: 'Storage Path',
sharedStorage: 'Общее хранилище включено, используйте один и тот же корень хранилища для всех каналов!',
},
user: {
title: 'Конфигурация пользователя',
add: 'Добавить пользователя',
delete: 'Удалить пользователя',
name: 'Имя пользователя',
mail: 'Электронная почта',
password: 'Пароль',
newPass: 'Новый пароль',
confirmPass: 'Подтвердите пароль',
save: 'Сохранить',
admin: 'Админ',
deleteNotPossible: 'Delete current user not possible!',
deleteSuccess: 'Удаление пользователя успешно!',
deleteError: 'Удаление пользователя с ошибкой',
addSuccess: 'Добавление пользователя успешно!',
addFailed: 'Добавление пользователя не успешно!',
mismatch: 'Password mismatch!',
updateSuccess: 'Обновление данных о пользователе успешно!',
updateFailed: 'Обновление данных о пользователе не успешно!',
},
}

View File

@ -0,0 +1,27 @@
<template>
<div class="min-h-screen bg-base-200">
<div v-if="authStore.isLogin && !String(route.name).includes('index')" class="sticky top-0 z-10">
<HeaderMenu />
</div>
<main :class="authStore.isLogin && !String(route.name).includes('index') ? 'h-[calc(100%-52px)]' : 'h-full'">
<slot />
</main>
<AlertMsg />
</div>
</template>
<script setup lang="ts">
const colorMode = useColorMode()
const authStore = useAuth()
const indexStore = useIndex()
const route = useRoute()
if (colorMode.value === 'dark') {
indexStore.darkMode = true
} else {
indexStore.darkMode = false
}
</script>

Some files were not shown because too many files have changed in this diff Show More