1
0
mirror of https://github.com/r4sas/recastin-panel synced 2025-03-12 05:11:04 +00:00

Added channelName column, needed for Chat integration

This commit is contained in:
Shyim 2018-05-09 21:33:19 +02:00
parent f8cf7db0bf
commit aac20784cc
6 changed files with 63 additions and 2 deletions

5
.gitignore vendored
View File

@ -23,4 +23,7 @@ yarn-error.log
###< symfony/web-server-bundle ###
.idea
/config/jwt
###> lexik/jwt-authentication-bundle ###
/config/jwt/*.pem
###< lexik/jwt-authentication-bundle ###

View File

@ -36,6 +36,8 @@
<fg-input label="Stream-Key" v-model="endpoint.streamKey"></fg-input>
<fg-input label="Channel Name" v-model="endpoint.channelName"></fg-input>
<button class="btn btn-primary">Save</button>
</form>
</card>
@ -61,6 +63,7 @@
type: 'Mixer',
server: '',
streamKey: '',
channelName: '',
},
services: {},
serviceNames: []

View File

@ -23,7 +23,7 @@ const router = new VueRouter({
});
Vue.router = router;
axios.defaults.baseURL = typeof appUrl === 'undefined' ? `http://streamer.miku/api` : appUrl;
axios.defaults.baseURL = typeof appUrl === 'undefined' ? `http://localhost/api` : appUrl;
Vue.use(VueAxios, axios);
Vue.use(VueNotify);

View File

@ -250,6 +250,7 @@ class Streams extends Controller
$endpoint->setType($requestBody['type']);
$endpoint->setServer($requestBody['server']);
$endpoint->setStreamKey($requestBody['streamKey']);
$endpoint->setChannelName($requestBody['channelName']);
$endpoint->setStream($stream);
$manager = $this->get('doctrine.orm.entity_manager');

View File

@ -51,6 +51,12 @@ class Endpoint implements \JsonSerializable
*/
private $streamKey;
/**
* @ORM\Column(name="channelName", type="string", length=255)
* @var string
*/
private $channelName;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Streams", inversedBy="endpoints")
* @ORM\JoinColumn(name="stream_id", referencedColumnName="id")
@ -185,6 +191,24 @@ class Endpoint implements \JsonSerializable
$this->stream = $stream;
}
/**
* @return string
* @author Soner Sayakci <shyim@posteo.de>
*/
public function getChannelName(): string
{
return $this->channelName;
}
/**
* @param string $channelName
* @author Soner Sayakci <shyim@posteo.de>
*/
public function setChannelName(string $channelName): void
{
$this->channelName = $channelName;
}
/**
* @ORM\PostPersist()
* @ORM\PostUpdate()

View File

@ -0,0 +1,30 @@
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20180509192256 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE user CHANGE role role VARCHAR(255) DEFAULT \'user\' NOT NULL');
$this->addSql('ALTER TABLE endpoint ADD channelName VARCHAR(255) NOT NULL, CHANGE stream_id stream_id INT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE endpoint DROP channelName, CHANGE stream_id stream_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE user CHANGE role role VARCHAR(255) DEFAULT \'\'user\'\' NOT NULL COLLATE utf8mb4_unicode_ci');
}
}