Settings Servers refresh all not only one, show list libraries in settings

pull/9/head
chewbaka 7 years ago
parent 07bdc95fcb
commit f6716ed53b

@ -0,0 +1,12 @@
language: php
php:
- 5.3
- 5.4
- 5.5
- 7.0
before_script:
- curl -s http://getcomposer.org/installer | php
- php composer.phar install --dev
script: php oil test

@ -5,7 +5,7 @@
"keywords": ["application", "website", "development", "framework", "PHP", "PHP7"], "keywords": ["application", "website", "development", "framework", "PHP", "PHP7"],
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": ">=5.3.3", "php": ">=5.6.33",
"composer/installers": "~1.0", "composer/installers": "~1.0",
"fuel/core": "1.8.*", "fuel/core": "1.8.*",
"fuel/auth": "1.8.*", "fuel/auth": "1.8.*",

@ -1,42 +1,48 @@
<?php <?php
use Fuel\Core\Controller; use Fuel\Core\Controller;
use Fuel\Core\FuelException; use Fuel\Core\FuelException;
use Fuel\Core\View; use Fuel\Core\Response;
use Fuel\Core\Asset; use Fuel\Core\View;
use Fuel\Core\Asset;
class Controller_Install extends Controller
{ class Controller_Install extends Controller
public function action_index() {
{ public function action_index()
$view = View::forge('install/index'); {
$lock = Config::load('lock', true);
$js = Asset::js('plex_alert.js');
if($lock)
$view->set_safe('end_js', $js); Response::redirect('/login');
$config_db = Config::load('db', true); $view = View::forge('install/index');
$config_db = $config_db['default'];
$js = Asset::js('plex_alert.js');
$view->set('db_host', $config_db['connection']['hostname']);
$view->set('db_port', $config_db['connection']['port']); $view->set_safe('end_js', $js);
$view->set('db_database', $config_db['connection']['database']);
$view->set('db_prefix', $config_db['table_prefix']); $config_db = Config::load('db', true);
$view->set('db_username', $config_db['connection']['username']); $config_db = $config_db['default'];
$view->set('db_password', $config_db['connection']['password']);
$view->set('db_host', $config_db['connection']['hostname']);
try { $view->set('db_port', $config_db['connection']['port']);
$config_plex = Model_Server::find()[0]; $view->set('db_database', $config_db['connection']['database']);
$view->set('db_prefix', $config_db['table_prefix']);
if($config_plex) { $view->set('db_username', $config_db['connection']['username']);
$view->set('plex_url', $config_plex->url); $view->set('db_password', $config_db['connection']['password']);
$view->set('plex_port', $config_plex->port);
$view->set('plex_token', $config_plex->token); try {
} $config_plex = Model_Server::find()[0];
}catch (FuelException $e){
//@TODO if($config_plex) {
} $view->set('plex_url', $config_plex->url);
$view->set('plex_port', $config_plex->port);
return $view; $view->set('plex_token', $config_plex->token);
} }
}catch (FuelException $e){
//@TODO
}
return $view;
}
} }

@ -11,6 +11,14 @@ use Fuel\Core\FuelException;
class Controller_Login extends Controller class Controller_Login extends Controller
{ {
public function before()
{
parent::before();
$user = Session::get('user');
if($user)
Response::redirect('/home');
}
public function action_index() public function action_index()
{ {

@ -9,6 +9,14 @@ use Fuel\Core\FuelException;
class Controller_Register extends Controller class Controller_Register extends Controller
{ {
public function before()
{
parent::before();
$user = Session::get('user');
if($user)
Response::redirect('/home');
}
public function action_index() public function action_index()
{ {

@ -1,463 +1,465 @@
<?php <?php
use Fuel\Core\Config; use Fuel\Core\Config;
use Fuel\Core\Controller_Rest; use Fuel\Core\Controller_Rest;
use Fuel\Core\DB; use Fuel\Core\DB;
use Fuel\Core\DBUtil; use Fuel\Core\DBUtil;
use Fuel\Core\FuelException; use Fuel\Core\FuelException;
use Fuel\Core\Input; use Fuel\Core\Input;
use Fuel\Core\Request; use Fuel\Core\Request;
use Fuel\Core\Str; use Fuel\Core\Str;
class Controller_Rest_Install extends Controller_Rest class Controller_Rest_Install extends Controller_Rest
{ {
public function post_require() public function post_require()
{ {
$result = []; $result = [];
$version = version_compare(PHP_VERSION, 5.6, '>='); $version = version_compare(PHP_VERSION, 5.6, '>=');
$result['version'] = $version ? true : false; $result['version'] = $version ? true : false;
$result['mysql'] = extension_loaded('mysql') ? true : false; $result['mysql'] = extension_loaded('mysql') ? true : false;
$result['mysqli'] = extension_loaded('mysqli') ? true : false; $result['mysqli'] = extension_loaded('mysqli') ? true : false;
$result['pdo_mysql'] = extension_loaded('pdo_mysql') ? true : false; $result['pdo_mysql'] = extension_loaded('pdo_mysql') ? true : false;
$result['simplexml'] = extension_loaded('SimpleXML') ? true : false; $result['simplexml'] = extension_loaded('SimpleXML') ? true : false;
$result['curl'] = function_exists('curl_version') ? true : false; $result['curl'] = function_exists('curl_version') ? true : false;
$result['config'] = is_writable('../fuel/app/config/') ? true : false; $result['config'] = is_writable('../fuel/app/config/') ? true : false;
return $this->response($result); return $this->response($result);
} }
public function post_config() public function post_config()
{ {
try { try {
$host = Input::post('host'); $host = Input::post('host');
$port = Input::post('port'); $port = Input::post('port');
$dbname = Input::post('database'); $dbname = Input::post('database');
$username = Input::post('username'); $username = Input::post('username');
$password = Input::post('password'); $password = Input::post('password');
$boolean = Config::load('db', true); $boolean = Config::load('db', true);
if(!$boolean) if(!$boolean)
throw new FuelException('Config db.php not work!'); throw new FuelException('Config db.php not work!');
$config = array( $config = array(
'active' => 'default', 'active' => 'default',
'default' => array( 'default' => array(
'type' => 'pdo', 'type' => 'pdo',
'connection' => array( 'connection' => array(
'dsn' => 'mysql:host=' . $host . ($port ? ';port=' . $port : '') . ';dbname=' . $dbname, 'dsn' => 'mysql:host=' . $host . ($port ? ';port=' . $port : '') . ';dbname=' . $dbname,
'hostname' => $host, 'hostname' => $host,
'port' => $port, 'port' => $port,
'database' => $dbname, 'database' => $dbname,
'username' => $username, 'username' => $username,
'password' => $password, 'password' => $password,
), ),
'table_prefix' => 'plex_', 'table_prefix' => 'plex_',
'charset' => 'utf8', 'charset' => 'utf8',
'enable_cache' => true, 'enable_cache' => true,
'hash' => Str::random('alnum', 32) 'hash' => Str::random('alnum', 32)
), ),
); );
Config::save('db', $config); Config::save('db', $config);
return $this->response(array('error' => false)); return $this->response(array('error' => false));
}catch (FuelException $e) { }catch (FuelException $e) {
return $this->response(array('error' => true, 'message' => $e->getMessage()), 400); return $this->response(array('error' => true, 'message' => $e->getMessage()), 400);
} }
} }
public function post_tables() public function post_tables()
{ {
Config::load('db', true); Config::load('db', true);
$logs = ''; $logs = '';
try { try {
DB::start_transaction(); DB::start_transaction();
$logs .= 'Creation table user'."\r\n"; $logs .= 'Creation table user'."\r\n";
/** /**
* CREATE TABLE USER * CREATE TABLE USER
*/ */
DBUtil::create_table( DBUtil::create_table(
'user', 'user',
array( array(
'id' => array('constraint' => 36, 'type' => 'varchar'), 'id' => array('constraint' => 36, 'type' => 'varchar'),
'username' => array('constraint' => 255, 'type' => 'varchar'), 'username' => array('constraint' => 255, 'type' => 'varchar'),
'email' => array('constraint' => 255, 'type' => 'varchar'), 'email' => array('constraint' => 255, 'type' => 'varchar'),
'password' => array('constraint' => 255, 'type' => 'varchar'), 'password' => array('constraint' => 255, 'type' => 'varchar'),
'admin' => array('constraint' => 1, 'type' => 'int', 'default' => 0), 'admin' => array('constraint' => 1, 'type' => 'int', 'default' => 0),
'lastlogin' => array('constraint' => 11, 'type' => 'int'), 'lastlogin' => array('constraint' => 11, 'type' => 'int'),
'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0) 'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0)
), ),
array('id'), false, 'InnoDB', 'utf8_unicode_ci' array('id'), false, 'InnoDB', 'utf8_unicode_ci'
); );
$logs .= 'Table user create!'."\r\n"; $logs .= 'Table user create!'."\r\n";
$logs .= 'Creation table server'."\r\n"; $logs .= 'Creation table server'."\r\n";
/** /**
* CREATE TABLE SERVER * CREATE TABLE SERVER
*/ */
DBUtil::create_table( DBUtil::create_table(
'server', 'server',
array( array(
'id' => array('constraint' => 36, 'type' => 'varchar'), 'id' => array('constraint' => 36, 'type' => 'varchar'),
'user_id' => array('constraint' => 36, 'type' => 'varchar'), 'user_id' => array('constraint' => 36, 'type' => 'varchar'),
'url' => array('constraint' => 255, 'type' => 'varchar'), 'url' => array('constraint' => 255, 'type' => 'varchar'),
'port' => array('constraint' => 2, 'type' => 'int', 'null' => true), 'port' => array('constraint' => 2, 'type' => 'int', 'null' => true),
'token' => array('constraint' => 255, 'type' => 'varchar'), 'token' => array('constraint' => 255, 'type' => 'varchar'),
'lastcheck' => array('constraint' => 11, 'type' => 'int'), 'lastcheck' => array('constraint' => 11, 'type' => 'int'),
'name' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'name' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'plateforme' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'plateforme' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'platformVersion' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'platformVersion' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'updatedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'updatedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'version' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'version' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'online' => array('constraint' => 1, 'type' => 'int', 'default' => 0), 'online' => array('constraint' => 1, 'type' => 'int', 'default' => 0),
'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0) 'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0)
), ),
array('id'), false, 'InnoDB', 'utf8_unicode_ci' array('id'), false, 'InnoDB', 'utf8_unicode_ci'
); );
$logs .= 'Server table create!'."\r\n"; $logs .= 'Server table create!'."\r\n";
$logs .= 'Creation table library'."\r\n"; $logs .= 'Creation table library'."\r\n";
/** /**
* CREATE TABLE LIBRARY * CREATE TABLE LIBRARY
*/ */
DBUtil::create_table( DBUtil::create_table(
'library', 'library',
array( array(
'id' => array('constraint' => 36, 'type' => 'varchar'), 'id' => array('constraint' => 36, 'type' => 'varchar'),
'server_id' => array('constraint' => 36, 'type' => 'varchar'), 'server_id' => array('constraint' => 36, 'type' => 'varchar'),
'plex_key' => array('constraint' => 11, 'type' => 'int'), 'plex_key' => array('constraint' => 11, 'type' => 'int'),
'name' => array('constraint' => 255, 'type' => 'varchar'), 'name' => array('constraint' => 255, 'type' => 'varchar'),
'type' => array('constraint' => 255, 'type' => 'varchar'), 'type' => array('constraint' => 255, 'type' => 'varchar'),
'updatedAt' => array('constraint' => 11, 'type' => 'int'), 'updatedAt' => array('constraint' => 11, 'type' => 'int'),
'createdAt' => array('constraint' => 11, 'type' => 'int'), 'createdAt' => array('constraint' => 11, 'type' => 'int'),
'scannedAt' => array('constraint' => 11, 'type' => 'int'), 'scannedAt' => array('constraint' => 11, 'type' => 'int'),
'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0) 'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0)
), ),
array('id'), false, 'InnoDB', 'utf8_unicode_ci' array('id'), false, 'InnoDB', 'utf8_unicode_ci'
); );
$logs .= 'Library table create!'."\r\n"; $logs .= 'Library table create!'."\r\n";
$logs .= 'Creation table tv_show'."\r\n"; $logs .= 'Creation table tv_show'."\r\n";
/** /**
* CREATE TABLE LIBRARY * CREATE TABLE LIBRARY
*/ */
DBUtil::create_table( DBUtil::create_table(
'tvshow', 'tvshow',
array( array(
'id' => array('constraint' => 36, 'type' => 'varchar'), 'id' => array('constraint' => 36, 'type' => 'varchar'),
'library_id' => array('constraint' => 36, 'type' => 'varchar'), 'library_id' => array('constraint' => 36, 'type' => 'varchar'),
'plex_key' => array('constraint' => 255, 'type' => 'varchar'), 'plex_key' => array('constraint' => 255, 'type' => 'varchar'),
'studio' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'studio' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'title' => array('constraint' => 255, 'type' => 'varchar'), 'title' => array('constraint' => 255, 'type' => 'varchar'),
'contentRating' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'contentRating' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'summary' => array('type' => 'text', 'null' => true), 'summary' => array('type' => 'text', 'null' => true),
'rating' => array('constraint' => 3, 'type' => 'varchar', 'null' => true), 'rating' => array('constraint' => 3, 'type' => 'varchar', 'null' => true),
'year' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'year' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'thumb' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'thumb' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'art' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'art' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'banner' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'banner' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'theme' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'theme' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'originallyAvailableAt' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'originallyAvailableAt' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'leafCount' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'leafCount' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'addedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'addedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'updatedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'updatedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0) 'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0)
), ),
array('id'), false, 'InnoDB', 'utf8_unicode_ci' array('id'), false, 'InnoDB', 'utf8_unicode_ci'
); );
$logs .= 'Library table create!'."\r\n"; $logs .= 'Library table create!'."\r\n";
$logs .= 'Creation table season'."\r\n"; $logs .= 'Creation table season'."\r\n";
/** /**
* CREATE TABLE SEASON * CREATE TABLE SEASON
*/ */
DBUtil::create_table( DBUtil::create_table(
'season', 'season',
array( array(
'id' => array('constraint' => 36, 'type' => 'varchar'), 'id' => array('constraint' => 36, 'type' => 'varchar'),
'tv_show_id' => array('constraint' => 36, 'type' => 'varchar'), 'tv_show_id' => array('constraint' => 36, 'type' => 'varchar'),
'plex_key' => array('constraint' => 36, 'type' => 'varchar'), 'plex_key' => array('constraint' => 36, 'type' => 'varchar'),
'number' => array('constraint' => 11, 'type' => 'int'), 'number' => array('constraint' => 11, 'type' => 'int'),
'title' => array('constraint' => 255, 'type' => 'varchar'), 'title' => array('constraint' => 255, 'type' => 'varchar'),
'thumb' => array('constraint' => 255, 'type' => 'varchar'), 'thumb' => array('constraint' => 255, 'type' => 'varchar'),
'art' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'art' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'leafCount' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'leafCount' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'addedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'addedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'updatedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'updatedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0) 'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0)
), ),
array('id'), false, 'InnoDB', 'utf8_unicode_ci' array('id'), false, 'InnoDB', 'utf8_unicode_ci'
); );
$logs .= 'Season table create!'."\r\n"; $logs .= 'Season table create!'."\r\n";
$logs .= 'Creation table movie'."\r\n"; $logs .= 'Creation table movie'."\r\n";
/** /**
* CREATE TABLE SEASON * CREATE TABLE SEASON
*/ */
DBUtil::create_table( DBUtil::create_table(
'movie', 'movie',
array( array(
'id' => array('constraint' => 36, 'type' => 'varchar'), 'id' => array('constraint' => 36, 'type' => 'varchar'),
'library_id' => array('constraint' => 36, 'type' => 'varchar', 'null' => true), 'library_id' => array('constraint' => 36, 'type' => 'varchar', 'null' => true),
'season_id' => array('constraint' => 36, 'type' => 'varchar', 'null' => true), 'season_id' => array('constraint' => 36, 'type' => 'varchar', 'null' => true),
'plex_key' => array('constraint' => 36, 'type' => 'varchar'), 'plex_key' => array('constraint' => 36, 'type' => 'varchar'),
'type' => array('constraint' => 5, 'type' => 'varchar'), 'type' => array('constraint' => 5, 'type' => 'varchar'),
'number' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'number' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'studio' => array('constraint' => 36, 'type' => 'varchar', 'null' => true), 'studio' => array('constraint' => 36, 'type' => 'varchar', 'null' => true),
'title' => array('constraint' => 255, 'type' => 'varchar'), 'title' => array('constraint' => 255, 'type' => 'varchar'),
'originalTitle' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'originalTitle' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'summary' => array('type' => 'text', 'null' => true), 'summary' => array('type' => 'text', 'null' => true),
'rating' => array('constraint' => 3, 'type' => 'varchar', 'null' => true), 'rating' => array('constraint' => 3, 'type' => 'varchar', 'null' => true),
'year' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'year' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'thumb' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'thumb' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'art' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'art' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'duration' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'duration' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'originallyAvailableAt' => array('constraint' => 11, 'type' => 'varchar', 'null' => true), 'originallyAvailableAt' => array('constraint' => 11, 'type' => 'varchar', 'null' => true),
'addedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'addedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'updatedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'updatedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0) 'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0)
), ),
array('id'), false, 'InnoDB', 'utf8_unicode_ci' array('id'), false, 'InnoDB', 'utf8_unicode_ci'
); );
$logs .= 'Movie table create!'."\r\n"; $logs .= 'Movie table create!'."\r\n";
$logs .= 'Creation table configuration'."\r\n"; $logs .= 'Creation table configuration'."\r\n";
/** /**
* CREATE TABLE CONFIGURATION * CREATE TABLE CONFIGURATION
*/ */
DBUtil::create_table( DBUtil::create_table(
'configurations', 'configurations',
array( array(
'id' => array('constraint' => 36, 'type' => 'varchar'), 'id' => array('constraint' => 36, 'type' => 'varchar'),
'name' => array('constraint' => 255, 'type' => 'varchar'), 'name' => array('constraint' => 255, 'type' => 'varchar'),
'data' => array('constraint' => 255, 'type' => 'varchar') 'data' => array('constraint' => 255, 'type' => 'varchar')
), ),
array('id'), false, 'InnoDB', 'utf8_unicode_ci' array('id'), false, 'InnoDB', 'utf8_unicode_ci'
); );
$logs .= 'Configuration table create!'."\r\n"; $logs .= 'Configuration table create!'."\r\n";
$logs .= 'Creation table permission'."\r\n"; $logs .= 'Creation table permission'."\r\n";
/** /**
* CREATE TABLE PERMISSION * CREATE TABLE PERMISSION
*/ */
DBUtil::create_table( DBUtil::create_table(
'permission', 'permission',
array( array(
'id' => array('constraint' => 36, 'type' => 'varchar'), 'id' => array('constraint' => 36, 'type' => 'varchar'),
'name' => array('constraint' => 255, 'type' => 'varchar'), 'name' => array('constraint' => 255, 'type' => 'varchar'),
'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0) 'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0)
), ),
array('id'), false, 'InnoDB', 'utf8_unicode_ci' array('id'), false, 'InnoDB', 'utf8_unicode_ci'
); );
$logs .= 'Permission table create!'."\r\n"; $logs .= 'Permission table create!'."\r\n";
$logs .= 'Creation table user permission'."\r\n"; $logs .= 'Creation table user permission'."\r\n";
/** /**
* CREATE TABLE USER'S PERMISSION * CREATE TABLE USER'S PERMISSION
*/ */
DBUtil::create_table( DBUtil::create_table(
'user_permission', 'user_permission',
array( array(
'id' => array('constraint' => 36, 'type' => 'varchar'), 'id' => array('constraint' => 36, 'type' => 'varchar'),
'permission_id' => array('constraint' => 36, 'type' => 'varchar'), 'permission_id' => array('constraint' => 36, 'type' => 'varchar'),
'user_id' => array('constraint' => 36, 'type' => 'varchar'), 'user_id' => array('constraint' => 36, 'type' => 'varchar'),
'library_id' => array('constraint' => 36, 'type' => 'varchar'), 'library_id' => array('constraint' => 36, 'type' => 'varchar'),
'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0) 'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0)
), ),
array('id'), false, 'InnoDB', 'utf8_unicode_ci' array('id'), false, 'InnoDB', 'utf8_unicode_ci'
); );
$logs .= 'User Permission table create!'."\r\n"; $logs .= 'User Permission table create!'."\r\n";
$logs .= 'Creation table user watching'."\r\n"; $logs .= 'Creation table user watching'."\r\n";
/** /**
* CREATE TABLE USER'S WATCHING * CREATE TABLE USER'S WATCHING
*/ */
DBUtil::create_table( DBUtil::create_table(
'user_watching', 'user_watching',
array( array(
'id' => array('constraint' => 36, 'type' => 'varchar'), 'id' => array('constraint' => 36, 'type' => 'varchar'),
'file_id' => array('constraint' => 11, 'type' => 'int'), 'file_id' => array('constraint' => 11, 'type' => 'int'),
'user_id' => array('constraint' => 36, 'type' => 'varchar'), 'user_id' => array('constraint' => 36, 'type' => 'varchar'),
'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0) 'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0)
), ),
array('id'), false, 'InnoDB', 'utf8_unicode_ci' array('id'), false, 'InnoDB', 'utf8_unicode_ci'
); );
$logs .= 'User Watching table create!'."\r\n"; $logs .= 'User Watching table create!'."\r\n";
$logs .= 'Create Foreign key'."\r\n"; $logs .= 'Create Foreign key'."\r\n";
/** /**
* FOREIGN KEY * FOREIGN KEY
*/ */
DBUtil::add_foreign_key('tvshow', array( DBUtil::add_foreign_key('tvshow', array(
'constraint' => 'constraintTvShowLibrary', 'constraint' => 'constraintTvShowLibrary',
'key' => 'library_id', 'key' => 'library_id',
'reference' => array( 'reference' => array(
'table' => 'library', 'table' => 'library',
'column' => 'id', 'column' => 'id',
), ),
'on_update' => 'NO ACTION', 'on_update' => 'NO ACTION',
'on_delete' => 'NO ACTION', 'on_delete' => 'NO ACTION',
)); ));
DBUtil::add_foreign_key('season', array( DBUtil::add_foreign_key('season', array(
'constraint' => 'constraintSeasonTvShow', 'constraint' => 'constraintSeasonTvShow',
'key' => 'tv_show_id', 'key' => 'tv_show_id',
'reference' => array( 'reference' => array(
'table' => 'tvshow', 'table' => 'tvshow',
'column' => 'id', 'column' => 'id',
), ),
'on_update' => 'NO ACTION', 'on_update' => 'NO ACTION',
'on_delete' => 'NO ACTION', 'on_delete' => 'NO ACTION',
)); ));
DBUtil::add_foreign_key('movie', array( DBUtil::add_foreign_key('movie', array(
'constraint' => 'constraintMovieLibrary', 'constraint' => 'constraintMovieLibrary',
'key' => 'library_id', 'key' => 'library_id',
'reference' => array( 'reference' => array(
'table' => 'library', 'table' => 'library',
'column' => 'id', 'column' => 'id',
), ),
'on_update' => 'NO ACTION', 'on_update' => 'NO ACTION',
'on_delete' => 'NO ACTION', 'on_delete' => 'NO ACTION',
)); ));
DBUtil::add_foreign_key('movie', array( DBUtil::add_foreign_key('movie', array(
'constraint' => 'constraintMovieSeason', 'constraint' => 'constraintMovieSeason',
'key' => 'season_id', 'key' => 'season_id',
'reference' => array( 'reference' => array(
'table' => 'season', 'table' => 'season',
'column' => 'id', 'column' => 'id',
), ),
'on_update' => 'NO ACTION', 'on_update' => 'NO ACTION',
'on_delete' => 'NO ACTION', 'on_delete' => 'NO ACTION',
)); ));
DBUtil::add_foreign_key('user_permission', array( DBUtil::add_foreign_key('user_permission', array(
'constraint' => 'constraintLibraryPermission', 'constraint' => 'constraintLibraryPermission',
'key' => 'library_id', 'key' => 'library_id',
'reference' => array( 'reference' => array(
'table' => 'library', 'table' => 'library',
'column' => 'id', 'column' => 'id',
), ),
'on_update' => 'NO ACTION', 'on_update' => 'NO ACTION',
'on_delete' => 'NO ACTION', 'on_delete' => 'NO ACTION',
)); ));
DBUtil::add_foreign_key('user_watching', array( DBUtil::add_foreign_key('user_watching', array(
'constraint' => 'constraintUserWatching', 'constraint' => 'constraintUserWatching',
'key' => 'user_id', 'key' => 'user_id',
'reference' => array( 'reference' => array(
'table' => 'user', 'table' => 'user',
'column' => 'id', 'column' => 'id',
), ),
'on_update' => 'NO ACTION', 'on_update' => 'NO ACTION',
'on_delete' => 'NO ACTION', 'on_delete' => 'NO ACTION',
)); ));
DBUtil::add_foreign_key('library', array( DBUtil::add_foreign_key('library', array(
'constraint' => 'constraintServerLibrary', 'constraint' => 'constraintServerLibrary',
'key' => 'server_id', 'key' => 'server_id',
'reference' => array( 'reference' => array(
'table' => 'server', 'table' => 'server',
'column' => 'id', 'column' => 'id',
), ),
'on_update' => 'NO ACTION', 'on_update' => 'NO ACTION',
'on_delete' => 'NO ACTION', 'on_delete' => 'NO ACTION',
)); ));
DBUtil::add_foreign_key('server', array( DBUtil::add_foreign_key('server', array(
'constraint' => 'constraintServerUser', 'constraint' => 'constraintServerUser',
'key' => 'user_id', 'key' => 'user_id',
'reference' => array( 'reference' => array(
'table' => 'user', 'table' => 'user',
'column' => 'id', 'column' => 'id',
), ),
'on_update' => 'NO ACTION', 'on_update' => 'NO ACTION',
'on_delete' => 'NO ACTION', 'on_delete' => 'NO ACTION',
)); ));
$logs .= 'Foreign key create!'."\r\n"; $logs .= 'Foreign key create!'."\r\n";
DB::commit_transaction(); DB::commit_transaction();
$logs .= 'All Tables and Foreign Key successfully!'."\r\n"; $logs .= 'All Tables and Foreign Key successfully!'."\r\n";
return $this->response(array('error' => false, 'message' => $logs)); return $this->response(array('error' => false, 'message' => $logs));
}catch (FuelException $e) { }catch (FuelException $e) {
DBUtil::drop_table('user_watching'); DBUtil::drop_table('user_watching');
DBUtil::drop_table('user_permission'); DBUtil::drop_table('user_permission');
DBUtil::drop_table('permission'); DBUtil::drop_table('permission');
DBUtil::drop_table('library'); DBUtil::drop_table('library');
DBUtil::drop_table('server'); DBUtil::drop_table('server');
DBUtil::drop_table('configurations'); DBUtil::drop_table('configurations');
DBUtil::drop_table('user'); DBUtil::drop_table('user');
DB::rollback_transaction(); DB::rollback_transaction();
return $this->response(array('error' => true, 'message' => $e->getMessage()), 400); return $this->response(array('error' => true, 'message' => $e->getMessage()), 400);
} }
} }
public function post_plex() public function post_admin()
{ {
try { try {
$url = Input::post('url'); $config = Config::load('db', true);
//@TODO CHECK AND REMOVE HTTP AND HTTPS $email = Input::post('email');
$username = Input::post('username');
$port = Input::post('port'); $password = Input::post('password');
$token = Input::post('token'); $Cpassword = Input::post('cpassword');
$curl = Request::forge('http://' . $url . ($port ? ':' . $port : '') . '/?X-Plex-Token=' . $token, 'curl'); if($password !== $Cpassword)
$result = $curl->execute(); throw new FuelException('Password match error!');
if(!$result) $user = Model_User::forge(array(
throw new FuelException('Can not connect to your server!'); 'username' => $username,
'email' => $email,
$server = Model_Server::forge(); 'password' => hash('sha512', $config['default']['hash'] . $password),
$server->set([ 'admin' => 1,
'url' => $url, 'lastlogin' => time()
'port' => $port, ));
'token' => $token,
'lastcheck' => time() if(!$user->validates()) {
]); throw new FuelException($user->validation()->show_errors());
$server->save(); }
return $this->response(array('error' => false)); $user->save();
} catch (FuelException $e) {
return $this->response(array('error' => true, 'message' => $e->getMessage()), 400); return $this->response(array('error' => false));
} } catch (Exception $e) {
} return $this->response(array('error' => true, 'message' => $e->getMessage()), 404);
}
public function post_admin() }
{
try { public function post_plex()
$config = Config::load('db', true); {
try {
$email = Input::post('email'); $url = Input::post('url');
$username = Input::post('username');
$password = Input::post('password'); //@TODO CHECK AND REMOVE HTTP AND HTTPS
$Cpassword = Input::post('cpassword');
$port = Input::post('port');
if($password !== $Cpassword) $token = Input::post('token');
throw new FuelException('Password match error!');
$curl = Request::forge('http://' . $url . ($port ? ':' . $port : '') . '/?X-Plex-Token=' . $token, 'curl');
$user = Model_User::forge(array( $result = $curl->execute();
'username' => $username,
'email' => $email, if(!$result)
'password' => hash('sha512', $config['default']['hash'] . $password), throw new FuelException('Can not connect to your server!');
'admin' => 1,
'lastlogin' => time() $server = Model_Server::forge();
)); $server->set([
'url' => $url,
if(!$user->validates()) { 'port' => $port,
throw new FuelException($user->validation()->show_errors()); 'token' => $token,
} 'lastcheck' => time()
]);
$user->save(); $server->save();
return $this->response(array('error' => false)); Config::save('lock', array('FUCK OFF!'));
} catch (Exception $e) {
return $this->response(array('error' => true, 'message' => $e->getMessage()), 404); return $this->response(array('error' => false));
} } catch (FuelException $e) {
} return $this->response(array('error' => true, 'message' => $e->getMessage()), 400);
}
}
} }

@ -1,7 +1,9 @@
<?php <?php
use Fuel\Core\Controller_Rest; use Fuel\Core\Controller_Rest;
use Fuel\Core\FuelException;
use Fuel\Core\Response; use Fuel\Core\Response;
use Fuel\Core\Session;
use Fuel\Core\View; use Fuel\Core\View;
class Controller_Rest_Settings extends Controller_Rest class Controller_Rest_Settings extends Controller_Rest
@ -12,4 +14,56 @@ class Controller_Rest_Settings extends Controller_Rest
return new Response($view); return new Response($view);
} }
public function post_server()
{
try {
$url = Input::post('url');
//@TODO CHECK AND REMOVE HTTP AND HTTPS
$port = Input::post('port');
$token = Input::post('token');
$curl = Request::forge('http://' . $url . ($port ? ':' . $port : '') . '/?X-Plex-Token=' . $token, 'curl');
$result = $curl->execute();
if(!$result)
throw new FuelException('Can not connect to your server!');
$server = Model_Server::forge();
$server->set([
'user_id' => Session::get('user')->id,
'url' => $url,
'port' => $port,
'token' => $token,
'lastcheck' => time()
]);
$server->save();
return $this->response(array('error' => false));
} catch (FuelException $e) {
return $this->response(array('error' => true, 'message' => $e->getMessage() ?: 'Wrong parameters'), 400);
}
}
public function delete_server()
{
try {
$server = Input::delete('server_id');
$user = Session::get('user');
$server = Model_Server::find_by_pk($server);
if(!$server || $server->user_id !== $user->id)
throw new FuelException('No server found!');
$server->set(['disable' => 1]);
$server->save();
return $this->response(array('error' => false));
} catch (FuelException $e) {
return $this->response(array('error' => true, 'message' => $e->getMessage() ?: 'Wrong parameters'), 400);
}
}
} }

@ -1,6 +1,7 @@
<?php <?php
use Fuel\Core\Controller_Template; use Fuel\Core\Controller_Template;
use Fuel\Core\DB;
use Fuel\Core\Response; use Fuel\Core\Response;
use Fuel\Core\Session; use Fuel\Core\Session;
use Fuel\Core\View; use Fuel\Core\View;
@ -31,12 +32,42 @@ class Controller_Settings extends Controller_Template
public function action_servers() public function action_servers()
{ {
$this->template->js_bottom = ['plex_alert.js'];
$body = View::forge('settings/servers'); $body = View::forge('settings/servers');
$servers = Model_Server::find_by('user_id',Session::get('user')->id); $user_id = Session::get('user')->id;
$servers = Model_Server::find(function($query) use($user_id) {
$query
->where('user_id', $user_id)
->and_where('disable', 0)
;
});
$body->set('servers', $servers); $body->set('servers', $servers);
$this->template->body = $body; $this->template->body = $body;
} }
public function action_libraries()
{
$body = View::forge('settings/libraries');
$user_id = Session::get('user')->id;
$libraries = Model_Library::find(function($query) use($user_id) {
$query
->select('library.*')
->join('server', 'LEFT')
->on('server.id', '=','library.server_id' )
->where('server.user_id', $user_id)
->and_where('server.disable', 0)
;
});
$body->set('libraries', $libraries);
$this->template->body = $body;
}
} }

@ -17,6 +17,34 @@ class Model_Library extends Model_Overwrite
'disable' 'disable'
); );
private $_server = null;
public function getServer()
{
if(!$this->_server)
$this->_server = Model_Server::find_by_pk($this->server_id);
return $this->_server;
}
public function getLastUpdate()
{
$dateString = date('Y/m/d H:i:s', time());
$now = new DateTime($dateString);
$dateString = date('Y-m-d H:i:s', $this->updatedAt);
$time = new DateTime($dateString);
$diff = date_diff($now, $time);
$days = $diff->days . 'd ';
$hours = $diff->h . 'h ';
$minutes = $diff->i . 'min ';
$seconds = $diff->s . 's';
return $days.$hours.$minutes.$seconds;
}
/** /**
* List all libraries and register it in database * List all libraries and register it in database
* @param $server * @param $server

@ -44,13 +44,6 @@ class Model_Server extends Model_Overwrite
//$curl = Request::forge('http://' . $config['main']['server'] . ':' . $config['main']['port'] . '/:/prefs?X-Plex-Token=' . $config['main']['token'], 'curl'); //$curl = Request::forge('http://' . $config['main']['server'] . ':' . $config['main']['port'] . '/:/prefs?X-Plex-Token=' . $config['main']['token'], 'curl');
public function initialise()
{
$servers = Model_Server::find();
self::BrowseServeur($servers);
}
/** /**
* Browse the list of server registered * Browse the list of server registered
* @param null $_servers * @param null $_servers

@ -0,0 +1,3 @@
<?php
return array('FUCK OFF!');

@ -1,28 +1,28 @@
<div class="PageContent-pageContent-16mK6 Scroller-scroller-d5-b- Scroller-vertical-1bgGS "> <div class="PageContent-pageContent-16mK6 Scroller-scroller-d5-b- Scroller-vertical-1bgGS ">
<div class="DashboardPage-dashboardPageContent-2rN8X PageContent-innerPageContent-3ktLT"> <div class="DashboardPage-dashboardPageContent-2rN8X PageContent-innerPageContent-3ktLT">
<div style="opacity: 1; pointer-events: auto;"> <div style="opacity: 1; pointer-events: auto;">
<div class="HubCell-hubCell-3Ys17" data-qa-id="hub--home.television.recent" <div class="HubCell-hubCell-3Ys17" data-qa-id="tv_show"
style="visibility: visible;"> style="visibility: visible;">
<div class="HubCellHeader-hubCellHeader-2pvYN"> <div class="HubCellHeader-hubCellHeader-2pvYN">
<div class="HubCellTitle-hubCellTitle-2abIn"><a <div class="HubCellTitle-hubCellTitle-2abIn"><a
href="#" role="link" class="Link-link-2XYrU Link-default-32xSO">RECENTLY ADDED TV</a></div> href="#" role="link" class="Link-link-2XYrU Link-default-32xSO">RECENTLY ADDED TV</a></div>
<div class="HubCell-hubActions-28w1-"> <div class="HubCell-hubActions-28w1- tv-shows-hubcell">
<button data-qa-id="hubPreviousButton" role="button" <button role="button" data-hubcell-action="previous"
class="HubCell-hubScrollButton-2Y7ri Link-link-2XYrU Link-default-32xSO isDisabled" class="HubCell-hubScrollButton-2Y7ri Link-link-2XYrU Link-default-32xSO isDisabled"
type="button" disabled=""> type="button">
<i class="plex-icon-hub-prev-560" aria-hidden="false" aria-label="Previous Page"></i> <i class="plex-icon-hub-prev-560"></i>
</button> </button>
<button data-qa-id="hubNextButton" role="button" <button role="button" data-hubcell-action="next"
class="HubCell-hubScrollButton-2Y7ri Link-link-2XYrU Link-default-32xSO" class="HubCell-hubScrollButton-2Y7ri Link-link-2XYrU Link-default-32xSO"
type="button"> type="button">
<i class="plex-icon-hub-next-560" aria-hidden="false" aria-label="Next Page"></i> <i class="plex-icon-hub-next-560"></i>
</button> </button>
</div> </div>
</div> </div>
<div style="height: 275px; overflow: hidden;"> <div style="height: 275px; overflow: hidden;">
<div class="Measure-container-2XznZ"> <div class="Measure-container-2XznZ">
<div class="VirtualListScroller-scroller-37EU_ Scroller-scroller-d5-b- Scroller-horizontal-1k8ET "> <div id="tv_show_list" class="VirtualListScroller-scroller-37EU_ Scroller-scroller-d5-b- Scroller-horizontal-1k8ET ">
<div class=" " style="width: 3019px; height: 275px;"> <div class=" " style="width: 4540px; height: 275px;">
<?php if($episodes) : ?> <?php if($episodes) : ?>
<?php <?php
$translate = -150; $translate = -150;
@ -115,29 +115,28 @@
</div> </div>
</div> </div>
</div> </div>
<div class="HubCell-hubCell-3Ys17" data-qa-id="hub--home.movies.recent" <div class="HubCell-hubCell-3Ys17" data-qa-id="movies"
style="visibility: visible;"> style="visibility: visible;">
<div class="HubCellHeader-hubCellHeader-2pvYN"> <div class="HubCellHeader-hubCellHeader-2pvYN">
<div class="HubCellTitle-hubCellTitle-2abIn"><a <div class="HubCellTitle-hubCellTitle-2abIn"><a
href="#" href="#"
role="link" class="Link-link-2XYrU Link-default-32xSO">RECENTLY ADDED MOVIES</a></div> role="link" class="Link-link-2XYrU Link-default-32xSO">RECENTLY ADDED MOVIES</a></div>
<div class="HubCell-hubActions-28w1-"> <div class="HubCell-hubActions-28w1- movies-hubcell">
<button data-qa-id="hubPreviousButton" role="button" <button role="button" data-hubcell-action="previous"
class="HubCell-hubScrollButton-2Y7ri Link-link-2XYrU Link-default-32xSO isDisabled" class="HubCell-hubScrollButton-2Y7ri Link-link-2XYrU Link-default-32xSO isDisabled"
type="button" disabled=""><i class="plex-icon-hub-prev-560" type="button">
aria-hidden="false" <i class="plex-icon-hub-prev-560"></i>
aria-label="Previous Page"></i>
</button> </button>
<button data-qa-id="hubNextButton" role="button" <button role="button" data-hubcell-action="next"
class="HubCell-hubScrollButton-2Y7ri Link-link-2XYrU Link-default-32xSO" class="HubCell-hubScrollButton-2Y7ri Link-link-2XYrU Link-default-32xSO"
type="button"><i class="plex-icon-hub-next-560" aria-hidden="false" type="button">
aria-label="Next Page"></i></button> <i class="plex-icon-hub-next-560"></i>
</div> </div>
</div> </div>
<div style="height: 255px; overflow: hidden;"> <div style="height: 255px; overflow: hidden;">
<div class="Measure-container-2XznZ"> <div class="Measure-container-2XznZ">
<div class="VirtualListScroller-scroller-37EU_ Scroller-scroller-d5-b- Scroller-horizontal-1k8ET "> <div id="movies_list" class="VirtualListScroller-scroller-37EU_ Scroller-scroller-d5-b- Scroller-horizontal-1k8ET ">
<div class=" " style="width: 3019px; height: 255px;"> <div class=" " style="width: 4540px; height: 255px;">
<?php if($movies) : ?> <?php if($movies) : ?>
<?php <?php
$translate = -150; $translate = -150;
@ -237,5 +236,38 @@ $(function () {
$('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id='+ movie_id +'&width='+ 126 +'&height='+189+'")'); $('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id='+ movie_id +'&width='+ 126 +'&height='+189+'")');
}, (index + 1) * 100); }, (index + 1) * 100);
}); });
$('.HubCell-hubActions-28w1- button').on('click', function(){
var parent = $(this).closest('div[data-qa-id]');
var select = $(parent).data('qa-id');
var previous = $(parent).find('button[data-hubcell-action="previous"]');
var next = $(parent).find('button[data-hubcell-action="next"]');
if($(this).data('hubcell-action') === 'previous') {
$('#' + select + '_list').animate({scrollLeft: $('#' + select + '_list').scrollLeft() - 152 * 2}, 500);
setTimeout(function(){
if($('#' + select + '_list').scrollLeft() <= (150 * 19)) {
$(next).removeClass('isDisabled');
}
if($('#' + select + '_list').scrollLeft() === 0) {
$(previous).addClass('isDisabled');
}
}, 500);
}
if($(this).data('hubcell-action') === 'next') {
$('#' + select + '_list').animate({scrollLeft: $('#' + select + '_list').scrollLeft() + 152 * 2}, 500);
setTimeout(function(){
if($('#' + select + '_list').scrollLeft() > 0) {
$(previous).removeClass('isDisabled');
}
console.log($('#' + select + '_list').scrollLeft());
if($('#' + select + '_list').scrollLeft() >= (150 * 19)) {
$(next).addClass('isDisabled');
}
}, 500);
}
});
}); });
</script> </script>

@ -36,8 +36,8 @@
<li><a class="card btn-gray selected" href="#checking">Configuration</a></li> <li><a class="card btn-gray selected" href="#checking">Configuration</a></li>
<li><a class="card btn-gray" href="#SQL">Configuration SQL</a></li> <li><a class="card btn-gray" href="#SQL">Configuration SQL</a></li>
<li><a class="card btn-gray" href="#create-table">Create Tables</a></li> <li><a class="card btn-gray" href="#create-table">Create Tables</a></li>
<li><a class="card btn-gray" href="#config-plex">Add plex server</a></li>
<li><a class="card btn-gray" href="#admin">Create Admin Account</a></li> <li><a class="card btn-gray" href="#admin">Create Admin Account</a></li>
<li><a class="card btn-gray" href="#config-plex">Add plex server</a></li>
</ul> </ul>
</div> </div>
<div class="col-sm-8 col-md-9"> <div class="col-sm-8 col-md-9">
@ -283,99 +283,99 @@
<span class="btn-label">Next ></span> <span class="btn-label">Next ></span>
</button> </button>
</div> </div>
<div id="config-plex" class="card-content hidden"> <div id="admin" class="card-content hidden">
<div class="FormGroup-group-15o1H"> <div class="FormGroup-group-15o1H">
<form class="Page-page-aq7i_"> <form class="Page-page-aq7i_">
<div class="PageHeader-pageHeader-18RSw"> <div class="PageHeader-pageHeader-18RSw">
Plex information: Create Admin account:
</div> </div>
<div> <div>
<label class="FormLabel-label-1sr1f " for="url"> <label class="FormLabel-label-1sr1f " for="email">
Plex URL: Admin Email:
</label> </label>
<input id="url" name="url" placeholder="127.0.0.1" <input id="email" name="email" placeholder="admin@domain.tld"
value="<?php echo isset($plex_url) ? $plex_url : ''; ?>"
class="TextInput-input-34u_B input-input-2ol6B TextInput-large-3XjFh input-large-1cY_k" class="TextInput-input-34u_B input-input-2ol6B TextInput-large-3XjFh input-large-1cY_k"
type="text"> type="text">
</div> </div>
<div> <div>
<label class="FormLabel-label-1sr1f " for="port"> <label class="FormLabel-label-1sr1f " for="username">
Plex Port: Admin Username:
</label> </label>
<input id="port" name="port" placeholder="3306" <input id="username" name="username" placeholder="Admin"
value="<?php echo isset($plex_port) ? $plex_port : ''; ?>"
class="TextInput-input-34u_B input-input-2ol6B TextInput-large-3XjFh input-large-1cY_k" class="TextInput-input-34u_B input-input-2ol6B TextInput-large-3XjFh input-large-1cY_k"
type="text"> type="text">
</div> </div>
<div> <div>
<label class="FormLabel-label-1sr1f " for="token"> <label class="FormLabel-label-1sr1f " for="password">
Plex Token: Admin Password:
</label> </label>
<input id="token" name="token" placeholder="YOURTOKEN" <input id="password" name="password" placeholder="••••••••••••••"
value="<?php echo isset($plex_token) ? $plex_token : ''; ?>"
class="TextInput-input-34u_B input-input-2ol6B TextInput-large-3XjFh input-large-1cY_k" class="TextInput-input-34u_B input-input-2ol6B TextInput-large-3XjFh input-large-1cY_k"
type="text"> type="password">
</div>
<div>
<label class="FormLabel-label-1sr1f " for="cpassword">
Admin Password Confirmation:
</label>
<input id="cpassword" name="cpassword" placeholder="••••••••••••••"
class="TextInput-input-34u_B input-input-2ol6B TextInput-large-3XjFh input-large-1cY_k"
type="password">
</div> </div>
</form> </form>
</div> </div>
<button class="btn btn-lg btn-primary btn-loading col-sm-4" <button class="btn btn-lg btn-primary btn-loading col-sm-4"
onclick="check_plex()"> onclick="create_admin()">
<span class="btn-label">Save it!</span> <span class="btn-label">Save it!</span>
</button> </button>
<button class="btn btn-lg btn-link btn-loading col-sm-offset-8 col-sm-4 hidden" <button class="btn btn-lg btn-link btn-loading col-sm-offset-8 col-sm-4 hidden"
type="button" type="button"
onclick="next()"> onclick="window.location.replace('/login');">
<span class="btn-label">Next ></span> <span class="btn-label">Finish!</span>
</button> </button>
</div> </div>
<div id="admin" class="card-content hidden"> <div id="config-plex" class="card-content hidden">
<div class="FormGroup-group-15o1H"> <div class="FormGroup-group-15o1H">
<form class="Page-page-aq7i_"> <form class="Page-page-aq7i_">
<div class="PageHeader-pageHeader-18RSw"> <div class="PageHeader-pageHeader-18RSw">
Create Admin account: Plex information:
</div> </div>
<div> <div>
<label class="FormLabel-label-1sr1f " for="email"> <label class="FormLabel-label-1sr1f " for="url">
Admin Email: Plex URL:
</label> </label>
<input id="email" name="email" placeholder="admin@domain.tld" <input id="url" name="url" placeholder="127.0.0.1"
value="<?php echo isset($plex_url) ? $plex_url : ''; ?>"
class="TextInput-input-34u_B input-input-2ol6B TextInput-large-3XjFh input-large-1cY_k" class="TextInput-input-34u_B input-input-2ol6B TextInput-large-3XjFh input-large-1cY_k"
type="text"> type="text">
</div> </div>
<div> <div>
<label class="FormLabel-label-1sr1f " for="username"> <label class="FormLabel-label-1sr1f " for="port">
Admin Username: Plex Port:
</label> </label>
<input id="username" name="username" placeholder="Admin" <input id="port" name="port" placeholder="3306"
value="<?php echo isset($plex_port) ? $plex_port : ''; ?>"
class="TextInput-input-34u_B input-input-2ol6B TextInput-large-3XjFh input-large-1cY_k" class="TextInput-input-34u_B input-input-2ol6B TextInput-large-3XjFh input-large-1cY_k"
type="text"> type="text">
</div> </div>
<div> <div>
<label class="FormLabel-label-1sr1f " for="password"> <label class="FormLabel-label-1sr1f " for="token">
Admin Password: Plex Token:
</label>
<input id="password" name="password" placeholder="••••••••••••••"
class="TextInput-input-34u_B input-input-2ol6B TextInput-large-3XjFh input-large-1cY_k"
type="password">
</div>
<div>
<label class="FormLabel-label-1sr1f " for="cpassword">
Admin Password Confirmation:
</label> </label>
<input id="cpassword" name="cpassword" placeholder="••••••••••••••" <input id="token" name="token" placeholder="YOURTOKEN"
value="<?php echo isset($plex_token) ? $plex_token : ''; ?>"
class="TextInput-input-34u_B input-input-2ol6B TextInput-large-3XjFh input-large-1cY_k" class="TextInput-input-34u_B input-input-2ol6B TextInput-large-3XjFh input-large-1cY_k"
type="password"> type="text">
</div> </div>
</form> </form>
</div> </div>
<button class="btn btn-lg btn-primary btn-loading col-sm-4" <button class="btn btn-lg btn-primary btn-loading col-sm-4"
onclick="create_admin()"> onclick="check_plex()">
<span class="btn-label">Save it!</span> <span class="btn-label">Save it!</span>
</button> </button>
<button class="btn btn-lg btn-link btn-loading col-sm-offset-8 col-sm-4 hidden" <button class="btn btn-lg btn-link btn-loading col-sm-offset-8 col-sm-4 hidden"
type="button" type="button"
onclick="window.location.replace('/login');"> onclick="next()">
<span class="btn-label">Finish!</span> <span class="btn-label">Next ></span>
</button> </button>
</div> </div>
</div> </div>
@ -637,17 +637,20 @@
document.getElementById('table').value = 'Please wait we are creating your tables!'; document.getElementById('table').value = 'Please wait we are creating your tables!';
} }
function check_plex() { function create_admin() {
var button = document.querySelector('#config-plex button'); var button = document.querySelector('#admin button');
var next = document.querySelector('#config-plex button.hidden'); var next = document.querySelector('#admin button.hidden');
var data = new FormData(document.querySelector('#config-plex form')); var data = new FormData(document.querySelector('#admin form'));
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('POST', '/rest/install/plex.json'); xhr.open('POST', '/rest/install/admin.json');
xhr.addEventListener('readystatechange', function () { xhr.addEventListener('readystatechange', function () {
if (xhr.readyState === XMLHttpRequest.DONE) { if (xhr.readyState === XMLHttpRequest.DONE) {
if(xhr.status === 500)
return show_alert('error', xhr.responseText);
var result = JSON.parse(xhr.responseText); var result = JSON.parse(xhr.responseText);
if(result.error === true) { if(result.error === true) {
show_alert('error', result.message); show_alert('error', result.message);
@ -661,20 +664,17 @@
xhr.send(data); xhr.send(data);
} }
function create_admin() { function check_plex() {
var button = document.querySelector('#admin button'); var button = document.querySelector('#config-plex button');
var next = document.querySelector('#admin button.hidden'); var next = document.querySelector('#config-plex button.hidden');
var data = new FormData(document.querySelector('#admin form')); var data = new FormData(document.querySelector('#config-plex form'));
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('POST', '/rest/install/admin.json'); xhr.open('POST', '/rest/install/plex.json');
xhr.addEventListener('readystatechange', function () { xhr.addEventListener('readystatechange', function () {
if (xhr.readyState === XMLHttpRequest.DONE) { if (xhr.readyState === XMLHttpRequest.DONE) {
if(xhr.status === 500)
return show_alert('error', xhr.responseText);
var result = JSON.parse(xhr.responseText); var result = JSON.parse(xhr.responseText);
if(result.error === true) { if(result.error === true) {
show_alert('error', result.message); show_alert('error', result.message);

@ -5,11 +5,11 @@
<button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button> <button type="button" class="close" data-dismiss="modal"><i class="glyphicon remove-2"></i></button>
<h4 class="modal-title"><i class="modal-icon glyphicon server-plus"></i> Add a new server</h4></div> <h4 class="modal-title"><i class="modal-icon glyphicon server-plus"></i> Add a new server</h4></div>
<div class="modal-body modal-body-scroll dark-scrollbar"> <div class="modal-body modal-body-scroll dark-scrollbar">
<div id="config-plex" class="card-content"> <div id="add-plex" class="card-content">
<div class="FormGroup-group-15o1H"> <div class="FormGroup-group-15o1H">
<form class="Page-page-aq7i_" style="height: auto"> <form class="Page-page-aq7i_" style="height: auto">
<div class="PageHeader-pageHeader-18RSw"> <div class="PageHeader-pageHeader-18RSw">
Plex information: Plex server information:
</div> </div>
<div> <div>
<label class="FormLabel-label-1sr1f " for="url"> <label class="FormLabel-label-1sr1f " for="url">
@ -40,15 +40,9 @@
</div> </div>
</form> </form>
</div> </div>
<button class="btn btn-lg btn-primary btn-loading col-sm-4" <button class="btn btn-lg btn-primary col-sm-4">
onclick="check_plex()">
<span class="btn-label">Save it!</span> <span class="btn-label">Save it!</span>
</button> </button>
<button class="btn btn-lg btn-link btn-loading col-sm-offset-8 col-sm-4 hidden"
type="button"
onclick="next()">
<span class="btn-label">Next ></span>
</button>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">

@ -4,8 +4,8 @@
<div class="row"> <div class="row">
<div class="col-sm-4 col-md-3"> <div class="col-sm-4 col-md-3">
<ul class="settings-nav nav nav-cards"> <ul class="settings-nav nav nav-cards">
<li><a class="card btn-gray selected" href="#general-web-group">Général</a></li> <li><a class="card btn-gray selected" href="#general-web-group">General</a></li>
<li><a class="card btn-gray" href="#quality-web-group">Qualité</a></li> <li><a class="card btn-gray" href="#quality-web-group">Sub Account</a></li>
<li class="advanced-setting"><a class="card btn-gray" href="#debug-web-group">Débogage</a></li> <li class="advanced-setting"><a class="card btn-gray" href="#debug-web-group">Débogage</a></li>
<li><a class="card btn-gray" href="#player-web-group">Lecteur</a></li> <li><a class="card btn-gray" href="#player-web-group">Lecteur</a></li>
</ul> </ul>
@ -14,50 +14,11 @@
<form id="web-settings-form"> <form id="web-settings-form">
<div id="general-web-group" class="settings-group active"><h4 class="version-title"> Version <div id="general-web-group" class="settings-group active"><h4 class="version-title"> Version
3.41.1 </h4> 3.41.1 </h4>
<div class="form-group"><label for="language">Langue</label> <select id="language"> <div class="form-group">
<label for="language">Langue</label>
<select id="language">
<option value="en"> English</option> <option value="en"> English</option>
<option value="en-GB"> English (UK)</option>
<option value="af"> Afrikaans</option>
<option value="my"> Burmese</option>
<option value="ca"> Català</option>
<option value="cs"> čeština</option>
<option value="sr"> српски језик</option>
<option value="da"> Dansk</option>
<option value="de"> Deutsch</option>
<option value="et"> eesti</option>
<option value="es"> Español</option>
<option value="es-419"> Español (Latinoamérica)</option>
<option value="el"> Ελληνικά</option>
<option value="fr" selected=""> Français</option> <option value="fr" selected=""> Français</option>
<option value="fr-CA"> Français Canadien</option>
<option value="hr"> hrvatski</option>
<option value="is"> Íslenska</option>
<option value="it"> Italiano</option>
<option value="lt"> lietuvių kalba</option>
<option value="hu"> Magyar</option>
<option value="nl"> Nederlands</option>
<option value="no"> Norsk</option>
<option value="pl"> Polski</option>
<option value="pt"> Português</option>
<option value="pt-BR"> Português Brasileiro</option>
<option value="ru"> русский язык</option>
<option value="ro"> română</option>
<option value="sk"> slovenčina</option>
<option value="sl"> Slovenščina</option>
<option value="fi"> Suomeksi</option>
<option value="sv"> Svenska</option>
<option value="vi"> Tiếng Việt</option>
<option value="tr"> Türkçe</option>
<option value="uk"> українська</option>
<option value="bg"> български език</option>
<option value="zh"> 中文</option>
<option value="zh-TW"> 臺語</option>
<option value="ja"> 日本語</option>
<option value="ko"> 한국어</option>
<option value="th"> ไทย</option>
<option value="fa"> فارسی</option>
<option value="ar"> العربية</option>
<option value="he"> עברית</option>
</select> </select>
<p class="help-block">Aidez-nous à traduire cette application dans votre langue <a <p class="help-block">Aidez-nous à traduire cette application dans votre langue <a
href="https://transifex.com/plex-1/plex-web" target="_blank">ici</a>.</p> href="https://transifex.com/plex-1/plex-web" target="_blank">ici</a>.</p>

@ -0,0 +1,58 @@
<div class="settings-container">
<div class="filter-bar">
<button class="toggle-advanced-btn btn btn-sm Button-primary-2LQVw pull-left add-libraries"
data-placement="top" data-toggle="tooltip" data-original-title="Add library"><i class="glyphicon circle-plus"></i></button>
<button class="toggle-advanced-btn btn btn-sm btn-default pull-right refresh">Refresh Libraries &nbsp;<i class="glyphicon refresh"></i></button>
</div>
<div class="devices-container row">
<div class="device-list-container col-sm-12 col-md-12">
<ul class="list card-tile-list">
<?php if($libraries) : ?>
<?php foreach ($libraries as $library) : ?>
<li class="card-tile-list-item card-3-col-item">
<div class="card card-device">
<div class="card-actions">
<button class="edit-device-btn card-action-btn btn-info"
data-placement="top" data-toggle="tooltip" data-original-title="Refresh">
<i class="glyphicon refresh"></i>
</button>
<button class="edit-device-btn card-action-btn"
data-placement="top" data-toggle="tooltip" data-original-title="Edit">
<i class="glyphicon pencil"></i>
</button>
<button class="edit-device-btn card-action-btn btn-danger"
data-placement="top" data-toggle="tooltip" data-original-title="Disable">
<i class="glyphicon ban"></i>
</button>
<button class="remove-libraries-btn card-action-btn btn-danger"
data-placement="top" data-toggle="tooltip" data-original-title="Delete">
<i class="glyphicon remove-2"></i>
</button>
</div>
<h4 class="name"><?php echo $library->name; ?> <span class="glyphicon ok-2 text-success"></span></h4>
<div class="card-details">
<div class="pull-right">
<div class="last-seen text-muted"><i class="plex-icon-watch-later-560"></i> <?php echo $library->getLastUpdate(); ?></div>
<span class="sync-info hidden">
<span class="glyphicon circle-arrow-down sync-icon"></span>
<span class="sync-count">123</span> / <span class="sync-size">456</span>
</span>
</div>
<span class="version text-muted"><?php echo $library->type; ?></span>
<div class="device-info-container">
<div class="product"><?php echo $library->getServer()->name; ?></div>
<div class="device text-muted"></div>
<div class="platform-info text-muted">
<span class="platform">Linux</span>
<span class="platform-version">Debian 8</span>
</div>
</div>
</div>
</div>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>
</div>
</div>

@ -1,27 +1,42 @@
<div class="settings-container"> <div class="settings-container">
<div class="filter-bar"> <div class="filter-bar">
<button class="toggle-advanced-btn btn btn-sm Button-primary-2LQVw pull-left add"><i class="glyphicon circle-plus"></i></button> <button class="toggle-advanced-btn btn btn-sm Button-primary-2LQVw pull-left add"
data-placement="top" data-toggle="tooltip" data-original-title="Add server"><i class="glyphicon circle-plus"></i></button>
<button class="toggle-advanced-btn btn btn-sm btn-default pull-right refresh">Refresh Servers &nbsp;<i class="glyphicon refresh"></i></button> <button class="toggle-advanced-btn btn btn-sm btn-default pull-right refresh">Refresh Servers &nbsp;<i class="glyphicon refresh"></i></button>
</div> </div>
<div class="devices-container row"> <div class="devices-container row">
<div class="device-list-container col-sm-12 col-md-12"> <div class="device-list-container col-sm-12 col-md-12">
<ul class="list card-tile-list"> <ul class="list card-tile-list">
<?php if($servers) : ?>
<?php foreach ($servers as $server) : ?> <?php foreach ($servers as $server) : ?>
<li class="card-tile-list-item card-2-col-item"> <li class="card-tile-list-item card-2-col-item">
<div class="card card-device"> <div class="card card-device">
<img class="card-poster device-icon" src="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTEwIDExMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGZpbGw9IiNlNWEwMGQiIGQ9Im0wIDBoMTEwdjExMGgtMTEweiIvPjxwYXRoIGQ9Im0zMCA2MGMxNi41NjkgMCAzMC0xMy40MzEgMzAtMzAgMC0xNi41NjktMTMuNDMxLTMwLTMwLTMwLTE2LjU2OSAwLTMwIDEzLjQzMS0zMCAzMCAwIDE2LjU2OSAxMy40MzEgMzAgMzAgMzBtLS41NzEtNDguNzJsMTIuMTQ5IDE4Ljc0OS0xMi4xNSAxOC43NWgtNS41MDQtNS41MDR2LS4wMDRsMTIuMTQ3LTE4Ljc0Ni0xMi4xNDctMTguNzQ2di0uMDAyaDExLjAxIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyNSAyNSkiIGZpbGw9IiMxZjFmMWYiLz48L2c+PC9zdmc+"> <img class="card-poster device-icon" src="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTEwIDExMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGZpbGw9IiNlNWEwMGQiIGQ9Im0wIDBoMTEwdjExMGgtMTEweiIvPjxwYXRoIGQ9Im0zMCA2MGMxNi41NjkgMCAzMC0xMy40MzEgMzAtMzAgMC0xNi41NjktMTMuNDMxLTMwLTMwLTMwLTE2LjU2OSAwLTMwIDEzLjQzMS0zMCAzMCAwIDE2LjU2OSAxMy40MzEgMzAgMzAgMzBtLS41NzEtNDguNzJsMTIuMTQ5IDE4Ljc0OS0xMi4xNSAxOC43NWgtNS41MDQtNS41MDR2LS4wMDRsMTIuMTQ3LTE4Ljc0Ni0xMi4xNDctMTguNzQ2di0uMDAyaDExLjAxIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyNSAyNSkiIGZpbGw9IiMxZjFmMWYiLz48L2c+PC9zdmc+">
<div class="card-actions"> <div class="card-actions">
<button class="remove-device-btn card-action-btn btn-danger"> <button class="edit-device-btn card-action-btn btn-info"
data-placement="top" data-toggle="tooltip" data-original-title="Refresh">
<i class="glyphicon refresh"></i>
</button>
<button class="edit-device-btn card-action-btn"
data-placement="top" data-toggle="tooltip" data-original-title="Edit">
<i class="glyphicon pencil"></i>
</button>
<button class="edit-device-btn card-action-btn btn-danger"
data-placement="top" data-toggle="tooltip" data-original-title="Disable">
<i class="glyphicon ban"></i>
</button>
<button class="remove-libraries-btn card-action-btn btn-danger" data-server-id="<?php echo $server->id; ?>"
data-placement="top" data-toggle="tooltip" data-original-title="Delete">
<i class="glyphicon remove-2"></i> <i class="glyphicon remove-2"></i>
</button> </button>
</div> </div>
<h4 class="name"><?php echo $server->name; ?> <span data-placement="top" data-toggle="tooltip" data-original-title="<?php echo $server->online ? 'online' : 'offline' ; ?>" class="glyphicon <?php echo $server->online ? 'server text-success' : 'server-ban text-danger' ; ?>"></span></h4> <h4 class="name"><?php echo $server->name; ?> <span data-placement="top" data-toggle="tooltip" data-original-title="<?php echo $server->online ? 'online' : 'offline' ; ?>" class="glyphicon <?php echo $server->online ? 'server text-success' : 'server-ban text-danger' ; ?>"></span></h4>
<div class="card-details"> <div class="card-details">
<div class="pull-right"> <div class="pull-right">
<div class="last-seen text-muted"><?php echo $server->getLastCheck(); ?></div> <div class="last-seen text-muted"><i class="plex-icon-watch-later-560"></i> <?php echo $server->getLastCheck(); ?></div>
<span class="sync-info hidden"> <span class="sync-info hidden">
<span class="glyphicon circle-arrow-down sync-icon"></span> <span class="glyphicon circle-arrow-down sync-icon"></span>
<span class="sync-count">123</span> <span class="sync-size">123</span> <span class="sync-count">123</span> / <span class="sync-size">456</span>
</span> </span>
</div> </div>
<span class="version text-muted"><?php echo $server->version; ?></span> <span class="version text-muted"><?php echo $server->version; ?></span>
@ -37,6 +52,7 @@
</div> </div>
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>
</ul> </ul>
</div> </div>
</div> </div>
@ -48,14 +64,45 @@
method: 'get', method: 'get',
url: '/rest/settings/add_server.json' url: '/rest/settings/add_server.json'
}).done(function (data) { }).done(function (data) {
$('body').append(data); $('body').append(data).delay(100).queue(function() {
setTimeout(function() {
$('.media-server-modal').removeClass('out').addClass('in'); $('.media-server-modal').removeClass('out').addClass('in');
}, 100); });
}); });
}); });
$(document).on('click', '.media-server-modal button.close', function () { $(document).on('click', '.media-server-modal button.close', function () {
$('.media-server-modal').remove(); $('.media-server-modal').removeClass('in').addClass('out').delay(500).queue(function(){ $(this).remove()});
});
$(document).on('click', '#add-plex button', function () {
var url = $('#add-plex #url').val();
var port = $('#add-plex #port').val();
var token = $('#add-plex #token').val();
$.ajax({
method: 'post',
url: '/rest/settings/server.json',
data: {url: url, port: port, token: token}
}).done(function (data) {
show_alert('success', 'Server save succesfully!');
$('.media-server-modal button.close').click();
}).fail(function (data) {
data = JSON.parse(data.responseText);
show_alert('error', data.message);
setTimeout(function(){location.reload()}, 200);
});
});
$(document).on('click', 'button.remove-device-btn', function () {
var button = this;
var server_id = $(this).data('server-id');
$.ajax({
method: 'delete',
url: '/rest/settings/server.json',
data: {server_id: server_id}
}).done(function (data) {
show_alert('success', 'Server delete succesfully!');
$(button).closest('li').get(0).remove();
}).fail(function (data) {
data = JSON.parse(data.responseText);
show_alert('error', data.message);
});
}); });
}); });
// UPDATE DATA SERVER AND BROWSING // UPDATE DATA SERVER AND BROWSING

@ -4724,7 +4724,7 @@ label.disabled {
.alert > .alert-icon { .alert > .alert-icon {
position: absolute; position: absolute;
top: 50%; top: 40%;
left: 35px; left: 35px;
margin-top: -24px; margin-top: -24px;
font-size: 48px; font-size: 48px;
@ -9924,11 +9924,15 @@ a.card:focus, a.card:hover {
font-size: 16px font-size: 16px
} }
.card-action-btn.btn-danger, .card-action-btn.btn-success { .card-action-btn.btn-danger:active,
color: #ac3323 .card-action-btn.btn-danger:focus,
} .card-action-btn.btn-danger:hover,
.card-action-btn.btn-success:active,
.card-action-btn.btn-danger:active, .card-action-btn.btn-danger:focus, .card-action-btn.btn-danger:hover, .card-action-btn.btn-success:active, .card-action-btn.btn-success:focus, .card-action-btn.btn-success:hover { .card-action-btn.btn-success:focus,
.card-action-btn.btn-success:hover,
.card-action-btn.btn-info:active,
.card-action-btn.btn-info:focus,
.card-action-btn.btn-info:hover {
background: none; background: none;
border: 0; border: 0;
outline: 0; outline: 0;
@ -9936,6 +9940,14 @@ a.card:focus, a.card:hover {
box-shadow: none box-shadow: none
} }
.card-action-btn.btn-info {
color: #2d6ca2;
}
.card-action-btn.btn-danger {
color: #ac3323
}
.card-action-btn.btn-success { .card-action-btn.btn-success {
color: #5cb85c color: #5cb85c
} }
@ -9954,15 +9966,19 @@ a.card:focus, a.card:hover {
cursor: default cursor: default
} }
.card-action-btn.btn-danger, .card-action-btn.btn-success { .card-action-btn.btn-danger, .card-action-btn.btn-info.disabled, .card-action-btn.btn-success {
background: none background: none
} }
.card-action-btn.btn-danger.disabled, .card-action-btn.btn-success.disabled { .card-action-btn.btn-danger.disabled, .card-action-btn.btn-info.disabled, .card-action-btn.btn-success.disabled {
opacity: .2; opacity: .2;
filter: alpha(opacity=20) filter: alpha(opacity=20)
} }
.card-action-btn.btn-info.disabled {
color: #2d6ca2;
}
.card-action-btn.btn-success.disabled { .card-action-btn.btn-success.disabled {
color: #5cb85c color: #5cb85c
} }

Loading…
Cancel
Save