Merge pull request #3089 from CachetHQ/laravel-56

Upgrade to Laravel 5.6
This commit is contained in:
James Brooks
2018-06-26 18:31:46 +01:00
committed by GitHub
130 changed files with 2562 additions and 1741 deletions

View File

@@ -1,5 +1,5 @@
language: php language: php
dist: trusty
sudo: false sudo: false
branches: branches:
@@ -7,9 +7,8 @@ branches:
- l10n_2.4 - l10n_2.4
php: php:
- 5.6
- 7.0
- 7.1 - 7.1
- 7.2
before_install: before_install:
- cp .env.example .env - cp .env.example .env
@@ -17,4 +16,10 @@ before_install:
install: travis_retry composer install --no-interaction --no-suggest install: travis_retry composer install --no-interaction --no-suggest
script: vendor/bin/phpunit script:
- if [ "$TRAVIS_PHP_VERSION" != "7.1" ]; then vendor/bin/phpunit; fi
- if [ "$TRAVIS_PHP_VERSION" == "7.1" ]; then vendor/bin/phpunit --coverage-clover build/logs/clover.xml; fi
after_script:
- if [ "$TRAVIS_PHP_VERSION" == "7.1" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [ "$TRAVIS_PHP_VERSION" == "7.1" ]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi

View File

@@ -16,7 +16,7 @@ use CachetHQ\Cachet\Models\Invite;
/** /**
* This is the user was invited event class. * This is the user was invited event class.
* *
* @author Joseph Cohen <joealt-three.com> * @author Joseph Cohen <joe@alt-three.com>
* @author Graham Campbell <graham@alt-three.com> * @author Graham Campbell <graham@alt-three.com>
* @author James Brooks <james@alt-three.com> * @author James Brooks <james@alt-three.com>
*/ */

View File

@@ -61,7 +61,7 @@ class CreateComponentCommandHandler
/** /**
* Filter the command data. * Filter the command data.
* *
* @param \CachetHQ\Cachet\Bus\Commands\Incident\CreateComponentCommand $command * @param \CachetHQ\Cachet\Bus\Commands\Component\CreateComponentCommand $command
* *
* @return array * @return array
*/ */

View File

@@ -64,7 +64,7 @@ class UpdateComponentCommandHandler
/** /**
* Filter the command data. * Filter the command data.
* *
* @param \CachetHQ\Cachet\Bus\Commands\Incident\UpdateComponentCommand $command * @param \CachetHQ\Cachet\Bus\Commands\Component\UpdateComponentCommand $command
* *
* @return array * @return array
*/ */

View File

@@ -116,7 +116,7 @@ class CreateIncidentCommandHandler
// Update the component. // Update the component.
if ($component = Component::find($command->component_id)) { if ($component = Component::find($command->component_id)) {
dispatch(new UpdateComponentCommand( execute(new UpdateComponentCommand(
Component::find($command->component_id), Component::find($command->component_id),
null, null,
null, null,

View File

@@ -88,7 +88,7 @@ class UpdateIncidentCommandHandler
// Update the component. // Update the component.
if ($component = Component::find($command->component_id)) { if ($component = Component::find($command->component_id)) {
dispatch(new UpdateComponentCommand( execute(new UpdateComponentCommand(
Component::find($command->component_id), Component::find($command->component_id),
null, null,
null, null,

View File

@@ -63,7 +63,7 @@ class CreateIncidentUpdateCommandHandler
$update = IncidentUpdate::create($data); $update = IncidentUpdate::create($data);
// Update the original incident with the new status. // Update the original incident with the new status.
dispatch(new UpdateIncidentCommand( execute(new UpdateIncidentCommand(
$command->incident, $command->incident,
null, null,
$command->status, $command->status,

View File

@@ -20,7 +20,7 @@ class ClaimInviteCommandHandler
/** /**
* Handle the claim invite command. * Handle the claim invite command.
* *
* @param \CachetHQ\Cachet\Bus\Commands\User\ClaimInviteCommand $command * @param \CachetHQ\Cachet\Bus\Commands\Invite\ClaimInviteCommand $command
* *
* @return void * @return void
*/ */

View File

@@ -58,7 +58,7 @@ class SubscribeSubscriberCommandHandler
}); });
if ($command->verified) { if ($command->verified) {
dispatch(new VerifySubscriberCommand($subscriber)); execute(new VerifySubscriberCommand($subscriber));
} else { } else {
$subscriber->notify(new VerifySubscriptionNotification()); $subscriber->notify(new VerifySubscriptionNotification());
} }

View File

@@ -44,7 +44,7 @@ class SendBeaconJobHandler
/** /**
* Handle the send beacon job. * Handle the send beacon job.
* *
* @param \CachetHQ\Cachet\Bus\Jobs\SendBeaconJob $job * @param \CachetHQ\Cachet\Bus\Jobs\System\SendBeaconJob $job
* *
* @return void * @return void
*/ */

View File

@@ -50,6 +50,9 @@ class StatusComposer
*/ */
public function compose(View $view) public function compose(View $view)
{ {
$view->with($this->system->getStatus()); $status = $this->system->getStatus();
$view->withSystemStatus(array_get($status, 'system_status'));
$view->withSystemMessage(array_get($status, 'system_message'));
} }
} }

View File

@@ -40,7 +40,7 @@ class BeaconCommand extends Command
* *
* @return void * @return void
*/ */
public function fire() public function handle()
{ {
dispatch(new SendBeaconJob()); dispatch(new SendBeaconJob());
} }

View File

@@ -46,7 +46,7 @@ class DemoMetricPointSeederCommand extends Command
* *
* @return void * @return void
*/ */
public function fire() public function handle()
{ {
if (!$this->confirmToProceed()) { if (!$this->confirmToProceed()) {
return; return;

View File

@@ -79,7 +79,7 @@ class DemoSeederCommand extends Command
* *
* @return void * @return void
*/ */
public function fire() public function handle()
{ {
if (!$this->confirmToProceed()) { if (!$this->confirmToProceed()) {
return; return;

View File

@@ -41,7 +41,7 @@ class InstallCommand extends Command
* *
* @return void * @return void
*/ */
public function fire() public function handle()
{ {
if (!$this->confirm('Do you want to install Cachet?')) { if (!$this->confirm('Do you want to install Cachet?')) {
$this->line('Installation aborted. Goodbye!'); $this->line('Installation aborted. Goodbye!');

View File

@@ -39,7 +39,7 @@ class VersionCommand extends Command
* *
* @return void * @return void
*/ */
public function fire() public function handle()
{ {
$this->info('Cachet '.CACHET_VERSION.' is installed ⚡'); $this->info('Cachet '.CACHET_VERSION.' is installed ⚡');
} }

View File

@@ -29,7 +29,7 @@ class JsonValidationDisplayer extends JsonDisplayer implements DisplayerInterfac
* *
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
*/ */
public function display(Exception $exception, $id, $code, array $headers) public function display(Exception $exception, string $id, int $code, array $headers)
{ {
$info = $this->info->generate($exception, $id, 400); $info = $this->info->generate($exception, $id, 400);
@@ -47,7 +47,7 @@ class JsonValidationDisplayer extends JsonDisplayer implements DisplayerInterfac
* *
* @return bool * @return bool
*/ */
public function canDisplay(Exception $original, Exception $transformed, $code) public function canDisplay(Exception $original, Exception $transformed, int $code)
{ {
return $transformed instanceof ValidationException; return $transformed instanceof ValidationException;
} }

View File

@@ -53,7 +53,7 @@ class MaintenanceDisplayer implements DisplayerInterface
* *
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
*/ */
public function display(Exception $exception, $id, $code, array $headers) public function display(Exception $exception, string $id, int $code, array $headers)
{ {
return new Response($this->render(), $code, array_merge($headers, ['Content-Type' => $this->contentType()])); return new Response($this->render(), $code, array_merge($headers, ['Content-Type' => $this->contentType()]));
} }
@@ -87,7 +87,7 @@ class MaintenanceDisplayer implements DisplayerInterface
* *
* @return bool * @return bool
*/ */
public function canDisplay(Exception $original, Exception $transformed, $code) public function canDisplay(Exception $original, Exception $transformed, int $code)
{ {
return $transformed instanceof MaintenanceModeException; return $transformed instanceof MaintenanceModeException;
} }

View File

@@ -47,7 +47,7 @@ class RedirectDisplayer implements DisplayerInterface
* *
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
*/ */
public function display(Exception $exception, $id, $code, array $headers) public function display(Exception $exception, string $id, int $code, array $headers)
{ {
return redirect()->guest('auth/login'); return redirect()->guest('auth/login');
} }
@@ -71,7 +71,7 @@ class RedirectDisplayer implements DisplayerInterface
* *
* @return bool * @return bool
*/ */
public function canDisplay(Exception $original, Exception $transformed, $code) public function canDisplay(Exception $original, Exception $transformed, int $code)
{ {
$redirect = $transformed instanceof HttpExceptionInterface && $transformed->getStatusCode() === 401; $redirect = $transformed instanceof HttpExceptionInterface && $transformed->getStatusCode() === 401;

View File

@@ -47,7 +47,7 @@ class ThrottleDisplayer implements DisplayerInterface
* *
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
*/ */
public function display(Exception $exception, $id, $code, array $headers) public function display(Exception $exception, string $id, int $code, array $headers)
{ {
return cachet_redirect('auth.login')->withError(trans('forms.login.rate-limit')); return cachet_redirect('auth.login')->withError(trans('forms.login.rate-limit'));
} }
@@ -71,7 +71,7 @@ class ThrottleDisplayer implements DisplayerInterface
* *
* @return bool * @return bool
*/ */
public function canDisplay(Exception $original, Exception $transformed, $code) public function canDisplay(Exception $original, Exception $transformed, int $code)
{ {
return $transformed instanceof TooManyRequestsHttpException && $this->request->is('auth*'); return $transformed instanceof TooManyRequestsHttpException && $this->request->is('auth*');
} }

View File

@@ -27,7 +27,7 @@ class ApiFilter
* *
* @return \GrahamCampbell\Exceptions\Displayers\DisplayerInterface[] * @return \GrahamCampbell\Exceptions\Displayers\DisplayerInterface[]
*/ */
public function filter(array $displayers, Request $request, Exception $original, Exception $transformed, $code) public function filter(array $displayers, Request $request, Exception $original, Exception $transformed, int $code)
{ {
if ($request->is('api*')) { if ($request->is('api*')) {
foreach ($displayers as $index => $displayer) { foreach ($displayers as $index => $displayer) {

View File

@@ -33,6 +33,8 @@ class AppServiceProvider extends ServiceProvider
* Boot the service provider. * Boot the service provider.
* *
* @param \AltThree\Bus\Dispatcher $dispatcher * @param \AltThree\Bus\Dispatcher $dispatcher
*
* @return void
*/ */
public function boot(Dispatcher $dispatcher) public function boot(Dispatcher $dispatcher)
{ {

View File

@@ -76,7 +76,7 @@ class ComponentController extends AbstractApiController
public function store() public function store()
{ {
try { try {
$component = dispatch(new CreateComponentCommand( $component = execute(new CreateComponentCommand(
Binput::get('name'), Binput::get('name'),
Binput::get('description'), Binput::get('description'),
Binput::get('status'), Binput::get('status'),
@@ -97,9 +97,9 @@ class ComponentController extends AbstractApiController
Collection::make(preg_split('/ ?, ?/', $tags))->map(function ($tag) { Collection::make(preg_split('/ ?, ?/', $tags))->map(function ($tag) {
return trim($tag); return trim($tag);
})->map(function ($tag) { })->map(function ($tag) {
return dispatch(new CreateTagCommand($tag)); return execute(new CreateTagCommand($tag));
})->each(function ($tag) use ($component) { })->each(function ($tag) use ($component) {
dispatch(new ApplyTagCommand($component, $tag)); execute(new ApplyTagCommand($component, $tag));
}); });
} }
@@ -116,7 +116,7 @@ class ComponentController extends AbstractApiController
public function update(Component $component) public function update(Component $component)
{ {
try { try {
dispatch(new UpdateComponentCommand( execute(new UpdateComponentCommand(
$component, $component,
Binput::get('name'), Binput::get('name'),
Binput::get('description'), Binput::get('description'),
@@ -139,9 +139,9 @@ class ComponentController extends AbstractApiController
Collection::make(preg_split('/ ?, ?/', $tags))->map(function ($tag) { Collection::make(preg_split('/ ?, ?/', $tags))->map(function ($tag) {
return trim($tag); return trim($tag);
})->map(function ($tag) { })->map(function ($tag) {
return dispatch(new CreateTagCommand($tag)); return execute(new CreateTagCommand($tag));
})->each(function ($tag) use ($component) { })->each(function ($tag) use ($component) {
dispatch(new ApplyTagCommand($component, $tag)); execute(new ApplyTagCommand($component, $tag));
}); });
} }
@@ -157,7 +157,7 @@ class ComponentController extends AbstractApiController
*/ */
public function destroy(Component $component) public function destroy(Component $component)
{ {
dispatch(new RemoveComponentCommand($component)); execute(new RemoveComponentCommand($component));
return $this->noContent(); return $this->noContent();
} }

View File

@@ -92,7 +92,7 @@ class ComponentGroupController extends AbstractApiController
public function store() public function store()
{ {
try { try {
$group = dispatch(new CreateComponentGroupCommand( $group = execute(new CreateComponentGroupCommand(
Binput::get('name'), Binput::get('name'),
Binput::get('order', 0), Binput::get('order', 0),
Binput::get('collapsed', 0), Binput::get('collapsed', 0),
@@ -115,7 +115,7 @@ class ComponentGroupController extends AbstractApiController
public function update(ComponentGroup $group) public function update(ComponentGroup $group)
{ {
try { try {
$group = dispatch(new UpdateComponentGroupCommand( $group = execute(new UpdateComponentGroupCommand(
$group, $group,
Binput::get('name'), Binput::get('name'),
Binput::get('order'), Binput::get('order'),
@@ -138,7 +138,7 @@ class ComponentGroupController extends AbstractApiController
*/ */
public function destroy(ComponentGroup $group) public function destroy(ComponentGroup $group)
{ {
dispatch(new RemoveComponentGroupCommand($group)); execute(new RemoveComponentGroupCommand($group));
return $this->noContent(); return $this->noContent();
} }

View File

@@ -67,7 +67,7 @@ class IncidentController extends AbstractApiController
public function store() public function store()
{ {
try { try {
$incident = dispatch(new CreateIncidentCommand( $incident = execute(new CreateIncidentCommand(
Binput::get('name'), Binput::get('name'),
Binput::get('status'), Binput::get('status'),
Binput::get('message', null, false, false), Binput::get('message', null, false, false),
@@ -98,7 +98,7 @@ class IncidentController extends AbstractApiController
public function update(Incident $incident) public function update(Incident $incident)
{ {
try { try {
$incident = dispatch(new UpdateIncidentCommand( $incident = execute(new UpdateIncidentCommand(
$incident, $incident,
Binput::get('name'), Binput::get('name'),
Binput::get('status'), Binput::get('status'),
@@ -128,7 +128,7 @@ class IncidentController extends AbstractApiController
*/ */
public function destroy(Incident $incident) public function destroy(Incident $incident)
{ {
dispatch(new RemoveIncidentCommand($incident)); execute(new RemoveIncidentCommand($incident));
return $this->noContent(); return $this->noContent();
} }

View File

@@ -74,7 +74,7 @@ class IncidentUpdateController extends AbstractApiController
public function store(Incident $incident) public function store(Incident $incident)
{ {
try { try {
$update = dispatch(new CreateIncidentUpdateCommand( $update = execute(new CreateIncidentUpdateCommand(
$incident, $incident,
Binput::get('status'), Binput::get('status'),
Binput::get('message'), Binput::get('message'),
@@ -100,7 +100,7 @@ class IncidentUpdateController extends AbstractApiController
public function update(Incident $incident, IncidentUpdate $update) public function update(Incident $incident, IncidentUpdate $update)
{ {
try { try {
$update = dispatch(new UpdateIncidentUpdateCommand( $update = execute(new UpdateIncidentUpdateCommand(
$update, $update,
Binput::get('status'), Binput::get('status'),
Binput::get('message'), Binput::get('message'),
@@ -124,7 +124,7 @@ class IncidentUpdateController extends AbstractApiController
public function destroy(Incident $incident, IncidentUpdate $update) public function destroy(Incident $incident, IncidentUpdate $update)
{ {
try { try {
dispatch(new RemoveIncidentUpdateCommand($update)); execute(new RemoveIncidentUpdateCommand($update));
} catch (QueryException $e) { } catch (QueryException $e) {
throw new BadRequestHttpException(); throw new BadRequestHttpException();
} }

View File

@@ -62,7 +62,7 @@ class MetricController extends AbstractApiController
public function store() public function store()
{ {
try { try {
$metric = dispatch(new CreateMetricCommand( $metric = execute(new CreateMetricCommand(
Binput::get('name'), Binput::get('name'),
Binput::get('suffix'), Binput::get('suffix'),
Binput::get('description'), Binput::get('description'),
@@ -92,7 +92,7 @@ class MetricController extends AbstractApiController
public function update(Metric $metric) public function update(Metric $metric)
{ {
try { try {
$metric = dispatch(new UpdateMetricCommand( $metric = execute(new UpdateMetricCommand(
$metric, $metric,
Binput::get('name'), Binput::get('name'),
Binput::get('suffix'), Binput::get('suffix'),
@@ -122,7 +122,7 @@ class MetricController extends AbstractApiController
*/ */
public function destroy(Metric $metric) public function destroy(Metric $metric)
{ {
dispatch(new RemoveMetricCommand($metric)); execute(new RemoveMetricCommand($metric));
return $this->noContent(); return $this->noContent();
} }

View File

@@ -48,7 +48,7 @@ class MetricPointController extends AbstractApiController
public function store(Metric $metric) public function store(Metric $metric)
{ {
try { try {
$metricPoint = dispatch(new CreateMetricPointCommand( $metricPoint = execute(new CreateMetricPointCommand(
$metric, $metric,
Binput::get('value'), Binput::get('value'),
Binput::get('timestamp') Binput::get('timestamp')
@@ -64,13 +64,13 @@ class MetricPointController extends AbstractApiController
* Updates a metric point. * Updates a metric point.
* *
* @param \CachetHQ\Cachet\Models\Metric $metric * @param \CachetHQ\Cachet\Models\Metric $metric
* @param \CachetHQ\Cachet\Models\MetircPoint $metricPoint * @param \CachetHQ\Cachet\Models\MetricPoint $metricPoint
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function update(Metric $metric, MetricPoint $metricPoint) public function update(Metric $metric, MetricPoint $metricPoint)
{ {
$metricPoint = dispatch(new UpdateMetricPointCommand( $metricPoint = execute(new UpdateMetricPointCommand(
$metricPoint, $metricPoint,
$metric, $metric,
Binput::get('value'), Binput::get('value'),
@@ -90,7 +90,7 @@ class MetricPointController extends AbstractApiController
*/ */
public function destroy(Metric $metric, MetricPoint $metricPoint) public function destroy(Metric $metric, MetricPoint $metricPoint)
{ {
dispatch(new RemoveMetricPointCommand($metricPoint)); execute(new RemoveMetricPointCommand($metricPoint));
return $this->noContent(); return $this->noContent();
} }

View File

@@ -67,7 +67,7 @@ class ScheduleController extends AbstractApiController
public function store() public function store()
{ {
try { try {
$schedule = dispatch(new CreateScheduleCommand( $schedule = execute(new CreateScheduleCommand(
Binput::get('name'), Binput::get('name'),
Binput::get('message', null, false, false), Binput::get('message', null, false, false),
Binput::get('status'), Binput::get('status'),
@@ -92,7 +92,7 @@ class ScheduleController extends AbstractApiController
public function update(Schedule $schedule) public function update(Schedule $schedule)
{ {
try { try {
$schedule = dispatch(new UpdateScheduleCommand( $schedule = execute(new UpdateScheduleCommand(
$schedule, $schedule,
Binput::get('name'), Binput::get('name'),
Binput::get('message'), Binput::get('message'),
@@ -118,7 +118,7 @@ class ScheduleController extends AbstractApiController
public function destroy(Schedule $schedule) public function destroy(Schedule $schedule)
{ {
try { try {
dispatch(new DeleteScheduleCommand($schedule)); execute(new DeleteScheduleCommand($schedule));
} catch (QueryException $e) { } catch (QueryException $e) {
throw new BadRequestHttpException(); throw new BadRequestHttpException();
} }

View File

@@ -50,7 +50,7 @@ class SubscriberController extends AbstractApiController
$verified = Binput::get('verify', app(Repository::class)->get('setting.skip_subscriber_verification')); $verified = Binput::get('verify', app(Repository::class)->get('setting.skip_subscriber_verification'));
try { try {
$subscriber = dispatch(new SubscribeSubscriberCommand(Binput::get('email'), $verified, Binput::get('components', null))); $subscriber = execute(new SubscribeSubscriberCommand(Binput::get('email'), $verified, Binput::get('components', null)));
} catch (QueryException $e) { } catch (QueryException $e) {
throw new BadRequestHttpException(); throw new BadRequestHttpException();
} }
@@ -67,7 +67,7 @@ class SubscriberController extends AbstractApiController
*/ */
public function destroy(Subscriber $subscriber) public function destroy(Subscriber $subscriber)
{ {
dispatch(new UnsubscribeSubscriberCommand($subscriber)); execute(new UnsubscribeSubscriberCommand($subscriber));
return $this->noContent(); return $this->noContent();
} }

View File

@@ -30,7 +30,7 @@ class SubscriptionController extends AbstractApiController
*/ */
public function destroy(Subscription $subscription) public function destroy(Subscription $subscription)
{ {
dispatch(new UnsubscribeSubscriptionCommand($subscription)); execute(new UnsubscribeSubscriptionCommand($subscription));
return $this->noContent(); return $this->noContent();
} }

View File

@@ -36,7 +36,7 @@ class ApiController extends AbstractApiController
public function postUpdateComponent(Component $component) public function postUpdateComponent(Component $component)
{ {
try { try {
dispatch(new UpdateComponentCommand( execute(new UpdateComponentCommand(
$component, $component,
$component->name, $component->name,
$component->description, $component->description,
@@ -68,7 +68,7 @@ class ApiController extends AbstractApiController
try { try {
$component = Component::find($componentId); $component = Component::find($componentId);
dispatch(new UpdateComponentCommand( execute(new UpdateComponentCommand(
$component, $component,
$component->name, $component->name,
$component->description, $component->description,
@@ -100,7 +100,7 @@ class ApiController extends AbstractApiController
foreach ($groupData as $order => $groupId) { foreach ($groupData as $order => $groupId) {
$group = ComponentGroup::find($groupId); $group = ComponentGroup::find($groupId);
dispatch(new UpdateComponentGroupCommand( execute(new UpdateComponentGroupCommand(
$group, $group,
$group->name, $group->name,
$order + 1, $order + 1,

View File

@@ -61,8 +61,8 @@ class ComponentController extends Controller
]; ];
View::share([ View::share([
'sub_menu' => $this->subMenu, 'subMenu' => $this->subMenu,
'sub_title' => trans_choice('dashboard.components.components', 2), 'subTitle' => trans_choice('dashboard.components.components', 2),
]); ]);
} }
@@ -115,7 +115,7 @@ class ComponentController extends Controller
$tags = array_pull($componentData, 'tags'); $tags = array_pull($componentData, 'tags');
try { try {
$component = dispatch(new UpdateComponentCommand( $component = execute(new UpdateComponentCommand(
$component, $component,
$componentData['name'], $componentData['name'],
$componentData['description'], $componentData['description'],
@@ -140,9 +140,9 @@ class ComponentController extends Controller
Collection::make(preg_split('/ ?, ?/', $tags))->map(function ($tag) { Collection::make(preg_split('/ ?, ?/', $tags))->map(function ($tag) {
return trim($tag); return trim($tag);
})->map(function ($tag) { })->map(function ($tag) {
return dispatch(new CreateTagCommand($tag)); return execute(new CreateTagCommand($tag));
})->each(function ($tag) use ($component) { })->each(function ($tag) use ($component) {
dispatch(new ApplyTagCommand($component, $tag)); execute(new ApplyTagCommand($component, $tag));
}); });
return cachet_redirect('dashboard.components.edit', [$component->id]) return cachet_redirect('dashboard.components.edit', [$component->id])
@@ -172,7 +172,7 @@ class ComponentController extends Controller
$tags = array_pull($componentData, 'tags'); $tags = array_pull($componentData, 'tags');
try { try {
$component = dispatch(new CreateComponentCommand( $component = execute(new CreateComponentCommand(
$componentData['name'], $componentData['name'],
$componentData['description'], $componentData['description'],
$componentData['status'], $componentData['status'],
@@ -193,9 +193,9 @@ class ComponentController extends Controller
Collection::make(preg_split('/ ?, ?/', $tags))->map(function ($tag) { Collection::make(preg_split('/ ?, ?/', $tags))->map(function ($tag) {
return trim($tag); return trim($tag);
})->map(function ($tag) { })->map(function ($tag) {
return dispatch(new CreateTagCommand($tag)); return execute(new CreateTagCommand($tag));
})->each(function ($tag) use ($component) { })->each(function ($tag) use ($component) {
dispatch(new ApplyTagCommand($component, $tag)); execute(new ApplyTagCommand($component, $tag));
}); });
return cachet_redirect('dashboard.components') return cachet_redirect('dashboard.components')
@@ -211,7 +211,7 @@ class ComponentController extends Controller
*/ */
public function deleteComponentAction(Component $component) public function deleteComponentAction(Component $component)
{ {
dispatch(new RemoveComponentCommand($component)); execute(new RemoveComponentCommand($component));
return cachet_redirect('dashboard.components') return cachet_redirect('dashboard.components')
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success')));

View File

@@ -87,7 +87,7 @@ class ComponentGroupController extends Controller
*/ */
public function deleteComponentGroupAction(ComponentGroup $group) public function deleteComponentGroupAction(ComponentGroup $group)
{ {
dispatch(new RemoveComponentGroupCommand($group)); execute(new RemoveComponentGroupCommand($group));
return cachet_redirect('dashboard.components.groups') return cachet_redirect('dashboard.components.groups')
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success')));
@@ -126,7 +126,7 @@ class ComponentGroupController extends Controller
public function postAddComponentGroup() public function postAddComponentGroup()
{ {
try { try {
$group = dispatch(new CreateComponentGroupCommand( $group = execute(new CreateComponentGroupCommand(
Binput::get('name'), Binput::get('name'),
Binput::get('order', 0), Binput::get('order', 0),
Binput::get('collapsed'), Binput::get('collapsed'),
@@ -153,7 +153,7 @@ class ComponentGroupController extends Controller
public function updateComponentGroupAction(ComponentGroup $group) public function updateComponentGroupAction(ComponentGroup $group)
{ {
try { try {
$group = dispatch(new UpdateComponentGroupCommand( $group = execute(new UpdateComponentGroupCommand(
$group, $group,
Binput::get('name'), Binput::get('name'),
$group->order, $group->order,

View File

@@ -101,7 +101,7 @@ class DashboardController extends Controller
$welcomeUser = !Auth::user()->welcomed; $welcomeUser = !Auth::user()->welcomed;
if ($welcomeUser) { if ($welcomeUser) {
dispatch(new WelcomeUserCommand(Auth::user())); execute(new WelcomeUserCommand(Auth::user()));
} }
$entries = null; $entries = null;

View File

@@ -65,7 +65,7 @@ class IncidentController extends Controller
$this->auth = $auth; $this->auth = $auth;
$this->system = $system; $this->system = $system;
View::share('sub_title', trans('dashboard.incidents.title')); View::share('subTitle', trans('dashboard.incidents.title'));
} }
/** /**
@@ -117,7 +117,7 @@ class IncidentController extends Controller
public function createIncidentAction() public function createIncidentAction()
{ {
try { try {
$incident = dispatch(new CreateIncidentCommand( $incident = execute(new CreateIncidentCommand(
Binput::get('name'), Binput::get('name'),
Binput::get('status'), Binput::get('status'),
Binput::get('message', null, false, false), Binput::get('message', null, false, false),
@@ -213,7 +213,7 @@ class IncidentController extends Controller
*/ */
public function deleteIncidentAction(Incident $incident) public function deleteIncidentAction(Incident $incident)
{ {
dispatch(new RemoveIncidentCommand($incident)); execute(new RemoveIncidentCommand($incident));
return cachet_redirect('dashboard.incidents') return cachet_redirect('dashboard.incidents')
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success')));
@@ -246,7 +246,7 @@ class IncidentController extends Controller
public function editIncidentAction(Incident $incident) public function editIncidentAction(Incident $incident)
{ {
try { try {
$incident = dispatch(new UpdateIncidentCommand( $incident = execute(new UpdateIncidentCommand(
$incident, $incident,
Binput::get('name'), Binput::get('name'),
Binput::get('status'), Binput::get('status'),

View File

@@ -101,7 +101,7 @@ class IncidentUpdateController extends Controller
public function createIncidentUpdateAction(Incident $incident) public function createIncidentUpdateAction(Incident $incident)
{ {
try { try {
$incidentUpdate = dispatch(new CreateIncidentUpdateCommand( $incidentUpdate = execute(new CreateIncidentUpdateCommand(
$incident, $incident,
Binput::get('status'), Binput::get('status'),
Binput::get('message'), Binput::get('message'),
@@ -151,7 +151,7 @@ class IncidentUpdateController extends Controller
public function editIncidentUpdateAction(Incident $incident, IncidentUpdate $incidentUpdate) public function editIncidentUpdateAction(Incident $incident, IncidentUpdate $incidentUpdate)
{ {
try { try {
$incidentUpdate = dispatch(new UpdateIncidentUpdateCommand( $incidentUpdate = execute(new UpdateIncidentUpdateCommand(
$incidentUpdate, $incidentUpdate,
Binput::get('status'), Binput::get('status'),
Binput::get('message'), Binput::get('message'),

View File

@@ -71,7 +71,7 @@ class MetricController extends Controller
$metricData = Binput::get('metric'); $metricData = Binput::get('metric');
try { try {
dispatch(new CreateMetricCommand( execute(new CreateMetricCommand(
$metricData['name'], $metricData['name'],
$metricData['suffix'], $metricData['suffix'],
$metricData['description'], $metricData['description'],
@@ -115,7 +115,7 @@ class MetricController extends Controller
*/ */
public function deleteMetricAction(Metric $metric) public function deleteMetricAction(Metric $metric)
{ {
dispatch(new RemoveMetricCommand($metric)); execute(new RemoveMetricCommand($metric));
return cachet_redirect('dashboard.metrics') return cachet_redirect('dashboard.metrics')
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.delete.success'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.delete.success')));
@@ -146,7 +146,7 @@ class MetricController extends Controller
public function editMetricAction(Metric $metric) public function editMetricAction(Metric $metric)
{ {
try { try {
dispatch(new UpdateMetricCommand( execute(new UpdateMetricCommand(
$metric, $metric,
Binput::get('name', null, false), Binput::get('name', null, false),
Binput::get('suffix', null, false), Binput::get('suffix', null, false),

View File

@@ -42,7 +42,7 @@ class ScheduleController extends Controller
*/ */
public function __construct() public function __construct()
{ {
View::share('sub_title', trans('dashboard.schedule.title')); View::share('subTitle', trans('dashboard.schedule.title'));
} }
/** /**
@@ -81,7 +81,7 @@ class ScheduleController extends Controller
public function addScheduleAction() public function addScheduleAction()
{ {
try { try {
dispatch(new CreateScheduleCommand( execute(new CreateScheduleCommand(
Binput::get('name'), Binput::get('name'),
Binput::get('message', null, false, false), Binput::get('message', null, false, false),
Binput::get('status', Schedule::UPCOMING), Binput::get('status', Schedule::UPCOMING),
@@ -127,7 +127,7 @@ class ScheduleController extends Controller
public function editScheduleAction(Schedule $schedule) public function editScheduleAction(Schedule $schedule)
{ {
try { try {
$schedule = dispatch(new UpdateScheduleCommand( $schedule = execute(new UpdateScheduleCommand(
$schedule, $schedule,
Binput::get('name', null), Binput::get('name', null),
Binput::get('message', null), Binput::get('message', null),
@@ -156,7 +156,7 @@ class ScheduleController extends Controller
*/ */
public function deleteScheduleAction(Schedule $schedule) public function deleteScheduleAction(Schedule $schedule)
{ {
dispatch(new DeleteScheduleCommand($schedule)); execute(new DeleteScheduleCommand($schedule));
return cachet_redirect('dashboard.schedule') return cachet_redirect('dashboard.schedule')
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.delete.success'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.delete.success')));

View File

@@ -18,12 +18,12 @@ use CachetHQ\Cachet\Notifications\System\SystemTestNotification;
use CachetHQ\Cachet\Settings\Repository; use CachetHQ\Cachet\Settings\Repository;
use Exception; use Exception;
use GrahamCampbell\Binput\Facades\Binput; use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Log\Writer;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Lang; use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
@@ -116,8 +116,8 @@ class SettingsController extends Controller
]; ];
View::share([ View::share([
'sub_title' => trans('dashboard.settings.settings'), 'subTitle' => trans('dashboard.settings.settings'),
'sub_menu' => $this->subMenu, 'subMenu' => $this->subMenu,
]); ]);
} }
@@ -270,7 +270,7 @@ class SettingsController extends Controller
{ {
$this->subMenu['log']['active'] = true; $this->subMenu['log']['active'] = true;
$log = app(Writer::class)->getMonolog(); $log = Log::getLogger();
$logContents = ''; $logContents = '';
@@ -319,7 +319,7 @@ class SettingsController extends Controller
{ {
$config = Binput::get('config'); $config = Binput::get('config');
dispatch(new UpdateConfigCommand($config)); execute(new UpdateConfigCommand($config));
return cachet_redirect('dashboard.settings.mail') return cachet_redirect('dashboard.settings.mail')
->withInput(Binput::all()) ->withInput(Binput::all())

View File

@@ -58,7 +58,7 @@ class SubscriberController extends Controller
$subscribers = preg_split("/\r\n|\n|\r/", Binput::get('email')); $subscribers = preg_split("/\r\n|\n|\r/", Binput::get('email'));
foreach ($subscribers as $subscriber) { foreach ($subscribers as $subscriber) {
dispatch(new SubscribeSubscriberCommand($subscriber, $verified)); execute(new SubscribeSubscriberCommand($subscriber, $verified));
} }
} catch (ValidationException $e) { } catch (ValidationException $e) {
return cachet_redirect('dashboard.subscribers.create') return cachet_redirect('dashboard.subscribers.create')
@@ -82,7 +82,7 @@ class SubscriberController extends Controller
*/ */
public function deleteSubscriberAction(Subscriber $subscriber) public function deleteSubscriberAction(Subscriber $subscriber)
{ {
dispatch(new UnsubscribeSubscriberCommand($subscriber)); execute(new UnsubscribeSubscriberCommand($subscriber));
return cachet_redirect('dashboard.subscribers'); return cachet_redirect('dashboard.subscribers');
} }

View File

@@ -80,7 +80,7 @@ class TeamController extends Controller
public function postAddUser() public function postAddUser()
{ {
try { try {
dispatch(new CreateUserCommand( execute(new CreateUserCommand(
Binput::get('username'), Binput::get('username'),
Binput::get('password'), Binput::get('password'),
Binput::get('email'), Binput::get('email'),
@@ -129,7 +129,7 @@ class TeamController extends Controller
public function postInviteUser() public function postInviteUser()
{ {
try { try {
dispatch(new InviteUserCommand( execute(new InviteUserCommand(
array_unique(array_filter((array) Binput::get('emails'))) array_unique(array_filter((array) Binput::get('emails')))
)); ));
} catch (ValidationException $e) { } catch (ValidationException $e) {
@@ -152,7 +152,7 @@ class TeamController extends Controller
*/ */
public function deleteUser(User $user) public function deleteUser(User $user)
{ {
dispatch(new RemoveUserCommand($user)); execute(new RemoveUserCommand($user));
return cachet_redirect('dashboard.team') return cachet_redirect('dashboard.team')
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.delete.success'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.delete.success')));

View File

@@ -258,7 +258,7 @@ class SetupController extends Controller
$envData = array_pull($postData, 'env'); $envData = array_pull($postData, 'env');
// Write the env to the .env file. // Write the env to the .env file.
dispatch(new UpdateConfigCommand($envData)); execute(new UpdateConfigCommand($envData));
if (Request::ajax()) { if (Request::ajax()) {
return Response::json(['status' => 1]); return Response::json(['status' => 1]);

View File

@@ -69,7 +69,7 @@ class SignupController extends Controller
} }
try { try {
dispatch(new SignupUserCommand( execute(new SignupUserCommand(
Binput::get('username'), Binput::get('username'),
Binput::get('password'), Binput::get('password'),
Binput::get('email'), Binput::get('email'),
@@ -82,7 +82,7 @@ class SignupController extends Controller
->withErrors($e->getMessageBag()); ->withErrors($e->getMessageBag());
} }
dispatch(new ClaimInviteCommand($invite)); execute(new ClaimInviteCommand($invite));
return cachet_redirect('status-page') return cachet_redirect('status-page')
->withSuccess(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.awesome'), trans('cachet.signup.success'))); ->withSuccess(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.awesome'), trans('cachet.signup.success')));

View File

@@ -80,7 +80,7 @@ class SubscribeController extends Controller
$verified = app(Repository::class)->get('setting.skip_subscriber_verification'); $verified = app(Repository::class)->get('setting.skip_subscriber_verification');
try { try {
$subscription = dispatch(new SubscribeSubscriberCommand($email, $verified)); $subscription = execute(new SubscribeSubscriberCommand($email, $verified));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return cachet_redirect('status-page') return cachet_redirect('status-page')
->withInput(Binput::all()) ->withInput(Binput::all())
@@ -116,7 +116,7 @@ class SubscribeController extends Controller
} }
if (!$subscriber->is_verified) { if (!$subscriber->is_verified) {
dispatch(new VerifySubscriberCommand($subscriber)); execute(new VerifySubscriberCommand($subscriber));
} }
return cachet_redirect('status-page') return cachet_redirect('status-page')
@@ -144,9 +144,9 @@ class SubscribeController extends Controller
} }
if ($subscription) { if ($subscription) {
dispatch(new UnsubscribeSubscriptionCommand(Subscription::forSubscriber($subscriber->id)->firstOrFail())); execute(new UnsubscribeSubscriptionCommand(Subscription::forSubscriber($subscriber->id)->firstOrFail()));
} else { } else {
dispatch(new UnsubscribeSubscriberCommand($subscriber)); execute(new UnsubscribeSubscriberCommand($subscriber));
} }
return cachet_redirect('status-page') return cachet_redirect('status-page')
@@ -204,7 +204,7 @@ class SubscribeController extends Controller
} }
try { try {
dispatch(new UpdateSubscriberSubscriptionCommand($subscriber, Binput::get('subscriptions'))); execute(new UpdateSubscriberSubscriptionCommand($subscriber, Binput::get('subscriptions')));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return cachet_redirect('subscribe.manage', $subscriber->verify_code) return cachet_redirect('subscribe.manage', $subscriber->verify_code)
->withInput(Binput::all()) ->withInput(Binput::all())

View File

@@ -11,7 +11,19 @@
namespace CachetHQ\Cachet\Http; namespace CachetHQ\Cachet\Http;
use AltThree\Throttle\ThrottlingMiddleware;
use CachetHQ\Cachet\Http\Middleware\Admin;
use CachetHQ\Cachet\Http\Middleware\ApiAuthentication;
use CachetHQ\Cachet\Http\Middleware\Authenticate;
use CachetHQ\Cachet\Http\Middleware\Localize;
use CachetHQ\Cachet\Http\Middleware\ReadyForUse;
use CachetHQ\Cachet\Http\Middleware\RedirectIfAuthenticated;
use CachetHQ\Cachet\Http\Middleware\SetupAlreadyCompleted;
use CachetHQ\Cachet\Http\Middleware\SubscribersConfigured;
use CachetHQ\Cachet\Http\Middleware\TrustProxies;
use Illuminate\Auth\Middleware\Authorize;
use Illuminate\Foundation\Http\Kernel as HttpKernel; use Illuminate\Foundation\Http\Kernel as HttpKernel;
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode;
class Kernel extends HttpKernel class Kernel extends HttpKernel
{ {
@@ -21,8 +33,8 @@ class Kernel extends HttpKernel
* @var array * @var array
*/ */
protected $middleware = [ protected $middleware = [
'Fideloper\Proxy\TrustProxies', TrustProxies::class,
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode', CheckForMaintenanceMode::class,
]; ];
/** /**
@@ -31,15 +43,15 @@ class Kernel extends HttpKernel
* @var array * @var array
*/ */
protected $routeMiddleware = [ protected $routeMiddleware = [
'admin' => 'CachetHQ\Cachet\Http\Middleware\Admin', 'admin' => Admin::class,
'can' => 'Illuminate\Auth\Middleware\Authorize', 'can' => Authorize::class,
'auth' => 'CachetHQ\Cachet\Http\Middleware\Authenticate', 'auth' => Authenticate::class,
'auth.api' => 'CachetHQ\Cachet\Http\Middleware\ApiAuthentication', 'auth.api' => ApiAuthentication::class,
'guest' => 'CachetHQ\Cachet\Http\Middleware\RedirectIfAuthenticated', 'guest' => RedirectIfAuthenticated::class,
'localize' => 'CachetHQ\Cachet\Http\Middleware\Localize', 'localize' => Localize::class,
'ready' => 'CachetHQ\Cachet\Http\Middleware\ReadyForUse', 'ready' => ReadyForUse::class,
'setup' => 'CachetHQ\Cachet\Http\Middleware\SetupAlreadyCompleted', 'setup' => SetupAlreadyCompleted::class,
'subscribers' => 'CachetHQ\Cachet\Http\Middleware\SubscribersConfigured', 'subscribers' => SubscribersConfigured::class,
'throttle' => 'AltThree\Throttle\ThrottlingMiddleware', 'throttle' => ThrottlingMiddleware::class,
]; ];
} }

View File

@@ -0,0 +1,47 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Http\Middleware;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Request;
/**
* This is the trust proxies middleware class.
*
* @author James Brooks <james@alt-three.com>
*/
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
/**
* Create new trust proxies instance.
*
* @return void
*/
public function __construct()
{
$this->proxies = empty(env('TRUSTED_PROXIES')) ? '*' : explode(',', trim(env('TRUSTED_PROXIES')));
}
}

View File

@@ -10,6 +10,7 @@
*/ */
use CachetHQ\Cachet\Settings\Repository; use CachetHQ\Cachet\Settings\Repository;
use Illuminate\Contracts\Bus\Dispatcher;
use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Request; use Illuminate\Support\Facades\Request;
use Jenssegers\Date\Date; use Jenssegers\Date\Date;
@@ -159,3 +160,17 @@ if (!function_exists('cachet_redirect')) {
return app('redirect')->to($url, $status, $headers); return app('redirect')->to($url, $status, $headers);
} }
} }
if (!function_exists('execute')) {
/**
* Send the given command to the dispatcher for execution.
*
* @param object $command
*
* @return void
*/
function execute($command)
{
return app(Dispatcher::class)->dispatchNow($command);
}
}

View File

@@ -26,7 +26,7 @@ $app->singleton(Illuminate\Contracts\Http\Kernel::class, CachetHQ\Cachet\Http\Ke
$app->singleton(Illuminate\Contracts\Console\Kernel::class, CachetHQ\Cachet\Console\Kernel::class); $app->singleton(Illuminate\Contracts\Console\Kernel::class, CachetHQ\Cachet\Console\Kernel::class);
$app->singleton(Illuminate\Contracts\Debug\ExceptionHandler::class, GrahamCampbell\Exceptions\NewExceptionHandler::class); $app->singleton(Illuminate\Contracts\Debug\ExceptionHandler::class, GrahamCampbell\Exceptions\ExceptionHandler::class);
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@@ -25,45 +25,44 @@
} }
], ],
"require": { "require": {
"php": ">=5.6.4", "php": "^7.0",
"ext-xml": "*", "ext-xml": "*",
"alt-three/badger": "^3.1", "alt-three/badger": "^5.0",
"alt-three/bus": "^2.0", "alt-three/bus": "^4.0",
"alt-three/emoji": "^4.1", "alt-three/emoji": "^6.0",
"alt-three/logger": "^1.3", "alt-three/throttle": "^3.0",
"alt-three/throttle": "^1.0", "alt-three/twitter": "^3.0",
"alt-three/twitter": "^1.0", "alt-three/validator": "^4.0",
"alt-three/validator": "^2.0",
"aws/aws-sdk-php": "^3.7", "aws/aws-sdk-php": "^3.7",
"backup-manager/laravel": "dev-master#df53f9c9d8c6be5d7a2638f45d54b8fb7bc51e2b", "barryvdh/laravel-cors": "^0.11.0",
"barryvdh/laravel-cors": "^0.8",
"doctrine/dbal": "2.5.13", "doctrine/dbal": "2.5.13",
"fideloper/proxy": "^3.1", "fideloper/proxy": "^4.0",
"graham-campbell/binput": "^3.5", "graham-campbell/binput": "^5.0",
"graham-campbell/exceptions": "^9.1", "graham-campbell/exceptions": "^11.0",
"graham-campbell/markdown": "^7.1", "graham-campbell/markdown": "^10.0",
"guzzlehttp/guzzle": "^6.2.1", "guzzlehttp/guzzle": "^6.2.1",
"jenssegers/date": "^3.2", "jenssegers/date": "^3.2",
"laravel/framework": "^5.4", "laravel/framework": "5.6.*",
"laravel/tinker": "^1.0", "laravel/tinker": "^1.0",
"laravolt/avatar": "^1.8", "laravolt/avatar": "^1.8",
"mccool/laravel-auto-presenter": "^5.0", "mccool/laravel-auto-presenter": "^7.0",
"nexmo/client": "@beta", "nexmo/client": "@beta",
"pragmarx/google2fa": "^0.7.1", "pragmarx/google2fa": "^0.7.1",
"predis/predis": "^1.1", "predis/predis": "^1.1",
"roumen/feed": "^2.10", "roumen/feed": "^2.10",
"spatie/laravel-backup": "^5.9",
"twig/twig": "^1.26.1" "twig/twig": "^1.26.1"
}, },
"require-dev": { "require-dev": {
"ext-sqlite3": "*", "ext-sqlite3": "*",
"alt-three/testbench": "^1.11", "alt-three/testbench": "^4.0",
"barryvdh/laravel-debugbar": "^2.4", "barryvdh/laravel-debugbar": "^3.0",
"filp/whoops": "^2.1", "filp/whoops": "^2.1",
"fzaninotto/faker": "^1.6", "fzaninotto/faker": "^1.6",
"graham-campbell/testbench-core": "^1.1", "graham-campbell/analyzer": "^2.0",
"mockery/mockery": "0.9.9", "graham-campbell/testbench-core": "^3.0",
"nikic/php-parser": "^3.0", "mockery/mockery": "^1.0",
"phpunit/phpunit": "5.7.20", "phpunit/phpunit": "^7.0",
"symfony/css-selector": "^3.1", "symfony/css-selector": "^3.1",
"symfony/dom-crawler": "^3.1", "symfony/dom-crawler": "^3.1",
"tightenco/mailthief": "^0.3.2" "tightenco/mailthief": "^0.3.2"
@@ -89,24 +88,17 @@
}, },
"scripts": { "scripts": {
"post-root-package-install": [ "post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\"" "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
], ],
"post-create-project-cmd": [ "post-create-project-cmd": [
"php artisan key:generate" "@php artisan key:generate"
], ],
"post-install-cmd": [ "post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postInstall", "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"php artisan optimize" "@php artisan package:discover"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
] ]
}, },
"config": { "config": {
"platform": {
"php": "5.6.4"
},
"preferred-install": "dist", "preferred-install": "dist",
"sort-packages": true, "sort-packages": true,
"optimize-autoloader": true "optimize-autoloader": true

2515
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -175,12 +175,9 @@ return [
*/ */
AltThree\Badger\BadgerServiceProvider::class, AltThree\Badger\BadgerServiceProvider::class,
AltThree\Emoji\EmojiServiceProvider::class, AltThree\Emoji\EmojiServiceProvider::class,
AltThree\Logger\LoggerServiceProvider::class,
AltThree\Twitter\TwitterServiceProvider::class, AltThree\Twitter\TwitterServiceProvider::class,
BackupManager\Laravel\Laravel5ServiceProvider::class,
Barryvdh\Cors\ServiceProvider::class, Barryvdh\Cors\ServiceProvider::class,
env('APP_DEBUG') ? Barryvdh\Debugbar\ServiceProvider::class : null, env('APP_DEBUG') ? Barryvdh\Debugbar\ServiceProvider::class : null,
Fideloper\Proxy\TrustedProxyServiceProvider::class,
GrahamCampbell\Binput\BinputServiceProvider::class, GrahamCampbell\Binput\BinputServiceProvider::class,
GrahamCampbell\Exceptions\ExceptionsServiceProvider::class, GrahamCampbell\Exceptions\ExceptionsServiceProvider::class,
GrahamCampbell\Markdown\MarkdownServiceProvider::class, GrahamCampbell\Markdown\MarkdownServiceProvider::class,
@@ -190,6 +187,7 @@ return [
Laravolt\Avatar\ServiceProvider::class, Laravolt\Avatar\ServiceProvider::class,
McCool\LaravelAutoPresenter\AutoPresenterServiceProvider::class, McCool\LaravelAutoPresenter\AutoPresenterServiceProvider::class,
PragmaRX\Google2FA\Vendor\Laravel\ServiceProvider::class, PragmaRX\Google2FA\Vendor\Laravel\ServiceProvider::class,
Spatie\Backup\BackupServiceProvider::class,
Roumen\Feed\FeedServiceProvider::class, Roumen\Feed\FeedServiceProvider::class,
/* /*

View File

@@ -1,70 +0,0 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'local' => [
'type' => 'Local',
'root' => database_path('backups'),
],
's3' => [
'type' => 'AwsS3',
'key' => '',
'secret' => '',
'region' => 'us-east-1',
'bucket' => '',
'root' => '',
],
'gcs' => [
'type' => 'Gcs',
'key' => '',
'secret' => '',
'bucket' => '',
'root' => '',
],
'rackspace' => [
'type' => 'Rackspace',
'username' => '',
'key' => '',
'container' => '',
'zone' => '',
'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/',
'root' => '',
],
'dropbox' => [
'type' => 'Dropbox',
'token' => '',
'key' => '',
'secret' => '',
'app' => '',
'root' => '',
],
'ftp' => [
'type' => 'Ftp',
'host' => '',
'username' => '',
'password' => '',
'port' => 21,
'passive' => true,
'ssl' => true,
'timeout' => 30,
'root' => '',
],
'sftp' => [
'type' => 'Sftp',
'host' => '',
'username' => '',
'password' => '',
'port' => 21,
'timeout' => 10,
'privateKey' => '',
'root' => '',
],
];

196
config/backup.php Normal file
View File

@@ -0,0 +1,196 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'backup' => [
/*
* The name of this application. You can use this name to monitor
* the backups.
*/
'name' => config('app.name'),
'source' => [
'files' => [
/*
* The list of directories and files that will be included in the backup.
*/
'include' => [
base_path(),
],
/*
* These directories and files will be excluded from the backup.
*
* Directories used by the backup process will automatically be excluded.
*/
'exclude' => [
base_path('vendor'),
base_path('node_modules'),
],
/*
* Determines if symlinks should be followed.
*/
'followLinks' => false,
],
/*
* The names of the connections to the databases that should be backed up
* MySQL, PostgreSQL, SQLite and Mongo databases are supported.
*/
'databases' => [
'mysql',
],
],
/*
* The database dump can be gzipped to decrease diskspace usage.
*/
'gzip_database_dump' => false,
'destination' => [
/*
* The filename prefix used for the backup zip file.
*/
'filename_prefix' => '',
/*
* The disk names on which the backups will be stored.
*/
'disks' => [
'database',
],
],
/*
* The directory where the temporary files will be stored.
*/
'temporary_directory' => storage_path('app/backup-temp'),
],
/*
* You can get notified when specific events occur. Out of the box you can use 'mail' and 'slack'.
* For Slack you need to install guzzlehttp/guzzle.
*
* You can also use your own notification classes, just make sure the class is named after one of
* the `Spatie\Backup\Events` classes.
*/
'notifications' => [
'notifications' => [
\Spatie\Backup\Notifications\Notifications\BackupHasFailed::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFound::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\CleanupHasFailed::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\BackupWasSuccessful::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\HealthyBackupWasFound::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\CleanupWasSuccessful::class => ['mail'],
],
/*
* Here you can specify the notifiable to which the notifications should be sent. The default
* notifiable will use the variables specified in this config file.
*/
'notifiable' => \Spatie\Backup\Notifications\Notifiable::class,
'mail' => [
'to' => 'your@example.com',
],
'slack' => [
'webhook_url' => '',
/*
* If this is set to null the default channel of the webhook will be used.
*/
'channel' => null,
'username' => null,
'icon' => null,
],
],
/*
* Here you can specify which backups should be monitored.
* If a backup does not meet the specified requirements the
* UnHealthyBackupWasFound event will be fired.
*/
'monitorBackups' => [
[
'name' => config('app.name'),
'disks' => ['local'],
'newestBackupsShouldNotBeOlderThanDays' => 1,
'storageUsedMayNotBeHigherThanMegabytes' => 5000,
],
/*
[
'name' => 'name of the second app',
'disks' => ['local', 's3'],
'newestBackupsShouldNotBeOlderThanDays' => 1,
'storageUsedMayNotBeHigherThanMegabytes' => 5000,
],
*/
],
'cleanup' => [
/*
* The strategy that will be used to cleanup old backups. The default strategy
* will keep all backups for a certain amount of days. After that period only
* a daily backup will be kept. After that period only weekly backups will
* be kept and so on.
*
* No matter how you configure it the default strategy will never
* delete the newest backup.
*/
'strategy' => \Spatie\Backup\Tasks\Cleanup\Strategies\DefaultStrategy::class,
'defaultStrategy' => [
/*
* The number of days for which backups must be kept.
*/
'keepAllBackupsForDays' => 7,
/*
* The number of days for which daily backups must be kept.
*/
'keepDailyBackupsForDays' => 16,
/*
* The number of weeks for which one weekly backup must be kept.
*/
'keepWeeklyBackupsForWeeks' => 8,
/*
* The number of months for which one monthly backup must be kept.
*/
'keepMonthlyBackupsForMonths' => 4,
/*
* The number of years for which one yearly backup must be kept.
*/
'keepYearlyBackupsForYears' => 2,
/*
* After cleaning up the backups remove the oldest backup until
* this amount of megabytes has been reached.
*/
'deleteOldestBackupsWhenUsingMoreMegabytesThan' => 5000,
],
],
];

View File

@@ -57,6 +57,11 @@ return [
'root' => storage_path('app'), 'root' => storage_path('app'),
], ],
'database' => [
'driver' => 'local',
'root' => database_path('backups'),
],
'public' => [ 'public' => [
'driver' => 'local', 'driver' => 'local',
'root' => storage_path('app/public'), 'root' => storage_path('app/public'),

61
config/hashing.php Normal file
View File

@@ -0,0 +1,61 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon"
|
*/
'driver' => 'bcrypt',
/*
|--------------------------------------------------------------------------
| Bcrypt Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
],
/*
|--------------------------------------------------------------------------
| Argon Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 1024,
'threads' => 2,
'time' => 2,
],
];

View File

@@ -1,27 +0,0 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
/*
|--------------------------------------------------------------------------
| Loggers
|--------------------------------------------------------------------------
|
| Here are each of the loggers to call under the hood while logging.
|
*/
'loggers' => [
'Illuminate\Log\Writer' => ['warning', 'error', 'critical', 'alert', 'emergency'],
],
];

90
config/logging.php Normal file
View File

@@ -0,0 +1,90 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Monolog\Handler\StreamHandler;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'days' => 7,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => 'critical',
],
'stderr' => [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'with' => [
'stream' => 'php://stderr',
],
],
'syslog' => [
'driver' => 'syslog',
'level' => 'debug',
],
'errorlog' => [
'driver' => 'errorlog',
'level' => 'debug',
],
],
];

View File

@@ -1,52 +0,0 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Illuminate\Http\Request;
return [
/*
|--------------------------------------------------------------------------
| Trusted Proxies
|--------------------------------------------------------------------------
|
| Set trusted proxy IP addresses. Both IPv4 and IPv6 addresses are
| supported, along with CIDR notation. The "*" character is syntactic sugar
| within TrustedProxy to trust any proxy; a requirement when you cannot
| know the address of your proxy (e.g. if using Rackspace balancers).
|
| By default, we are trusting local IPs and CloudFlare only.
|
*/
'proxies' => empty(env('TRUSTED_PROXIES')) ? '*' : explode(',', trim(env('TRUSTED_PROXIES'))),
/*
|--------------------------------------------------------------------------
| Respected Headers
|--------------------------------------------------------------------------
|
| Change these if the proxy does not send the default header names. Note
| that headers such as X-Forwarded-For are transformed to
| HTTP_X_FORWARDED_FOR format.
|
| By default, we are using the Symfony defaults.
|
*/
'headers' => [
Request::HEADER_CLIENT_IP => 'X_FORWARDED_FOR',
Request::HEADER_CLIENT_HOST => 'X_FORWARDED_HOST',
Request::HEADER_CLIENT_PROTO => 'X_FORWARDED_PROTO',
Request::HEADER_CLIENT_PORT => 'X_FORWARDED_PORT',
],
];

View File

@@ -65,7 +65,7 @@
</div> </div>
</fieldset> </fieldset>
<input type="hidden" name="component[user_id]" value="{{ $component->agent_id || $current_user->id }}"> <input type="hidden" name="component[user_id]" value="{{ $component->agent_id || $currentUser->id }}">
<input type="hidden" name="component[order]" value="{{ $component->order ?: 0 }}"> <input type="hidden" name="component[order]" value="{{ $component->order ?: 0 }}">
<div class="btn-group"> <div class="btn-group">

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="content-panel"> <div class="content-panel">
@includeWhen(isset($sub_menu), 'dashboard.partials.sub-sidebar') @includeWhen(isset($subMenu), 'dashboard.partials.sub-sidebar')
<div class="content-wrapper"> <div class="content-wrapper">
<div class="header sub-header"> <div class="header sub-header">
<span class="uppercase"> <span class="uppercase">

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="content-panel"> <div class="content-panel">
@includeWhen(isset($sub_menu), 'dashboard.partials.sub-sidebar') @includeWhen(isset($subMenu), 'dashboard.partials.sub-sidebar')
<div class="content-wrapper"> <div class="content-wrapper">
<div class="header sub-header"> <div class="header sub-header">
<span class="uppercase"> <span class="uppercase">

View File

@@ -13,7 +13,7 @@
<div class="content-wrapper"> <div class="content-wrapper">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@if(!$notifications_enabled) @if(!$notificationsEnabled)
<div class="alert alert-info" role="alert"> <div class="alert alert-info" role="alert">
{{ trans('forms.incidents.notify_disabled') }} {{ trans('forms.incidents.notify_disabled') }}
</div> </div>
@@ -23,12 +23,12 @@
<form class="form-vertical" name="IncidentForm" role="form" method="POST" autocomplete="off"> <form class="form-vertical" name="IncidentForm" role="form" method="POST" autocomplete="off">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<fieldset> <fieldset>
@if($incident_templates->count() > 0) @if($incidentTemplates->count() > 0)
<div class="form-group"> <div class="form-group">
<label for="incident-template">{{ trans('forms.incidents.templates.template') }}</label> <label for="incident-template">{{ trans('forms.incidents.templates.template') }}</label>
<select class="form-control" name="template" v-model="template"> <select class="form-control" name="template" v-model="template">
<option selected></option> <option selected></option>
@foreach($incident_templates as $tpl) @foreach($incidentTemplates as $tpl)
<option value="{{ $tpl->slug }}">{{ $tpl->name }}</option> <option value="{{ $tpl->slug }}">{{ $tpl->name }}</option>
@endforeach @endforeach
</select> </select>
@@ -75,19 +75,19 @@
<option value="0" selected>{{ trans('forms.incidents.not_stickied') }}</option> <option value="0" selected>{{ trans('forms.incidents.not_stickied') }}</option>
</select> </select>
</div> </div>
@if(!$components_in_groups->isEmpty() || !$components_out_groups->isEmpty()) @if(!$componentsInGroups->isEmpty() || !$componentsOutGroups->isEmpty())
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.incidents.component') }}</label> <small class="text-muted">{{ trans('forms.optional') }}</small> <label>{{ trans('forms.incidents.component') }}</label> <small class="text-muted">{{ trans('forms.optional') }}</small>
<select name="component_id" class="form-control" v-model="component.id"> <select name="component_id" class="form-control" v-model="component.id">
<option value="" selected></option> <option value="" selected></option>
@foreach($components_in_groups as $group) @foreach($componentsInGroups as $group)
<optgroup label="{{ $group->name }}"> <optgroup label="{{ $group->name }}">
@foreach($group->components as $component) @foreach($group->components as $component)
<option value="{{ $component->id }}">{{ $component->name }}</option> <option value="{{ $component->id }}">{{ $component->name }}</option>
@endforeach @endforeach
</optgroup> </optgroup>
@endforeach @endforeach
@foreach($components_out_groups as $component) @foreach($componentsOutGroups as $component)
<option value="{{ $component->id }}">{{ $component->name }}</option> <option value="{{ $component->id }}">{{ $component->name }}</option>
@endforeach @endforeach
</select> </select>
@@ -120,7 +120,7 @@
<label>{{ trans('forms.incidents.occurred_at') }}</label> <small class="text-muted">{{ trans('forms.optional') }}</small> <label>{{ trans('forms.incidents.occurred_at') }}</label> <small class="text-muted">{{ trans('forms.optional') }}</small>
<input type="text" name="occurred_at" class="form-control" rel="datepicker-custom" data-date-format="YYYY-MM-DD HH:mm" placeholder="{{ trans('forms.optional') }}"> <input type="text" name="occurred_at" class="form-control" rel="datepicker-custom" data-date-format="YYYY-MM-DD HH:mm" placeholder="{{ trans('forms.optional') }}">
</div> </div>
@if($notifications_enabled) @if($notificationsEnabled)
<input type="hidden" name="notify" value="0"> <input type="hidden" name="notify" value="0">
<div class="checkbox"> <div class="checkbox">
<label> <label>

View File

@@ -13,7 +13,7 @@
<div class="content-wrapper"> <div class="content-wrapper">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@if(!$notifications_enabled) @if(!$notificationsEnabled)
<div class="alert alert-info" role="alert"> <div class="alert alert-info" role="alert">
{{ trans('forms.incidents.notify_disabled') }} {{ trans('forms.incidents.notify_disabled') }}
</div> </div>

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="content-panel"> <div class="content-panel">
@includeWhen(isset($sub_menu), 'dashboard.partials.sub-sidebar') @includeWhen(isset($subMenu), 'dashboard.partials.sub-sidebar')
<div class="content-wrapper"> <div class="content-wrapper">
<div class="header sub-header"> <div class="header sub-header">
<span class="uppercase"> <span class="uppercase">

View File

@@ -13,7 +13,7 @@
<div class="content-wrapper"> <div class="content-wrapper">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@if(!$notifications_enabled) @if(!$notificationsEnabled)
<div class="alert alert-info" role="alert"> <div class="alert alert-info" role="alert">
{{ trans('forms.incidents.notify_disabled') }} {{ trans('forms.incidents.notify_disabled') }}
</div> </div>

View File

@@ -13,7 +13,7 @@
<div class="content-wrapper"> <div class="content-wrapper">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@if(!$notifications_enabled) @if(!$notificationsEnabled)
<div class="alert alert-info" role="alert"> <div class="alert alert-info" role="alert">
{{ trans('forms.incidents.notify_disabled') }} {{ trans('forms.incidents.notify_disabled') }}
</div> </div>

View File

@@ -1,93 +1,95 @@
@extends('layout.dashboard') @extends('layout.dashboard')
@section('content') @section('content')
<div> <dashboard inline-template :welcome-user="{{ $welcomeUser ? 'true' : 'false' }}" :user="{{ $currentUser }}">
<div class="header"> <div>
<div class="sidebar-toggler visible-xs"> <div class="header">
<i class="ion ion-navicon"></i> <div class="sidebar-toggler visible-xs">
</div> <i class="ion ion-navicon"></i>
<span class="uppercase">
<i class="ion ion-speedometer"></i> {{ trans('dashboard.dashboard') }}
</span>
</div>
<div class="content-wrapper">
<div class="row">
<div class="col-md-12">
<div class="alert alert-info hidden" id="update-alert">{!! trans('cachet.system.update') !!}</div>
</div> </div>
<span class="uppercase">
<i class="ion ion-speedometer"></i> {{ trans('dashboard.dashboard') }}
</span>
</div> </div>
<div class="content-wrapper">
<div class="row">
<div class="col-md-12">
<div class="alert alert-info hidden" id="update-alert">{!! trans('cachet.system.update') !!}</div>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="section-components no-select"> <div class="section-components no-select">
@if(!$component_groups->isEmpty() || !$ungrouped_components->isEmpty()) @if(!$componentGroups->isEmpty() || !$ungroupedComponents->isEmpty())
@include('dashboard.partials.components') @include('dashboard.partials.components')
@else @else
<ul class="list-group components"> <ul class="list-group components">
<li class="list-group-item"> <li class="list-group-item">
<a href="{{ cachet_route('dashboard.components.create') }}">{{ trans('dashboard.components.add.message') }}</a> <a href="{{ cachet_route('dashboard.components.create') }}">{{ trans('dashboard.components.add.message') }}</a>
</li> </li>
</ul> </ul>
@endif @endif
</div>
</div> </div>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-lg-6">
<div class="stats-widget">
<div class="stats-top">
<span class="stats-value"><a href="{{ cachet_route('dashboard.incidents') }}">{{ $incidents->reduce(function($carry, $incident) { return $carry + count($incident); }) }}</a></span>
<span class="stats-label">{{ trans('dashboard.incidents.incidents') }}</span>
</div>
<div class="stats-chart">
<div class="sparkline" data-type="line" data-resize="true" data-height="80" data-width="100%" data-line-width="2" data-min-spot-color="#e65100" data-max-spot-color="#ffb300" data-line-color="#3498db" data-spot-color="#00838f" data-fill-color="#3498db" data-highlight-line-color="#00acc1" data-highlight-spot-color="#ff8a65" data-spot-radius="false" data-data="[{{ $incidents->map(function ($incident) { return count($incident); } )->implode(',') }}]"></div>
</div>
</div>
</div> </div>
<div class="col-sm-12 col-lg-6"> <div class="row">
<div class="stats-widget"> <div class="col-sm-12 col-lg-6">
<div class="stats-top"> <div class="stats-widget">
<span class="stats-value"><a href="{{ cachet_route('dashboard.subscribers') }}">{{ $subscribers->reduce(function($carry, $subscribers) { return $carry + count($subscribers); }) }}</a></span> <div class="stats-top">
<span class="stats-label">{{ trans('dashboard.subscribers.subscribers') }}</span> <span class="stats-value"><a href="{{ cachet_route('dashboard.incidents') }}">{{ $incidents->reduce(function($carry, $incident) { return $carry + count($incident); }) }}</a></span>
</div> <span class="stats-label">{{ trans('dashboard.incidents.incidents') }}</span>
<div class="stats-chart"> </div>
<div class="sparkline" data-type="line" data-resize="true" data-height="80" data-width="100%" data-line-width="2" data-min-spot-color="#e65100" data-max-spot-color="#ffb300" data-line-color="#3498db" data-spot-color="#00838f" data-fill-color="#3498db" data-highlight-line-color="#00acc1" data-highlight-spot-color="#ff8a65" data-spot-radius="false" data-data="[{{ $subscribers->map(function ($subscriber) { return count($subscriber); } )->implode(',') }}]"></div> <div class="stats-chart">
<div class="sparkline" data-type="line" data-resize="true" data-height="80" data-width="100%" data-line-width="2" data-min-spot-color="#e65100" data-max-spot-color="#ffb300" data-line-color="#3498db" data-spot-color="#00838f" data-fill-color="#3498db" data-highlight-line-color="#00acc1" data-highlight-spot-color="#ff8a65" data-spot-radius="false" data-data="[{{ $incidents->map(function ($incident) { return count($incident); } )->implode(',') }}]"></div>
</div>
</div> </div>
</div> </div>
</div>
</div>
<div class="row"> <div class="col-sm-12 col-lg-6">
<div class="col-sm-12 col-lg-6"> <div class="stats-widget">
<div class="stats-widget"> <div class="stats-top">
<div class="stats-top"> <span class="stats-value"><a href="{{ cachet_route('dashboard.subscribers') }}">{{ $subscribers->reduce(function($carry, $subscribers) { return $carry + count($subscribers); }) }}</a></span>
<span class="stats-value">{{ trans('dashboard.widgets.support') }}</span> <span class="stats-label">{{ trans('dashboard.subscribers.subscribers') }}</span>
<span class="stats-label">{!! trans('dashboard.widgets.support_subtitle') !!}</span> </div>
</div> <div class="stats-chart">
</div> <div class="sparkline" data-type="line" data-resize="true" data-height="80" data-width="100%" data-line-width="2" data-min-spot-color="#e65100" data-max-spot-color="#ffb300" data-line-color="#3498db" data-spot-color="#00838f" data-fill-color="#3498db" data-highlight-line-color="#00acc1" data-highlight-spot-color="#ff8a65" data-spot-radius="false" data-data="[{{ $subscribers->map(function ($subscriber) { return count($subscriber); } )->implode(',') }}]"></div>
</div>
@if($entries)
<div class="col-sm-12 col-lg-6">
<div class="stats-widget">
<div class='stats-top'>
<span class='stats-value'>{{ trans('dashboard.widgets.news') }}</span>
<span class='stats-label'>{{ trans('dashboard.widgets.news_subtitle') }}</span>
</div>
<div class='stats-body'>
<div class="list-group">
@foreach($entries as $entry)
<a class="list-group-item" href="{{ $entry->link }}" target="_blank">{{ $entry->title }}, <small>{{ $entry->pubDate }}</small> <span class="badge"><i class="ion-android-open"></i></span></a>
@endforeach
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@endif
<div class="row">
<div class="col-sm-12 col-lg-6">
<div class="stats-widget">
<div class="stats-top">
<span class="stats-value">{{ trans('dashboard.widgets.support') }}</span>
<span class="stats-label">{!! trans('dashboard.widgets.support_subtitle') !!}</span>
</div>
</div>
</div>
@if($entries)
<div class="col-sm-12 col-lg-6">
<div class="stats-widget">
<div class='stats-top'>
<span class='stats-value'>{{ trans('dashboard.widgets.news') }}</span>
<span class='stats-label'>{{ trans('dashboard.widgets.news_subtitle') }}</span>
</div>
<div class='stats-body'>
<div class="list-group">
@foreach($entries as $entry)
<a class="list-group-item" href="{{ $entry->link }}" target="_blank">{{ $entry->title }}, <small>{{ $entry->pubDate }}</small> <span class="badge"><i class="ion-android-open"></i></span></a>
@endforeach
</div>
</div>
</div>
</div>
@endif
</div>
@includeWhen($welcomeUser, 'dashboard.partials.welcome-modal')
</div> </div>
</div> </div>
@includeWhen($welcome_user, 'dashboard.partials.welcome-modal')
</div> </div>
@stop @stop

View File

@@ -17,12 +17,12 @@
<form class="form-vertical" name="ScheduleForm" role="form" method="POST" autocomplete="off"> <form class="form-vertical" name="ScheduleForm" role="form" method="POST" autocomplete="off">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<fieldset> <fieldset>
@if($incident_templates->count() > 0) @if($incidentTemplates->count() > 0)
<div class="form-group"> <div class="form-group">
<label for="incident-template">{{ trans('forms.schedules.templates.template') }}</label> <label for="incident-template">{{ trans('forms.schedules.templates.template') }}</label>
<select class="form-control" name="template"> <select class="form-control" name="template">
<option selected></option> <option selected></option>
@foreach($incident_templates as $tpl) @foreach($incidentTemplates as $tpl)
<option value="{{ $tpl->slug }}">{{ $tpl->name }}</option> <option value="{{ $tpl->slug }}">{{ $tpl->name }}</option>
@endforeach @endforeach
</select> </select>

View File

@@ -18,12 +18,12 @@
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="hidden" name="visible" value="1"> <input type="hidden" name="visible" value="1">
<fieldset> <fieldset>
@if($incident_templates->count() > 0) @if($incidentTemplates->count() > 0)
<div class="form-group"> <div class="form-group">
<label for="incident-template">{{ trans('forms.schedules.templates.template') }}</label> <label for="incident-template">{{ trans('forms.schedules.templates.template') }}</label>
<select class="form-control" name="template"> <select class="form-control" name="template">
<option selected></option> <option selected></option>
@foreach($incident_templates as $tpl) @foreach($incidentTemplates as $tpl)
<option value="{{ $tpl->slug }}">{{ $tpl->name }}</option> <option value="{{ $tpl->slug }}">{{ $tpl->name }}</option>
@endforeach @endforeach
</select> </select>

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="content-panel"> <div class="content-panel">
@includeWhen(isset($sub_menu), 'dashboard.partials.sub-sidebar') @includeWhen(isset($subMenu), 'dashboard.partials.sub-sidebar')
<div class="content-wrapper"> <div class="content-wrapper">
<div class="header sub-header"> <div class="header sub-header">
<span class="uppercase"> <span class="uppercase">

View File

@@ -58,7 +58,7 @@
<div class="form-group"> <div class="form-group">
<label for="metric-places">{{ trans('forms.metrics.threshold') }}</label> <label for="metric-places">{{ trans('forms.metrics.threshold') }}</label>
<select name="metric[threshold]" class="form-control" required> <select name="metric[threshold]" class="form-control" required>
@foreach ($acceptable_thresholds as $threshold) @foreach ($acceptableThresholds as $threshold)
<option {{ (int) Binput::old('metric.threshold') === $threshold ? 'selected' : null }}>{{ $threshold }}</option> <option {{ (int) Binput::old('metric.threshold') === $threshold ? 'selected' : null }}>{{ $threshold }}</option>
@endforeach @endforeach
</select> </select>

View File

@@ -58,7 +58,7 @@
<div class="form-group"> <div class="form-group">
<label for="metric-places">{{ trans('forms.metrics.threshold') }}</label> <label for="metric-places">{{ trans('forms.metrics.threshold') }}</label>
<select name="threshold" class="form-control" required> <select name="threshold" class="form-control" required>
@foreach ($acceptable_thresholds as $threshold) @foreach ($acceptableThresholds as $threshold)
<option {{ (int) Binput::old('metric.threshold') === $threshold || $metric->threshold === $threshold ? 'selected' : null }}>{{ $threshold }}</option> <option {{ (int) Binput::old('metric.threshold') === $threshold || $metric->threshold === $threshold ? 'selected' : null }}>{{ $threshold }}</option>
@endforeach @endforeach
</select> </select>

View File

@@ -1,5 +1,5 @@
@if($component_groups->count() > 0) @if($componentGroups->count() > 0)
@foreach($component_groups as $componentGroup) @foreach($componentGroups as $componentGroup)
@if($componentGroup->enabled_components->count() > 0) @if($componentGroup->enabled_components->count() > 0)
<ul class="list-group components"> <ul class="list-group components">
<li class="list-group-item group-name"> <li class="list-group-item group-name">
@@ -16,14 +16,14 @@
@endforeach @endforeach
@endif @endif
@if($ungrouped_components->count() > 0) @if($ungroupedComponents->count() > 0)
<ul class="list-group components"> <ul class="list-group components">
@if($component_groups->count() > 0) @if($componentGroups->count() > 0)
<li class="list-group-item group-name"> <li class="list-group-item group-name">
<span class="component-group-other">{{ trans('cachet.components.group.other') }}</span> <span class="component-group-other">{{ trans('cachet.components.group.other') }}</span>
</li> </li>
@endif @endif
@foreach($ungrouped_components as $component) @foreach($ungroupedComponents as $component)
@include('dashboard.partials.component', compact($component)) @include('dashboard.partials.component', compact($component))
@endforeach @endforeach
</ul> </ul>

View File

@@ -2,10 +2,10 @@
<div class="sidebar-inner"> <div class="sidebar-inner">
<div class="profile"> <div class="profile">
<a href="{{ cachet_route('dashboard.user') }}"> <a href="{{ cachet_route('dashboard.user') }}">
<span class="avatar"><img src="{{ $current_user->avatar }}"></span> <span class="avatar"><img src="{{ $currentUser->avatar }}"></span>
</a> </a>
<a href="{{ cachet_route('dashboard.user') }}"> <a href="{{ cachet_route('dashboard.user') }}">
<h4 class="username">{{ $current_user->username }}</h4> <h4 class="username">{{ $currentUser->username }}</h4>
</a> </a>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
@@ -26,28 +26,28 @@
<a href="{{ cachet_route('dashboard.incidents') }}"> <a href="{{ cachet_route('dashboard.incidents') }}">
<i class="ion ion-ios-information-outline"></i> <i class="ion ion-ios-information-outline"></i>
<span>{{ trans('dashboard.incidents.incidents') }}</span> <span>{{ trans('dashboard.incidents.incidents') }}</span>
<span class="label label-info">{{ $incident_count }}</span> <span class="label label-info">{{ $incidentCount }}</span>
</a> </a>
</li> </li>
<li {!! set_active('dashboard/templates*') !!}> <li {!! set_active('dashboard/templates*') !!}>
<a href="{{ cachet_route('dashboard.templates') }}"> <a href="{{ cachet_route('dashboard.templates') }}">
<i class="ion ion-ios-paper-outline"></i> <i class="ion ion-ios-paper-outline"></i>
<span>{{ trans('dashboard.incidents.incident-templates') }}</span> <span>{{ trans('dashboard.incidents.incident-templates') }}</span>
<span class="label label-info">{{ $incident_template_count }}</span> <span class="label label-info">{{ $incidentTemplateCount }}</span>
</a> </a>
</li> </li>
<li {!! set_active('dashboard/schedule*') !!}> <li {!! set_active('dashboard/schedule*') !!}>
<a href="{{ cachet_route('dashboard.schedule') }}"> <a href="{{ cachet_route('dashboard.schedule') }}">
<i class="ion ion-android-calendar"></i> <i class="ion ion-android-calendar"></i>
<span>{{ trans('dashboard.schedule.schedule') }}</span> <span>{{ trans('dashboard.schedule.schedule') }}</span>
<span class="label label-info">{{ $schedule_count }}</span> <span class="label label-info">{{ $scheduleCount }}</span>
</a> </a>
</li> </li>
<li {!! set_active('dashboard/components*') !!}> <li {!! set_active('dashboard/components*') !!}>
<a href="{{ cachet_route('dashboard.components') }}"> <a href="{{ cachet_route('dashboard.components') }}">
<i class="ion ion-ios-browsers-outline"></i> <i class="ion ion-ios-browsers-outline"></i>
<span>{{ trans('dashboard.components.components') }}</span> <span>{{ trans('dashboard.components.components') }}</span>
<span class="label label-info">{{ $component_count }}</span> <span class="label label-info">{{ $componentCount }}</span>
</a> </a>
</li> </li>
<li {!! set_active('dashboard/metrics*') !!}> <li {!! set_active('dashboard/metrics*') !!}>
@@ -60,7 +60,7 @@
<a href="{{ cachet_route('dashboard.subscribers') }}"> <a href="{{ cachet_route('dashboard.subscribers') }}">
<i class="ion ion-ios-email-outline"></i> <i class="ion ion-ios-email-outline"></i>
<span>{{ trans('dashboard.subscribers.subscribers') }}</span> <span>{{ trans('dashboard.subscribers.subscribers') }}</span>
<span class="label label-info">{{ $subscriber_count }}</span> <span class="label label-info">{{ $subscriberCount }}</span>
</a> </a>
</li> </li>
<li {!! set_active('dashboard/team*') !!}> <li {!! set_active('dashboard/team*') !!}>

View File

@@ -2,10 +2,10 @@
<div class="sidebar-toggler visible-xs"> <div class="sidebar-toggler visible-xs">
<i class="ion ion-navicon"></i> <i class="ion ion-navicon"></i>
</div> </div>
<h3>{{ $sub_title }}</h3> <h3>{{ $subTitle }}</h3>
<hr> <hr>
<ul class="menu"> <ul class="menu">
@foreach($sub_menu as $key => $item) @foreach($subMenu as $key => $item)
<li><a href="{{ $item['url'] }}" class="{{ $item['active'] ? 'active' : null }}"><i class="ion {{ $item['icon'] }}"></i> {{ $item['title'] }}</a></li> <li><a href="{{ $item['url'] }}" class="{{ $item['active'] ? 'active' : null }}"><i class="ion {{ $item['icon'] }}"></i> {{ $item['title'] }}</a></li>
@endforeach @endforeach
</ul> </ul>

View File

@@ -6,7 +6,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<header> <header>
{{ trans('dashboard.welcome.welcome', ['username' => $current_user->username]) }} {{ trans('dashboard.welcome.welcome', ['username' => $currentUser->username]) }}
</header> </header>
<p> <p>

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="content-panel"> <div class="content-panel">
@includeWhen(isset($sub_menu), 'dashboard.partials.sub-sidebar') @includeWhen(isset($subMenu), 'dashboard.partials.sub-sidebar')
<div class="content-wrapper"> <div class="content-wrapper">
<div class="header sub-header" id="application-setup"> <div class="header sub-header" id="application-setup">
<span class="uppercase"> <span class="uppercase">
@@ -19,7 +19,7 @@
<div class="col-xs-12"> <div class="col-xs-12">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.analytics.analytics_google') }}</label> <label>{{ trans('forms.settings.analytics.analytics_google') }}</label>
<input type="text" name="app_analytics" class="form-control" value="{{ $app_analytics }}" placeholder="UA-12345-12"> <input type="text" name="app_analytics" class="form-control" value="{{ $appAnalytics }}" placeholder="UA-12345-12">
</div> </div>
</div> </div>
</div> </div>
@@ -27,7 +27,7 @@
<div class="col-xs-12"> <div class="col-xs-12">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.analytics.analytics_gosquared') }}</label> <label>{{ trans('forms.settings.analytics.analytics_gosquared') }}</label>
<input type="text" name="app_analytics_go_squared" class="form-control" value="{{ $app_analytics_go_squared }}" placeholder="GSN-12345-A"> <input type="text" name="app_analytics_go_squared" class="form-control" value="{{ $appAnalyticsGoSquared }}" placeholder="GSN-12345-A">
</div> </div>
</div> </div>
</div> </div>
@@ -35,7 +35,7 @@
<div class="col-xs-12"> <div class="col-xs-12">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.analytics.analytics_piwik_url') }}</label> <label>{{ trans('forms.settings.analytics.analytics_piwik_url') }}</label>
<input type="text" name="app_analytics_piwik_url" class="form-control" value="{{ $app_analytics_piwik_url }}" placeholder="{{ trans('forms.settings.analytics.analytics_piwik_url') }}"> <input type="text" name="app_analytics_piwik_url" class="form-control" value="{{ $appAnalyticsPiwikURL }}" placeholder="{{ trans('forms.settings.analytics.analytics_piwik_url') }}">
</div> </div>
</div> </div>
</div> </div>
@@ -43,7 +43,7 @@
<div class="col-xs-12"> <div class="col-xs-12">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.analytics.analytics_piwik_siteid') }}</label> <label>{{ trans('forms.settings.analytics.analytics_piwik_siteid') }}</label>
<input type="number" min="1" max="100" name="app_analytics_piwik_site_id" class="form-control" value="{{ $app_analytics_piwik_site_id }}" placeholder="{{ trans('forms.settings.analytics.analytics_piwik_siteid') }}"> <input type="number" min="1" max="100" name="app_analytics_piwik_site_id" class="form-control" value="{{ $appAnalyticsPiwikSiteID }}" placeholder="{{ trans('forms.settings.analytics.analytics_piwik_siteid') }}">
</div> </div>
</div> </div>
</div> </div>

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="content-panel"> <div class="content-panel">
@includeWhen(isset($sub_menu), 'dashboard.partials.sub-sidebar') @includeWhen(isset($subMenu), 'dashboard.partials.sub-sidebar')
<div class="content-wrapper"> <div class="content-wrapper">
<div class="header sub-header" id="application-setup"> <div class="header sub-header" id="application-setup">
<span class="uppercase"> <span class="uppercase">
@@ -19,7 +19,7 @@
<div class="col-xs-12"> <div class="col-xs-12">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.app-setup.site-name') }}</label> <label>{{ trans('forms.settings.app-setup.site-name') }}</label>
<input type="text" class="form-control" name="app_name" value="{{ $app_name }}" required placeholder="{{ trans('forms.settings.app-setup.site-name') }}"> <input type="text" class="form-control" name="app_name" value="{{ $appName }}" required placeholder="{{ trans('forms.settings.app-setup.site-name') }}">
</div> </div>
</div> </div>
</div> </div>
@@ -27,7 +27,7 @@
<div class="col-xs-12"> <div class="col-xs-12">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.app-setup.site-url') }}</label> <label>{{ trans('forms.settings.app-setup.site-url') }}</label>
<input type="text" class="form-control" name="app_domain" value="{{ $app_domain }}" required placeholder="{{ trans('forms.settings.app-setup.site-url') }}"> <input type="text" class="form-control" name="app_domain" value="{{ $appDomain }}" required placeholder="{{ trans('forms.settings.app-setup.site-url') }}">
</div> </div>
</div> </div>
</div> </div>
@@ -36,7 +36,7 @@
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.app-setup.about-this-page') }}</label> <label>{{ trans('forms.settings.app-setup.about-this-page') }}</label>
<div class='markdown-control'> <div class='markdown-control'>
<textarea name="app_about" class="form-control autosize" rows="4" placeholder="{{ trans('forms.settings.app-setup.about-this-page') }}">{{ $raw_app_about }}</textarea> <textarea name="app_about" class="form-control autosize" rows="4" placeholder="{{ trans('forms.settings.app-setup.about-this-page') }}">{{ $rawAppAbout }}</textarea>
</div> </div>
</div> </div>
</div> </div>
@@ -103,7 +103,7 @@
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input type="hidden" value="0" name="display_graphs"> <input type="hidden" value="0" name="display_graphs">
<input type="checkbox" value="1" name="display_graphs" {{ $app_graphs ? 'checked' : null }}> <input type="checkbox" value="1" name="display_graphs" {{ $appGraphs ? 'checked' : null }}>
{{ trans('forms.settings.app-setup.display-graphs') }} {{ trans('forms.settings.app-setup.display-graphs') }}
</label> </label>
</div> </div>
@@ -114,7 +114,7 @@
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input type="hidden" value="0" name="show_support"> <input type="hidden" value="0" name="show_support">
<input type="checkbox" value="1" name="show_support" {{ $show_support ? 'checked' : null }}> <input type="checkbox" value="1" name="show_support" {{ $showSupport ? 'checked' : null }}>
{{ trans('setup.show_support') }} {{ trans('setup.show_support') }}
</label> </label>
</div> </div>
@@ -125,7 +125,7 @@
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input type="hidden" value="0" name="enable_external_dependencies"> <input type="hidden" value="0" name="enable_external_dependencies">
<input type="checkbox" value="1" name="enable_external_dependencies" {{ $enable_external_dependencies ? 'checked' : null }}> <input type="checkbox" value="1" name="enable_external_dependencies" {{ $enableExternalDependencies ? 'checked' : null }}>
{{ trans('forms.settings.app-setup.enable_external_dependencies') }} {{ trans('forms.settings.app-setup.enable_external_dependencies') }}
</label> </label>
</div> </div>
@@ -136,7 +136,7 @@
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input type="hidden" value="0" name="show_timezone"> <input type="hidden" value="0" name="show_timezone">
<input type="checkbox" value="1" name="show_timezone" {{ $show_timezone ? 'checked' : null }}> <input type="checkbox" value="1" name="show_timezone" {{ $showTimezone ? 'checked' : null }}>
{{ trans('forms.settings.app-setup.show_timezone') }} {{ trans('forms.settings.app-setup.show_timezone') }}
</label> </label>
</div> </div>
@@ -147,7 +147,7 @@
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input type="hidden" value="0" name="only_disrupted_days"> <input type="hidden" value="0" name="only_disrupted_days">
<input type="checkbox" value="1" name="only_disrupted_days" {{ $only_disrupted_days ? 'checked' : null }}> <input type="checkbox" value="1" name="only_disrupted_days" {{ $onlyDisruptedDays ? 'checked' : null }}>
{{ trans('forms.settings.app-setup.only_disrupted_days') }} {{ trans('forms.settings.app-setup.only_disrupted_days') }}
</label> </label>
</div> </div>

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="content-panel"> <div class="content-panel">
@includeWhen(isset($sub_menu), 'dashboard.partials.sub-sidebar') @includeWhen(isset($subMenu), 'dashboard.partials.sub-sidebar')
<div class="content-wrapper"> <div class="content-wrapper">
<div class="header sub-header" id="application-setup"> <div class="header sub-header" id="application-setup">
<span class="uppercase"> <span class="uppercase">

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="content-panel"> <div class="content-panel">
@includeWhen(isset($sub_menu), 'dashboard.partials.sub-sidebar') @includeWhen(isset($subMenu), 'dashboard.partials.sub-sidebar')
<div class="content-wrapper"> <div class="content-wrapper">
<div class="header sub-header" id="application-setup"> <div class="header sub-header" id="application-setup">
<span class="uppercase"> <span class="uppercase">

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="content-panel"> <div class="content-panel">
@includeWhen(isset($sub_menu), 'dashboard.partials.sub-sidebar') @includeWhen(isset($subMenu), 'dashboard.partials.sub-sidebar')
<div class="content-wrapper"> <div class="content-wrapper">
<div class="header sub-header" id="application-setup"> <div class="header sub-header" id="application-setup">
<span class="uppercase"> <span class="uppercase">
@@ -63,7 +63,7 @@
<select name="app_locale" class="form-control" required> <select name="app_locale" class="form-control" required>
<option value="">Select Language</option> <option value="">Select Language</option>
@foreach($langs as $key => $lang) @foreach($langs as $key => $lang)
<option value="{{ $key }}" @if($app_locale === $key) selected @endif> <option value="{{ $key }}" @if($appLocale === $key) selected @endif>
{{ $lang['name'] }} {{ $lang['name'] }}
</option> </option>
@endforeach @endforeach
@@ -76,7 +76,7 @@
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input type="hidden" value="0" name="automatic_localization"> <input type="hidden" value="0" name="automatic_localization">
<input type="checkbox" value="1" name="automatic_localization" {{ $automatic_localization ? 'checked' : null }}> <input type="checkbox" value="1" name="automatic_localization" {{ $automaticLocalization ? 'checked' : null }}>
{{ trans('forms.settings.app-setup.automatic_localization') }} {{ trans('forms.settings.app-setup.automatic_localization') }}
</label> </label>
</div> </div>

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="content-panel"> <div class="content-panel">
@includeWhen(isset($sub_menu), 'dashboard.partials.sub-sidebar') @includeWhen(isset($subMenu), 'dashboard.partials.sub-sidebar')
<div class="content-wrapper"> <div class="content-wrapper">
<div class="header sub-header" id="application-setup"> <div class="header sub-header" id="application-setup">
<span class="uppercase"> <span class="uppercase">

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="content-panel"> <div class="content-panel">
@includeWhen(isset($sub_menu), 'dashboard.partials.sub-sidebar') @includeWhen(isset($subMenu), 'dashboard.partials.sub-sidebar')
<div class="content-wrapper"> <div class="content-wrapper">
<div class="header sub-header" id="application-setup"> <div class="header sub-header" id="application-setup">
<span class="uppercase"> <span class="uppercase">
@@ -19,7 +19,7 @@
<label>{{ trans('forms.setup.mail_driver') }}</label> <label>{{ trans('forms.setup.mail_driver') }}</label>
<select name="config[mail_driver]" class="form-control" required> <select name="config[mail_driver]" class="form-control" required>
<option disabled>{{ trans('forms.setup.mail_driver') }}</option> <option disabled>{{ trans('forms.setup.mail_driver') }}</option>
@foreach($mail_drivers as $driver => $driverName) @foreach($mailDrivers as $driver => $driverName)
<option value="{{ $driver }}" {{ Binput::old('config.mail_driver', $config['driver']) == $driver ? "selected" : null }}>{{ $driverName }}</option> <option value="{{ $driver }}" {{ Binput::old('config.mail_driver', $config['driver']) == $driver ? "selected" : null }}>{{ $driverName }}</option>
@endforeach @endforeach
</select> </select>

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="content-panel"> <div class="content-panel">
@includeWhen(isset($sub_menu), 'dashboard.partials.sub-sidebar') @includeWhen(isset($subMenu), 'dashboard.partials.sub-sidebar')
<div class="content-wrapper"> <div class="content-wrapper">
<div class="header sub-header" id="security"> <div class="header sub-header" id="security">
<span class="uppercase"> <span class="uppercase">
@@ -48,13 +48,13 @@
</div> </div>
</div> </div>
@if(!$unsecure_users->isEmpty()) @if(!$unsecureUsers->isEmpty())
<hr> <hr>
<div class="panel panel-danger"> <div class="panel panel-danger">
<div class="panel-heading">{{ trans('dashboard.settings.security.two-factor') }}</div> <div class="panel-heading">{{ trans('dashboard.settings.security.two-factor') }}</div>
<div class="list-group"> <div class="list-group">
@foreach($unsecure_users as $user) @foreach($unsecureUsers as $user)
<div class="list-group-item"> <div class="list-group-item">
<strong>{{ $user->username }}</strong> <strong>{{ $user->username }}</strong>
<span class="label label-danger pull-right"><i class="ion ion-ios-unlocked"></i></span> <span class="label label-danger pull-right"><i class="ion ion-ios-unlocked"></i></span>

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="content-panel"> <div class="content-panel">
@includeWhen(isset($sub_menu), 'dashboard.partials.sub-sidebar') @includeWhen(isset($subMenu), 'dashboard.partials.sub-sidebar')
<div class="content-wrapper"> <div class="content-wrapper">
<div class="header sub-header" id="stylesheet"> <div class="header sub-header" id="stylesheet">
<span class="uppercase"> <span class="uppercase">

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="content-panel"> <div class="content-panel">
@includeWhen(isset($sub_menu), 'dashboard.partials.sub-sidebar') @includeWhen(isset($subMenu), 'dashboard.partials.sub-sidebar')
<div class="content-wrapper"> <div class="content-wrapper">
<div class="header sub-header" id="theme"> <div class="header sub-header" id="theme">
<span class="uppercase"> <span class="uppercase">
@@ -18,9 +18,9 @@
<div class="col-xs-12"> <div class="col-xs-12">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.app-setup.banner') }}</label> <label>{{ trans('forms.settings.app-setup.banner') }}</label>
@if($app_banner) @if($appBanner)
<div id="banner-view" class="well"> <div id="banner-view" class="well">
<img src="data:{{ $app_banner_type }};base64,{{ $app_banner }}" style="max-width: 100%"> <img src="data:{{ $app_banner_type }};base64,{{ $appBanner }}" style="max-width: 100%">
<br><br> <br><br>
<button id="remove-banner" class="btn btn-danger">{{ trans('forms.remove') }}</button> <button id="remove-banner" class="btn btn-danger">{{ trans('forms.remove') }}</button>
</div> </div>
@@ -37,13 +37,13 @@
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.theme.background-color') }}</label> <label>{{ trans('forms.settings.theme.background-color') }}</label>
<input type="text" class="form-control color-code" name="style.background_color" value="{{ $theme_background_color }}" placeholder="{{ trans('forms.settings.theme.background-color') }}"> <input type="text" class="form-control color-code" name="style.background_color" value="{{ $themeBackgroundColor }}" placeholder="{{ trans('forms.settings.theme.background-color') }}">
</div> </div>
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.theme.text-color') }}</label> <label>{{ trans('forms.settings.theme.text-color') }}</label>
<input type="text" class="form-control color-code" name="style.text_color" value="{{ $theme_text_color }}" placeholder="{{ trans('forms.settings.theme.text-color') }}"> <input type="text" class="form-control color-code" name="style.text_color" value="{{ $themeTextColor }}" placeholder="{{ trans('forms.settings.theme.text-color') }}">
</div> </div>
</div> </div>
</div> </div>
@@ -52,20 +52,20 @@
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.theme.banner-background-color') }}</label> <label>{{ trans('forms.settings.theme.banner-background-color') }}</label>
<input type="text" class="form-control color-code" name="style.banner_background_color" value="{{ $theme_banner_background_color }}" placeholder="{{ trans('forms.settings.theme.banner-background-color') }}"> <input type="text" class="form-control color-code" name="style.banner_background_color" value="{{ $themeBannerBackgroundColor }}" placeholder="{{ trans('forms.settings.theme.banner-background-color') }}">
</div> </div>
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.theme.banner-padding') }}</label> <label>{{ trans('forms.settings.theme.banner-padding') }}</label>
<input type="text" class="form-control" name="style.banner_padding" value="{{ $theme_banner_padding }}" placeholder="{{ trans('forms.settings.theme.banner-padding') }}"> <input type="text" class="form-control" name="style.banner_padding" value="{{ $themeBannerPadding }}" placeholder="{{ trans('forms.settings.theme.banner-padding') }}">
</div> </div>
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12">
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input type="hidden" value="0" name="style.fullwidth_header"> <input type="hidden" value="0" name="style.fullwidth_header">
<input type="checkbox" value="1" name="style.fullwidth_header" {{ $app_banner_style_full_width ? 'checked' : null }}> <input type="checkbox" value="1" name="style.fullwidth_header" {{ $appBannerStyleFullWidth ? 'checked' : null }}>
{{ trans('forms.settings.theme.fullwidth-banner') }} {{ trans('forms.settings.theme.fullwidth-banner') }}
</label> </label>
</div> </div>
@@ -76,13 +76,13 @@
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.theme.reds') }}</label> <label>{{ trans('forms.settings.theme.reds') }}</label>
<input type="text" class="form-control color-code" name="style.reds" value="{{ $theme_reds }}" placeholder="{{ trans('forms.settings.theme.reds') }}"> <input type="text" class="form-control color-code" name="style.reds" value="{{ $themeReds }}" placeholder="{{ trans('forms.settings.theme.reds') }}">
</div> </div>
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.theme.blues') }}</label> <label>{{ trans('forms.settings.theme.blues') }}</label>
<input type="text" class="form-control color-code" name="style.blues" value="{{ $theme_blues }}" placeholder="{{ trans('forms.settings.theme.blues') }}"> <input type="text" class="form-control color-code" name="style.blues" value="{{ $themeBlues }}" placeholder="{{ trans('forms.settings.theme.blues') }}">
</div> </div>
</div> </div>
</div> </div>
@@ -90,13 +90,13 @@
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.theme.greens') }}</label> <label>{{ trans('forms.settings.theme.greens') }}</label>
<input type="text" class="form-control color-code" name="style.greens" value="{{ $theme_greens }}" placeholder="{{ trans('forms.settings.theme.greens') }}"> <input type="text" class="form-control color-code" name="style.greens" value="{{ $themeGreens }}" placeholder="{{ trans('forms.settings.theme.greens') }}">
</div> </div>
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.theme.yellows') }}</label> <label>{{ trans('forms.settings.theme.yellows') }}</label>
<input type="text" class="form-control color-code" name="style.yellows" value="{{ $theme_yellows }}" placeholder="{{ trans('forms.settings.theme.yellows') }}"> <input type="text" class="form-control color-code" name="style.yellows" value="{{ $themeYellows }}" placeholder="{{ trans('forms.settings.theme.yellows') }}">
</div> </div>
</div> </div>
</div> </div>
@@ -104,13 +104,13 @@
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.theme.oranges') }}</label> <label>{{ trans('forms.settings.theme.oranges') }}</label>
<input type="text" class="form-control color-code" name="style.oranges" value="{{ $theme_oranges }}" placeholder="{{ trans('forms.settings.theme.oranges') }}"> <input type="text" class="form-control color-code" name="style.oranges" value="{{ $themeOranges }}" placeholder="{{ trans('forms.settings.theme.oranges') }}">
</div> </div>
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.theme.metrics') }}</label> <label>{{ trans('forms.settings.theme.metrics') }}</label>
<input type="text" class="form-control color-code" name="style.metrics" value="{{ $theme_metrics }}" placeholder="{{ trans('forms.settings.theme.metrics') }}"> <input type="text" class="form-control color-code" name="style.metrics" value="{{ $themeMetrics }}" placeholder="{{ trans('forms.settings.theme.metrics') }}">
</div> </div>
</div> </div>
</div> </div>
@@ -118,13 +118,13 @@
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.theme.links') }}</label> <label>{{ trans('forms.settings.theme.links') }}</label>
<input type="text" class="form-control color-code" name="style.links" value="{{ $theme_links }}" placeholder="{{ trans('forms.settings.theme.links') }}"> <input type="text" class="form-control color-code" name="style.links" value="{{ $themeLinks }}" placeholder="{{ trans('forms.settings.theme.links') }}">
</div> </div>
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.settings.theme.background-fills') }}</label> <label>{{ trans('forms.settings.theme.background-fills') }}</label>
<input type="text" class="form-control color-code" name="style.background_fills" value="{{ $theme_background_fills }}" placeholder="{{ trans('forms.settings.theme.background-fills') }}"> <input type="text" class="form-control color-code" name="style.background_fills" value="{{ $themeBackgroundFills }}" placeholder="{{ trans('forms.settings.theme.background-fills') }}">
</div> </div>
</div> </div>
</div> </div>

View File

@@ -8,7 +8,7 @@
<span class="uppercase"> <span class="uppercase">
<i class="ion ion-ios-email-outline"></i> {{ trans('dashboard.subscribers.subscribers') }} <i class="ion ion-ios-email-outline"></i> {{ trans('dashboard.subscribers.subscribers') }}
</span> </span>
@if($current_user->isAdmin && $enable_subscribers) @if($currentUser->isAdmin && $enableSubscribers)
<a class="btn btn-md btn-success pull-right" href="{{ cachet_route('dashboard.subscribers.create') }}"> <a class="btn btn-md btn-success pull-right" href="{{ cachet_route('dashboard.subscribers.create') }}">
{{ trans('dashboard.subscribers.add.title') }} {{ trans('dashboard.subscribers.add.title') }}
</a> </a>
@@ -19,7 +19,7 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<p class="lead"> <p class="lead">
@if($enable_subscribers) @if($enableSubscribers)
{{ trans('dashboard.subscribers.description') }} {{ trans('dashboard.subscribers.description') }}
@else @else
{{ trans('dashboard.subscribers.description_disabled') }} {{ trans('dashboard.subscribers.description_disabled') }}

View File

@@ -29,7 +29,7 @@
<input type="password" class="form-control password-strength" name="password" value="" placeholder="{{ trans('forms.user.password') }}"> <input type="password" class="form-control password-strength" name="password" value="" placeholder="{{ trans('forms.user.password') }}">
<div class="strengthify-wrapper"></div> <div class="strengthify-wrapper"></div>
</div> </div>
@if($current_user->isAdmin) @if($currentUser->isAdmin)
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.user.user_level') }}</label> <label>{{ trans('forms.user.user_level') }}</label>
<select name="level" class="form-control"> <select name="level" class="form-control">

View File

@@ -26,10 +26,10 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.user.password') }}</label> <label>{{ trans('forms.user.password') }}</label>
<input type="password" class="form-control password-strength" name="password" value="" {{ !$current_user->isAdmin ? "disabled": "" }} placeholder="{{ trans('forms.user.password') }}"> <input type="password" class="form-control password-strength" name="password" value="" {{ !$currentUser->isAdmin ? "disabled": "" }} placeholder="{{ trans('forms.user.password') }}">
<div class="strengthify-wrapper"></div> <div class="strengthify-wrapper"></div>
</div> </div>
@if($current_user->isAdmin) @if($currentUser->isAdmin)
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.user.user_level') }}</label> <label>{{ trans('forms.user.user_level') }}</label>
<select name="level" class="form-control"> <select name="level" class="form-control">
@@ -42,9 +42,9 @@
<div class="form-group"> <div class="form-group">
<button type="submit" class="btn btn-success">{{ trans('forms.update') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.update') }}</button>
@if($current_user->isAdmin) @if($currentUser->isAdmin)
<a class="btn btn-info" href="{{ cachet_route('dashboard.user.api.regen', [$user->id]) }}">{{ trans('cachet.api.revoke') }}</a> <a class="btn btn-info" href="{{ cachet_route('dashboard.user.api.regen', [$user->id]) }}">{{ trans('cachet.api.revoke') }}</a>
@if($current_user->id != $user->id) @if($currentUser->id != $user->id)
<a class="btn btn-danger confirm-action" href="{{ cachet_route('dashboard.team.delete', [$user->id], 'delete') }}" data-method="DELETE">{{ trans('forms.delete') }}</a> <a class="btn btn-danger confirm-action" href="{{ cachet_route('dashboard.team.delete', [$user->id], 'delete') }}" data-method="DELETE">{{ trans('forms.delete') }}</a>
@endif @endif
@endif @endif

View File

@@ -8,7 +8,7 @@
<span class="uppercase"> <span class="uppercase">
<i class="ion ion-ios-people-outline"></i> {{ trans('dashboard.team.team') }} <i class="ion ion-ios-people-outline"></i> {{ trans('dashboard.team.team') }}
</span> </span>
@if($current_user->isAdmin) @if($currentUser->isAdmin)
<div class="button-group pull-right"> <div class="button-group pull-right">
<a class="btn btn-sm btn-success" href="{{ cachet_route('dashboard.team.invite') }}"> <a class="btn btn-sm btn-success" href="{{ cachet_route('dashboard.team.invite') }}">
{{ trans('dashboard.team.invite.title') }} {{ trans('dashboard.team.invite.title') }}
@@ -26,9 +26,9 @@
<p class="lead">{{ trans('dashboard.team.description') }}</p> <p class="lead">{{ trans('dashboard.team.description') }}</p>
<div class="user-grid"> <div class="user-grid">
@foreach($team_members as $member) @foreach($teamMembers as $member)
<div class="user col-sm-3 col-xs-6"> <div class="user col-sm-3 col-xs-6">
<a href="@if($current_user->id == $member->id) {{ url('dashboard/user') }} @else /dashboard/team/{{ $member->id }} @endif"> <a href="@if($currentUser->id == $member->id) {{ url('dashboard/user') }} @else /dashboard/team/{{ $member->id }} @endif">
<img src="{{ $member->avatar }}"> <img src="{{ $member->avatar }}">
</a> </a>
<div class="name">{{ $member->username }}</div> <div class="name">{{ $member->username }}</div>

View File

@@ -33,10 +33,10 @@ window.addEventListener("DOMContentLoaded", function(e) {
<div class="content-wrapper"> <div class="content-wrapper">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@if($updated_template = Session::get('updated_template')) @if($updatedTemplate = Session::get('updated_template'))
<div class="alert alert-{{ ($template_errors = Session::get('template_errors')) ? 'danger' : 'success' }}"> <div class="alert alert-{{ ($templateErrors = Session::get('template_errors')) ? 'danger' : 'success' }}">
@if($template_errors) @if($templateErrors)
{{ sprintf("%s - %s", trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.edit.failure').' '.$template_errors) }} {{ sprintf("%s - %s", trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.edit.failure').' '.$templateErrors) }}
@else @else
{{ sprintf("%s - %s", trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.edit.success')) }} {{ sprintf("%s - %s", trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.edit.success')) }}
@endif @endif

View File

@@ -17,7 +17,7 @@
<div class="col-sm-12"> <div class="col-sm-12">
@include('partials.errors') @include('partials.errors')
<div class="striped-list"> <div class="striped-list">
@forelse($incident_templates as $template) @forelse($incidentTemplates as $template)
<div class="row striped-list-item"> <div class="row striped-list-item">
<div class="col-xs-6"> <div class="col-xs-6">
<strong>{{ $template->name }}</strong> <strong>{{ $template->name }}</strong>

View File

@@ -19,15 +19,15 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="form-group"> <div class="form-group">
<a href="https://gravatar.com"><img src="{{ $current_user->avatar }}" class="img-responsive img-thumbnail" title="{{ trans('forms.user.gravatar') }}" data-toggle="tooltip"></a> <a href="https://gravatar.com"><img src="{{ $currentUser->avatar }}" class="img-responsive img-thumbnail" title="{{ trans('forms.user.gravatar') }}" data-toggle="tooltip"></a>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.user.username') }}</label> <label>{{ trans('forms.user.username') }}</label>
<input type="text" class="form-control" name="username" value="{{ $current_user->username }}" required placeholder="{{ trans('forms.user.username') }}"> <input type="text" class="form-control" name="username" value="{{ $currentUser->username }}" required placeholder="{{ trans('forms.user.username') }}">
</div> </div>
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.user.email') }}</label> <label>{{ trans('forms.user.email') }}</label>
<input type="email" class="form-control" name="email" value="{{ $current_user->email }}" required placeholder="{{ trans('forms.user.email') }}"> <input type="email" class="form-control" name="email" value="{{ $currentUser->email }}" required placeholder="{{ trans('forms.user.email') }}">
</div> </div>
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.user.password') }}</label> <label>{{ trans('forms.user.password') }}</label>
@@ -38,8 +38,8 @@
<div class="form-group"> <div class="form-group">
<label>{{ trans('forms.user.api-token') }}</label> <label>{{ trans('forms.user.api-token') }}</label>
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" name="api_key" readonly value="{{ $current_user->api_key }}" placeholder="{{ trans('forms.user.api-token') }}"> <input type="text" class="form-control" name="api_key" readonly value="{{ $currentUser->api_key }}" placeholder="{{ trans('forms.user.api-token') }}">
<a href="{{ cachet_route('dashboard.user.api.regen', [$current_user->id]) }}" class="input-group-addon btn btn-danger">{{ trans('cachet.api.regenerate') }}</a> <a href="{{ cachet_route('dashboard.user.api.regen', [$currentUser->id]) }}" class="input-group-addon btn btn-danger">{{ trans('cachet.api.regenerate') }}</a>
</div> </div>
<span class="help-block">{{ trans('forms.user.api-token-help') }}</span> <span class="help-block">{{ trans('forms.user.api-token-help') }}</span>
</div> </div>
@@ -47,17 +47,17 @@
<div class="form-group"> <div class="form-group">
<label class="checkbox-inline"> <label class="checkbox-inline">
<input type="hidden" name="google2fa" value="0"> <input type="hidden" name="google2fa" value="0">
<input type='checkbox' name="google2fa" value="1" {{ $current_user->hasTwoFactor ? "checked" : "" }}> <input type='checkbox' name="google2fa" value="1" {{ $currentUser->hasTwoFactor ? "checked" : "" }}>
{{ trans('forms.setup.enable_google2fa') }} {{ trans('forms.setup.enable_google2fa') }}
</label> </label>
</div> </div>
@if($current_user->hasTwoFactor) @if($currentUser->hasTwoFactor)
<div class="form-group"> <div class="form-group">
<?php <?php
$google2fa_url = PragmaRX\Google2FA\Vendor\Laravel\Facade::getQRCodeGoogleUrl( $google2fa_url = PragmaRX\Google2FA\Vendor\Laravel\Facade::getQRCodeGoogleUrl(
'Cachet', 'Cachet',
$current_user->email, $currentUser->email,
$current_user->google_2fa_secret $currentUser->google_2fa_secret
); );
?> ?>
<img src="{{ $google2fa_url }}" class="img-responsive"> <img src="{{ $google2fa_url }}" class="img-responsive">

View File

@@ -20,10 +20,10 @@
<link rel="apple-touch-icon" sizes="144x144" href="{{ asset('/img/apple-touch-icon-144x144.png') }}"> <link rel="apple-touch-icon" sizes="144x144" href="{{ asset('/img/apple-touch-icon-144x144.png') }}">
<link rel="apple-touch-icon" sizes="152x152" href="{{ asset('/img/apple-touch-icon-152x152.png') }}"> <link rel="apple-touch-icon" sizes="152x152" href="{{ asset('/img/apple-touch-icon-152x152.png') }}">
<title>{{ $page_title or $site_title }}</title> <title>{{ $pageTitle or $siteTitle }}</title>
@if($enable_external_dependencies) @if($enableExternalDependencies)
{{-- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset={{ $font_subset }}" rel="stylesheet" type="text/css"> --}} {{-- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset={{ $fontSubset }}" rel="stylesheet" type="text/css"> --}}
@endif @endif
<link rel="stylesheet" href="{{ mix('dist/css/dashboard/dashboard.css') }}"> <link rel="stylesheet" href="{{ mix('dist/css/dashboard/dashboard.css') }}">
@yield('css') @yield('css')
@@ -32,7 +32,7 @@
<script type="text/javascript"> <script type="text/javascript">
var Global = {}; var Global = {};
Global.locale = '{{ $app_locale }}'; Global.locale = '{{ $appLocale }}';
</script> </script>
<script src="{{ mix('dist/js/manifest.js') }}"></script> <script src="{{ mix('dist/js/manifest.js') }}"></script>

View File

@@ -20,16 +20,16 @@
<link rel="apple-touch-icon" sizes="144x144" href="{{ asset('/img/apple-touch-icon-144x144.png') }}"> <link rel="apple-touch-icon" sizes="144x144" href="{{ asset('/img/apple-touch-icon-144x144.png') }}">
<link rel="apple-touch-icon" sizes="152x152" href="{{ asset('/img/apple-touch-icon-152x152.png') }}"> <link rel="apple-touch-icon" sizes="152x152" href="{{ asset('/img/apple-touch-icon-152x152.png') }}">
<title>{{ $page_title or $site_title }}</title> <title>{{ $pageTitle or $siteTitle }}</title>
<script> <script>
window.Global = {} window.Global = {}
Global.locale = '{{ $app_locale }}'; Global.locale = '{{ $appLocale }}';
Global.csrfToken = '{{ csrf_token() }}'; Global.csrfToken = '{{ csrf_token() }}';
</script> </script>
@if($enable_external_dependencies) @if($enableExternalDependencies)
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset={{ $font_subset }}" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset={{ $fontSubset }}" rel="stylesheet" type="text/css">
@endif @endif
<link rel="stylesheet" href="{{ mix('dist/css/dashboard/dashboard.css') }}"> <link rel="stylesheet" href="{{ mix('dist/css/dashboard/dashboard.css') }}">
@yield('css') @yield('css')
@@ -42,26 +42,22 @@
<body class="dashboard"> <body class="dashboard">
<div class="wrapper" id="app"> <div class="wrapper" id="app">
<dashboard inline-template :user="{{ $current_user }}"> @include('dashboard.partials.sidebar')
<div> <div class="page-content">
@include('dashboard.partials.sidebar') @if(!$isWriteable)
<div class="page-content"> <div class="content-wrapper">
@if(!$is_writeable) <div class="row">
<div class="content-wrapper"> <div class="col-sm-12">
<div class="row"> <div class="alert alert-info">
<div class="col-sm-12"> {!! trans('dashboard.writeable_settings') !!}
<div class="alert alert-info">
{!! trans('dashboard.writeable_settings') !!}
</div>
</div>
</div> </div>
</div> </div>
@endif
@yield('content')
</div> </div>
</div> </div>
</dashboard> @endif
@yield('content')
</div>
</div> </div>
</body> </body>
@yield('js') @yield('js')

View File

@@ -7,25 +7,25 @@
<meta name="env" content="{{ app('env') }}"> <meta name="env" content="{{ app('env') }}">
<meta name="token" content="{{ csrf_token() }}"> <meta name="token" content="{{ csrf_token() }}">
<link rel="alternate" type="application/atom+xml" href="{{ cachet_route('feed.atom') }}" title="{{ $site_title }} - Atom Feed"> <link rel="alternate" type="application/atom+xml" href="{{ cachet_route('feed.atom') }}" title="{{ $siteTitle }} - Atom Feed">
<link rel="alternate" type="application/rss+xml" href="{{ cachet_route('feed.rss') }}" title="{{ $site_title }} - RSS Feed"> <link rel="alternate" type="application/rss+xml" href="{{ cachet_route('feed.rss') }}" title="{{ $siteTitle }} - RSS Feed">
<!-- Mobile friendliness --> <!-- Mobile friendliness -->
<meta name="HandheldFriendly" content="True"> <meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320"> <meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="description" content="@yield('description', trans('cachet.meta.description.overview', ['app' => $app_name]))"> <meta name="description" content="@yield('description', trans('cachet.meta.description.overview', ['app' => $appName]))">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
<meta property="og:title" content="{{ $site_title }}"> <meta property="og:title" content="{{ $siteTitle }}">
<meta property="og:image" content="/img/favicon.png"> <meta property="og:image" content="/img/favicon.png">
<meta property="og:description" content="@yield('description', trans('cachet.meta.description.overview', ['app' => $app_name]))"> <meta property="og:description" content="@yield('description', trans('cachet.meta.description.overview', ['app' => $appName]))">
<!-- Mobile IE allows us to activate ClearType technology for smoothing fonts for easy reading --> <!-- Mobile IE allows us to activate ClearType technology for smoothing fonts for easy reading -->
<meta http-equiv="cleartype" content="on"> <meta http-equiv="cleartype" content="on">
<meta name="msapplication-TileColor" content="{{ $theme_greens }}" /> <meta name="msapplication-TileColor" content="{{ $themeGreens }}" />
<meta name="msapplication-TileImage" content="{{ asset('/img/favicon.png') }}" /> <meta name="msapplication-TileImage" content="{{ asset('/img/favicon.png') }}" />
@if (isset($favicon)) @if (isset($favicon))
@@ -44,10 +44,10 @@
<link rel="apple-touch-icon" sizes="144x144" href="{{ asset('/img/apple-touch-icon-144x144.png') }}"> <link rel="apple-touch-icon" sizes="144x144" href="{{ asset('/img/apple-touch-icon-144x144.png') }}">
<link rel="apple-touch-icon" sizes="152x152" href="{{ asset('/img/apple-touch-icon-152x152.png') }}"> <link rel="apple-touch-icon" sizes="152x152" href="{{ asset('/img/apple-touch-icon-152x152.png') }}">
<title>@yield('title', $site_title)</title> <title>@yield('title', $siteTitle)</title>
@if($enable_external_dependencies) @if($enableExternalDependencies)
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset={{ $font_subset }}" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset={{ $fontSubset }}" rel="stylesheet" type="text/css">
@endif @endif
<link rel="stylesheet" href="{{ mix('dist/css/app.css') }}"> <link rel="stylesheet" href="{{ mix('dist/css/app.css') }}">
@@ -55,26 +55,25 @@
@include('partials.crowdin') @include('partials.crowdin')
@if($app_stylesheet) @if($appStylesheet)
<style type="text/css"> <style type="text/css">
{!! $app_stylesheet !!} {!! $appStylesheet !!}
</style> </style>
@endif @endif
<script type="text/javascript"> <script type="text/javascript">
var Global = {}; var Global = {};
var refreshRate = parseInt("{{ $appRefreshRate }}");
var refreshRate = parseInt("{{ $app_refresh_rate }}");
function refresh() { function refresh() {
window.location.reload(true); window.location.reload(true);
} }
if(refreshRate > 0) { if (refreshRate > 0) {
setTimeout(refresh, refreshRate * 1000); setTimeout(refresh, refreshRate * 1000);
} }
Global.locale = '{{ $app_locale }}'; Global.locale = '{{ $appLocale }}';
</script> </script>
<script src="{{ mix('dist/js/manifest.js') }}"></script> <script src="{{ mix('dist/js/manifest.js') }}"></script>
<script src="{{ mix('dist/js/vendor.js') }}"></script> <script src="{{ mix('dist/js/vendor.js') }}"></script>

View File

@@ -1,7 +1,7 @@
@if($about_app) @if($aboutApp)
<div class="about-app"> <div class="about-app">
<h2>{{ trans('cachet.about_this_site') }}</h2> <h2>{{ trans('cachet.about_this_site') }}</h2>
{!! $about_app !!} {!! $aboutApp !!}
</div> </div>
@endif @endif

View File

@@ -1,36 +1,36 @@
@if($enable_external_dependencies) @if($enableExternalDependencies)
@if($app_analytics) @if($appAnalytics)
<script> <script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ $app_analytics }}', 'auto'); ga('create', '{{ $appAnalytics }}', 'auto');
ga('send', 'pageview'); ga('send', 'pageview');
</script> </script>
@endif @endif
@if($app_analytics_go_squared) @if($appAnalyticsGoSquared)
<script> <script>
!function(g,s,q,r,d){r=g[r]=g[r]||function(){(r.q=r.q||[]).push( !function(g,s,q,r,d){r=g[r]=g[r]||function(){(r.q=r.q||[]).push(
arguments)};d=s.createElement(q);q=s.getElementsByTagName(q)[0]; arguments)};d=s.createElement(q);q=s.getElementsByTagName(q)[0];
d.src='https://d1l6p2sc9645hc.cloudfront.net/tracker.js';q.parentNode. d.src='https://d1l6p2sc9645hc.cloudfront.net/tracker.js';q.parentNode.
insertBefore(d,q)}(window,document,'script','_gs'); insertBefore(d,q)}(window,document,'script','_gs');
_gs('{{ $app_analytics_go_squared }}'); _gs('{{ $appAnalyticsGoSquared }}');
</script> </script>
@endif @endif
@if($app_analytics_piwik_url) @if($appAnalyticsPiwikUrl)
<script type="text/javascript"> <script type="text/javascript">
var _paq = _paq || []; var _paq = _paq || [];
_paq.push(['trackPageView']); _paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']); _paq.push(['enableLinkTracking']);
(function() { (function() {
var u="{{ $app_analytics_piwik_url }}"; var u="{{ $appAnalyticsPiwikUrl }}";
_paq.push(['setTrackerUrl', u+'/piwik.php']); _paq.push(['setTrackerUrl', u+'/piwik.php']);
_paq.push(['setSiteId', {{ $app_analytics_piwik_site_id }}]); _paq.push(['setSiteId', {{ $appAnalyticsPiwikSiteID }}]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'/piwik.js'; s.parentNode.insertBefore(g,s); g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'/piwik.js'; s.parentNode.insertBefore(g,s);
})(); })();
</script> </script>
<noscript><p><img src="{{ $app_analytics_piwik_url }}/piwik.php?idsite={{ $app_analytics_piwik_site_id }}" style="border:0;" alt="" /></p></noscript> <noscript><p><img src="{{ $appAnalyticsPiwikUrl }}/piwik.php?idsite={{ $appAnalyticsPiwikSiteID }}" style="border:0;" alt="" /></p></noscript>
@endif @endif
@endif @endif

View File

@@ -1,15 +1,15 @@
@if($app_header) @if($appHeader)
{!! $app_header !!} {!! $appHeader !!}
@else @else
@if($app_banner) @if($appBanner)
<div @if($app_banner_style_full_width)class="app-banner"@endif> <div @if($appBannerStyleFullWidth)class="app-banner"@endif>
<div class="container"> <div class="container">
<div class="row app-banner-padding @if(!$app_banner_style_full_width) app-banner @endif"> <div class="row app-banner-padding @if(!$appBannerStyleFullWidth) app-banner @endif">
<div class="col-md-12 text-center"> <div class="col-md-12 text-center">
@if($app_domain) @if($appDomain)
<a href="{{ $app_domain }}" class="links"><img src="data:{{ $app_banner_type }};base64, {{ $app_banner }}" class="banner-image img-responsive"></a> <a href="{{ $appDomain }}" class="links"><img src="data:{{ $app_banner_type }};base64, {{ $appBanner }}" class="banner-image img-responsive"></a>
@else @else
<img src="data:{{ $app_banner_type }};base64, {{ $app_banner }}" class="banner-image img-responsive"> <img src="data:{{ $appBannerType }};base64, {{ $appBanner }}" class="banner-image img-responsive">
@endif @endif
</div> </div>
</div> </div>

Some files were not shown because too many files have changed in this diff Show More