Skip to content

Commit

Permalink
Couple small bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
joszz committed Jun 16, 2021
1 parent 5539b97 commit 1c3621c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/controllers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function initialize()
{
$this->settings = $this->di->get('settings');

if (in_array($this->dispatcher->getControllerName(), $this->controllersToLoadMenu))
if ($this->di->has('db') && in_array($this->dispatcher->getControllerName(), $this->controllersToLoadMenu))
{
if ($this->session->get('auth'))
{
Expand Down
10 changes: 8 additions & 2 deletions app/forms/formfields/dashboard/CouchpotatoFormFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,18 @@ protected function initializeFields()
->setFilters(['striptags', 'string'])
->setAttributes(['class' => 'form-control', 'fieldset' => true])
->setDefault($this->form->settings->couchpotato->tmdb_api_url)
->addValidator(new UrlValidator(['message' => $this->form->translator->validation['url']]));
->addValidators([
new UrlValidator(['message' => $this->form->translator->validation['url'], 'allowEmpty' => true]),
new PresenceOfConfirmation(['message' => $this->form->translator->validation['required'], 'with' => 'couchpotato-enabled'])
]);

$this->fields[] = $tmdbAPIKey = new Password('couchpotato-tmdb_api_key');
$tmdbAPIKey->setLabel('TMDB API key')
->setFilters(['striptags', 'string'])
->setAttributes(['class' => 'form-control', 'fieldset' => 'end'])
->setDefault($this->form->settings->couchpotato->tmdb_api_key);
->setDefault($this->form->settings->couchpotato->tmdb_api_key)
->addValidators([
new PresenceOfConfirmation(['message' => $this->form->translator->validation['required'], 'with' => 'couchpotato-enabled'])
]);
}
}
2 changes: 1 addition & 1 deletion app/forms/formfields/dashboard/JellyfinFormFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected function initializeFields()
'class' => 'form-control',
'multiple' => 'multiple',
'fieldset' => 'end',
'data-selected' => $this->form->settings->jellyfin->views,
'data-selected' => $this->form->settings->jellyfin->views ?? '',
'data-apiurl' => '../jellyfin/views'
])
->setUserOptions(['buttons' => ['refresh_api_data']]);
Expand Down
2 changes: 1 addition & 1 deletion app/forms/formfields/dashboard/PulsewayFormFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function initializeFields()
'multiple' => 'multiple',
'fieldset' => 'end',
'disabled' => true,
'data-selected' => $this->form->settings->pulseway->systems,
'data-selected' => $this->form->settings->pulseway->systems ?? '',
'data-apiurl' => '../pulseway/systems'
])
->setUserOptions(['buttons' => ['refresh_api_data']]);
Expand Down
1 change: 1 addition & 0 deletions app/forms/formfields/dashboard/SpeedtestFormFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ protected function initializeFields()
$this->fields[] = $speedtestGetIP = new Check('speedtest-get_isp_info');
$speedtestGetIP->setLabel('Get ISP IP');
$speedtestGetIP->setAttributes([
'value' => '1',
'checked' => $this->form->settings->speedtest->get_isp_info == '1' ? 'checked' : null,
'data-toggle' => 'toggle',
'data-onstyle' => 'success',
Expand Down
6 changes: 4 additions & 2 deletions js/dashboard-blocks/phpsysinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,17 @@
block.find(".update .packages .value").html(packages);
block.find(".update .security .value").html(security);

if (count > 0) {
if (count > 0 && settings.setBadges) {
//todo: handle the error with .catch((error)
navigator.setAppBadge(count);
return;
}
}

//todo: handle the error with .catch((error)
navigator.clearAppBadge();
if (settings.setBadges) {
navigator.clearAppBadge();
}
},

/**
Expand Down

0 comments on commit 1c3621c

Please sign in to comment.