Compare commits

...

39 Commits
2.4 ... v2.3.14

Author SHA1 Message Date
James Brooks
0c72e5eec8 Apply fixes from StyleCI (#2962)
[ci skip] [skip ci]
2018-03-26 19:18:30 +01:00
James Brooks
83bc743d79 Merge pull request #2960 from anthonybocci/metric-points-prefix-table-2925
Use the table prefix on metric_points
2018-03-26 19:18:07 +01:00
Anthony Bocci
35dcc8c928 Use the table prefix on metric_points
In the '.env' file, a 'DB_PREFIX' sets the prefix that should be used
on every table name. When writing an SQL query the 'DB_PREFIX' value
has to be prefixed to the table name.

The repository PgSqlRepository, MySqlRepository and SqliteRepository,
located in 'app/Repositories/Metric/' did not apply this prefix on
the 'metric_points' table. The problem occured only when we set a
'DB_PREFIX' not null, the rest of the application worked correctly but
the part about 'metric_points' couldn't work, saying the table was
inexistant.

A method was added in the repository AbstractMetricRepository to get
the 'metric_points' table name with the prefix if there is one.
This method is used in the three repositories to get the right table
name.

Note: This problem was present in 2.3, but was already fixed in 2.4 so
there is no need to apply this commit on the 2.4 branch.

See: CachetHQ/Cachet/#2955
2018-03-23 20:56:41 +01:00
James Brooks
93d1f8784a Merge pull request #2864 from snowflakeOps/2.3
use a better and smaller image for open graph (e.g for slack)
2018-01-11 21:33:49 +00:00
Markus Ritzmann
0450f2f330 #2853 use a better and smaller image for og 2018-01-11 16:49:01 +01:00
James Brooks
595b152db5 Merge pull request #2671 from checkitonus/bug/invalid-template-23
Quick check to make sure the template exists
2017-09-30 11:38:19 +01:00
Graham Campbell
cc15d078bf Removed old links 2017-09-10 18:24:01 +01:00
Graham Campbell
3b568bbc07 Mail password non-required 2017-09-10 18:11:23 +01:00
Graham Campbell
ae4c414a82 Upgraded exceptions package 2017-09-10 17:54:18 +01:00
Graham Campbell
5358cf5e1e Upgraded deps 2017-09-10 17:20:07 +01:00
Andrew Judd
6dedacad57 Removing a helper method 2017-07-30 08:48:45 -04:00
Andrew Judd
29c9211935 Quick check to make sure the template exists 2017-07-29 11:13:41 -04:00
James Brooks
7d47546650 Switch to dev 2017-07-17 21:50:00 +01:00
James Brooks
f5a9941903 Update deps again 2017-07-17 21:49:42 +01:00
James Brooks
52b7bf74b9 Update version 2017-07-17 21:46:30 +01:00
James Brooks
6a59d5ac4d Update deps 2017-07-17 21:44:45 +01:00
James Brooks
19b7b0c3b2 Require predis/predis. Fixes #2611 2017-07-17 21:44:43 +01:00
Graham Campbell
d4507e0722 Back to dev 2017-06-28 23:42:10 +01:00
Graham Campbell
47bc73f9e9 Release v2.3.12 2017-06-28 23:41:31 +01:00
Graham Campbell
81fc6479d5 Revert to original travis config 2017-06-28 22:53:06 +01:00
Graham Campbell
c9ca99990c Update .travis.yml 2017-06-28 22:49:07 +01:00
Graham Campbell
e0d35d6e64 Merge branch '2.3' of https://github.com/CachetHQ/Cachet into 2.3 2017-06-28 22:39:55 +01:00
Graham Campbell
813be34f25 Upgraded dependencies 2017-06-28 22:39:41 +01:00
Graham Campbell
900723105b Update .travis.yml 2017-06-28 22:38:44 +01:00
Graham Campbell
8012a201b9 Update .travis.yml 2017-06-28 22:00:28 +01:00
Graham Campbell
706e7765e1 Update .travis.yml 2017-06-28 21:52:45 +01:00
Guido Hendriks
bcff3d0730 Improve testCreateSubscriberWithSubscriptions test case (#2487) 2017-06-28 21:45:27 +01:00
James Brooks
db5bf005bc Apply fixes from StyleCI (#2606)
[ci skip] [skip ci]
2017-06-28 20:52:41 +01:00
James Brooks
dac88efce6 Merge pull request #2601 from Daniel15/2.3-with-patches
Backport API endpoint to get system status to v2.3
2017-06-28 20:52:08 +01:00
James Brooks
38ef2630ee Add system status to /status endpoint 2017-06-20 17:18:38 +10:00
James Brooks
c215ad4111 Implement the system status api endpoint. Closes #1936 2017-06-20 17:09:03 +10:00
James Brooks
c899839a7f Back to dev 2017-04-12 23:05:32 +01:00
James Brooks
2e5e8b1545 Bump version to 2.3.11 2017-04-12 23:05:09 +01:00
James Brooks
7e556d5dba Apply fixes from StyleCI (#2486)
[ci skip] [skip ci]
2017-04-12 23:04:21 +01:00
James Brooks
331e176fbc Updated deps 2017-03-25 11:42:25 +00:00
James Brooks
bde0abe472 Fix handling of individual component subscriptions via API 2016-09-21 18:35:58 +01:00
James Brooks
f2bf2eff68 Test creating a subscriber returns subscriptions 2016-09-21 18:17:22 +01:00
James Brooks
50ab96fc4f Load subscriptions when creating a subscriber 2016-09-21 18:16:08 +01:00
James Brooks
3cbee1302e Update deps 2016-09-21 18:08:56 +01:00
60 changed files with 891 additions and 635 deletions

View File

@@ -1,14 +1,17 @@
language: php
sudo: false
dist: trusty
php:
- 5.5.9
- 5.5
- 5.6
- 7.0
- 7.1
- hhvm
sudo: false
before_install: cp .env.example .env
install: travis_retry composer install --no-interaction --no-scripts --prefer-source

View File

@@ -95,7 +95,7 @@ If you'd like to contribute translations, please check out our [CrowdIn project]
## Show your support
Cachet is a BSD-3-licensed open source project. If you'd like to support future development, check out the [Patreon campaign](https://patreon.com/jbrooksuk).
Cachet is a BSD-3-licensed open source project.
## Professional Installation Service

View File

@@ -1 +1 @@
2.3.11-dev
2.3.14-dev

View File

@@ -70,7 +70,7 @@ class ReportIncidentCommandHandler
'visible' => $command->visible,
];
if ($command->template) {
if (IncidentTemplate::where('slug', '=', $command->template)->first()) {
$data['message'] = $this->parseIncidentTemplate($command->template, $command->template_vars);
} else {
$data['message'] = $command->message;

View File

@@ -44,17 +44,17 @@ class SubscribeSubscriberCommandHandler
// Decide what to subscribe the subscriber to.
if ($subscriptions = $command->subscriptions) {
$subscriptions = Component::whereIn('id', $subscriptions);
$components = Component::whereIn('id', $subscriptions)->get();
} else {
$subscriptions = Component::all();
$components = Component::all();
}
foreach ($subscriptions as $component) {
$components->map(function ($component) use ($subscriber) {
Subscription::create([
'subscriber_id' => $subscriber->id,
'component_id' => $component->id,
]);
}
});
if ($command->verified) {
dispatch(new VerifySubscriberCommand($subscriber));
@@ -62,6 +62,8 @@ class SubscribeSubscriberCommandHandler
event(new SubscriberHasSubscribedEvent($subscriber));
}
$subscriber->load('subscriptions');
return $subscriber;
}
}

View File

@@ -13,7 +13,6 @@ namespace CachetHQ\Cachet\Bus\Handlers\Commands\Subscriber;
use CachetHQ\Cachet\Bus\Commands\Subscriber\UnsubscribeSubscriberCommand;
use CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasUnsubscribedEvent;
use CachetHQ\Cachet\Models\Subscriber;
class UnsubscribeSubscriberCommandHandler
{

View File

@@ -11,13 +11,38 @@
namespace CachetHQ\Cachet\Composers;
use CachetHQ\Cachet\Integrations\Core\System;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\ComponentGroup;
use CachetHQ\Cachet\Models\Incident;
use Illuminate\Contracts\View\View;
/**
* This is the status page composer.
*
* @author James Brooks <james@alt-three.com>
*/
class StatusPageComposer
{
/**
* The system instance.
*
* @var \CachetHQ\Cachet\Integrations\Contracts\System
*/
protected $system;
/**
* Create a new status page composer instance.
*
* @param \CachetHQ\Cachet\Integrations\Contracts\System $system
*
* @return void
*/
public function __construct(System $system)
{
$this->system = $system;
}
/**
* Index page view composer.
*
@@ -27,42 +52,7 @@ class StatusPageComposer
*/
public function compose(View $view)
{
$totalComponents = Component::enabled()->count();
$majorOutages = Component::enabled()->status(4)->count();
$isMajorOutage = $totalComponents ? ($majorOutages / $totalComponents) >= 0.5 : false;
// Default data
$withData = [
'system_status' => 'info',
'system_message' => trans_choice('cachet.service.bad', $totalComponents),
'favicon' => 'favicon-high-alert',
];
if ($isMajorOutage) {
$withData = [
'system_status' => 'danger',
'system_message' => trans_choice('cachet.service.major', $totalComponents),
'favicon' => 'favicon-high-alert',
];
} elseif (Component::enabled()->notStatus(1)->count() === 0) {
// If all our components are ok, do we have any non-fixed incidents?
$incidents = Incident::notScheduled()->orderBy('created_at', 'desc')->get()->filter(function ($incident) {
return $incident->status > 0;
});
$incidentCount = $incidents->count();
if ($incidentCount === 0 || ($incidentCount >= 1 && (int) $incidents->first()->status === 4)) {
$withData = [
'system_status' => 'success',
'system_message' => trans_choice('cachet.service.good', $totalComponents),
'favicon' => 'favicon',
];
}
} else {
if (Component::enabled()->whereIn('status', [2, 3])->count() > 0) {
$withData['favicon'] = 'favicon-medium-alert';
}
}
$status = $this->system->getStatus();
// Scheduled maintenance code.
$scheduledMaintenance = Incident::scheduled()->orderBy('scheduled_at')->get();
@@ -72,7 +62,7 @@ class StatusPageComposer
$componentGroups = ComponentGroup::whereIn('id', $usedComponentGroups)->orderBy('order')->get();
$ungroupedComponents = Component::enabled()->where('group_id', 0)->orderBy('order')->orderBy('created_at')->get();
$view->with($withData)
$view->with($status)
->withComponentGroups($componentGroups)
->withUngroupedComponents($ungroupedComponents)
->withScheduledMaintenance($scheduledMaintenance);

View File

@@ -163,13 +163,6 @@ class DemoSeederCommand extends Command
'order' => 1,
'group_id' => 2,
'link' => 'https://styleci.io',
], [
'name' => 'Patreon Page',
'description' => 'Support future development of Cachet.',
'status' => 1,
'order' => 0,
'group_id' => 0,
'link' => 'https://patreon.com/jbrooksuk',
],
];

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\Foundation\Providers;
use CachetHQ\Cachet\Integrations\Contracts\System as SystemContract;
use CachetHQ\Cachet\Integrations\Core\System;
use Illuminate\Contracts\Container\Container;
use Illuminate\Support\ServiceProvider;
/**
* This is the integration service provider.
*
* @author James Brooks <james@alt-three.com>
*/
class IntegrationServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->registerSystem();
}
/**
* Register the system class.
*
* @return void
*/
protected function registerSystem()
{
$this->app->singleton(SystemContract::class, function (Container $app) {
return new System();
});
}
}

View File

@@ -11,6 +11,7 @@
namespace CachetHQ\Cachet\Http\Controllers\Api;
use CachetHQ\Cachet\Integrations\Contracts\System;
use CachetHQ\Cachet\Integrations\Releases;
/**
@@ -44,4 +45,19 @@ class GeneralController extends AbstractApiController
'latest' => $latest,
])->item(CACHET_VERSION);
}
/**
* Get the system status message.
*
* @return \Illuminate\Http\JsonResponse
*/
public function status()
{
$system = app()->make(System::class)->getStatus();
return $this->item([
'status' => $system['system_status'],
'message' => $system['system_message'],
]);
}
}

View File

@@ -149,7 +149,7 @@ class SetupController extends Controller
return $input->mail_driver === 'smtp';
});
$v->sometimes(['env.mail_address', 'env.mail_username', 'env.mail_password'], 'required', function ($input) {
$v->sometimes(['env.mail_address', 'env.mail_username'], 'required', function ($input) {
return $input->mail_driver !== 'log';
});

View File

@@ -33,6 +33,7 @@ class ApiRoutes
$router->group(['middleware' => ['auth.api']], function (Registrar $router) {
$router->get('ping', 'GeneralController@ping');
$router->get('version', 'GeneralController@version');
$router->get('status', 'GeneralController@status');
$router->get('components', 'ComponentController@getComponents');
$router->get('components/groups', 'ComponentGroupController@getGroups');

View File

@@ -0,0 +1,27 @@
<?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\Integrations\Contracts;
/**
* This is the system interface.
*
* @author James Brooks <james@alt-three.com>
*/
interface System
{
/**
* Get the entire system status.
*
* @return array
*/
public function getStatus();
}

View File

@@ -0,0 +1,70 @@
<?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\Integrations\Core;
use CachetHQ\Cachet\Integrations\Contracts\System as SystemContract;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\Incident;
/**
* This is the core system class.
*
* @author James Brooks <james@alt-three.com>
*/
class System implements SystemContract
{
/**
* Get the entire system status.
*
* @return array
*/
public function getStatus()
{
$enabledScope = Component::enabled();
$totalComponents = Component::enabled()->count();
$majorOutages = Component::enabled()->status(4)->count();
$isMajorOutage = $totalComponents ? ($majorOutages / $totalComponents) >= 0.5 : false;
// Default data
$status = [
'system_status' => 'info',
'system_message' => trans_choice('cachet.service.bad', $totalComponents),
'favicon' => 'favicon-high-alert',
];
if ($isMajorOutage) {
$status = [
'system_status' => 'danger',
'system_message' => trans_choice('cachet.service.major', $totalComponents),
'favicon' => 'favicon-high-alert',
];
} elseif (Component::enabled()->notStatus(1)->count() === 0) {
// If all our components are ok, do we have any non-fixed incidents?
$incidents = Incident::notScheduled()->orderBy('created_at', 'desc')->get()->filter(function ($incident) {
return $incident->status > 0;
});
$incidentCount = $incidents->count();
if ($incidentCount === 0 || ($incidentCount >= 1 && (int) $incidents->first()->status === 4)) {
$status = [
'system_status' => 'success',
'system_message' => trans_choice('cachet.service.good', $totalComponents),
'favicon' => 'favicon',
];
}
} elseif (Component::enabled()->whereIn('status', [2, 3])->count() > 0) {
$status['favicon'] = 'favicon-medium-alert';
}
return $status;
}
}

View File

@@ -47,6 +47,20 @@ abstract class AbstractMetricRepository
$this->config = $config;
}
/**
* Get the table names prefix.
*
* @return string
*/
protected function getPrefix()
{
$driver = $this->config->get('database.default');
$connection = $this->config->get('database.connections.'.$driver);
$prefix = $connection['prefix'];
return $prefix;
}
/**
* Get the metrics table name.
*
@@ -54,10 +68,20 @@ abstract class AbstractMetricRepository
*/
protected function getTableName()
{
$driver = $this->config->get('database.default');
$connection = $this->config->get('database.connections.'.$driver);
$prefix = $connection['prefix'];
$prefix = $this->getPrefix();
return $prefix.'metrics';
}
/**
* Get the metric points table name.
*
* @return string
*/
protected function getMetricPointsTableName()
{
$prefix = $this->getPrefix();
return $prefix.'metric_points';
}
}

View File

@@ -36,6 +36,7 @@ class MySqlRepository extends AbstractMetricRepository implements MetricInterfac
{
$dateTime = (new Date())->sub(new DateInterval('PT'.$hour.'H'))->sub(new DateInterval('PT'.$minute.'M'));
$timeInterval = $dateTime->format('YmdHi');
$metricPointsTableName = $this->getMetricPointsTableName();
if (!isset($metric->calc_type) || $metric->calc_type == Metric::CALC_SUM) {
$queryType = 'SUM(mp.`value` * mp.`counter`) AS `value`';
@@ -45,7 +46,7 @@ class MySqlRepository extends AbstractMetricRepository implements MetricInterfac
$value = 0;
$points = DB::select("SELECT {$queryType} FROM {$this->getTableName()} m INNER JOIN metric_points mp ON m.id = mp.metric_id WHERE m.id = :metricId AND DATE_FORMAT(mp.`created_at`, '%Y%m%d%H%i') = :timeInterval GROUP BY HOUR(mp.`created_at`), MINUTE(mp.`created_at`)", [
$points = DB::select("SELECT {$queryType} FROM {$this->getTableName()} m INNER JOIN $metricPointsTableName mp ON m.id = mp.metric_id WHERE m.id = :metricId AND DATE_FORMAT(mp.`created_at`, '%Y%m%d%H%i') = :timeInterval GROUP BY HOUR(mp.`created_at`), MINUTE(mp.`created_at`)", [
'metricId' => $metric->id,
'timeInterval' => $timeInterval,
]);
@@ -73,6 +74,7 @@ class MySqlRepository extends AbstractMetricRepository implements MetricInterfac
{
$dateTime = (new Date())->sub(new DateInterval('PT'.$hour.'H'));
$hourInterval = $dateTime->format('YmdH');
$metricPointsTableName = $this->getMetricPointsTableName();
if (!isset($metric->calc_type) || $metric->calc_type == Metric::CALC_SUM) {
$queryType = 'SUM(mp.`value` * mp.`counter`) AS `value`';
@@ -82,7 +84,7 @@ class MySqlRepository extends AbstractMetricRepository implements MetricInterfac
$value = 0;
$points = DB::select("SELECT {$queryType} FROM {$this->getTableName()} m INNER JOIN metric_points mp ON m.id = mp.metric_id WHERE m.id = :metricId AND DATE_FORMAT(mp.`created_at`, '%Y%m%d%H') = :hourInterval GROUP BY HOUR(mp.`created_at`)", [
$points = DB::select("SELECT {$queryType} FROM {$this->getTableName()} m INNER JOIN $metricPointsTableName mp ON m.id = mp.metric_id WHERE m.id = :metricId AND DATE_FORMAT(mp.`created_at`, '%Y%m%d%H') = :hourInterval GROUP BY HOUR(mp.`created_at`)", [
'metricId' => $metric->id,
'hourInterval' => $hourInterval,
]);
@@ -108,6 +110,7 @@ class MySqlRepository extends AbstractMetricRepository implements MetricInterfac
public function getPointsForDayInWeek(Metric $metric, $day)
{
$dateTime = (new Date())->sub(new DateInterval('P'.$day.'D'));
$metricPointsTableName = $this->getMetricPointsTableName();
if (!isset($metric->calc_type) || $metric->calc_type == Metric::CALC_SUM) {
$queryType = 'SUM(mp.`value` * mp.`counter`) AS `value`';
@@ -117,7 +120,7 @@ class MySqlRepository extends AbstractMetricRepository implements MetricInterfac
$value = 0;
$points = DB::select("SELECT {$queryType} FROM {$this->getTableName()} m INNER JOIN metric_points mp ON m.id = mp.metric_id WHERE m.id = :metricId AND mp.`created_at` BETWEEN DATE_SUB(mp.`created_at`, INTERVAL 1 WEEK) AND DATE_ADD(NOW(), INTERVAL 1 DAY) AND DATE_FORMAT(mp.`created_at`, '%Y%m%d') = :timeInterval GROUP BY DATE_FORMAT(mp.`created_at`, '%Y%m%d')", [
$points = DB::select("SELECT {$queryType} FROM {$this->getTableName()} m INNER JOIN $metricPointsTableName mp ON m.id = mp.metric_id WHERE m.id = :metricId AND mp.`created_at` BETWEEN DATE_SUB(mp.`created_at`, INTERVAL 1 WEEK) AND DATE_ADD(NOW(), INTERVAL 1 DAY) AND DATE_FORMAT(mp.`created_at`, '%Y%m%d') = :timeInterval GROUP BY DATE_FORMAT(mp.`created_at`, '%Y%m%d')", [
'metricId' => $metric->id,
'timeInterval' => $dateTime->format('Ymd'),
]);

View File

@@ -34,19 +34,20 @@ class PgSqlRepository extends AbstractMetricRepository implements MetricInterfac
*/
public function getPointsLastHour(Metric $metric, $hour, $minute)
{
$metricPointsTableName = $this->getMetricPointsTableName();
$dateTime = (new Date())->sub(new DateInterval('PT'.$hour.'H'))->sub(new DateInterval('PT'.$minute.'M'));
// Default metrics calculations.
if (!isset($metric->calc_type) || $metric->calc_type == Metric::CALC_SUM) {
$queryType = 'sum(metric_points.value * metric_points.counter)';
$queryType = "sum($metricPointsTableName.value * $metricPointsTableName.counter)";
} elseif ($metric->calc_type == Metric::CALC_AVG) {
$queryType = 'avg(metric_points.value * metric_points.counter)';
$queryType = "avg($metricPointsTableName.value * $metricPointsTableName.counter)";
} else {
$queryType = 'sum(metric_points.value * metric_points.counter)';
$queryType = "sum($metricPointsTableName.value * $metricPointsTableName.counter)";
}
$value = 0;
$query = DB::select("select {$queryType} as value FROM {$this->getTableName()} m JOIN metric_points ON metric_points.metric_id = m.id WHERE m.id = :metricId AND to_char(metric_points.created_at, 'YYYYMMDDHH24MI') = :timeInterval GROUP BY to_char(metric_points.created_at, 'HHMI')", [
$query = DB::select("select {$queryType} as value FROM {$this->getTableName()} m JOIN $metricPointsTableName ON $metricPointsTableName.metric_id = m.id WHERE m.id = :metricId AND to_char($metricPointsTableName.created_at, 'YYYYMMDDHH24MI') = :timeInterval GROUP BY to_char($metricPointsTableName.created_at, 'HHMI')", [
'metricId' => $metric->id,
'timeInterval' => $dateTime->format('YmdHi'),
]);
@@ -73,18 +74,19 @@ class PgSqlRepository extends AbstractMetricRepository implements MetricInterfac
public function getPointsByHour(Metric $metric, $hour)
{
$dateTime = (new Date())->sub(new DateInterval('PT'.$hour.'H'));
$metricPointsTableName = $this->getMetricPointsTableName();
// Default metrics calculations.
if (!isset($metric->calc_type) || $metric->calc_type == Metric::CALC_SUM) {
$queryType = 'sum(metric_points.value * metric_points.counter)';
$queryType = "sum($metricPointsTableName.value * $metricPointsTableName.counter)";
} elseif ($metric->calc_type == Metric::CALC_AVG) {
$queryType = 'avg(metric_points.value * metric_points.counter)';
$queryType = "avg($metricPointsTableName.value * $metricPointsTableName.counter)";
} else {
$queryType = 'sum(metric_points.value * metric_points.counter)';
$queryType = "sum($metricPointsTableName.value * $metricPointsTableName.counter)";
}
$value = 0;
$query = DB::select("select {$queryType} as value FROM {$this->getTableName()} m JOIN metric_points ON metric_points.metric_id = m.id WHERE metric_points.metric_id = :metricId AND to_char(metric_points.created_at, 'YYYYMMDDHH24') = :timeInterval GROUP BY to_char(metric_points.created_at, 'H')", [
$query = DB::select("select {$queryType} as value FROM {$this->getTableName()} m JOIN $metricPointsTableName ON $metricPointsTableName.metric_id = m.id WHERE $metricPointsTableName.metric_id = :metricId AND to_char($metricPointsTableName.created_at, 'YYYYMMDDHH24') = :timeInterval GROUP BY to_char($metricPointsTableName.created_at, 'H')", [
'metricId' => $metric->id,
'timeInterval' => $dateTime->format('YmdH'),
]);
@@ -110,6 +112,7 @@ class PgSqlRepository extends AbstractMetricRepository implements MetricInterfac
public function getPointsForDayInWeek(Metric $metric, $day)
{
$dateTime = (new Date())->sub(new DateInterval('P'.$day.'D'));
$metricPointsTableName = $this->getMetricPointsTableName();
if (!isset($metric->calc_type) || $metric->calc_type == Metric::CALC_SUM) {
$queryType = 'sum(mp.value * mp.counter) AS value';
@@ -118,7 +121,7 @@ class PgSqlRepository extends AbstractMetricRepository implements MetricInterfac
}
$value = 0;
$points = DB::select("SELECT {$queryType} FROM {$this->getTableName()} m INNER JOIN metric_points mp ON m.id = mp.metric_id WHERE m.id = :metricId AND mp.created_at BETWEEN (mp.created_at - interval '1 week') AND (now() + interval '1 day') AND to_char(mp.created_at, 'YYYYMMDD') = :timeInterval GROUP BY to_char(mp.created_at, 'YYYYMMDD')", [
$points = DB::select("SELECT {$queryType} FROM {$this->getTableName()} m INNER JOIN $metricPointsTableName mp ON m.id = mp.metric_id WHERE m.id = :metricId AND mp.created_at BETWEEN (mp.created_at - interval '1 week') AND (now() + interval '1 day') AND to_char(mp.created_at, 'YYYYMMDD') = :timeInterval GROUP BY to_char(mp.created_at, 'YYYYMMDD')", [
'metricId' => $metric->id,
'timeInterval' => $dateTime->format('Ymd'),
]);

View File

@@ -30,18 +30,19 @@ class SqliteRepository extends AbstractMetricRepository implements MetricInterfa
public function getPointsLastHour(Metric $metric, $hour, $minute)
{
$dateTime = (new Date())->sub(new DateInterval('PT'.$hour.'H'))->sub(new DateInterval('PT'.$minute.'M'));
$metricPointsTableName = $this->getMetricPointsTableName();
// Default metrics calculations.
if (!isset($metric->calc_type) || $metric->calc_type == Metric::CALC_SUM) {
$queryType = 'sum(metric_points.value * metric_points.counter)';
$queryType = "sum($metricPointsTableName.value * $metricPointsTableName.counter)";
} elseif ($metric->calc_type == Metric::CALC_AVG) {
$queryType = 'avg(metric_points.value * metric_points.counter)';
$queryType = "avg($metricPointsTableName.value * $metricPointsTableName.counter)";
} else {
$queryType = 'sum(metric_points.value * metric_points.counter)';
$queryType = "sum($metricPointsTableName.value * $metricPointsTableName.counter)";
}
$value = 0;
$query = DB::select("select {$queryType} as value FROM {$this->getTableName()} m JOIN metric_points ON metric_points.metric_id = m.id WHERE m.id = :metricId AND strftime('%Y%m%d%H%M', metric_points.created_at) = :timeInterval GROUP BY strftime('%H%M', metric_points.created_at)", [
$query = DB::select("select {$queryType} as value FROM {$this->getTableName()} m JOIN $metricPointsTableName ON $metricPointsTableName.metric_id = m.id WHERE m.id = :metricId AND strftime('%Y%m%d%H%M', $metricPointsTableName.created_at) = :timeInterval GROUP BY strftime('%H%M', $metricPointsTableName.created_at)", [
'metricId' => $metric->id,
'timeInterval' => $dateTime->format('YmdHi'),
]);
@@ -68,18 +69,19 @@ class SqliteRepository extends AbstractMetricRepository implements MetricInterfa
public function getPointsByHour(Metric $metric, $hour)
{
$dateTime = (new Date())->sub(new DateInterval('PT'.$hour.'H'));
$metricPointsTableName = $this->getMetricPointsTableName();
// Default metrics calculations.
if (!isset($metric->calc_type) || $metric->calc_type == Metric::CALC_SUM) {
$queryType = 'sum(metric_points.value * metric_points.counter)';
$queryType = "sum($metricPointsTableName.value * $metricPointsTableName.counter)";
} elseif ($metric->calc_type == Metric::CALC_AVG) {
$queryType = 'avg(metric_points.value * metric_points.counter)';
$queryType = "avg($metricPointsTableName.value * $metricPointsTableName.counter)";
} else {
$queryType = 'sum(metric_points.value * metric_points.counter)';
$queryType = "sum($metricPointsTableName.value * $metricPointsTableName.counter)";
}
$value = 0;
$query = DB::select("select {$queryType} as value FROM {$this->getTableName()} m JOIN metric_points ON metric_points.metric_id = m.id WHERE m.id = :metricId AND strftime('%Y%m%d%H', metric_points.created_at) = :timeInterval GROUP BY strftime('%H', metric_points.created_at)", [
$query = DB::select("select {$queryType} as value FROM {$this->getTableName()} m JOIN $metricPointsTableName ON $metricPointsTableName.metric_id = m.id WHERE m.id = :metricId AND strftime('%Y%m%d%H', $metricPointsTableName.created_at) = :timeInterval GROUP BY strftime('%H', $metricPointsTableName.created_at)", [
'metricId' => $metric->id,
'timeInterval' => $dateTime->format('YmdH'),
]);
@@ -105,18 +107,19 @@ class SqliteRepository extends AbstractMetricRepository implements MetricInterfa
public function getPointsForDayInWeek(Metric $metric, $day)
{
$dateTime = (new Date())->sub(new DateInterval('P'.$day.'D'));
$metricPointsTableName = $this->getMetricPointsTableName();
// Default metrics calculations.
if (!isset($metric->calc_type) || $metric->calc_type == Metric::CALC_SUM) {
$queryType = 'sum(metric_points.value * metric_points.counter)';
$queryType = "sum($metricPointsTableName.value * $metricPointsTableName.counter)";
} elseif ($metric->calc_type == Metric::CALC_AVG) {
$queryType = 'avg(metric_points.value * metric_points.counter)';
$queryType = "avg($metricPointsTableName.value * $metricPointsTableName.counter)";
} else {
$queryType = 'sum(metric_points.value * metric_points.counter)';
$queryType = "sum($metricPointsTableName.value * $metricPointsTableName.counter)";
}
$value = 0;
$query = DB::select("select {$queryType} as value FROM {$this->getTableName()} m JOIN metric_points ON metric_points.metric_id = m.id WHERE m.id = :metricId AND metric_points.created_at > date('now', '-7 day') AND strftime('%Y%m%d', metric_points.created_at) = :timeInterval GROUP BY strftime('%Y%m%d', metric_points.created_at)", [
$query = DB::select("select {$queryType} as value FROM {$this->getTableName()} m JOIN $metricPointsTableName ON $metricPointsTableName.metric_id = m.id WHERE m.id = :metricId AND $metricPointsTableName.created_at > date('now', '-7 day') AND strftime('%Y%m%d', $metricPointsTableName.created_at) = :timeInterval GROUP BY strftime('%Y%m%d', $metricPointsTableName.created_at)", [
'metricId' => $metric->id,
'timeInterval' => $dateTime->format('Ymd'),
]);

View File

@@ -21,26 +21,27 @@
"require": {
"php": ">=5.5.9",
"ext-xml": "*",
"laravel/framework": "5.2.39",
"alt-three/badger": "^3.1",
"alt-three/bus": "^1.1",
"alt-three/emoji": "^3.1",
"alt-three/throttle": "^1.0",
"alt-three/validator": "^1.5",
"aws/aws-sdk-php": "^3.7",
"backup-manager/laravel": "^1.1",
"backup-manager/laravel": "dev-master#df53f9c9d8c6be5d7a2638f45d54b8fb7bc51e2b",
"barryvdh/laravel-cors": "^0.8",
"doctrine/dbal": "^2.5",
"fedeisas/laravel-mail-css-inliner": "^1.5",
"fideloper/proxy": "^3.1",
"graham-campbell/binput": "^3.4",
"graham-campbell/core": "^5.1",
"graham-campbell/exceptions": "^8.6",
"graham-campbell/exceptions": "^9.4",
"graham-campbell/markdown": "^6.1",
"guzzlehttp/guzzle": "^6.2.1",
"jenssegers/date": "^3.2",
"laravel/framework": "5.2.39",
"mccool/laravel-auto-presenter": "^4.3",
"pragmarx/google2fa": "^0.7.1",
"predis/predis": "^1.1",
"rcrowe/twigbridge": "^0.9.2",
"roumen/feed": "^2.10.4"
},
@@ -49,7 +50,7 @@
"filp/whoops": "^2.1",
"fzaninotto/faker": "^1.6",
"graham-campbell/testbench-core": "^1.1",
"mockery/mockery": "0.9.5",
"mockery/mockery": "0.9.9",
"phpunit/phpunit": "4.8.21",
"symfony/css-selector": "^3.0",
"symfony/dom-crawler": "^3.0"

984
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -184,6 +184,7 @@ return [
'CachetHQ\Cachet\Foundation\Providers\ComposerServiceProvider',
'CachetHQ\Cachet\Foundation\Providers\ConsoleServiceProvider',
'CachetHQ\Cachet\Foundation\Providers\ConfigServiceProvider',
'CachetHQ\Cachet\Foundation\Providers\IntegrationServiceProvider',
'CachetHQ\Cachet\Foundation\Providers\EventServiceProvider',
'CachetHQ\Cachet\Foundation\Providers\RepositoryServiceProvider',
'CachetHQ\Cachet\Foundation\Providers\RouteServiceProvider',

BIN
public/img/ogimage.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Unterstützer',
'license' => 'Cachet ist ein BSD-3-lizensiertes Open Source-Projekt, veröffentlicht von <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Unterstützer & Sponsoren',
'backers' => 'Wenn Du die Entwicklung der Software unterstützen möchtest, kannst Du unter <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> einen Beitrag leisten.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Vielen Dank an jeden der :count Unterstützer.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Cachet unterstützen',
'support_subtitle' => 'Unterstütze uns unter <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong>!',
'news' => 'Aktuelle Neuigkeiten',
'news_subtitle' => 'Erhalte die neusten Nachrichten',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'crwdns771:0crwdne771:0',
'support_subtitle' => 'crwdns772:0crwdne772:0',
'news' => 'crwdns773:0crwdne773:0',
'news_subtitle' => 'crwdns774:0crwdne774:0',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest update',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Colaboradores',
'license' => 'Cachet es un proyecto de código libre bajo la licencia BSD-3, liberado por <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Patrocinadores',
'backers' => 'Si desea apoyar futuros desarrollos, ingrese a la campaña de <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a>.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Gracias a todos y cada uno de los :count colaboradores.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Apoye Cachet',
'support_subtitle' => '¡Visite nuestro proyecto en la página de <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong>!',
'news' => 'Últimas noticias',
'news_subtitle' => 'Obtener las actualizaciones más recientes',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributeurs',
'license' => 'Cachet est un logiciel libre sous licence BSD-3 édité par <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Partenaires financiers et sponsors',
'backers' => 'Si vous souhaitez aider des développements futurs jetez un œil à la campagne <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a>.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Merci à chacun des :count contributeurs.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Supportez Cachet',
'support_subtitle' => 'Jetez un œil à la page <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong>!',
'news' => 'Dernières actualités',
'news_subtitle' => 'Obtenez les dernières mises à jour',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Collaboratori',
'license' => 'Cachet è un progetto open source con licenza BSD-3, rilasciato da <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank"> Alt tre Services Limited</a>.',
'backers-title' => 'Sostenitori e sponsor',
'backers' => 'Se si desidera sostenere lo sviluppo futuro, scopri la campagna <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a>.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Grazie a tutti i :count contributori.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Supporta Cachet',
'support_subtitle' => 'Visita la nostra pagina <strong><a href="https://patreon.com/jbrooksuk" target="_blank"> Patreon</a></strong>!',
'news' => 'Utime notizie',
'news_subtitle' => 'Ottieni l\'aggiornamento più recente',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Bijdragers',
'license' => 'Cachet is een BSD-3-gelicentieerd opensourceproject, uitgebracht door <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank"> Alt Three Services Limited</a>.',
'backers-title' => 'Donateurs & Sponsoren',
'backers' => 'Als u de toekomstige ontwikkeling wilt ondersteunen, bezoek de <a href="https://patreon.com/jbrooksuk" target="_blank"> Cachet Patreon</a>-campagne.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Dank aan de :count verschillende medewerkers.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Ondersteuning Cachet',
'support_subtitle' => 'Kijk op onze <strong><a href="https://patreon.com/jbrooksuk" target="_blank"> Patreon</a></strong> pagina!',
'news' => 'Laatste nieuws',
'news_subtitle' => 'Ontvang de nieuwste updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Colaboradores',
'license' => 'Cachet é um projeto de código aberto com licença BSD-3, lançado pela <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank"> Alt Three Services Limited</a>.',
'backers-title' => 'Apoiadores e Patrocinadores',
'backers' => 'Se você deseja apoiar o desenvolvimento, confira a campanha do <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet no Pantreon</a>.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Agradeço a cada um dos :count colaboradores.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Ajude o Cachet',
'support_subtitle' => 'Confira nossa campanha no <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong>!',
'news' => 'Últimas Notícias',
'news_subtitle' => 'Receba as últimas atualizações',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Разработчики',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Партнеры & спонсоры',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Поддержать Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Последние новости',
'news_subtitle' => 'Проверить обновления',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => '贡献者',
'license' => 'Cachet 是 <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a> 开发的一个开源项目,使用 BSD-3 授权。',
'backers-title' => '后勤力量和赞助商',
'backers' => '如果您想为后续的开发提供支持,请查看 <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a>。',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => '感谢您和 :count 位贡献者们',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => '支持 Cachet',
'support_subtitle' => '查看我们的 <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> 页面!',
'news' => '最新消息',
'news_subtitle' => '获取最近的更新',
],

View File

@@ -224,7 +224,7 @@ return [
'contributors' => 'Contributors',
'license' => 'Cachet is a BSD-3-licensed open source project, released by <a href="https://alt-three.com/?utm_source=cachet&utm_medium=credits&utm_campaign=Cachet%20Credit%20Dashboard" target="_blank">Alt Three Services Limited</a>.',
'backers-title' => 'Backers & Sponsors',
'backers' => 'If you\'d like to support future development, check out the <a href="https://patreon.com/jbrooksuk" target="_blank">Cachet Patreon</a> campaign.',
'backers' => 'If you\'d like to support future development, check out the CrowdIn and GitHub.',
'thank-you' => 'Thank you to each and every one of the :count contributors.',
],
],
@@ -251,8 +251,6 @@ return [
// Widgets
'widgets' => [
'support' => 'Support Cachet',
'support_subtitle' => 'Check out our <strong><a href="https://patreon.com/jbrooksuk" target="_blank">Patreon</a></strong> page!',
'news' => 'Latest News',
'news_subtitle' => 'Get the latest updates',
],

View File

@@ -60,17 +60,8 @@
</div>
<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="col-sm-12">
<div class="stats-widget">
<div class='stats-top'>
<span class='stats-value'>{{ trans('dashboard.widgets.news') }}</span>

View File

@@ -19,7 +19,7 @@
<meta property="og:type" content="website">
<meta property="og:title" content="{{ $site_title }}">
<meta property="og:image" content="/img/favicon.png">
<meta property="og:image" content="/img/ogimage.png">
<meta property="og:description" content="{{ trans('cachet.description', ['app' => $app_name]) }}">
<!-- Mobile IE allows us to activate ClearType technology for smoothing fonts for easy reading -->

View File

@@ -73,15 +73,20 @@ class SubscriberTest extends AbstractApiTestCase
$this->post('/api/v1/subscribers', [
'email' => 'support@alt-three.com',
'verify' => true,
'subscriptions' => [
'components' => [
1,
2,
3,
],
]);
$this->assertResponseOk();
$this->seeHeader('Content-Type', 'application/json');
$this->seeJson(['email' => 'support@alt-three.com']);
$this->seeJsonStructure(['data' => ['subscriptions' => []]]);
$data = $this->decodeResponseJson();
$this->assertCount(2, $data['data']['subscriptions']);
$this->assertEquals(1, $data['data']['subscriptions'][0]['component_id']);
$this->assertEquals(3, $data['data']['subscriptions'][1]['component_id']);
}
public function testDeleteSubscriber()

View File

@@ -0,0 +1,31 @@
<?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\Tests\Cachet\Foundation\Providers;
use AltThree\TestBench\ServiceProviderTrait;
use CachetHQ\Cachet\Integrations\Contracts\System;
use CachetHQ\Tests\Cachet\AbstractTestCase;
/**
* This is the integration service provider test class.
*
* @author James Brooks <james@alt-three.com>
*/
class IntegrationServiceProviderTest extends AbstractTestCase
{
use ServiceProviderTrait;
public function testSystemIsInjectable()
{
$this->assertIsInjectable(System::class);
}
}