mirror of
https://github.com/cachethq/cachet.git
synced 2026-03-05 17:47:01 +00:00
Compare commits
117 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5d92f5a3d | ||
|
|
247c1565a4 | ||
|
|
8f5afff4a2 | ||
|
|
b045028c7b | ||
|
|
16189da222 | ||
|
|
7596966e6c | ||
|
|
dcea947973 | ||
|
|
d8ea3c59e3 | ||
|
|
a2f8f4540e | ||
|
|
4031c42958 | ||
|
|
8348f48692 | ||
|
|
faf91470aa | ||
|
|
58039634bd | ||
|
|
915ea0d0bd | ||
|
|
a019d82010 | ||
|
|
0f029702d4 | ||
|
|
71b5d446ba | ||
|
|
6246f20506 | ||
|
|
9dcc5d6896 | ||
|
|
235e3281b0 | ||
|
|
04b96e7dec | ||
|
|
e15af44449 | ||
|
|
ef9f7d23a0 | ||
|
|
ef694b027a | ||
|
|
f53e466500 | ||
|
|
1e24138d7a | ||
|
|
9120dba237 | ||
|
|
7f261a218a | ||
|
|
5b5db06ce3 | ||
|
|
b6635d30ee | ||
|
|
5ae23b64d2 | ||
|
|
0d90f0459b | ||
|
|
bcbbee22d9 | ||
|
|
9750191bff | ||
|
|
52c4901a78 | ||
|
|
587555c2d4 | ||
|
|
b4c7fb2ab0 | ||
|
|
e61d24f685 | ||
|
|
88e85d2dfb | ||
|
|
5b72f2febc | ||
|
|
7583fedaec | ||
|
|
eecd78496c | ||
|
|
4703aeadb2 | ||
|
|
48dc39122f | ||
|
|
3aacfb7849 | ||
|
|
ef304950bb | ||
|
|
2101b829bb | ||
|
|
ad8f098ec1 | ||
|
|
2551a1a038 | ||
|
|
3874b533be | ||
|
|
85c0e94408 | ||
|
|
1793f5588a | ||
|
|
46ff13c7fb | ||
|
|
da8c8fae74 | ||
|
|
ff9eb123c6 | ||
|
|
895d1ea1b6 | ||
|
|
503252c3a2 | ||
|
|
ec0f0768f0 | ||
|
|
68cc6eb93c | ||
|
|
fdfebc18fb | ||
|
|
0cd3ea0e92 | ||
|
|
0f10522e9c | ||
|
|
3913ab65ac | ||
|
|
2048e0899c | ||
|
|
83e1013771 | ||
|
|
7d4bab478f | ||
|
|
18d7af2b35 | ||
|
|
e3cfb47d66 | ||
|
|
716d357738 | ||
|
|
cee336fd7c | ||
|
|
b3497820f9 | ||
|
|
67152806d7 | ||
|
|
5298ad241a | ||
|
|
e2da8ee1fa | ||
|
|
b6c22c1029 | ||
|
|
5c54830b0f | ||
|
|
1a6c22a8a9 | ||
|
|
690290449e | ||
|
|
cb5badefcc | ||
|
|
e326381604 | ||
|
|
c25437871a | ||
|
|
662fff9edf | ||
|
|
e96088fc0f | ||
|
|
7472657812 | ||
|
|
6becaf2acd | ||
|
|
c5c21cd8db | ||
|
|
b960146512 | ||
|
|
3b6fb9f64e | ||
|
|
acfb32bf1d | ||
|
|
f9946928c1 | ||
|
|
5176fca8f0 | ||
|
|
4852f5558a | ||
|
|
b0c75a2319 | ||
|
|
73d7303b6e | ||
|
|
2d8f2cbd63 | ||
|
|
cb2ce8f67f | ||
|
|
d6d103cf15 | ||
|
|
7f36783582 | ||
|
|
ed851c232a | ||
|
|
920a3ef6a9 | ||
|
|
15816c56bb | ||
|
|
e5e4b04151 | ||
|
|
283d343dd6 | ||
|
|
aa85c8708e | ||
|
|
f93506fed9 | ||
|
|
b92f9d30fc | ||
|
|
3673e57c6f | ||
|
|
9fb6ae4fc0 | ||
|
|
583601644c | ||
|
|
5ea816ce2b | ||
|
|
541d410e41 | ||
|
|
03348b8ff2 | ||
|
|
2e8743eb6b | ||
|
|
66ff1cca65 | ||
|
|
64ff9b7d40 | ||
|
|
446aed6b9a | ||
|
|
0281c44933 |
2
.github/ISSUE_TEMPLATE
vendored
2
.github/ISSUE_TEMPLATE
vendored
@@ -1,7 +1,7 @@
|
||||
Before submitting your issue, please make sure that you've checked the checkboxes below.
|
||||
|
||||
- [ ] I am running the [latest release](https://github.com/CachetHQ/Cachet/releases/latest) version of Cachet.
|
||||
- [ ] I am running at least PHP 5.5.9. *You can check this by running `php -v`.*
|
||||
- [ ] I am running at least PHP 5.6.4. *You can check this by running `php -v`.*
|
||||
- [ ] I have ran `rm -rf bootstrap/cache/*`.
|
||||
|
||||
### Expected behaviour
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 5.5.9
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
- hhvm
|
||||
|
||||
26
README.md
26
README.md
@@ -10,9 +10,9 @@
|
||||
|
||||
Cachet is a beautiful and powerful open source status page system, a free replacement to services such as StatusPage.io, Status.io and others.
|
||||
|
||||
## Supporting Cachet
|
||||
## Show your support
|
||||
|
||||
Cachet is a BSD-3-licensed open source project. If you'd like to support future development, check out the [Cachet Patreon campaign](https://patreon.com/jbrooksuk).
|
||||
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).
|
||||
|
||||
## Features
|
||||
|
||||
@@ -29,11 +29,11 @@ Cachet is a BSD-3-licensed open source project. If you'd like to support future
|
||||
|
||||
## Usage in production
|
||||
|
||||
The `master` branch of this repository is a development branch and **should not** be used in production. Instead, please check out the latest tag release.
|
||||
Use of `master` in a production environment is not recommended as it may change at any time.
|
||||
|
||||
## Requirements
|
||||
|
||||
- PHP 5.5.9+ or newer
|
||||
- PHP 5.6.4+ or newer
|
||||
- Apache or Nginx server
|
||||
- [Composer](https://getcomposer.org)
|
||||
|
||||
@@ -43,9 +43,9 @@ We're always looking for contributions that improve Cachet. It's easy to get sta
|
||||
|
||||
### Contributing as a non-developer/non-designer
|
||||
|
||||
If you're one of the more linguistically talented people in the world who can speak and write more than just English, we're always looking for new [translations](#translations).
|
||||
We're always looking for new [translations](#translations).
|
||||
|
||||
Of course bug reports, feature requests and [documentation](https://docs.cachethq.io) are always being sought after.
|
||||
Of course bug reports, feature requests and [documentation](https://docs.cachethq.io) are always appreciated.
|
||||
|
||||
### Contributing as a designer
|
||||
|
||||
@@ -56,22 +56,22 @@ You'll need to install Node.js, Bower and Gulp.
|
||||
To get started you can do the following:
|
||||
|
||||
1. Install Node.js and our dev dependencies.
|
||||
2. Modify the SCSS files in `./resources/assets/sass/`
|
||||
2. Make your changes to the SCSS files in `./resources/assets/sass/`
|
||||
3. Run `gulp`
|
||||
|
||||
If you're making a lot of changes, you'll find that running `gulp watch` will really help you out!
|
||||
If you're making a lot of changes, you'll find that running `gulp watch` will make life easier for you!
|
||||
|
||||
### Contributing as a developer
|
||||
|
||||
Built using [Laravel](https://laravel.com), Cachet is very easy to jump into. Have a look around you'll find it surprisingly easy!
|
||||
Built using [Laravel](https://laravel.com).
|
||||
|
||||
These extra dependencies are required to develop Cachet:
|
||||
We use these extra dependencies to develop Cachet:
|
||||
|
||||
- Node.js
|
||||
- Gulp
|
||||
- Git
|
||||
|
||||
Once cloned to your local machine, you'll need some demo data! Simply run `php artisan cachet:seed` to get the demo installation on the go.
|
||||
Once cloned to your local machine, you'll need some demo data! Run `php artisan cachet:seed` to get the demo installation on the go.
|
||||
|
||||
## Installation, Upgrades and Documentation
|
||||
|
||||
@@ -91,7 +91,7 @@ The demo is reset every half hour.
|
||||
|
||||
### Release Notes
|
||||
|
||||
All releases are listed on the [Releases page](https://github.com/CachetHQ/Cachet/releases) of the [Cachet GitHub repository](https://github.com/CachetHQ/Cachet). On the Releases page, you can also find the release notes for each release.
|
||||
We list releases on the [Releases page](https://github.com/CachetHQ/Cachet/releases) of the [Cachet GitHub repository](https://github.com/CachetHQ/Cachet). On the Releases page, you can also find the release notes for each release.
|
||||
|
||||
## Translations
|
||||
|
||||
@@ -99,7 +99,7 @@ A special thank you to our [translators](https://crowdin.com/project/cachet/acti
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within Cachet, please send an e-mail to us at support@alt-three.com. All security vulnerabilities will be promptly addressed.
|
||||
If you discover a security vulnerability within Cachet, please send an e-mail to us at support@alt-three.com. We handle all security vulnerabilities on a case-by-case basis.
|
||||
|
||||
## Installations
|
||||
|
||||
|
||||
61
app/Bus/Commands/ComponentTag/AddComponentTagCommand.php
Normal file
61
app/Bus/Commands/ComponentTag/AddComponentTagCommand.php
Normal 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.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\ComponentTag;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
|
||||
/**
|
||||
* This is the add component tag command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class AddComponentTagCommand
|
||||
{
|
||||
/**
|
||||
* The component to add the tag to.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public $component;
|
||||
|
||||
/**
|
||||
* The tag to add to the component.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Tag
|
||||
*/
|
||||
public $tag;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'component' => 'required',
|
||||
'tag' => 'required',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a add component tag command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
* @param \CachetHQ\Cachet\Models\Tag $tag
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component, Tag $tag)
|
||||
{
|
||||
$this->component = $component;
|
||||
$this->tag = $tag;
|
||||
}
|
||||
}
|
||||
61
app/Bus/Commands/ComponentTag/DeleteComponentTagCommand.php
Normal file
61
app/Bus/Commands/ComponentTag/DeleteComponentTagCommand.php
Normal 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.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\ComponentTag;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
|
||||
/**
|
||||
* This is the delete component tag command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class DeleteComponentTagCommand
|
||||
{
|
||||
/**
|
||||
* The component to delete the tag from.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public $component;
|
||||
|
||||
/**
|
||||
* The tag to delete.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Tag
|
||||
*/
|
||||
public $tag;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'component' => 'required',
|
||||
'tag' => 'required',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a delete component tag command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
* @param \CachetHQ\Cachet\Models\Tag $tag
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component, Tag $tag)
|
||||
{
|
||||
$this->component = $component;
|
||||
$this->tag = $tag;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?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\Bus\Commands\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
|
||||
/**
|
||||
* This is the remove incident update command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class RemoveIncidentUpdateCommand
|
||||
{
|
||||
/**
|
||||
* The incident update to remove.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\IncidentUpdate
|
||||
*/
|
||||
public $incidentUpdate;
|
||||
|
||||
/**
|
||||
* Create a new remove incident update command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $incidentUpdate
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(IncidentUpdate $incidentUpdate)
|
||||
{
|
||||
$this->incidentUpdate = $incidentUpdate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<?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\Bus\Commands\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the report incident update command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ReportIncidentUpdateCommand
|
||||
{
|
||||
/**
|
||||
* The incident.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public $incident;
|
||||
|
||||
/**
|
||||
* The incident status.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* The incident message.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $message;
|
||||
|
||||
/**
|
||||
* The user.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'incident' => 'required',
|
||||
'status' => 'required|int|min:1|max:4',
|
||||
'message' => 'required|string',
|
||||
'user' => 'required',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new report incident update command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident, $status, $message, User $user)
|
||||
{
|
||||
$this->incident = $incident;
|
||||
$this->status = $status;
|
||||
$this->message = $message;
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<?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\Bus\Commands\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the update incident update command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UpdateIncidentUpdateCommand
|
||||
{
|
||||
/**
|
||||
* The incident update.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\IncidentUpdate
|
||||
*/
|
||||
public $update;
|
||||
|
||||
/**
|
||||
* The incident status.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* The incident message.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $message;
|
||||
|
||||
/**
|
||||
* The user.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'update' => 'required',
|
||||
'status' => 'int|min:1|max:4',
|
||||
'message' => 'string',
|
||||
'user' => 'required',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new update incident update command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $update
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(IncidentUpdate $update, $status, $message, User $user)
|
||||
{
|
||||
$this->update = $update;
|
||||
$this->status = $status;
|
||||
$this->message = $message;
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
58
app/Bus/Commands/Tag/CreateTagCommand.php
Normal file
58
app/Bus/Commands/Tag/CreateTagCommand.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?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\Bus\Commands\Tag;
|
||||
|
||||
/**
|
||||
* This is the create tag command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class CreateTagCommand
|
||||
{
|
||||
/**
|
||||
* The name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The slug.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $slug;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'slug' => 'sometimes|string',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new create tag command instance.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $slug
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $slug)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->slug = $slug;
|
||||
}
|
||||
}
|
||||
50
app/Bus/Commands/Tag/DeleteTagCommand.php
Normal file
50
app/Bus/Commands/Tag/DeleteTagCommand.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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\Bus\Commands\Tag;
|
||||
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
|
||||
/**
|
||||
* This is the delete tag command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class DeleteTagCommand
|
||||
{
|
||||
/**
|
||||
* The tag.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Tag
|
||||
*/
|
||||
public $tag;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $rules = [
|
||||
'tag' => 'required',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new delete tag command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Tag $tag
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Tag $tag)
|
||||
{
|
||||
$this->tag = $tag;
|
||||
}
|
||||
}
|
||||
70
app/Bus/Commands/Tag/UpdateTagCommand.php
Normal file
70
app/Bus/Commands/Tag/UpdateTagCommand.php
Normal 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\Bus\Commands\Tag;
|
||||
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
|
||||
/**
|
||||
* This is the update tag command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UpdateTagCommand
|
||||
{
|
||||
/**
|
||||
* The tag.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Tag
|
||||
*/
|
||||
public $tag;
|
||||
|
||||
/**
|
||||
* The name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The slug.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $slug;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $rules = [
|
||||
'tag' => 'required',
|
||||
'name' => 'sometimes|string',
|
||||
'slug' => 'sometimes|string',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new update tag command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Tag $tag
|
||||
* @param string $name
|
||||
* @param string $slug
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Tag $tag, $name, $slug)
|
||||
{
|
||||
$this->tag = $tag;
|
||||
$this->name = $name;
|
||||
$this->slug = $slug;
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,12 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\User;
|
||||
|
||||
final class AddTeamMemberCommand
|
||||
/**
|
||||
* This is the add user command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class AddUserCommand
|
||||
{
|
||||
/**
|
||||
* The user username.
|
||||
@@ -48,8 +53,9 @@ final class AddTeamMemberCommand
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'password' => 'string',
|
||||
'level' => 'int',
|
||||
'email' => 'required|email',
|
||||
'password' => 'required|string',
|
||||
'level' => 'int|min:1|max:2',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -11,7 +11,12 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\User;
|
||||
|
||||
final class InviteTeamMemberCommand
|
||||
/**
|
||||
* This is the invite user command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class InviteUserCommand
|
||||
{
|
||||
/**
|
||||
* The invite emails.
|
||||
@@ -30,7 +35,7 @@ final class InviteTeamMemberCommand
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new invite team member command instance.
|
||||
* Create a new invite user command instance.
|
||||
*
|
||||
* @param string[] $emails
|
||||
*
|
||||
90
app/Bus/Commands/User/UpdateTeamMemberCommand.php
Normal file
90
app/Bus/Commands/User/UpdateTeamMemberCommand.php
Normal 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.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\User;
|
||||
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the update team member command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UpdateTeamMemberCommand
|
||||
{
|
||||
/**
|
||||
* The user to update.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The user username.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $username;
|
||||
|
||||
/**
|
||||
* The user password.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $password;
|
||||
|
||||
/**
|
||||
* The user email.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $email;
|
||||
|
||||
/**
|
||||
* The user level.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $level;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'user' => 'required',
|
||||
'name' => 'required|string',
|
||||
'email' => 'required|email',
|
||||
'password' => 'required|string',
|
||||
'level' => 'int|min:1|max:2',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new add team member command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @param string $email
|
||||
* @param int $level
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, $username, $password, $email, $level)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->username = $username;
|
||||
$this->password = $password;
|
||||
$this->email = $email;
|
||||
$this->level = $level;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?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\Bus\Events\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the incident update event interface.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface IncidentUpdateEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?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\Bus\Events\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
|
||||
/**
|
||||
* This is the incident update was removed event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class IncidentUpdateWasRemovedEvent implements IncidentUpdateEventInterface
|
||||
{
|
||||
/**
|
||||
* The incident update that has been removed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\IncidentUpdate
|
||||
*/
|
||||
public $update;
|
||||
|
||||
/**
|
||||
* Create a new incident update was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $update
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(IncidentUpdate $update)
|
||||
{
|
||||
$this->update = $update;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?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\Bus\Events\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
|
||||
/**
|
||||
* This is the incident update was reported event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class IncidentUpdateWasReportedEvent implements IncidentUpdateEventInterface
|
||||
{
|
||||
/**
|
||||
* The incident update that has been reported.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\IncidentUpdate
|
||||
*/
|
||||
public $update;
|
||||
|
||||
/**
|
||||
* Create a new incident update was reported event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $update
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(IncidentUpdate $update)
|
||||
{
|
||||
$this->update = $update;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?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\Bus\Events\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
|
||||
/**
|
||||
* This is the incident update was updated event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class IncidentUpdateWasUpdatedEvent implements IncidentUpdateEventInterface
|
||||
{
|
||||
/**
|
||||
* The incident update that has been updated.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\IncidentUpdate
|
||||
*/
|
||||
public $update;
|
||||
|
||||
/**
|
||||
* Create a new incident update was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $update
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(IncidentUpdate $update)
|
||||
{
|
||||
$this->update = $update;
|
||||
}
|
||||
}
|
||||
41
app/Bus/Events/User/UserWasUpdatedEvent.php
Normal file
41
app/Bus/Events/User/UserWasUpdatedEvent.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?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\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the user was updated event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserWasUpdatedEvent implements UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that has been updated.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new user was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?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\Bus\Exceptions\Tag;
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* This is the tag does not exist on component exception class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class TagDoesNotExistOnComponentException extends Exception implements TagExceptionInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
24
app/Bus/Exceptions/Tag/TagExceptionInterface.php
Normal file
24
app/Bus/Exceptions/Tag/TagExceptionInterface.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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\Bus\Exceptions\Tag;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Exceptions\ExceptionInterface;
|
||||
|
||||
/**
|
||||
* This is the tag exception interface.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface TagExceptionInterface extends ExceptionInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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\Bus\Handlers\Commands\ComponentTag;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\ComponentTag\AddComponentTagCommand;
|
||||
use CachetHQ\Cachet\Models\ComponentTag;
|
||||
|
||||
/**
|
||||
* This is the add component tag command handler.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class AddComponentTagCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the add component tag command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\ComponentTag\AddComponentTagCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\ComponentTag
|
||||
*/
|
||||
public function handle(AddComponentTagCommand $command)
|
||||
{
|
||||
$tag = ComponentTag::create([
|
||||
'component_id' => $command->component->id,
|
||||
'tag_id' => $command->tag->id,
|
||||
]);
|
||||
|
||||
return $tag;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?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\Bus\Handlers\Commands\ComponentTag;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\ComponentTag\DeleteComponentTagCommand;
|
||||
use CachetHQ\Cachet\Bus\Exceptions\Tag\TagDoesNotExistOnComponentException;
|
||||
use CachetHQ\Cachet\Models\ComponentTag;
|
||||
|
||||
/**
|
||||
* This is the delete component tag command handler.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class DeleteComponentTagCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the add component tag command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\ComponentTag\DeleteComponentTagCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(DeleteComponentTagCommand $command)
|
||||
{
|
||||
// If the tag does not exist on the component, throw an exception.
|
||||
if (!($componentTag = ComponentTag::tagForComponent($command->tag->id, $command->component->id))) {
|
||||
throw new TagDoesNotExistOnComponentException('The given tag <'.$command->tag->id.'> does not exist on this component <'.$command->componnet->id.'>');
|
||||
}
|
||||
|
||||
$componentTag->delete();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?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\Bus\Handlers\Commands\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\RemoveIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\IncidentUpdate\IncidentUpdateWasRemovedEvent;
|
||||
|
||||
/**
|
||||
* This is the remove incident update command handler.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class RemoveIncidentUpdateCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the remove incident update command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\IncidentUpdate\RemoveIncidentUpdateCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(RemoveIncidentUpdateCommand $command)
|
||||
{
|
||||
$update = $command->incidentUpdate;
|
||||
|
||||
event(new IncidentUpdateWasRemovedEvent($update));
|
||||
|
||||
$update->delete();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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\Bus\Handlers\Commands\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\ReportIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\UpdateIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\IncidentUpdate\IncidentUpdateWasReportedEvent;
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
|
||||
/**
|
||||
* This is the report incident update command handler.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class ReportIncidentUpdateCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the report incident command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\IncidentUpdate\ReportIncidentUpdateCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\IncidentUpdate
|
||||
*/
|
||||
public function handle(ReportIncidentUpdateCommand $command)
|
||||
{
|
||||
$data = [
|
||||
'incident_id' => $command->incident->id,
|
||||
'status' => $command->status,
|
||||
'message' => $command->message,
|
||||
'user_id' => $command->user->id,
|
||||
];
|
||||
|
||||
// Create the incident update.
|
||||
$update = IncidentUpdate::create($data);
|
||||
|
||||
// Update the original incident with the new status.
|
||||
dispatch(new UpdateIncidentCommand(
|
||||
$incident,
|
||||
null,
|
||||
$command->status,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
));
|
||||
|
||||
event(new IncidentUpdateWasReportedEvent($update));
|
||||
|
||||
return $update;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?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\Bus\Handlers\Commands\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\UpdateIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\IncidentUpdate\IncidentUpdateWasUpdatedEvent;
|
||||
|
||||
/**
|
||||
* This is the update incident update command handler.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class UpdateIncidentUpdateCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the update incident update command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\IncidentUpdate\UpdateIncidentUpdateCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\IncidentUpdate
|
||||
*/
|
||||
public function handle(UpdateIncidentUpdateCommand $command)
|
||||
{
|
||||
$command->update->update($this->filter($command));
|
||||
|
||||
event(new IncidentUpdateWasUpdatedEvent($command->update));
|
||||
|
||||
return $command->update;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the command data.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\IncidentUpdate\UpdateIncidentUpdateCommand $command
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function filter(UpdateIncidentUpdateCommand $command)
|
||||
{
|
||||
$params = [
|
||||
'status' => $command->status,
|
||||
'message' => $command->message,
|
||||
'user_id' => $command->user->id,
|
||||
];
|
||||
|
||||
return array_filter($params, function ($val) {
|
||||
return $val !== null;
|
||||
});
|
||||
}
|
||||
}
|
||||
35
app/Bus/Handlers/Commands/Tag/CreateTagCommandHandler.php
Normal file
35
app/Bus/Handlers/Commands/Tag/CreateTagCommandHandler.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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\Bus\Handlers\Commands\Tag;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Tag\CreateTagCommand;
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
|
||||
class CreateTagCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the create tag command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Tag\CreateTagCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\Tag
|
||||
*/
|
||||
public function handle(CreateTagCommand $command)
|
||||
{
|
||||
$tag = Tag::create([
|
||||
'name' => $command->name,
|
||||
'slug' => $command->slug,
|
||||
]);
|
||||
|
||||
return $tag;
|
||||
}
|
||||
}
|
||||
30
app/Bus/Handlers/Commands/Tag/DeleteTagCommandHandler.php
Normal file
30
app/Bus/Handlers/Commands/Tag/DeleteTagCommandHandler.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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\Bus\Handlers\Commands\Tag;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Tag\DeleteTagCommand;
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
|
||||
class DeleteTagCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the delete tag command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Tag\DeleteTagCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(DeleteTagCommand $command)
|
||||
{
|
||||
$command->tag->delete();
|
||||
}
|
||||
}
|
||||
51
app/Bus/Handlers/Commands/Tag/UpdateTagCommandHandler.php
Normal file
51
app/Bus/Handlers/Commands/Tag/UpdateTagCommandHandler.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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\Bus\Handlers\Commands\Tag;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Tag\UpdateTagCommand;
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
|
||||
class UpdateTagCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the update tag command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Tag\UpdateTagCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\Tag
|
||||
*/
|
||||
public function handle(UpdateTagCommand $command)
|
||||
{
|
||||
$command->tag->update($this->filter($command));
|
||||
|
||||
return $command->tag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the command data.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Tag\UpdateTagCommand $command
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function filter(UpdateTagCommand $command)
|
||||
{
|
||||
$params = [
|
||||
'name' => $command->name,
|
||||
'slug' => $command->slug,
|
||||
];
|
||||
|
||||
return array_filter($params, function ($val) {
|
||||
return $val !== null;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -11,20 +11,25 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\User\AddTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\AddUserCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\User\UserWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
class AddTeamMemberCommandHandler
|
||||
/**
|
||||
* This is the add user command handler.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class AddUserCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the add team member command.
|
||||
* Handle the add user command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\AddTeamMemberCommand $command
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\AddUserCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public function handle(AddTeamMemberCommand $command)
|
||||
public function handle(AddUserCommand $command)
|
||||
{
|
||||
$user = User::create([
|
||||
'username' => $command->username,
|
||||
@@ -11,20 +11,25 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\User\InviteTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\InviteUserCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\User\UserWasInvitedEvent;
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
|
||||
class InviteTeamMemberCommandHandler
|
||||
/**
|
||||
* This is the invite user command handler.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class InviteUserCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the invite team member command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\InviteTeamMemberCommand $command
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\InviteUserCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(InviteTeamMemberCommand $command)
|
||||
public function handle(InviteUserCommand $command)
|
||||
{
|
||||
foreach ($command->emails as $email) {
|
||||
$invite = Invite::create([
|
||||
@@ -0,0 +1,63 @@
|
||||
<?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\Bus\Handlers\Commands\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\User\UpdateTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\User\UserWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the update team member command handler.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class UpdateTeamMemberCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the add team member command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\UpdateTeamMemberCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public function handle(UpdateTeamMemberCommand $command)
|
||||
{
|
||||
$user = $command->user;
|
||||
|
||||
$user->update($this->filter($command));
|
||||
|
||||
event(new UserWasUpdatedEvent($user));
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the command data.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\UpdateTeamMemberCommand $command
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function filter(UpdateTeamMemberCommand $command)
|
||||
{
|
||||
$params = [
|
||||
'username' => $command->username,
|
||||
'password' => $command->password,
|
||||
'email' => $command->email,
|
||||
'level' => $command->level,
|
||||
];
|
||||
|
||||
return array_filter($params, function ($val) {
|
||||
return $val !== null;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -46,9 +46,9 @@ class SendSubscriberVerificationEmailHandler
|
||||
public function handle(SubscriberHasSubscribedEvent $event)
|
||||
{
|
||||
$mail = [
|
||||
'email' => $event->subscriber->email,
|
||||
'subject' => 'Confirm your subscription.',
|
||||
'link' => route('subscribe.verify', ['code' => $event->subscriber->verify_code]),
|
||||
'email' => $event->subscriber->email,
|
||||
'subject' => 'Confirm your subscription.',
|
||||
'link' => route('subscribe.verify', ['code' => $event->subscriber->verify_code]),
|
||||
];
|
||||
|
||||
$this->mailer->queue([
|
||||
|
||||
@@ -11,12 +11,41 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Composers;
|
||||
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use GrahamCampbell\Markdown\Facades\Markdown;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class AppComposer
|
||||
{
|
||||
/**
|
||||
* The date factory instance.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Dates\DateFactory
|
||||
*/
|
||||
protected $dates;
|
||||
|
||||
/**
|
||||
* The illuminate config instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Config\Repository
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* Create a new app composer instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Dates\DateFactory $dates
|
||||
* @param \Illuminate\Contracts\Config\Repository $config
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(DateFactory $dates, Repository $config)
|
||||
{
|
||||
$this->dates = $dates;
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Index page view composer.
|
||||
*
|
||||
@@ -26,25 +55,28 @@ class AppComposer
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$view->withAboutApp(Markdown::convertToHtml(Config::get('setting.app_about')));
|
||||
$view->withAppAnalytics(Config::get('setting.app_analytics'));
|
||||
$view->withAppAnalyticsGoSquared(Config::get('setting.app_analytics_gs'));
|
||||
$view->withAppAnalyticsPiwikUrl(Config::get('setting.app_analytics_piwik_url'));
|
||||
$view->withAppAnalyticsPiwikSiteId(Config::get('setting.app_analytics_piwik_site_id'));
|
||||
$view->withAppBanner(Config::get('setting.app_banner'));
|
||||
$view->withAppBannerStyleFullWidth(Config::get('setting.style_fullwidth_header'));
|
||||
$view->withAppBannerType(Config::get('setting.app_banner_type'));
|
||||
$view->withAppDomain(Config::get('setting.app_domain'));
|
||||
$view->withAppGraphs(Config::get('setting.display_graphs'));
|
||||
$view->withAppLocale(Config::get('setting.app_locale'));
|
||||
$view->withAppStylesheet(Config::get('setting.stylesheet'));
|
||||
$view->withAppUrl(Config::get('app.url'));
|
||||
$view->withAppHeader(Config::get('setting.header'));
|
||||
$view->withAppFooter(Config::get('setting.footer'));
|
||||
$view->withAppName(Config::get('setting.app_name'));
|
||||
$view->withShowSupport($support = Config::get('setting.show_support'));
|
||||
$view->withAutomaticLocalization(Config::get('setting.automatic_localization'));
|
||||
$view->withSiteTitle(Config::get('setting.app_name'));
|
||||
$view->withFontSubset(Config::get('langs.'.Config::get('app.locale').'.subset', 'latin'));
|
||||
$view->withAboutApp(Markdown::convertToHtml($this->config->get('setting.app_about')));
|
||||
$view->withAppAnalytics($this->config->get('setting.app_analytics'));
|
||||
$view->withAppAnalyticsGoSquared($this->config->get('setting.app_analytics_gs'));
|
||||
$view->withAppAnalyticsPiwikUrl($this->config->get('setting.app_analytics_piwik_url'));
|
||||
$view->withAppAnalyticsPiwikSiteId($this->config->get('setting.app_analytics_piwik_site_id'));
|
||||
$view->withAppBanner($this->config->get('setting.app_banner'));
|
||||
$view->withAppBannerStyleFullWidth($this->config->get('setting.style_fullwidth_header'));
|
||||
$view->withAppBannerType($this->config->get('setting.app_banner_type'));
|
||||
$view->withAppDomain($this->config->get('setting.app_domain'));
|
||||
$view->withAppGraphs($this->config->get('setting.display_graphs'));
|
||||
$view->withAppLocale($this->config->get('setting.app_locale'));
|
||||
$view->withAppStylesheet($this->config->get('setting.stylesheet'));
|
||||
$view->withAppUrl($this->config->get('app.url'));
|
||||
$view->withAppHeader($this->config->get('setting.header'));
|
||||
$view->withAppFooter($this->config->get('setting.footer'));
|
||||
$view->withAppName($this->config->get('setting.app_name'));
|
||||
$view->withShowSupport($this->config->get('setting.show_support'));
|
||||
$view->withAutomaticLocalization($this->config->get('setting.automatic_localization'));
|
||||
$view->withEnableExternalDependencies($this->config->get('setting.enable_external_dependencies'));
|
||||
$view->withShowTimezone($this->config->get('setting.show_timezone'));
|
||||
$view->withTimezone($this->dates->getTimezone());
|
||||
$view->withSiteTitle($this->config->get('setting.app_name'));
|
||||
$view->withFontSubset($this->config->get('langs.'.$this->config->get('app.locale').'.subset', 'latin'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,11 +12,30 @@
|
||||
namespace CachetHQ\Cachet\Composers;
|
||||
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class MetricsComposer
|
||||
{
|
||||
/**
|
||||
* The illuminate config instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Config\Repository
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* Create a new metrics composer.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Config\Repository $config
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Repository $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Metrics view composer.
|
||||
*
|
||||
@@ -27,7 +46,7 @@ class MetricsComposer
|
||||
public function compose(View $view)
|
||||
{
|
||||
$metrics = null;
|
||||
if ($displayMetrics = Config::get('setting.display_graphs')) {
|
||||
if ($displayMetrics = $this->config->get('setting.display_graphs')) {
|
||||
$metrics = Metric::displayable()->orderBy('order')->orderBy('id')->get();
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -11,11 +11,30 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Composers;
|
||||
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class ThemeComposer
|
||||
{
|
||||
/**
|
||||
* The illuminate config instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Config\Repository
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* Create a new theme composer.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Config\Repository $config
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Repository $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
@@ -26,17 +45,17 @@ class ThemeComposer
|
||||
public function compose(View $view)
|
||||
{
|
||||
// Theme colors.
|
||||
$view->withThemeBackgroundColor(Config::get('setting.style_background_color', '#F0F3F4'));
|
||||
$view->withThemeBackgroundFills(Config::get('setting.style_background_fills', '#FFFFFF'));
|
||||
$view->withThemeBannerBackgroundColor(Config::get('setting.style_banner_background_color', ''));
|
||||
$view->withThemeBannerPadding(Config::get('setting.style_banner_padding', '40px 0'));
|
||||
$view->withThemeTextColor(Config::get('setting.style_text_color', '#333333'));
|
||||
$view->withThemeReds(Config::get('setting.style_reds', '#ff6f6f'));
|
||||
$view->withThemeBlues(Config::get('setting.style_blues', '#3498db'));
|
||||
$view->withThemeGreens(Config::get('setting.style_greens', '#7ED321'));
|
||||
$view->withThemeYellows(Config::get('setting.style_yellows', '#F7CA18'));
|
||||
$view->withThemeOranges(Config::get('setting.style_oranges', '#FF8800'));
|
||||
$view->withThemeMetrics(Config::get('setting.style_metrics', '#0dccc0'));
|
||||
$view->withThemeLinks(Config::get('setting.style_links', '#7ED321'));
|
||||
$view->withThemeBackgroundColor($this->config->get('setting.style_background_color', '#F0F3F4'));
|
||||
$view->withThemeBackgroundFills($this->config->get('setting.style_background_fills', '#FFFFFF'));
|
||||
$view->withThemeBannerBackgroundColor($this->config->get('setting.style_banner_background_color', ''));
|
||||
$view->withThemeBannerPadding($this->config->get('setting.style_banner_padding', '40px 0'));
|
||||
$view->withThemeTextColor($this->config->get('setting.style_text_color', '#333333'));
|
||||
$view->withThemeReds($this->config->get('setting.style_reds', '#ff6f6f'));
|
||||
$view->withThemeBlues($this->config->get('setting.style_blues', '#3498db'));
|
||||
$view->withThemeGreens($this->config->get('setting.style_greens', '#7ED321'));
|
||||
$view->withThemeYellows($this->config->get('setting.style_yellows', '#F7CA18'));
|
||||
$view->withThemeOranges($this->config->get('setting.style_oranges', '#FF8800'));
|
||||
$view->withThemeMetrics($this->config->get('setting.style_metrics', '#0dccc0'));
|
||||
$view->withThemeLinks($this->config->get('setting.style_links', '#7ED321'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,30 @@ namespace CachetHQ\Cachet\Composers;
|
||||
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class TimezoneLocaleComposer
|
||||
{
|
||||
/**
|
||||
* The illuminate config instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Config\Repository
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* Create a new timezone locale composer.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Config\Repository $config
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Repository $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Timezones and Locales composer.
|
||||
*
|
||||
@@ -27,7 +46,7 @@ class TimezoneLocaleComposer
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$enabledLangs = Config::get('langs');
|
||||
$enabledLangs = $this->config->get('langs');
|
||||
|
||||
$langs = array_map(function ($lang) use ($enabledLangs) {
|
||||
$locale = basename($lang);
|
||||
|
||||
@@ -15,6 +15,7 @@ use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
@@ -187,71 +188,31 @@ class DemoSeederCommand extends Command
|
||||
*/
|
||||
protected function seedIncidents()
|
||||
{
|
||||
$incidentMessage = <<<'EINCIDENT'
|
||||
# Of course it does!
|
||||
|
||||
What kind of web application doesn't these days?
|
||||
|
||||
## Headers are fun aren't they
|
||||
|
||||
It's _exactly_ why we need Markdown. For **emphasis** and such.
|
||||
EINCIDENT;
|
||||
|
||||
$defaultIncidents = [
|
||||
[
|
||||
'name' => 'Cachet supports Markdown!',
|
||||
'message' => $incidentMessage,
|
||||
'status' => 4,
|
||||
'name' => 'Our monkeys aren\'t performing',
|
||||
'message' => 'We\'re investigating an issue with our monkeys not performing as they should be.',
|
||||
'status' => Incident::INVESTIGATING,
|
||||
'component_id' => 0,
|
||||
'scheduled_at' => null,
|
||||
'visible' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Awesome',
|
||||
'message' => ':+1: We totally nailed the fix.',
|
||||
'status' => 4,
|
||||
], [
|
||||
'name' => 'This is an unresolved incident',
|
||||
'message' => 'Unresolved incidents are left without a **Fixed** update.',
|
||||
'status' => Incident::INVESTIGATING,
|
||||
'component_id' => 0,
|
||||
'scheduled_at' => null,
|
||||
'visible' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Monitoring the fix',
|
||||
'message' => ":ship: We've deployed a fix.",
|
||||
'status' => 3,
|
||||
'component_id' => 0,
|
||||
'scheduled_at' => null,
|
||||
'visible' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Update',
|
||||
'message' => "We've identified the problem. Our engineers are currently looking at it.",
|
||||
'status' => 2,
|
||||
'component_id' => 0,
|
||||
'scheduled_at' => null,
|
||||
'visible' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Test Incident',
|
||||
'message' => 'Something went wrong, with something or another.',
|
||||
'status' => 1,
|
||||
'component_id' => 0,
|
||||
'scheduled_at' => null,
|
||||
'visible' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Investigating the API',
|
||||
'message' => ':zap: We\'ve seen high response times from our API. It looks to be fixing itself as time goes on.',
|
||||
'status' => 1,
|
||||
'component_id' => 1,
|
||||
'scheduled_at' => null,
|
||||
'visible' => 1,
|
||||
],
|
||||
];
|
||||
|
||||
Incident::truncate();
|
||||
IncidentUpdate::truncate();
|
||||
|
||||
foreach ($defaultIncidents as $incident) {
|
||||
Incident::create($incident);
|
||||
foreach ($defaultIncidents as $defaultIncident) {
|
||||
$incident = Incident::create($defaultIncident);
|
||||
|
||||
$this->seedIncidentUpdates($incident);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,6 +226,47 @@ EINCIDENT;
|
||||
IncidentTemplate::truncate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed the incident updates table for a given incident.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function seedIncidentUpdates($incident)
|
||||
{
|
||||
$defaultUpdates = [
|
||||
1 => [
|
||||
[
|
||||
'status' => Incident::FIXED,
|
||||
'message' => 'The monkeys are back and rested!',
|
||||
'user_id' => 1,
|
||||
], [
|
||||
'status' => Incident::WATCHED,
|
||||
'message' => 'Our monkeys need a break from performing. They\'ll be back after a good rest.',
|
||||
'user_id' => 1,
|
||||
], [
|
||||
'status' => Incident::IDENTIFIED,
|
||||
'message' => 'We have identified the issue with our lovely performing monkeys.',
|
||||
'user_id' => 1,
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
[
|
||||
'status' => Incident::WATCHED,
|
||||
'message' => 'We\'re actively watching this issue, so it remains unresolved.',
|
||||
'user_id' => 1,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$updates = $defaultUpdates[$incident->id];
|
||||
|
||||
foreach ($updates as $updateId => $update) {
|
||||
$update['incident_id'] = $incident->id;
|
||||
|
||||
IncidentUpdate::create($update);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed the metric points table.
|
||||
*
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Dates;
|
||||
|
||||
use DateTimeZone;
|
||||
use Jenssegers\Date\Date;
|
||||
|
||||
class DateFactory
|
||||
@@ -88,4 +89,17 @@ class DateFactory
|
||||
{
|
||||
return (new Date($time))->setTimezone($this->cachetTimezone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the abbreviated timezone.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTimezone()
|
||||
{
|
||||
$dateTime = new Date();
|
||||
$dateTime->setTimeZone(new DateTimeZone($this->cachetTimezone));
|
||||
|
||||
return $dateTime->format('T');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,6 @@ namespace CachetHQ\Cachet\Foundation\Providers;
|
||||
use AltThree\Bus\Dispatcher;
|
||||
use CachetHQ\Cachet\Bus\Middleware\UseDatabaseTransactions;
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use CachetHQ\Cachet\Integrations\Credits;
|
||||
use CachetHQ\Cachet\Integrations\Feed;
|
||||
use CachetHQ\Cachet\Integrations\Releases;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
@@ -55,9 +52,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
public function register()
|
||||
{
|
||||
$this->registerDateFactory();
|
||||
$this->registerCredits();
|
||||
$this->registerFeed();
|
||||
$this->registerReleases();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,47 +68,4 @@ class AppServiceProvider extends ServiceProvider
|
||||
return new DateFactory($appTimezone, $cacheTimezone);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the credits class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerCredits()
|
||||
{
|
||||
$this->app->singleton(Credits::class, function ($app) {
|
||||
$cache = $app['cache.store'];
|
||||
|
||||
return new Credits($cache);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the feed class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerFeed()
|
||||
{
|
||||
$this->app->singleton(Feed::class, function ($app) {
|
||||
$cache = $app['cache.store'];
|
||||
|
||||
return new Feed($cache);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the releases class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerReleases()
|
||||
{
|
||||
$this->app->singleton(Releases::class, function ($app) {
|
||||
$cache = $app['cache.store'];
|
||||
$token = $app['config']->get('services.github.token');
|
||||
|
||||
return new Releases($cache, $token);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,9 @@ class EventServiceProvider extends ServiceProvider
|
||||
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasUpdatedEvent' => [
|
||||
//
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasRemovedEvent' => [
|
||||
//
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\Incident\MaintenanceWasScheduledEvent' => [
|
||||
'CachetHQ\Cachet\Bus\Handlers\Events\Incident\SendMaintenanceEmailNotificationHandler',
|
||||
],
|
||||
@@ -90,5 +93,11 @@ class EventServiceProvider extends ServiceProvider
|
||||
'CachetHQ\Cachet\Bus\Events\User\UserWasInvitedEvent' => [
|
||||
'CachetHQ\Cachet\Bus\Handlers\Events\User\SendInviteUserEmailHandler',
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\User\UserWasUpdatedEvent' => [
|
||||
//
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\User\UserWasRemovedEvent' => [
|
||||
//
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
100
app/Foundation/Providers/IntegrationServiceProvider.php
Normal file
100
app/Foundation/Providers/IntegrationServiceProvider.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?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\Credits as CreditsContract;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Feed as FeedContract;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Releases as ReleasesContract;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\System as SystemContract;
|
||||
use CachetHQ\Cachet\Integrations\Core\Credits;
|
||||
use CachetHQ\Cachet\Integrations\Core\Feed;
|
||||
use CachetHQ\Cachet\Integrations\Core\System;
|
||||
use CachetHQ\Cachet\Integrations\GitHub\Releases;
|
||||
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->registerCredits();
|
||||
$this->registerFeed();
|
||||
$this->registerSystem();
|
||||
|
||||
$this->registerReleases();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the credits class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerCredits()
|
||||
{
|
||||
$this->app->singleton(CreditsContract::class, function ($app) {
|
||||
$cache = $app['cache.store'];
|
||||
|
||||
return new Credits($cache);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the feed class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerFeed()
|
||||
{
|
||||
$this->app->singleton(FeedContract::class, function ($app) {
|
||||
$cache = $app['cache.store'];
|
||||
|
||||
return new Feed($cache);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the system class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerSystem()
|
||||
{
|
||||
$this->app->singleton(SystemContract::class, function (Container $app) {
|
||||
return new System();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the releases class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerReleases()
|
||||
{
|
||||
$this->app->singleton(ReleasesContract::class, function ($app) {
|
||||
$cache = $app['cache.store'];
|
||||
$token = $app['config']->get('services.github.token');
|
||||
|
||||
return new Releases($cache, $token);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -28,34 +28,36 @@ class RouteServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Define the route model bindings, pattern filters, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
$this->app->call([$this, 'bind']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the bindings for the application.
|
||||
*
|
||||
* @param \Illuminate\Routing\Router $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot(Router $router)
|
||||
public function bind(Router $router)
|
||||
{
|
||||
parent::boot($router);
|
||||
|
||||
$this->registerBindings();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register model bindings.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerBindings()
|
||||
{
|
||||
$this->app->router->model('component', 'CachetHQ\Cachet\Models\Component');
|
||||
$this->app->router->model('component_group', 'CachetHQ\Cachet\Models\ComponentGroup');
|
||||
$this->app->router->model('incident', 'CachetHQ\Cachet\Models\Incident');
|
||||
$this->app->router->model('incident_template', 'CachetHQ\Cachet\Models\IncidentTemplate');
|
||||
$this->app->router->model('metric', 'CachetHQ\Cachet\Models\Metric');
|
||||
$this->app->router->model('metric_point', 'CachetHQ\Cachet\Models\MetricPoint');
|
||||
$this->app->router->model('setting', 'CachetHQ\Cachet\Models\Setting');
|
||||
$this->app->router->model('subscriber', 'CachetHQ\Cachet\Models\Subscriber');
|
||||
$this->app->router->model('subscription', 'CachetHQ\Cachet\Models\Subscription');
|
||||
$this->app->router->model('user', 'CachetHQ\Cachet\Models\User');
|
||||
$router->model('component', 'CachetHQ\Cachet\Models\Component');
|
||||
$router->model('component_group', 'CachetHQ\Cachet\Models\ComponentGroup');
|
||||
$router->model('component_tag', 'CachetHQ\Cachet\Models\ComponentTag');
|
||||
$router->model('incident', 'CachetHQ\Cachet\Models\Incident');
|
||||
$router->model('incident_template', 'CachetHQ\Cachet\Models\IncidentTemplate');
|
||||
$router->model('metric', 'CachetHQ\Cachet\Models\Metric');
|
||||
$router->model('metric_point', 'CachetHQ\Cachet\Models\MetricPoint');
|
||||
$router->model('setting', 'CachetHQ\Cachet\Models\Setting');
|
||||
$router->model('subscriber', 'CachetHQ\Cachet\Models\Subscriber');
|
||||
$router->model('subscription', 'CachetHQ\Cachet\Models\Subscription');
|
||||
$router->model('tag', 'CachetHQ\Cachet\Models\Tag');
|
||||
$router->model('user', 'CachetHQ\Cachet\Models\User');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
117
app/Http/Controllers/Api/ComponentTagController.php
Normal file
117
app/Http/Controllers/Api/ComponentTagController.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?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\Controllers\Api;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\ComponentTag\AddComponentTagCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\ComponentTag\DeleteComponentTagCommand;
|
||||
use CachetHQ\Cachet\Bus\Exceptions\Tag\TagDoesNotExistOnComponentException;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\ComponentTag;
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
|
||||
/**
|
||||
* This is the component tag controller class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class ComponentTagController extends AbstractApiController
|
||||
{
|
||||
/**
|
||||
* Get all tags.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function getTags()
|
||||
{
|
||||
$tags = Tag::query();
|
||||
|
||||
$tags->search(Binput::except(['sort', 'order', 'per_page']));
|
||||
|
||||
if ($sortBy = Binput::get('sort')) {
|
||||
$direction = Binput::has('order') && Binput::get('order') == 'desc';
|
||||
|
||||
$tags->sort($sortBy, $direction);
|
||||
}
|
||||
|
||||
$tags = $tags->paginate(Binput::get('per_page', 20));
|
||||
|
||||
return $this->paginator($tags, Request::instance());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single component tag.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\ComponentTag $componentTag
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function getTag(ComponentTag $componentTag)
|
||||
{
|
||||
return $this->item($componentTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new component tag.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function postTags()
|
||||
{
|
||||
$component = Component::find(Binput::get('component_id'));
|
||||
$tag = Tag::find(Binput::get('tag_id'));
|
||||
|
||||
if (!($component && $tag)) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
try {
|
||||
$tag = dispatch(new AddComponentTagCommand(
|
||||
$component,
|
||||
$tag
|
||||
));
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
return $this->item($tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an existing tag.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function deleteTag()
|
||||
{
|
||||
$component = Component::find(Binput::get('component_id'));
|
||||
$tag = Tag::find(Binput::get('tag_id'));
|
||||
|
||||
if (!($component && $tag)) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
try {
|
||||
dispatch(new DeleteComponentTagCommand(
|
||||
$component,
|
||||
$tag
|
||||
));
|
||||
} catch (TagDoesNotExistOnComponentException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
return $this->noContent();
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,8 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Api;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Releases;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Releases;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\System;
|
||||
|
||||
/**
|
||||
* This is the general api controller.
|
||||
@@ -37,11 +38,23 @@ class GeneralController extends AbstractApiController
|
||||
*/
|
||||
public function version()
|
||||
{
|
||||
$latest = app(Releases::class)->latest();
|
||||
$latest = app()->make(Releases::class)->latest();
|
||||
|
||||
return $this->setMetaData([
|
||||
'on_latest' => version_compare(CACHET_VERSION, $latest['tag_name']) === 1,
|
||||
'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($system['system_message']);
|
||||
}
|
||||
}
|
||||
|
||||
132
app/Http/Controllers/Api/IncidentUpdateController.php
Normal file
132
app/Http/Controllers/Api/IncidentUpdateController.php
Normal file
@@ -0,0 +1,132 @@
|
||||
<?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\Controllers\Api;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\RemoveIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\ReportIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\UpdateIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
|
||||
/**
|
||||
* This is the incident update controller.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class IncidentUpdateController extends AbstractApiController
|
||||
{
|
||||
/**
|
||||
* Return all updates on the incident.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function getIncidentUpdates(Incident $incident)
|
||||
{
|
||||
$updates = IncidentUpdate::orderBy('created_at', 'desc');
|
||||
|
||||
if ($sortBy = Binput::get('sort')) {
|
||||
$direction = Binput::has('order') && Binput::get('order') == 'desc';
|
||||
|
||||
$updates->sort($sortBy, $direction);
|
||||
}
|
||||
|
||||
$updates = $updates->paginate(Binput::get('per_page', 20));
|
||||
|
||||
return $this->paginator($updates, Request::instance());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a single incident update.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $update
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function getIncidentUpdate(Incident $incident, IncidentUpdate $update)
|
||||
{
|
||||
return $this->item($update);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new incident update.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function postIncidentUpdate(Incident $incident)
|
||||
{
|
||||
try {
|
||||
$update = dispatch(new ReportIncidentUpdateCommand(
|
||||
$incident,
|
||||
Binput::get('status'),
|
||||
Binput::get('message'),
|
||||
Auth::user()
|
||||
));
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
return $this->item($update);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an incident update.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $update
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function putIncidentUpdate(Incident $incident, IncidentUpdate $update)
|
||||
{
|
||||
try {
|
||||
$update = dispatch(new UpdateIncidentUpdateCommand(
|
||||
$update,
|
||||
Binput::get('status'),
|
||||
Binput::get('message'),
|
||||
Auth::user()
|
||||
));
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
return $this->item($update);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new incident update.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $update
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function deleteIncidentUpdate(Incident $incident, IncidentUpdate $update)
|
||||
{
|
||||
try {
|
||||
dispatch(new RemoveIncidentUpdateCommand($update));
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
return $this->noContent();
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ use CachetHQ\Cachet\Bus\Commands\Subscriber\UnsubscribeSubscriptionCommand;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use CachetHQ\Cachet\Models\Subscription;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
@@ -48,12 +49,10 @@ class SubscriberController extends AbstractApiController
|
||||
*/
|
||||
public function postSubscribers()
|
||||
{
|
||||
$verified = Binput::get('verify', app(Repository::class)->get('setting.skip_subscriber_verification'));
|
||||
|
||||
try {
|
||||
$subscriber = dispatch(new SubscribeSubscriberCommand(
|
||||
Binput::get('email'),
|
||||
Binput::get('verify', false),
|
||||
Binput::get('components', null)
|
||||
));
|
||||
$subscriber = dispatch(new SubscribeSubscriberCommand(Binput::get('email'), $verified, Binput::get('components')));
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
113
app/Http/Controllers/Api/TagController.php
Normal file
113
app/Http/Controllers/Api/TagController.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?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\Controllers\Api;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Tag\CreateTagCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Tag\DeleteTagCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Tag\UpdateTagCommand;
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
|
||||
class TagController extends AbstractApiController
|
||||
{
|
||||
/**
|
||||
* Get all tags.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function getTags()
|
||||
{
|
||||
$tags = Tag::query();
|
||||
|
||||
$tags->search(Binput::except(['sort', 'order', 'per_page']));
|
||||
|
||||
if ($sortBy = Binput::get('sort')) {
|
||||
$direction = Binput::has('order') && Binput::get('order') == 'desc';
|
||||
|
||||
$tags->sort($sortBy, $direction);
|
||||
}
|
||||
|
||||
$tags = $tags->paginate(Binput::get('per_page', 20));
|
||||
|
||||
return $this->paginator($tags, Request::instance());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single tag.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Tag $tag
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function getTag(Tag $tag)
|
||||
{
|
||||
return $this->item($tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new tag.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function postTags()
|
||||
{
|
||||
try {
|
||||
$tag = dispatch(new CreateTagCommand(
|
||||
Binput::get('name'),
|
||||
Binput::get('slug')
|
||||
));
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
return $this->item($tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing tag.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Tag $tag
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function putTag(Tag $tag)
|
||||
{
|
||||
try {
|
||||
$tag = dispatch(new UpdateTagCommand(
|
||||
$tag,
|
||||
Binput::get('name'),
|
||||
Binput::get('slug')
|
||||
));
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
return $this->item($tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an existing tag.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Tag $tag
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function deleteTag(Tag $tag)
|
||||
{
|
||||
dispatch(new DeleteTagCommand($tag));
|
||||
|
||||
return $this->noContent();
|
||||
}
|
||||
}
|
||||
87
app/Http/Controllers/Api/UserController.php
Normal file
87
app/Http/Controllers/Api/UserController.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?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\Controllers\Api;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\User\AddTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\RemoveUserCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\UpdateTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
|
||||
/**
|
||||
* This is the user controller class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class UserController extends AbstractApiController
|
||||
{
|
||||
/**
|
||||
* Create a new user.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function postUsers()
|
||||
{
|
||||
try {
|
||||
$user = dispatch(new AddTeamMemberCommand(
|
||||
Binput::get('username'),
|
||||
Binput::get('password'),
|
||||
Binput::get('email'),
|
||||
Binput::get('level', User::LEVEL_USER)
|
||||
));
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
return $this->item($user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing user.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function putUser(User $user)
|
||||
{
|
||||
try {
|
||||
dispatch(new UpdateTeamMemberCommand(
|
||||
$user,
|
||||
Binput::get('username'),
|
||||
Binput::get('password'),
|
||||
Binput::get('email'),
|
||||
Binput::get('level')
|
||||
));
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
return $this->item($user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a user from the system.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function deleteUser(User $user)
|
||||
{
|
||||
dispatch(new RemoveUserCommand($user));
|
||||
|
||||
return $this->noContent();
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Dashboard;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Feed;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Feed;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
@@ -15,15 +15,22 @@ use AltThree\Validator\ValidationException;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\RemoveIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\ReportIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\UpdateIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\ReportIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
/**
|
||||
* This is the incident controller.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class IncidentController extends Controller
|
||||
{
|
||||
/**
|
||||
@@ -33,13 +40,24 @@ class IncidentController extends Controller
|
||||
*/
|
||||
protected $subMenu = [];
|
||||
|
||||
/**
|
||||
* The guard instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Auth\Guard
|
||||
*/
|
||||
protected $auth;
|
||||
|
||||
/**
|
||||
* Creates a new incident controller instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
|
||||
$this->subMenu = [
|
||||
'incidents' => [
|
||||
'title' => trans('dashboard.incidents.incidents'),
|
||||
@@ -279,4 +297,43 @@ class IncidentController extends Controller
|
||||
return Redirect::route('dashboard.templates.edit', ['id' => $template->id])
|
||||
->withUpdatedTemplate($template);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the incident update form.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function showIncidentUpdateAction(Incident $incident)
|
||||
{
|
||||
return View::make('dashboard.incidents.update')->withIncident($incident);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new incident update.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function createIncidentUpdateAction(Incident $incident)
|
||||
{
|
||||
try {
|
||||
$incident = dispatch(new ReportIncidentUpdateCommand(
|
||||
$incident,
|
||||
Binput::get('status'),
|
||||
Binput::get('message'),
|
||||
$this->auth->user()
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.incidents.update', ['id' => $incident->id])
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.edit.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.incidents.index')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Dashboard;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Credits;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Credits;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
use CachetHQ\Cachet\Settings\Repository;
|
||||
use Exception;
|
||||
|
||||
@@ -16,6 +16,7 @@ use CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Subscriber\UnsubscribeSubscriberCommand;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
@@ -52,11 +53,13 @@ class SubscriberController extends Controller
|
||||
*/
|
||||
public function createSubscriberAction()
|
||||
{
|
||||
$verified = app(Repository::class)->get('setting.skip_subscriber_verification');
|
||||
|
||||
try {
|
||||
$subscribers = preg_split("/\r\n|\n|\r/", Binput::get('email'));
|
||||
|
||||
foreach ($subscribers as $subscriber) {
|
||||
dispatch(new SubscribeSubscriberCommand($subscriber));
|
||||
dispatch(new SubscribeSubscriberCommand($subscriber, $verified));
|
||||
}
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.subscribers.add')
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Dashboard;
|
||||
|
||||
use AltThree\Validator\ValidationException;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\AddTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\InviteTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\AddUserCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\InviteUserCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\RemoveUserCommand;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
@@ -81,7 +81,7 @@ class TeamController extends Controller
|
||||
public function postAddUser()
|
||||
{
|
||||
try {
|
||||
dispatch(new AddTeamMemberCommand(
|
||||
dispatch(new AddUserCommand(
|
||||
Binput::get('username'),
|
||||
Binput::get('password'),
|
||||
Binput::get('email'),
|
||||
@@ -130,7 +130,7 @@ class TeamController extends Controller
|
||||
public function postInviteUser()
|
||||
{
|
||||
try {
|
||||
dispatch(new InviteTeamMemberCommand(
|
||||
dispatch(new InviteUserCommand(
|
||||
array_unique(array_filter((array) Binput::get('emails')))
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
|
||||
@@ -85,7 +85,7 @@ class StatusPageController extends AbstractApiController
|
||||
$allIncidents = Incident::notScheduled()->where('visible', '>=', $incidentVisibility)->whereBetween('created_at', [
|
||||
$startDate->copy()->subDays($daysToShow)->format('Y-m-d').' 00:00:00',
|
||||
$startDate->format('Y-m-d').' 23:59:59',
|
||||
])->orderBy('scheduled_at', 'desc')->orderBy('created_at', 'desc')->get()->groupBy(function (Incident $incident) {
|
||||
])->orderBy('scheduled_at', 'desc')->orderBy('created_at', 'desc')->get()->load('updates')->groupBy(function (Incident $incident) {
|
||||
return app(DateFactory::class)->make($incident->is_scheduled ? $incident->scheduled_at : $incident->created_at)->toDateString();
|
||||
});
|
||||
|
||||
|
||||
@@ -18,10 +18,12 @@ use CachetHQ\Cachet\Bus\Commands\Subscriber\UnsubscribeSubscriptionCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Subscriber\UpdateSubscriberSubscriptionCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Subscriber\VerifySubscriberCommand;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use CachetHQ\Cachet\Models\Subscription;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use GrahamCampbell\Markdown\Facades\Markdown;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
@@ -56,10 +58,9 @@ class SubscribeController extends Controller
|
||||
{
|
||||
$email = Binput::get('email');
|
||||
$subscriptions = Binput::get('subscriptions');
|
||||
$verified = app(Repository::class)->get('setting.skip_subscriber_verification');
|
||||
|
||||
try {
|
||||
$verified = false;
|
||||
|
||||
$subscription = dispatch(new SubscribeSubscriberCommand($email, $verified));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('status-page')
|
||||
@@ -147,15 +148,19 @@ class SubscribeController extends Controller
|
||||
}
|
||||
|
||||
$subscriber = Subscriber::where('verify_code', '=', $code)->first();
|
||||
$usedComponentGroups = Component::enabled()->where('group_id', '>', 0)->groupBy('group_id')->pluck('group_id');
|
||||
$componentGroups = ComponentGroup::whereIn('id', $usedComponentGroups)->orderBy('order')->get();
|
||||
$ungroupedComponents = Component::enabled()->where('group_id', 0)->orderBy('order')->orderBy('created_at')->get();
|
||||
|
||||
if (!$subscriber) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
return View::make('subscribe.manage')
|
||||
->withComponents(Component::all())
|
||||
->withUngroupedComponents($ungroupedComponents)
|
||||
->withSubscriber($subscriber)
|
||||
->withSubscriptions($subscriber->subscriptions->pluck('component_id')->all());
|
||||
->withSubscriptions($subscriber->subscriptions->pluck('component_id')->all())
|
||||
->withComponentGroups($componentGroups);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,11 +37,13 @@ class Kernel extends HttpKernel
|
||||
'Illuminate\Session\Middleware\StartSession',
|
||||
'Illuminate\View\Middleware\ShareErrorsFromSession',
|
||||
'Illuminate\Foundation\Http\Middleware\VerifyCsrfToken',
|
||||
'Illuminate\Routing\Middleware\SubstituteBindings',
|
||||
],
|
||||
'api' => [
|
||||
'Barryvdh\Cors\HandleCors',
|
||||
'CachetHQ\Cachet\Http\Middleware\Acceptable',
|
||||
'CachetHQ\Cachet\Http\Middleware\Timezone',
|
||||
'Illuminate\Routing\Middleware\SubstituteBindings',
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
@@ -33,18 +33,27 @@ 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');
|
||||
$router->get('components/groups/{component_group}', 'ComponentGroupController@getGroup');
|
||||
$router->get('components/tags', 'ComponentTagController@getTags');
|
||||
$router->get('components/tags/{component_tag}', 'ComponentTagController@getTag');
|
||||
$router->get('components/{component}', 'ComponentController@getComponent');
|
||||
|
||||
$router->get('incidents', 'IncidentController@getIncidents');
|
||||
$router->get('incidents/{incident}', 'IncidentController@getIncident');
|
||||
|
||||
$router->get('incidents/{incident}/updates', 'IncidentUpdateController@getIncidentUpdates');
|
||||
$router->get('incidents/{incident}/updates/{update}', 'IncidentUpdateController@getIncidentUpdate');
|
||||
|
||||
$router->get('metrics', 'MetricController@getMetrics');
|
||||
$router->get('metrics/{metric}', 'MetricController@getMetric');
|
||||
$router->get('metrics/{metric}/points', 'MetricController@getMetricPoints');
|
||||
|
||||
$router->get('tags', 'TagController@getTags');
|
||||
$router->get('tags/{tag}', 'TagController@getTag');
|
||||
});
|
||||
|
||||
$router->group(['middleware' => ['auth.api:true']], function (Registrar $router) {
|
||||
@@ -52,24 +61,35 @@ class ApiRoutes
|
||||
|
||||
$router->post('components', 'ComponentController@postComponents');
|
||||
$router->post('components/groups', 'ComponentGroupController@postGroups');
|
||||
$router->post('components/tags', 'ComponentTagController@postTags');
|
||||
$router->post('incidents', 'IncidentController@postIncidents');
|
||||
$router->post('incidents/{incident}/updates', 'IncidentUpdateController@postIncidentUpdate');
|
||||
$router->post('metrics', 'MetricController@postMetrics');
|
||||
$router->post('metrics/{metric}/points', 'MetricPointController@postMetricPoints');
|
||||
$router->post('subscribers', 'SubscriberController@postSubscribers');
|
||||
$router->post('tags', 'TagController@postTags');
|
||||
$router->post('users', 'UserController@postUsers');
|
||||
|
||||
$router->put('components/groups/{component_group}', 'ComponentGroupController@putGroup');
|
||||
$router->put('components/{component}', 'ComponentController@putComponent');
|
||||
$router->put('incidents/{incident}', 'IncidentController@putIncident');
|
||||
$router->put('incidents/{incident}/updates/{update}', 'IncidentUpdateController@putIncidentUpdate');
|
||||
$router->put('metrics/{metric}', 'MetricController@putMetric');
|
||||
$router->put('metrics/{metric}/points/{metric_point}', 'MetricPointController@putMetricPoint');
|
||||
$router->put('tags/{tag}', 'TagController@putTag');
|
||||
$router->put('users/{user}', 'UserController@putUser');
|
||||
|
||||
$router->delete('components/groups/{component_group}', 'ComponentGroupController@deleteGroup');
|
||||
$router->delete('components/tags', 'ComponentTagController@deleteTag');
|
||||
$router->delete('components/{component}', 'ComponentController@deleteComponent');
|
||||
$router->delete('incidents/{incident}', 'IncidentController@deleteIncident');
|
||||
$router->delete('incidents/{incident}/updates/{update}', 'IncidentUpdateController@deleteIncidentUpdate');
|
||||
$router->delete('metrics/{metric}', 'MetricController@deleteMetric');
|
||||
$router->delete('metrics/{metric}/points/{metric_point}', 'MetricPointController@deleteMetricPoint');
|
||||
$router->delete('subscribers/{subscriber}', 'SubscriberController@deleteSubscriber');
|
||||
$router->delete('subscriptions/{subscription}', 'SubscriberController@deleteSubscription');
|
||||
$router->delete('tags/{tag}', 'TagController@deleteTag');
|
||||
$router->delete('users/{user}', 'UserController@deleteUser');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -89,7 +89,12 @@ class DashboardRoutes
|
||||
'as' => 'edit',
|
||||
'uses' => 'IncidentController@showEditIncidentAction',
|
||||
]);
|
||||
$router->get('{incident}/update', [
|
||||
'as' => 'update',
|
||||
'uses' => 'IncidentController@showIncidentUpdateAction',
|
||||
]);
|
||||
$router->post('{incident}/edit', 'IncidentController@editIncidentAction');
|
||||
$router->post('{incident}/update', 'IncidentController@createIncidentUpdateAction');
|
||||
});
|
||||
|
||||
$router->group(['as' => 'schedule.', 'prefix' => 'schedule'], function (Registrar $router) {
|
||||
|
||||
27
app/Integrations/Contracts/Credits.php
Normal file
27
app/Integrations/Contracts/Credits.php
Normal 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 credits interface.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface Credits
|
||||
{
|
||||
/**
|
||||
* Returns the latest credits.
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function latest();
|
||||
}
|
||||
27
app/Integrations/Contracts/Feed.php
Normal file
27
app/Integrations/Contracts/Feed.php
Normal 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 feed interface.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface Feed
|
||||
{
|
||||
/**
|
||||
* Returns the latest entries.
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function latest();
|
||||
}
|
||||
27
app/Integrations/Contracts/Releases.php
Normal file
27
app/Integrations/Contracts/Releases.php
Normal 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 releases interface.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface Releases
|
||||
{
|
||||
/**
|
||||
* Returns the latest release.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function latest();
|
||||
}
|
||||
27
app/Integrations/Contracts/System.php
Normal file
27
app/Integrations/Contracts/System.php
Normal 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();
|
||||
}
|
||||
@@ -9,13 +9,14 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Integrations;
|
||||
namespace CachetHQ\Cachet\Integrations\Core;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Credits as CreditsContract;
|
||||
use Exception;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Contracts\Cache\Repository;
|
||||
|
||||
class Credits
|
||||
class Credits implements CreditsContract
|
||||
{
|
||||
/**
|
||||
* The default url.
|
||||
@@ -9,8 +9,9 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Integrations;
|
||||
namespace CachetHQ\Cachet\Integrations\Core;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Feed as FeedContract;
|
||||
use Exception;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Contracts\Cache\Repository;
|
||||
@@ -20,7 +21,7 @@ use Illuminate\Contracts\Cache\Repository;
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class Feed
|
||||
class Feed implements FeedContract
|
||||
{
|
||||
/**
|
||||
* The default url.
|
||||
73
app/Integrations/Core/System.php
Normal file
73
app/Integrations/Core/System.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?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();
|
||||
$unresolvedCount = $incidents->filter(function ($incident) {
|
||||
return !$incident->is_resolved;
|
||||
})->count();
|
||||
|
||||
if ($incidentCount === 0 || ($incidentCount >= 1 && $unresolvedCount === 0)) {
|
||||
$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;
|
||||
}
|
||||
}
|
||||
@@ -9,12 +9,13 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Integrations;
|
||||
namespace CachetHQ\Cachet\Integrations\GitHub;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Releases as ReleasesContract;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Contracts\Cache\Repository;
|
||||
|
||||
class Releases
|
||||
class Releases implements ReleasesContract
|
||||
{
|
||||
/**
|
||||
* The default url.
|
||||
@@ -129,11 +129,11 @@ class Component extends Model implements HasPresenter
|
||||
/**
|
||||
* Components can have many tags.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||
*/
|
||||
public function tags()
|
||||
{
|
||||
return $this->belongsToMany(Tag::class);
|
||||
return $this->hasManyThrough(Tag::class, ComponentTag::class, 'tag_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
74
app/Models/ComponentTag.php
Normal file
74
app/Models/ComponentTag.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?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\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* This is the component tag class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class ComponentTag extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $casts = [
|
||||
'component_id' => 'int',
|
||||
'tag_id' => 'int',
|
||||
];
|
||||
|
||||
/**
|
||||
* The fillable properties.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $fillable = ['component_id', 'tag_id'];
|
||||
|
||||
/**
|
||||
* Get the component relation.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function component()
|
||||
{
|
||||
return $this->belongsTo(Component::class, 'component_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tag relation.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function tag()
|
||||
{
|
||||
return $this->belongsTo(Tag::class, 'tag_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a given tag for a component.
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param int $tagId
|
||||
* @param int $componentId
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeTagForComponent(Builder $query, $tagId, $componentId)
|
||||
{
|
||||
return $query->where('component_id', $componentId)->where('tag_id', $tagId);
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,43 @@ class Incident extends Model implements HasPresenter
|
||||
{
|
||||
use SearchableTrait, SoftDeletes, SortableTrait, ValidatingTrait;
|
||||
|
||||
/**
|
||||
* Status for incident being investigated.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
const INVESTIGATING = 1;
|
||||
|
||||
/**
|
||||
* Status for incident having been identified.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
const IDENTIFIED = 2;
|
||||
|
||||
/**
|
||||
* Status for incident being watched.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
const WATCHED = 3;
|
||||
|
||||
/**
|
||||
* Status for incident now being fixed.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
const FIXED = 4;
|
||||
|
||||
/**
|
||||
* The accessors to append to the model's array form.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $appends = [
|
||||
'is_resolved',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
*
|
||||
@@ -91,6 +128,13 @@ class Incident extends Model implements HasPresenter
|
||||
'message',
|
||||
];
|
||||
|
||||
/**
|
||||
* The relations to eager load on every query.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $with = ['updates'];
|
||||
|
||||
/**
|
||||
* Finds all visible incidents.
|
||||
*
|
||||
@@ -131,6 +175,16 @@ class Incident extends Model implements HasPresenter
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the updates relation.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function updates()
|
||||
{
|
||||
return $this->hasMany(IncidentUpdate::class)->orderBy('created_at', 'desc');
|
||||
}
|
||||
|
||||
/**
|
||||
* An incident belongs to a component.
|
||||
*
|
||||
@@ -141,6 +195,20 @@ class Incident extends Model implements HasPresenter
|
||||
return $this->belongsTo(Component::class, 'component_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the incident resolved?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getIsResolvedAttribute()
|
||||
{
|
||||
if ($updates = $this->updates->first()) {
|
||||
return $updates->status === self::FIXED;
|
||||
}
|
||||
|
||||
return $this->status === self::FIXED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the "incident" is scheduled or not.
|
||||
*
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
namespace CachetHQ\Cachet\Models;
|
||||
|
||||
use AltThree\Validator\ValidatingTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
@@ -66,7 +67,7 @@ class IncidentTemplate extends Model
|
||||
*
|
||||
* @return \Illuminate\Database\Query\Builder
|
||||
*/
|
||||
public function scopeForSlug($query, $slug)
|
||||
public function scopeForSlug(Builder $query, $slug)
|
||||
{
|
||||
return $query->where('slug', $slug);
|
||||
}
|
||||
|
||||
90
app/Models/IncidentUpdate.php
Normal file
90
app/Models/IncidentUpdate.php
Normal 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.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Models;
|
||||
|
||||
use AltThree\Validator\ValidatingTrait;
|
||||
use CachetHQ\Cachet\Models\Traits\SortableTrait;
|
||||
use CachetHQ\Cachet\Presenters\IncidentUpdatePresenter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use McCool\LaravelAutoPresenter\HasPresenter;
|
||||
|
||||
class IncidentUpdate extends Model implements HasPresenter
|
||||
{
|
||||
use SortableTrait, ValidatingTrait;
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $casts = [
|
||||
'incident_id' => 'int',
|
||||
'status' => 'int',
|
||||
'message' => 'string',
|
||||
'user_id' => 'int',
|
||||
];
|
||||
|
||||
/**
|
||||
* The fillable properties.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $fillable = [
|
||||
'incident_id',
|
||||
'status',
|
||||
'message',
|
||||
'user_id',
|
||||
];
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'incident_id' => 'int',
|
||||
'status' => 'required|int',
|
||||
'message' => 'required|string',
|
||||
'user_id' => 'required|int',
|
||||
];
|
||||
|
||||
/**
|
||||
* The sortable fields.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $sortable = [
|
||||
'id',
|
||||
'status',
|
||||
'user_id',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the incident relation.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function incident()
|
||||
{
|
||||
return $this->belongsTo(Incident::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the presenter class.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPresenterClass()
|
||||
{
|
||||
return IncidentUpdatePresenter::class;
|
||||
}
|
||||
}
|
||||
@@ -11,11 +11,15 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Models;
|
||||
|
||||
use CachetHQ\Cachet\Models\Traits\SearchableTrait;
|
||||
use CachetHQ\Cachet\Models\Traits\SortableTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class Tag extends Model
|
||||
{
|
||||
use SearchableTrait, SortableTrait;
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
*
|
||||
@@ -32,6 +36,28 @@ class Tag extends Model
|
||||
*/
|
||||
protected $fillable = ['name'];
|
||||
|
||||
/**
|
||||
* The searchable fields.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $searchable = [
|
||||
'id',
|
||||
'name',
|
||||
'slug',
|
||||
];
|
||||
|
||||
/**
|
||||
* The sortable fields.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $sortable = [
|
||||
'id',
|
||||
'name',
|
||||
'slug',
|
||||
];
|
||||
|
||||
/**
|
||||
* Overrides the models boot method.
|
||||
*/
|
||||
|
||||
@@ -97,4 +97,27 @@ class ComponentGroupPresenter extends BasePresenter implements Arrayable
|
||||
'lowest_human_status' => $this->lowest_human_status(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if any of the contained components have active subscriptions.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has_subscriber($subscriptions)
|
||||
{
|
||||
$enabled_components = $this->wrappedObject->enabled_components()->orderBy('order')->pluck('id')->toArray();
|
||||
$intersected = array_intersect($enabled_components, $subscriptions);
|
||||
|
||||
return count($intersected) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine the class for collapsed/uncollapsed groups on the subscription form.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function collapse_class_with_subscriptions($subscriptions)
|
||||
{
|
||||
return $this->has_subscriber($subscriptions) ? 'ion-ios-minus-outline' : 'ion-ios-plus-outline';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,19 @@ class IncidentPresenter extends BasePresenter implements Arrayable
|
||||
{
|
||||
use TimestampsTrait;
|
||||
|
||||
/**
|
||||
* Inciden icon lookup.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $icons = [
|
||||
0 => 'icon ion-android-calendar', // Scheduled
|
||||
1 => 'icon ion-flag oranges', // Investigating
|
||||
2 => 'icon ion-alert yellows', // Identified
|
||||
3 => 'icon ion-eye blues', // Watching
|
||||
4 => 'icon ion-checkmark greens', // Fixed
|
||||
];
|
||||
|
||||
/**
|
||||
* Renders the message from Markdown into HTML.
|
||||
*
|
||||
@@ -32,6 +45,16 @@ class IncidentPresenter extends BasePresenter implements Arrayable
|
||||
return Markdown::convertToHtml($this->wrappedObject->message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the raw text of the message, even without Markdown.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function raw_message()
|
||||
{
|
||||
return strip_tags($this->formattedMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* Present diff for humans date time.
|
||||
*
|
||||
@@ -157,19 +180,8 @@ class IncidentPresenter extends BasePresenter implements Arrayable
|
||||
*/
|
||||
public function icon()
|
||||
{
|
||||
switch ($this->wrappedObject->status) {
|
||||
case 0: // Scheduled
|
||||
return 'icon ion-android-calendar';
|
||||
case 1: // Investigating
|
||||
return 'icon ion-flag oranges';
|
||||
case 2: // Identified
|
||||
return 'icon ion-alert yellows';
|
||||
case 3: // Watching
|
||||
return 'icon ion-eye blues';
|
||||
case 4: // Fixed
|
||||
return 'icon ion-checkmark greens';
|
||||
default: // Something actually broke, this shouldn't happen.
|
||||
return '';
|
||||
if (isset($this->icons[$this->wrappedObject->status])) {
|
||||
return $this->icons[$this->wrappedObject->status];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,6 +195,72 @@ class IncidentPresenter extends BasePresenter implements Arrayable
|
||||
return trans('cachet.incidents.status.'.$this->wrappedObject->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the latest update.
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function latest_status()
|
||||
{
|
||||
if ($update = $this->latest()) {
|
||||
return $update->status;
|
||||
}
|
||||
|
||||
return $this->wrappedObject->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the latest update.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function latest_human_status()
|
||||
{
|
||||
if ($update = $this->latest()) {
|
||||
return trans('cachet.incidents.status.'.$update->status);
|
||||
}
|
||||
|
||||
return $this->human_status();
|
||||
}
|
||||
|
||||
/**
|
||||
* Present the latest icon.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function latest_icon()
|
||||
{
|
||||
if ($update = $this->latest()) {
|
||||
if (isset($this->icons[$update->status])) {
|
||||
return $this->icons[$update->status];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->icon();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the latest incident update.
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\IncidentUpdate|null
|
||||
*/
|
||||
public function latest()
|
||||
{
|
||||
if ($update = $this->wrappedObject->updates()->orderBy('created_at', 'desc')->first()) {
|
||||
return $update;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the incident permalink.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function permalink()
|
||||
{
|
||||
return route('incident', $this->wrappedObject->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the presenter instance to an array.
|
||||
*
|
||||
@@ -191,10 +269,15 @@ class IncidentPresenter extends BasePresenter implements Arrayable
|
||||
public function toArray()
|
||||
{
|
||||
return array_merge($this->wrappedObject->toArray(), [
|
||||
'human_status' => $this->human_status(),
|
||||
'scheduled_at' => $this->scheduled_at(),
|
||||
'created_at' => $this->created_at(),
|
||||
'updated_at' => $this->updated_at(),
|
||||
'human_status' => $this->human_status(),
|
||||
'latest_update_id' => $this->latest() ? $this->latest()->id : null,
|
||||
'latest_status' => $this->latest_status(),
|
||||
'latest_human_status' => $this->latest_human_status(),
|
||||
'latest_icon' => $this->latest_icon(),
|
||||
'permalink' => $this->permalink(),
|
||||
'scheduled_at' => $this->scheduled_at(),
|
||||
'created_at' => $this->created_at(),
|
||||
'updated_at' => $this->updated_at(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
162
app/Presenters/IncidentUpdatePresenter.php
Normal file
162
app/Presenters/IncidentUpdatePresenter.php
Normal file
@@ -0,0 +1,162 @@
|
||||
<?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\Presenters;
|
||||
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use CachetHQ\Cachet\Presenters\Traits\TimestampsTrait;
|
||||
use GrahamCampbell\Markdown\Facades\Markdown;
|
||||
use Illuminate\Contracts\Support\Arrayable;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use McCool\LaravelAutoPresenter\BasePresenter;
|
||||
|
||||
/**
|
||||
* This is the incident update presenter.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class IncidentUpdatePresenter extends BasePresenter implements Arrayable
|
||||
{
|
||||
use TimestampsTrait;
|
||||
|
||||
/**
|
||||
* Renders the message from Markdown into HTML.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function formattedMessage()
|
||||
{
|
||||
return Markdown::convertToHtml($this->wrappedObject->message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the raw text of the message, even without Markdown.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function raw_message()
|
||||
{
|
||||
return strip_tags($this->formattedMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* Present diff for humans date time.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function created_at_diff()
|
||||
{
|
||||
return app(DateFactory::class)->make($this->wrappedObject->created_at)->diffForHumans();
|
||||
}
|
||||
|
||||
/**
|
||||
* Present formatted date time.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function created_at_formatted()
|
||||
{
|
||||
return ucfirst(app(DateFactory::class)->make($this->wrappedObject->created_at)->format(Config::get('setting.incident_date_format', 'l jS F Y H:i:s')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats the created_at time ready to be used by bootstrap-datetimepicker.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function created_at_datetimepicker()
|
||||
{
|
||||
return app(DateFactory::class)->make($this->wrappedObject->created_at)->format('d/m/Y H:i');
|
||||
}
|
||||
|
||||
/**
|
||||
* Present formatted date time.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function created_at_iso()
|
||||
{
|
||||
return app(DateFactory::class)->make($this->wrappedObject->created_at)->toISO8601String();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a formatted timestamp for use within the timeline.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function timestamp_formatted()
|
||||
{
|
||||
if ($this->wrappedObject->is_scheduled) {
|
||||
return $this->scheduled_at_formatted;
|
||||
}
|
||||
|
||||
return $this->created_at_formatted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the iso timestamp for use within the timeline.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function timestamp_iso()
|
||||
{
|
||||
if ($this->wrappedObject->is_scheduled) {
|
||||
return $this->scheduled_at_iso;
|
||||
}
|
||||
|
||||
return $this->created_at_iso;
|
||||
}
|
||||
|
||||
/**
|
||||
* Present the status with an icon.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function icon()
|
||||
{
|
||||
switch ($this->wrappedObject->status) {
|
||||
case 1: // Investigating
|
||||
return 'icon ion-flag oranges';
|
||||
case 2: // Identified
|
||||
return 'icon ion-alert yellows';
|
||||
case 3: // Watching
|
||||
return 'icon ion-eye blues';
|
||||
case 4: // Fixed
|
||||
return 'icon ion-checkmark greens';
|
||||
default: // Something actually broke, this shouldn't happen.
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a human readable version of the status.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function human_status()
|
||||
{
|
||||
return trans('cachet.incidents.status.'.$this->wrappedObject->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the presenter instance to an array.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
return array_merge($this->wrappedObject->toArray(), [
|
||||
'human_status' => $this->human_status(),
|
||||
'created_at' => $this->created_at(),
|
||||
'updated_at' => $this->updated_at(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ $app->singleton('Illuminate\Contracts\Http\Kernel', 'CachetHQ\Cachet\Http\Kernel
|
||||
|
||||
$app->singleton('Illuminate\Contracts\Console\Kernel', 'CachetHQ\Cachet\Console\Kernel');
|
||||
|
||||
$app->singleton('Illuminate\Contracts\Debug\ExceptionHandler', 'GrahamCampbell\Exceptions\ExceptionHandler');
|
||||
$app->singleton('Illuminate\Contracts\Debug\ExceptionHandler', 'GrahamCampbell\Exceptions\NewExceptionHandler');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.5.9",
|
||||
"laravel/framework": "5.2.39",
|
||||
"php": ">=5.6.4",
|
||||
"laravel/framework": "~5.3.0",
|
||||
"alt-three/badger": "^3.1",
|
||||
"alt-three/bus": "^1.1",
|
||||
"alt-three/emoji": "^3.1",
|
||||
@@ -28,7 +28,7 @@
|
||||
"alt-three/validator": "^1.5",
|
||||
"aws/aws-sdk-php": "^3.7",
|
||||
"backup-manager/laravel": "^1.1",
|
||||
"barryvdh/laravel-cors": "^0.8",
|
||||
"barryvdh/laravel-cors": "^0.8.1",
|
||||
"doctrine/dbal": "^2.5",
|
||||
"fedeisas/laravel-mail-css-inliner": "^1.5",
|
||||
"fideloper/proxy": "^3.1",
|
||||
@@ -40,7 +40,7 @@
|
||||
"jenssegers/date": "^3.2",
|
||||
"mccool/laravel-auto-presenter": "^4.3",
|
||||
"pragmarx/google2fa": "^0.7.1",
|
||||
"rcrowe/twigbridge": "^0.9.2",
|
||||
"rcrowe/twigbridge": "^0.10",
|
||||
"roumen/feed": "^2.10.4"
|
||||
},
|
||||
"require-dev": {
|
||||
@@ -49,9 +49,9 @@
|
||||
"fzaninotto/faker": "^1.6",
|
||||
"graham-campbell/testbench-core": "^1.1",
|
||||
"mockery/mockery": "0.9.5",
|
||||
"phpunit/phpunit": "4.8.21",
|
||||
"symfony/css-selector": "^3.0",
|
||||
"symfony/dom-crawler": "^3.0"
|
||||
"phpunit/phpunit": "^5.2",
|
||||
"symfony/css-selector": "^3.1",
|
||||
"symfony/dom-crawler": "^3.1"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
@@ -92,13 +92,13 @@
|
||||
},
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "5.5.9"
|
||||
"php": "5.6.4"
|
||||
},
|
||||
"preferred-install": "dist"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.3-dev"
|
||||
"dev-develop": "3.0-dev"
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
|
||||
466
composer.lock
generated
466
composer.lock
generated
@@ -4,8 +4,8 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "ccd6111da387c617bd665375c696b486",
|
||||
"content-hash": "97beb5839c97f13a3fc0a55ef396524d",
|
||||
"hash": "59d3efdb1e49d5508a73a3ee84ecb741",
|
||||
"content-hash": "0ede4f4a11e39a6f3c9bec3a5478a91e",
|
||||
"packages": [
|
||||
{
|
||||
"name": "alt-three/badger",
|
||||
@@ -2019,16 +2019,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v5.2.39",
|
||||
"version": "5.3.x-dev",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "c2a77050269b4e03bd9a735a9f24e573a7598b8a"
|
||||
"reference": "81c4428924fd565bfaca3941402be29cd384f8d4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/c2a77050269b4e03bd9a735a9f24e573a7598b8a",
|
||||
"reference": "c2a77050269b4e03bd9a735a9f24e573a7598b8a",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/81c4428924fd565bfaca3941402be29cd384f8d4",
|
||||
"reference": "81c4428924fd565bfaca3941402be29cd384f8d4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2041,20 +2041,19 @@
|
||||
"monolog/monolog": "~1.11",
|
||||
"mtdowling/cron-expression": "~1.0",
|
||||
"nesbot/carbon": "~1.20",
|
||||
"paragonie/random_compat": "~1.4",
|
||||
"php": ">=5.5.9",
|
||||
"paragonie/random_compat": "~1.4|~2.0",
|
||||
"php": ">=5.6.4",
|
||||
"psy/psysh": "0.7.*",
|
||||
"swiftmailer/swiftmailer": "~5.1",
|
||||
"symfony/console": "2.8.*|3.0.*",
|
||||
"symfony/debug": "2.8.*|3.0.*",
|
||||
"symfony/finder": "2.8.*|3.0.*",
|
||||
"symfony/http-foundation": "2.8.*|3.0.*",
|
||||
"symfony/http-kernel": "2.8.*|3.0.*",
|
||||
"symfony/polyfill-php56": "~1.0",
|
||||
"symfony/process": "2.8.*|3.0.*",
|
||||
"symfony/routing": "2.8.*|3.0.*",
|
||||
"symfony/translation": "2.8.*|3.0.*",
|
||||
"symfony/var-dumper": "2.8.*|3.0.*",
|
||||
"symfony/console": "3.1.*",
|
||||
"symfony/debug": "3.1.*",
|
||||
"symfony/finder": "3.1.*",
|
||||
"symfony/http-foundation": "3.1.*",
|
||||
"symfony/http-kernel": "3.1.*",
|
||||
"symfony/process": "3.1.*",
|
||||
"symfony/routing": "3.1.*",
|
||||
"symfony/translation": "3.1.*",
|
||||
"symfony/var-dumper": "3.1.*",
|
||||
"vlucas/phpdotenv": "~2.2"
|
||||
},
|
||||
"replace": {
|
||||
@@ -2085,16 +2084,17 @@
|
||||
"illuminate/support": "self.version",
|
||||
"illuminate/translation": "self.version",
|
||||
"illuminate/validation": "self.version",
|
||||
"illuminate/view": "self.version"
|
||||
"illuminate/view": "self.version",
|
||||
"tightenco/collect": "self.version"
|
||||
},
|
||||
"require-dev": {
|
||||
"aws/aws-sdk-php": "~3.0",
|
||||
"mockery/mockery": "~0.9.4",
|
||||
"pda/pheanstalk": "~3.0",
|
||||
"phpunit/phpunit": "~4.1",
|
||||
"phpunit/phpunit": "~5.4",
|
||||
"predis/predis": "~1.0",
|
||||
"symfony/css-selector": "2.8.*|3.0.*",
|
||||
"symfony/dom-crawler": "2.8.*|3.0.*"
|
||||
"symfony/css-selector": "3.1.*",
|
||||
"symfony/dom-crawler": "3.1.*"
|
||||
},
|
||||
"suggest": {
|
||||
"aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (~3.0).",
|
||||
@@ -2106,20 +2106,17 @@
|
||||
"pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).",
|
||||
"predis/predis": "Required to use the redis cache and queue drivers (~1.0).",
|
||||
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).",
|
||||
"symfony/css-selector": "Required to use some of the crawler integration testing tools (2.8.*|3.0.*).",
|
||||
"symfony/dom-crawler": "Required to use most of the crawler integration testing tools (2.8.*|3.0.*).",
|
||||
"symfony/css-selector": "Required to use some of the crawler integration testing tools (3.1.*).",
|
||||
"symfony/dom-crawler": "Required to use most of the crawler integration testing tools (3.1.*).",
|
||||
"symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)."
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.2-dev"
|
||||
"dev-master": "5.3-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/Illuminate/Queue/IlluminateQueueClosure.php"
|
||||
],
|
||||
"files": [
|
||||
"src/Illuminate/Foundation/helpers.php",
|
||||
"src/Illuminate/Support/helpers.php"
|
||||
@@ -2144,7 +2141,7 @@
|
||||
"framework",
|
||||
"laravel"
|
||||
],
|
||||
"time": "2016-06-17 19:25:12"
|
||||
"time": "2016-07-29 13:52:53"
|
||||
},
|
||||
{
|
||||
"name": "league/commonmark",
|
||||
@@ -2637,16 +2634,16 @@
|
||||
},
|
||||
{
|
||||
"name": "paragonie/random_compat",
|
||||
"version": "v1.4.1",
|
||||
"version": "v2.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/paragonie/random_compat.git",
|
||||
"reference": "c7e26a21ba357863de030f0b9e701c7d04593774"
|
||||
"reference": "088c04e2f261c33bed6ca5245491cfca69195ccf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/c7e26a21ba357863de030f0b9e701c7d04593774",
|
||||
"reference": "c7e26a21ba357863de030f0b9e701c7d04593774",
|
||||
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/088c04e2f261c33bed6ca5245491cfca69195ccf",
|
||||
"reference": "088c04e2f261c33bed6ca5245491cfca69195ccf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2681,7 +2678,7 @@
|
||||
"pseudorandom",
|
||||
"random"
|
||||
],
|
||||
"time": "2016-03-18 20:34:03"
|
||||
"time": "2016-04-03 06:00:07"
|
||||
},
|
||||
{
|
||||
"name": "pragmarx/google2fa",
|
||||
@@ -2898,21 +2895,21 @@
|
||||
},
|
||||
{
|
||||
"name": "rcrowe/twigbridge",
|
||||
"version": "v0.9.2",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/rcrowe/TwigBridge.git",
|
||||
"reference": "78a4b7da75042660258a3269751c259eee81c34a"
|
||||
"reference": "6226d33331bbb1cdf64593a786f7efd1670200a7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/rcrowe/TwigBridge/zipball/78a4b7da75042660258a3269751c259eee81c34a",
|
||||
"reference": "78a4b7da75042660258a3269751c259eee81c34a",
|
||||
"url": "https://api.github.com/repos/rcrowe/TwigBridge/zipball/6226d33331bbb1cdf64593a786f7efd1670200a7",
|
||||
"reference": "6226d33331bbb1cdf64593a786f7efd1670200a7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/support": "5.0.*|5.1.*|5.2.*",
|
||||
"illuminate/view": "5.0.*|5.1.*|5.2.*",
|
||||
"illuminate/support": "5.0.*|5.1.*|5.2.*|5.3.*",
|
||||
"illuminate/view": "5.0.*|5.1.*|5.2.*|5.3.*",
|
||||
"php": ">=5.4.0",
|
||||
"twig/twig": "~1.15|~2.0"
|
||||
},
|
||||
@@ -2958,7 +2955,7 @@
|
||||
"laravel",
|
||||
"twig"
|
||||
],
|
||||
"time": "2016-02-22 07:48:48"
|
||||
"time": "2016-05-01 16:43:38"
|
||||
},
|
||||
{
|
||||
"name": "roumen/feed",
|
||||
@@ -3117,16 +3114,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "a7abb7153f6d1da47f87ec50274844e246b09d9f"
|
||||
"reference": "747154aa69b0f83cd02fc9aa554836dee417631a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/a7abb7153f6d1da47f87ec50274844e246b09d9f",
|
||||
"reference": "a7abb7153f6d1da47f87ec50274844e246b09d9f",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/747154aa69b0f83cd02fc9aa554836dee417631a",
|
||||
"reference": "747154aa69b0f83cd02fc9aa554836dee417631a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3146,7 +3143,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
"dev-master": "3.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3173,7 +3170,7 @@
|
||||
],
|
||||
"description": "Symfony Console Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 07:02:21"
|
||||
"time": "2016-06-29 07:02:31"
|
||||
},
|
||||
{
|
||||
"name": "symfony/css-selector",
|
||||
@@ -3230,16 +3227,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/debug",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/debug.git",
|
||||
"reference": "c54bc3539c3b87e86799533801e8ae0e971d78c2"
|
||||
"reference": "06e2d52e307ef880ac739f44ee6c2418ca9e3283"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/c54bc3539c3b87e86799533801e8ae0e971d78c2",
|
||||
"reference": "c54bc3539c3b87e86799533801e8ae0e971d78c2",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/06e2d52e307ef880ac739f44ee6c2418ca9e3283",
|
||||
"reference": "06e2d52e307ef880ac739f44ee6c2418ca9e3283",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3256,7 +3253,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
"dev-master": "3.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3283,7 +3280,7 @@
|
||||
],
|
||||
"description": "Symfony Debug Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 05:40:00"
|
||||
"time": "2016-06-29 05:41:56"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
@@ -3347,16 +3344,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/finder",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/finder.git",
|
||||
"reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9"
|
||||
"reference": "8201978de88a9fa0923e18601bb17f1df9c721e7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9",
|
||||
"reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/8201978de88a9fa0923e18601bb17f1df9c721e7",
|
||||
"reference": "8201978de88a9fa0923e18601bb17f1df9c721e7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3365,7 +3362,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
"dev-master": "3.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3392,20 +3389,20 @@
|
||||
],
|
||||
"description": "Symfony Finder Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 05:40:00"
|
||||
"time": "2016-06-29 05:41:56"
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-foundation",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/http-foundation.git",
|
||||
"reference": "1341139f906d295baa4f4abd55293d07e25a065a"
|
||||
"reference": "6b5a3764c5b0ce1f0ec3b8be5bba969122a78cfc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/1341139f906d295baa4f4abd55293d07e25a065a",
|
||||
"reference": "1341139f906d295baa4f4abd55293d07e25a065a",
|
||||
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/6b5a3764c5b0ce1f0ec3b8be5bba969122a78cfc",
|
||||
"reference": "6b5a3764c5b0ce1f0ec3b8be5bba969122a78cfc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3418,7 +3415,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
"dev-master": "3.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3445,20 +3442,20 @@
|
||||
],
|
||||
"description": "Symfony HttpFoundation Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 07:02:21"
|
||||
"time": "2016-06-29 07:02:31"
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-kernel",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/http-kernel.git",
|
||||
"reference": "177b63b2d50b63fa6d82ea41359ed9928cc7a1fb"
|
||||
"reference": "3a1ce1829128988826739bd9dd820f3238b92d65"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/177b63b2d50b63fa6d82ea41359ed9928cc7a1fb",
|
||||
"reference": "177b63b2d50b63fa6d82ea41359ed9928cc7a1fb",
|
||||
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/3a1ce1829128988826739bd9dd820f3238b92d65",
|
||||
"reference": "3a1ce1829128988826739bd9dd820f3238b92d65",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3500,7 +3497,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
"dev-master": "3.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3527,7 +3524,7 @@
|
||||
],
|
||||
"description": "Symfony HttpKernel Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-30 16:30:17"
|
||||
"time": "2016-06-30 17:16:01"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
@@ -3698,16 +3695,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "d7cde1f9d94d87060204f863779389b61c382eeb"
|
||||
"reference": "5c11a1a4d4016662eeaf0f8757958c7de069f9a0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/d7cde1f9d94d87060204f863779389b61c382eeb",
|
||||
"reference": "d7cde1f9d94d87060204f863779389b61c382eeb",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/5c11a1a4d4016662eeaf0f8757958c7de069f9a0",
|
||||
"reference": "5c11a1a4d4016662eeaf0f8757958c7de069f9a0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3716,7 +3713,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
"dev-master": "3.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3743,20 +3740,20 @@
|
||||
],
|
||||
"description": "Symfony Process Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 05:40:00"
|
||||
"time": "2016-06-29 05:42:25"
|
||||
},
|
||||
{
|
||||
"name": "symfony/routing",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/routing.git",
|
||||
"reference": "9038984bd9c05ab07280121e9e10f61a7231457b"
|
||||
"reference": "22c7adc204057a0ff0b12eea2889782a5deb70a3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/routing/zipball/9038984bd9c05ab07280121e9e10f61a7231457b",
|
||||
"reference": "9038984bd9c05ab07280121e9e10f61a7231457b",
|
||||
"url": "https://api.github.com/repos/symfony/routing/zipball/22c7adc204057a0ff0b12eea2889782a5deb70a3",
|
||||
"reference": "22c7adc204057a0ff0b12eea2889782a5deb70a3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3785,7 +3782,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
"dev-master": "3.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3818,20 +3815,20 @@
|
||||
"uri",
|
||||
"url"
|
||||
],
|
||||
"time": "2016-06-29 05:40:00"
|
||||
"time": "2016-06-29 05:41:56"
|
||||
},
|
||||
{
|
||||
"name": "symfony/translation",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/translation.git",
|
||||
"reference": "6bf844e1ee3c820c012386c10427a5c67bbefec8"
|
||||
"reference": "d63a94528530c3ea5ff46924c8001cec4a398609"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/6bf844e1ee3c820c012386c10427a5c67bbefec8",
|
||||
"reference": "6bf844e1ee3c820c012386c10427a5c67bbefec8",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/d63a94528530c3ea5ff46924c8001cec4a398609",
|
||||
"reference": "d63a94528530c3ea5ff46924c8001cec4a398609",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3855,7 +3852,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
"dev-master": "3.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3882,20 +3879,20 @@
|
||||
],
|
||||
"description": "Symfony Translation Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 05:40:00"
|
||||
"time": "2016-06-29 05:41:56"
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "2f046e9a9d571f22cc8b26783564876713b06579"
|
||||
"reference": "39492b8b8fe514163e677bf154fd80f6cc995759"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/2f046e9a9d571f22cc8b26783564876713b06579",
|
||||
"reference": "2f046e9a9d571f22cc8b26783564876713b06579",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/39492b8b8fe514163e677bf154fd80f6cc995759",
|
||||
"reference": "39492b8b8fe514163e677bf154fd80f6cc995759",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3911,7 +3908,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
"dev-master": "3.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3945,7 +3942,7 @@
|
||||
"debug",
|
||||
"dump"
|
||||
],
|
||||
"time": "2016-06-29 05:40:00"
|
||||
"time": "2016-06-29 05:41:56"
|
||||
},
|
||||
{
|
||||
"name": "tijsverkoyen/css-to-inline-styles",
|
||||
@@ -4502,6 +4499,48 @@
|
||||
],
|
||||
"time": "2016-05-22 21:52:33"
|
||||
},
|
||||
{
|
||||
"name": "myclabs/deep-copy",
|
||||
"version": "1.5.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/myclabs/DeepCopy.git",
|
||||
"reference": "a8773992b362b58498eed24bf85005f363c34771"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a8773992b362b58498eed24bf85005f363c34771",
|
||||
"reference": "a8773992b362b58498eed24bf85005f363c34771",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/collections": "1.*",
|
||||
"phpunit/phpunit": "~4.1"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"DeepCopy\\": "src/DeepCopy/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "Create deep copies (clones) of your objects",
|
||||
"homepage": "https://github.com/myclabs/DeepCopy",
|
||||
"keywords": [
|
||||
"clone",
|
||||
"copy",
|
||||
"duplicate",
|
||||
"object",
|
||||
"object graph"
|
||||
],
|
||||
"time": "2015-11-20 12:04:31"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/reflection-common",
|
||||
"version": "1.0",
|
||||
@@ -4712,39 +4751,40 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "2.2.4",
|
||||
"version": "4.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
|
||||
"reference": "5f3f7e736d6319d5f1fc402aff8b026da26709a3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
|
||||
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5f3f7e736d6319d5f1fc402aff8b026da26709a3",
|
||||
"reference": "5f3f7e736d6319d5f1fc402aff8b026da26709a3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"php": "^5.6 || ^7.0",
|
||||
"phpunit/php-file-iterator": "~1.3",
|
||||
"phpunit/php-text-template": "~1.2",
|
||||
"phpunit/php-token-stream": "~1.3",
|
||||
"sebastian/environment": "^1.3.2",
|
||||
"sebastian/version": "~1.0"
|
||||
"phpunit/php-token-stream": "^1.4.2",
|
||||
"sebastian/code-unit-reverse-lookup": "~1.0",
|
||||
"sebastian/environment": "^1.3.2 || ^2.0",
|
||||
"sebastian/version": "~1.0|~2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-xdebug": ">=2.1.4",
|
||||
"phpunit/phpunit": "~4"
|
||||
"phpunit/phpunit": "^5.4"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-dom": "*",
|
||||
"ext-xdebug": ">=2.2.1",
|
||||
"ext-xdebug": ">=2.4.0",
|
||||
"ext-xmlwriter": "*"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.2.x-dev"
|
||||
"dev-master": "4.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -4770,7 +4810,7 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2015-10-06 15:47:00"
|
||||
"time": "2016-07-26 14:39:29"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
@@ -4955,16 +4995,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "4.8.21",
|
||||
"version": "5.4.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "ea76b17bced0500a28098626b84eda12dbcf119c"
|
||||
"reference": "3132365e1430c091f208e120b8845d39c25f20e6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea76b17bced0500a28098626b84eda12dbcf119c",
|
||||
"reference": "ea76b17bced0500a28098626b84eda12dbcf119c",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3132365e1430c091f208e120b8845d39c25f20e6",
|
||||
"reference": "3132365e1430c091f208e120b8845d39c25f20e6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4973,21 +5013,27 @@
|
||||
"ext-pcre": "*",
|
||||
"ext-reflection": "*",
|
||||
"ext-spl": "*",
|
||||
"php": ">=5.3.3",
|
||||
"myclabs/deep-copy": "~1.3",
|
||||
"php": "^5.6 || ^7.0",
|
||||
"phpspec/prophecy": "^1.3.1",
|
||||
"phpunit/php-code-coverage": "~2.1",
|
||||
"phpunit/php-code-coverage": "^4.0.1",
|
||||
"phpunit/php-file-iterator": "~1.4",
|
||||
"phpunit/php-text-template": "~1.2",
|
||||
"phpunit/php-timer": ">=1.0.6",
|
||||
"phpunit/phpunit-mock-objects": "~2.3",
|
||||
"phpunit/php-timer": "^1.0.6",
|
||||
"phpunit/phpunit-mock-objects": "^3.2",
|
||||
"sebastian/comparator": "~1.1",
|
||||
"sebastian/diff": "~1.2",
|
||||
"sebastian/environment": "~1.3",
|
||||
"sebastian/environment": "^1.3 || ^2.0",
|
||||
"sebastian/exporter": "~1.2",
|
||||
"sebastian/global-state": "~1.0",
|
||||
"sebastian/version": "~1.0",
|
||||
"sebastian/object-enumerator": "~1.0",
|
||||
"sebastian/resource-operations": "~1.0",
|
||||
"sebastian/version": "~1.0|~2.0",
|
||||
"symfony/yaml": "~2.1|~3.0"
|
||||
},
|
||||
"conflict": {
|
||||
"phpdocumentor/reflection-docblock": "3.0.2"
|
||||
},
|
||||
"suggest": {
|
||||
"phpunit/php-invoker": "~1.1"
|
||||
},
|
||||
@@ -4997,7 +5043,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.8.x-dev"
|
||||
"dev-master": "5.4.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -5023,30 +5069,33 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2015-12-12 07:45:58"
|
||||
"time": "2016-07-26 14:48:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit-mock-objects",
|
||||
"version": "2.3.8",
|
||||
"version": "3.2.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
|
||||
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
|
||||
"reference": "b13d0d9426ced06958bd32104653526a6c998a52"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
|
||||
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b13d0d9426ced06958bd32104653526a6c998a52",
|
||||
"reference": "b13d0d9426ced06958bd32104653526a6c998a52",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/instantiator": "^1.0.2",
|
||||
"php": ">=5.3.3",
|
||||
"phpunit/php-text-template": "~1.2",
|
||||
"sebastian/exporter": "~1.2"
|
||||
"php": "^5.6 || ^7.0",
|
||||
"phpunit/php-text-template": "^1.2",
|
||||
"sebastian/exporter": "^1.2"
|
||||
},
|
||||
"conflict": {
|
||||
"phpunit/phpunit": "<5.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.4"
|
||||
"phpunit/phpunit": "^5.4"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-soap": "*"
|
||||
@@ -5054,7 +5103,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.3.x-dev"
|
||||
"dev-master": "3.2.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -5079,7 +5128,52 @@
|
||||
"mock",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2015-10-02 06:51:40"
|
||||
"time": "2016-06-12 07:37:26"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/code-unit-reverse-lookup",
|
||||
"version": "1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
|
||||
"reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe",
|
||||
"reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~5"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sebastian@phpunit.de"
|
||||
}
|
||||
],
|
||||
"description": "Looks up which function or method a line of code belongs to",
|
||||
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
|
||||
"time": "2016-02-13 06:45:14"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/comparator",
|
||||
@@ -5365,6 +5459,52 @@
|
||||
],
|
||||
"time": "2015-10-12 03:26:01"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/object-enumerator",
|
||||
"version": "1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
|
||||
"reference": "d4ca2fb70344987502567bc50081c03e6192fb26"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/d4ca2fb70344987502567bc50081c03e6192fb26",
|
||||
"reference": "d4ca2fb70344987502567bc50081c03e6192fb26",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6",
|
||||
"sebastian/recursion-context": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~5"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sebastian@phpunit.de"
|
||||
}
|
||||
],
|
||||
"description": "Traverses array structures and object graphs to enumerate all referenced objects",
|
||||
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
|
||||
"time": "2016-01-28 13:25:10"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/recursion-context",
|
||||
"version": "1.0.2",
|
||||
@@ -5419,20 +5559,70 @@
|
||||
"time": "2015-11-11 19:50:13"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/version",
|
||||
"version": "1.0.6",
|
||||
"name": "sebastian/resource-operations",
|
||||
"version": "1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/version.git",
|
||||
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
|
||||
"url": "https://github.com/sebastianbergmann/resource-operations.git",
|
||||
"reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
|
||||
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
|
||||
"reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sebastian@phpunit.de"
|
||||
}
|
||||
],
|
||||
"description": "Provides a list of PHP built-in functions that operate on resources",
|
||||
"homepage": "https://www.github.com/sebastianbergmann/resource-operations",
|
||||
"time": "2015-07-28 20:34:47"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/version",
|
||||
"version": "2.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/version.git",
|
||||
"reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5",
|
||||
"reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
@@ -5451,7 +5641,7 @@
|
||||
],
|
||||
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
|
||||
"homepage": "https://github.com/sebastianbergmann/version",
|
||||
"time": "2015-06-21 13:59:46"
|
||||
"time": "2016-02-04 12:56:52"
|
||||
},
|
||||
{
|
||||
"name": "symfony/dom-crawler",
|
||||
@@ -5614,10 +5804,10 @@
|
||||
"prefer-stable": true,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": ">=5.5.9"
|
||||
"php": ">=5.6.4"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"platform-overrides": {
|
||||
"php": "5.5.9"
|
||||
"php": "5.6.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
@@ -207,6 +208,7 @@ return [
|
||||
'Artisan' => 'Illuminate\Support\Facades\Artisan',
|
||||
'Auth' => 'Illuminate\Support\Facades\Auth',
|
||||
'Blade' => 'Illuminate\Support\Facades\Blade',
|
||||
'Broadcast' => 'Illuminate\Support\Facades\Broadcast',
|
||||
'Cache' => 'Illuminate\Support\Facades\Cache',
|
||||
'Config' => 'Illuminate\Support\Facades\Config',
|
||||
'Cookie' => 'Illuminate\Support\Facades\Cookie',
|
||||
|
||||
@@ -57,7 +57,15 @@ return [
|
||||
],
|
||||
|
||||
'memcached' => [
|
||||
'driver' => 'memcached',
|
||||
'driver' => 'memcached',
|
||||
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
|
||||
'sasl' => [
|
||||
env('MEMCACHED_USERNAME'),
|
||||
env('MEMCACHED_PASSWORD'),
|
||||
],
|
||||
'options' => [
|
||||
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
|
||||
],
|
||||
'servers' => [
|
||||
[
|
||||
'host' => '127.0.0.1',
|
||||
|
||||
@@ -71,7 +71,7 @@ return [
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8_unicode_ci',
|
||||
'prefix' => env('DB_PREFIX', null),
|
||||
'strict' => false,
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
],
|
||||
|
||||
@@ -85,6 +85,7 @@ return [
|
||||
'charset' => 'utf8',
|
||||
'prefix' => env('DB_PREFIX', null),
|
||||
'schema' => env('DB_SCHEMA', 'public'),
|
||||
'sslmode' => 'prefer',
|
||||
],
|
||||
|
||||
'sqlsrv' => [
|
||||
|
||||
@@ -94,6 +94,19 @@ return [
|
||||
|
||||
'table' => 'sessions',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "apc" or "memcached" session drivers, you may specify a
|
||||
| cache store that should be used for these sessions. This value must
|
||||
| correspond with one of the application's configured cache stores.
|
||||
|
|
||||
*/
|
||||
|
||||
'store' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Sweeping Lottery
|
||||
|
||||
@@ -56,4 +56,36 @@ return [
|
||||
|
||||
'show_support' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable External Dependencies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Whether to disable third-party dependencies.
|
||||
|
|
||||
*/
|
||||
|
||||
'enable_external_dependencies' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Show the timezone
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Whether to show the status page timezone in the footer.
|
||||
|
|
||||
*/
|
||||
|
||||
'show_timezone' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Skip subscriber verifications
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Whether to allow skipping of subscriber verifications.
|
||||
|
|
||||
*/
|
||||
|
||||
'skip_subscriber_verification' => false,
|
||||
];
|
||||
|
||||
@@ -11,14 +11,18 @@
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\ComponentTag;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use CachetHQ\Cachet\Models\Subscription;
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$factory->define(Component::class, function ($faker) {
|
||||
return [
|
||||
@@ -38,6 +42,13 @@ $factory->define(ComponentGroup::class, function ($faker) {
|
||||
];
|
||||
});
|
||||
|
||||
$factory->define(ComponentTag::class, function ($faker) {
|
||||
return [
|
||||
'component_id' => factory(Component::class)->create()->id,
|
||||
'tag_id' => factory(Tag::class)->create()->id,
|
||||
];
|
||||
});
|
||||
|
||||
$factory->define(Incident::class, function ($faker) {
|
||||
return [
|
||||
'name' => $faker->sentence(),
|
||||
@@ -55,6 +66,15 @@ $factory->define(IncidentTemplate::class, function ($faker) {
|
||||
];
|
||||
});
|
||||
|
||||
$factory->define(IncidentUpdate::class, function ($faker) {
|
||||
return [
|
||||
'incident_id' => factory(Incident::class)->create()->id,
|
||||
'message' => $faker->paragraph(),
|
||||
'status' => random_int(1, 4),
|
||||
'user_id' => factory(User::class)->create()->id,
|
||||
];
|
||||
});
|
||||
|
||||
$factory->define(Metric::class, function ($faker) {
|
||||
return [
|
||||
'name' => $faker->sentence(),
|
||||
@@ -91,6 +111,15 @@ $factory->define(Subscription::class, function ($faker) {
|
||||
];
|
||||
});
|
||||
|
||||
$factory->define(Tag::class, function ($faker) {
|
||||
$name = $faker->sentence();
|
||||
|
||||
return [
|
||||
'name' => $name,
|
||||
'slug' => Str::slug($name),
|
||||
];
|
||||
});
|
||||
|
||||
$factory->define(User::class, function ($faker) {
|
||||
return [
|
||||
'username' => $faker->userName,
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateIncidentUpdatesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('incident_updates', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('incident_id')->unsigned();
|
||||
$table->integer('status');
|
||||
$table->longText('message');
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('incident_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('incident_updates');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameComponentTagTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::rename('component_tag', 'component_tags');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::rename('component_tags', 'component_tag');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?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\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterTableComponentTagsAddTimestamps extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('component_tags', function (Blueprint $table) {
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('component_tags', function (Blueprint $table) {
|
||||
$table->dropTimestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
var elixir = require('laravel-elixir');
|
||||
|
||||
elixir.config.production = true;
|
||||
elixir.config.sourcemaps = false;
|
||||
|
||||
elixir(function (mix) {
|
||||
mix
|
||||
.sass('app.scss', 'public/dist/css/app.css')
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
</filter>
|
||||
<php>
|
||||
<env name="APP_ENV" value="testing"/>
|
||||
<env name="APP_DEBUG" value="true"/>
|
||||
<env name="APP_URL" value="http://localhost"/>
|
||||
<env name="APP_KEY" value="GCvcgDKMRIN498g52zfVEd9CxDs6PR7q"/>
|
||||
<env name="DB_DRIVER" value="sqlite"/>
|
||||
|
||||
@@ -277,6 +277,24 @@ $(function() {
|
||||
$this.next('.group-items').toggleClass('hide');
|
||||
});
|
||||
|
||||
$('.select-group').on('click', function () {
|
||||
var $parentGroup = $(this).closest('ul.list-group');
|
||||
$parentGroup.find('input[type=checkbox]').prop('checked', true);
|
||||
$parentGroup.find('.group-items').removeClass('hide')
|
||||
$parentGroup.find('.group-toggle').addClass('ion-ios-minus-outline').removeClass('ion-ios-plus-outline');
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.deselect-group').on('click', function () {
|
||||
var $parentGroup = $(this).closest('ul.list-group');
|
||||
$parentGroup.find('input[type=checkbox]').prop('checked', false);
|
||||
$parentGroup.find('.group-items').addClass('hide');
|
||||
$parentGroup.find('.group-toggle').removeClass('ion-ios-minus-outline').addClass('ion-ios-plus-outline');
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
// Setup wizard
|
||||
$('.wizard-next').on('click', function () {
|
||||
var $form = $('#setup-form'),
|
||||
|
||||
8
resources/assets/sass/_status-page.scss
vendored
8
resources/assets/sass/_status-page.scss
vendored
@@ -276,6 +276,14 @@ body.status-page {
|
||||
line-height: 1.3em;
|
||||
}
|
||||
|
||||
i.icon {
|
||||
font-size: 21px;
|
||||
line-height: 24px;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
min-width: 20px;
|
||||
}
|
||||
|
||||
&.group-name {
|
||||
background-color: $cachet_gray_light;
|
||||
padding: {
|
||||
|
||||
1
resources/assets/sass/app.scss
vendored
1
resources/assets/sass/app.scss
vendored
@@ -29,6 +29,7 @@ body {
|
||||
@import "modules/panels";
|
||||
@import "modules/btns";
|
||||
@import "modules/pager";
|
||||
@import "modules/markdown";
|
||||
|
||||
// Styles for partials
|
||||
@import "partials/base";
|
||||
|
||||
37
resources/assets/sass/modules/_markdown.scss
vendored
Normal file
37
resources/assets/sass/modules/_markdown.scss
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
.markdown-body {
|
||||
p {
|
||||
font-size: 1.1em !important;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: $cachet-base-dark;
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ $tooltip-bg: #333 !default;
|
||||
$tooltip-opacity: .9 !default;
|
||||
$base-background-color: #f1f1f1;
|
||||
|
||||
$base-font-family: "Open Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
|
||||
$base-font-family: -apple-system, BlinkMacSystemFont, "Open Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
|
||||
$base-font-weight: 400;
|
||||
$base-letter-spacing: 0.08em;
|
||||
$base-font-size: 15px;
|
||||
|
||||
@@ -136,6 +136,7 @@ return [
|
||||
'home' => 'Home',
|
||||
'description' => 'Stay up to date with the latest service updates from :app.',
|
||||
'powered_by' => 'Powered by <a href="https://cachethq.io" class="links">Cachet</a>.',
|
||||
'timezone' => 'Times are shown in :timezone.',
|
||||
'about_this_site' => 'About This Site',
|
||||
'rss-feed' => 'RSS',
|
||||
'atom-feed' => 'Atom',
|
||||
|
||||
@@ -20,6 +20,7 @@ return [
|
||||
'logged' => '{0} There are no incidents, good work.|You have logged one incident.|You have reported <strong>:count</strong> incidents.',
|
||||
'incident-create-template' => 'Create Template',
|
||||
'incident-templates' => 'Incident Templates',
|
||||
'updates' => '{0} Zero Updates|One Update|:count Updates',
|
||||
'add' => [
|
||||
'title' => 'Report an incident',
|
||||
'success' => 'Incident added.',
|
||||
@@ -34,6 +35,10 @@ return [
|
||||
'success' => 'The incident has been deleted and will not show on your status page.',
|
||||
'failure' => 'The incident could not be deleted, please try again.',
|
||||
],
|
||||
'update' => [
|
||||
'title' => 'Create new incident update',
|
||||
'subtitle' => 'Add an update to <strong>:incident</strong>',
|
||||
],
|
||||
|
||||
// Incident templates
|
||||
'templates' => [
|
||||
|
||||
@@ -104,17 +104,20 @@ return [
|
||||
|
||||
// Settings
|
||||
'settings' => [
|
||||
/// Application setup
|
||||
// Application setup
|
||||
'app-setup' => [
|
||||
'site-name' => 'Site Name',
|
||||
'site-url' => 'Site URL',
|
||||
'display-graphs' => 'Display graphs on status page?',
|
||||
'about-this-page' => 'About this page',
|
||||
'days-of-incidents' => 'How many days of incidents to show?',
|
||||
'banner' => 'Banner Image',
|
||||
'banner-help' => "It's recommended that you upload files no bigger than 930px wide .",
|
||||
'subscribers' => 'Allow people to signup to email notifications?',
|
||||
'automatic_localization' => 'Automatically localise your status page to your visitor\'s language?',
|
||||
'site-name' => 'Site Name',
|
||||
'site-url' => 'Site URL',
|
||||
'display-graphs' => 'Display graphs on status page?',
|
||||
'about-this-page' => 'About this page',
|
||||
'days-of-incidents' => 'How many days of incidents to show?',
|
||||
'banner' => 'Banner Image',
|
||||
'banner-help' => "It's recommended that you upload files no bigger than 930px wide .",
|
||||
'subscribers' => 'Allow people to signup to email notifications?',
|
||||
'skip_subscriber_verification' => 'Skip verifying of users? (Be warned, you could be spammed)',
|
||||
'automatic_localization' => 'Automatically localise your status page to your visitor\'s language?',
|
||||
'enable_external_dependencies' => 'Enable Third Party Dependencies (Google Fonts, Trackers, etc...)',
|
||||
'show_timezone' => 'Show the timezone the status page is running in.',
|
||||
],
|
||||
'analytics' => [
|
||||
'analytics_google' => 'Google Analytics code',
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user