mirror of https://github.com/sualko/cloud_bbb
feat: show warning if api is not configured
parent
6587b53246
commit
e147019dbe
|
@ -4,15 +4,40 @@ namespace OCA\BigBlueButton\Settings;
|
|||
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\Settings\ISettings;
|
||||
use OCP\IConfig;
|
||||
use \OCP\IL10N;
|
||||
|
||||
class Personal implements ISettings
|
||||
{
|
||||
/** @var IConfig */
|
||||
private $config;
|
||||
|
||||
/** @var IL10N */
|
||||
private $l;
|
||||
|
||||
/**
|
||||
* Admin constructor.
|
||||
*
|
||||
* @param IConfig $config
|
||||
*/
|
||||
public function __construct(IConfig $config, IL10N $l)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->l = $l;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TemplateResponse
|
||||
*/
|
||||
public function getForm()
|
||||
{
|
||||
return new TemplateResponse('bbb', 'manager');
|
||||
$warning = '';
|
||||
|
||||
if (empty($this->config->getAppValue('bbb', 'api.url')) || empty($this->config->getAppValue('bbb', 'api.secret'))) {
|
||||
$warning = $this->l->t('API url or secret not configured. Please contact your administrator.');
|
||||
}
|
||||
|
||||
return new TemplateResponse('bbb', 'manager', ['warning' => $warning]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,3 +3,9 @@ script('bbb', 'manager');
|
|||
?>
|
||||
|
||||
<div id="bbb-root"></div>
|
||||
|
||||
<?php if(!empty($_['warning'])): ?>
|
||||
<div id="bbb-warning">
|
||||
<span class="icon icon-error-color icon-visible"></span> <?php p($_['warning']); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
|
@ -1,6 +1,12 @@
|
|||
#bbb-react-root, #bbb-root {
|
||||
height: 100%;
|
||||
min-height: calc(100vh - 50px);
|
||||
#bbb-warning {
|
||||
margin: 3em;
|
||||
padding: 1em;
|
||||
background-color: rgb(255, 255, 123);
|
||||
display: inline-block;
|
||||
|
||||
.icon {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
#bbb-react-root {
|
||||
|
|
Loading…
Reference in New Issue