mirror of
https://github.com/r4sas/recastin-panel
synced 2025-03-12 13:21:14 +00:00
Added active flag to endpoints
This commit is contained in:
parent
6312ede523
commit
e271d1bfb4
@ -10,7 +10,7 @@ ReCast is a multi platform streaming tool written in PHP and uses nginx RTMP. Yo
|
||||
* Checkout this project, copy .env.dist to .env and adjust the settings
|
||||
* Run ```composer install --no-dev -o```
|
||||
* Generate JWT Keys, following [Documentation](https://github.com/lexik/LexikJWTAuthenticationBundle/blob/HEAD/Resources/doc/index.md#installation)
|
||||
* Create the database ```php bin/console doctrine:schema:create```
|
||||
* Create the database ```php bin/console doctrine:migrations:migrate```
|
||||
* Go to ``public/theme``, run ``npm install`` and copy the generated files to public (``cp -R static ..``)
|
||||
* Create a new crontab entry which runs every minute ```php bin/console recast:cron```
|
||||
* Create a new user with ```php bin/console recast:create:user```
|
||||
|
@ -9,6 +9,10 @@
|
||||
<card>
|
||||
<fg-input label="Name" v-model="endpoint.name"></fg-input>
|
||||
|
||||
<div class="form-group">
|
||||
<p-checkbox v-model="endpoint.active">Active</p-checkbox>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">
|
||||
Type
|
||||
@ -51,6 +55,7 @@
|
||||
return {
|
||||
endpoint: {
|
||||
name: '',
|
||||
active: false,
|
||||
type: 'Mixer',
|
||||
server: '',
|
||||
streamKey: '',
|
||||
@ -74,7 +79,7 @@
|
||||
methods: {
|
||||
save: function () {
|
||||
this.axios.post('/streams/' + this.$route.params.streamId + '/endpoints/update', this.endpoint).then(() => {
|
||||
this.$router.push('/ucp/streams/' + this.$route.params.streamId + '/endpoints');
|
||||
this.$router.push('/ucp/streams/' + this.$route.params.streamId + '/');
|
||||
})
|
||||
}
|
||||
},
|
||||
|
@ -24,6 +24,7 @@
|
||||
<table class="table">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Active</th>
|
||||
<th>Name</th>
|
||||
<th>Service</th>
|
||||
<th>Location</th>
|
||||
@ -32,6 +33,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="endpoint in endpoints">
|
||||
<td><i class="fa fa-circle" :class="endpoint.active ? 'text-success' : 'text-danger'" aria-hidden="true"></i></td>
|
||||
<td>{{ endpoint.name }}</td>
|
||||
<td>{{ endpoint.type }}</td>
|
||||
<td>{{ endpoint.server }}</td>
|
||||
|
@ -10,6 +10,7 @@
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Live</th>
|
||||
<th>Active</th>
|
||||
<th>Name</th>
|
||||
<th>Endpoints</th>
|
||||
<th>Action</th>
|
||||
@ -18,6 +19,7 @@
|
||||
<tbody>
|
||||
<tr v-for="stream in streams">
|
||||
<td><i class="fa fa-circle" :class="stream.live ? 'text-success' : 'text-danger'" aria-hidden="true"></i></td>
|
||||
<td><i class="fa fa-circle" :class="stream.active ? 'text-success' : 'text-danger'" aria-hidden="true"></i></td>
|
||||
<td>{{ stream.name }}</td>
|
||||
<td>{{ getProviders(stream) }}</td>
|
||||
<td>
|
||||
|
@ -208,6 +208,7 @@ class Streams extends Controller
|
||||
$endpoint = !empty($requestBody['id']) ? $this->endpointRepository->find($requestBody['id']) : new Endpoint();
|
||||
|
||||
$endpoint->setName($requestBody['name']);
|
||||
$endpoint->setActive($requestBody['active']);
|
||||
$endpoint->setType($requestBody['type']);
|
||||
$endpoint->setServer($requestBody['server']);
|
||||
$endpoint->setStreamKey($requestBody['streamKey']);
|
||||
|
@ -21,6 +21,12 @@ class Endpoint implements \JsonSerializable
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=false, options={"default": true})
|
||||
* @var bool
|
||||
*/
|
||||
private $active;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
* @var string
|
||||
@ -60,6 +66,24 @@ class Endpoint implements \JsonSerializable
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @author Soner Sayakci <shyim@posteo.de>
|
||||
*/
|
||||
public function isActive(): bool
|
||||
{
|
||||
return $this->active;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $active
|
||||
* @author Soner Sayakci <shyim@posteo.de>
|
||||
*/
|
||||
public function setActive(bool $active): void
|
||||
{
|
||||
$this->active = $active;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @author Soner Sayakci <shyim@posteo.de>
|
||||
|
@ -42,8 +42,17 @@ class StreamsRepository extends ServiceEntityRepository
|
||||
* @return Streams[]
|
||||
* @author Soner Sayakci <shyim@posteo.de>
|
||||
*/
|
||||
public function getActiveStreams()
|
||||
public function getActiveStreams(): array
|
||||
{
|
||||
return $this->findBy(['active' => true]);
|
||||
$qb = $this->createQueryBuilder('streams')
|
||||
->addSelect('endpoints')
|
||||
->addSelect('user')
|
||||
->leftJoin('streams.endpoints', 'endpoints')
|
||||
->leftJoin('streams.user', 'user')
|
||||
->andWhere('streams.active = true')
|
||||
->andWhere('endpoints.active = true')
|
||||
->getQuery();
|
||||
|
||||
return $qb->getResult();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user