Compare commits

..

764 Commits

Author SHA1 Message Date
James Brooks
d5d92f5a3d Update original incident with new update status 2016-08-04 20:28:06 +01:00
Graham Campbell
247c1565a4 Merge branch 'master' into develop 2016-07-29 13:26:02 -04:00
Graham Campbell
8f5afff4a2 Merge branch '2.4' 2016-07-29 13:14:33 -04:00
Graham Campbell
b045028c7b Merge pull request #2004 from CachetHQ/existence
Improved the bus test coverage
2016-07-29 13:12:29 -04:00
Graham Campbell
16189da222 Finished off tests 2016-07-29 13:05:30 -04:00
Graham Campbell
7596966e6c Added missing listener definitions 2016-07-29 13:05:18 -04:00
James Brooks
dcea947973 Fix metric point tests 2016-07-29 12:54:20 -04:00
James Brooks
d8ea3c59e3 Added update subscriber subscription command test 2016-07-29 12:54:20 -04:00
James Brooks
a2f8f4540e Added missing event tests 2016-07-29 12:54:20 -04:00
Graham Campbell
4031c42958 Added test existence tests 2016-07-29 12:54:20 -04:00
Graham Campbell
8348f48692 Merge branch '2.3' into 2.4 2016-07-29 12:51:23 -04:00
Graham Campbell
6c22c52e3a Updated the aws sdk 2016-07-29 12:51:06 -04:00
James Brooks
faf91470aa Remove elixir config 2016-07-29 12:05:50 -04:00
James Brooks
58039634bd Merge branch '2.3' into 2.4 2016-07-29 12:05:19 -04:00
James Brooks
ecfa9b1f01 Built in production 2016-07-29 12:04:57 -04:00
James Brooks
915ea0d0bd Merge branch '2.3' into 2.4 2016-07-29 11:45:45 -04:00
James Brooks
380048dd53 Updated Chart.js and rebuilt assets 2016-07-29 11:42:08 -04:00
Graham Campbell
ac57936b62 Merge pull request #2015 from CachetHQ/metrics-y-step-size
Set the step size to the metrics places
2016-07-28 15:39:58 -04:00
James Brooks
962b008fb2 Updated deps 2016-07-28 15:19:58 -04:00
James Brooks
5b1dd8ad00 Set the step size to the metrics places. Fixes #2012 2016-07-28 15:17:20 -04:00
James Brooks
c1d8203602 Added missing setup translations. Closes #2010 2016-07-28 15:06:16 -04:00
James Brooks
dc73f62803 Fixes issues with updating using dashboard api. Closes #2014 2016-07-28 10:47:59 -04:00
Graham Campbell
a019d82010 Merge branch '2.4' 2016-07-25 23:03:58 +01:00
Graham Campbell
0f029702d4 Merge branch '2.3' into 2.4 2016-07-25 23:02:12 +01:00
Graham Campbell
fdbde63143 Back to dev 2016-07-25 22:58:23 +01:00
Graham Campbell
9a9ec833eb Released 2.3.7 2016-07-25 22:57:05 +01:00
James Brooks
136cce2d6d Merge pull request #2008 from CachetHQ/analysis-XZnLDb
Applied fixes from StyleCI

[ci skip] [skip ci]
2016-07-25 21:52:31 +01:00
Graham Campbell
880a2d9cd9 Applied fixes from StyleCI
[ci skip] [skip ci]
2016-07-25 16:52:26 -04:00
James Brooks
71b5d446ba Merge branch '2.3' into 2.4 2016-07-25 21:44:07 +01:00
James Brooks
aea18a51c2 Sync languages 2016-07-25 21:42:49 +01:00
Graham Campbell
84bedf5c60 Merge pull request #2007 from CachetHQ/revert-1976-cli
Revert "Don't use settings caching in cli"
2016-07-25 19:32:16 +01:00
Graham Campbell
309a3f96ef Revert "Don't use settings caching in cli" 2016-07-25 19:25:05 +01:00
James Brooks
6246f20506 Set debug to true in tests 2016-07-25 08:09:53 +01:00
Graham Campbell
9dcc5d6896 Merge branch '2.3' into 2.4 2016-07-24 15:06:52 +01:00
Graham Campbell
acd1ac496d Merge pull request #2003 from CachetHQ/analysis
Run the new static analysis checks in the tests
2016-07-24 14:58:03 +01:00
Graham Campbell
8c273b8579 Run the new static analysis checks in the tests 2016-07-24 14:48:59 +01:00
Graham Campbell
b30a774bed Merge pull request #2002 from CachetHQ/imports
Added missing imports
2016-07-24 14:48:03 +01:00
Graham Campbell
3ea1428c23 Added missing imports 2016-07-24 14:47:02 +01:00
James Brooks
d6ab5efd14 Fixes #1998 2016-07-22 11:08:49 +01:00
James Brooks
235e3281b0 Merge branch '2.3' into 2.4 2016-07-22 09:20:58 +01:00
James Brooks
a94be2efca Update deps 2016-07-22 09:19:58 +01:00
James Brooks
04b96e7dec Merge pull request #1995 from CachetHQ/standardise-team-member-commands
Standardise the team member commands
2016-07-22 09:15:48 +01:00
James Brooks
e15af44449 Standardise the team member commands. Closes #1881 2016-07-21 11:49:05 +01:00
Joe Cohen
ef9f7d23a0 Merge pull request #1993 from CachetHQ/skip-subscriber-verification
Added option to skip subscriber verification
2016-07-20 14:50:29 -05:00
Graham Campbell
ef694b027a Removed old variable 2016-07-20 19:58:58 +01:00
Graham Campbell
f53e466500 Applied fixes from StyleCI
[ci skip] [skip ci]
2016-07-20 14:56:55 -04:00
Graham Campbell
1e24138d7a Removed extra brackets 2016-07-20 19:54:48 +01:00
Graham Campbell
9120dba237 Fixed verification skipping 2016-07-20 19:52:23 +01:00
James Brooks
7f261a218a Added option to skip subscriber verification. Closes #1990 2016-07-20 16:00:27 +01:00
Graham Campbell
5b5db06ce3 Updated composer.lock hashes 2016-07-18 19:44:19 +01:00
Graham Campbell
b6635d30ee Merge branch '2.4' 2016-07-18 19:39:25 +01:00
Graham Campbell
5ae23b64d2 Bumped version 2016-07-18 19:39:18 +01:00
Graham Campbell
0d90f0459b Merge branch '2.3' into 2.4 2016-07-18 19:38:10 +01:00
Graham Campbell
f8505a866d Back to dev 2016-07-18 19:34:29 +01:00
Graham Campbell
27235abab2 Released 2.3.6 2016-07-18 19:34:06 +01:00
Graham Campbell
f70bc7a42f Merge pull request #1986 from CachetHQ/deps
Updated dependencies
2016-07-18 18:51:37 +01:00
Graham Campbell
6cf622ae21 Updated dependencies 2016-07-18 18:46:43 +01:00
James Brooks
bcbbee22d9 Merge pull request #1983 from peelman/improve-manage-subscriptions
group components on manage subscriptions page
2016-07-18 15:00:21 +01:00
Nick Peelman
9750191bff proper indents for @includes 2016-07-18 09:51:23 -04:00
Nick Peelman
52c4901a78 left align @include tags 2016-07-18 09:39:09 -04:00
Nick Peelman
587555c2d4 Adding a newline... 2016-07-18 09:12:42 -04:00
Nick Peelman
b4c7fb2ab0 adding a period... 2016-07-18 09:12:00 -04:00
Nick Peelman
e61d24f685 Fixing indentation problems... 2016-07-18 09:08:48 -04:00
Nick Peelman
88e85d2dfb group components on manage subscriptions page 2016-07-18 08:49:38 -04:00
James Brooks
5b72f2febc Merge '2.3' 2016-07-17 16:42:27 +01:00
James Brooks
dd1a14a438 Back to dev 2016-07-17 16:38:52 +01:00
James Brooks
387818dbb2 Bump version 2016-07-17 16:38:24 +01:00
James Brooks
5d70d244ce Update feed package. Fixes #1973 2016-07-17 16:37:55 +01:00
James Brooks
ddc846d959 Back to dev 2016-07-16 09:54:54 +01:00
James Brooks
6fb6641499 Bump version 2016-07-16 09:54:28 +01:00
James Brooks
d5eb087eca Merge pull request #1976 from CachetHQ/cli
Don't use settings caching in cli
2016-07-15 07:48:26 +01:00
Graham Campbell
fd25edb2f0 Don't use settings caching in cli 2016-07-14 21:31:07 -07:00
Graham Campbell
7583fedaec Updated laravel 2016-07-14 11:25:50 -07:00
Graham Campbell
eecd78496c Merge branch 'master' into develop 2016-07-14 11:25:16 -07:00
Graham Campbell
4703aeadb2 Merge branch '2.3' 2016-07-14 11:23:45 -07:00
Graham Campbell
5879a2cb1a Updated the exceptions package 2016-07-14 11:11:21 -07:00
Graham Campbell
48dc39122f Merge branch 'master' into develop 2016-07-13 19:07:01 -07:00
Graham Campbell
3aacfb7849 Fixed the route service provider 2016-07-13 19:06:49 -07:00
Graham Campbell
ef304950bb Updated the tests 2016-07-13 19:04:58 -07:00
Graham Campbell
2101b829bb Merge branch 'master' into develop 2016-07-13 18:41:58 -07:00
Graham Campbell
ad8f098ec1 Merge branch '2.3' 2016-07-13 18:28:48 -07:00
Graham Campbell
df5b9b89e6 Updated dependencies 2016-07-13 18:25:27 -07:00
James Brooks
2551a1a038 Updated deps 2016-07-13 19:24:57 +01:00
James Brooks
3874b533be Fix Feed import 2016-07-13 14:41:59 +01:00
James Brooks
85c0e94408 Fix import 2016-07-13 14:39:39 +01:00
James Brooks
1793f5588a Added missing import 2016-07-13 14:39:13 +01:00
James Brooks
46ff13c7fb Merge pull request #1972 from CachetHQ/analysis-qyrNE2
Applied fixes from StyleCI

[ci skip] [skip ci]
2016-07-13 14:38:51 +01:00
James Brooks
da8c8fae74 Applied fixes from StyleCI
[ci skip] [skip ci]
2016-07-13 09:38:47 -04:00
James Brooks
ff9eb123c6 Don't use the Config facade in any composers 2016-07-13 14:38:36 +01:00
James Brooks
895d1ea1b6 Don't use the Config facade in the TimezoneLocaleComposer 2016-07-13 14:35:49 +01:00
James Brooks
503252c3a2 Tidy up integrations, use contracts 2016-07-13 14:33:20 +01:00
James Brooks
ec0f0768f0 Added missing typehints 2016-07-13 14:24:02 +01:00
James Brooks
68cc6eb93c Merge pull request #1968 from CachetHQ/system-status-api
Implement the system status api endpoint
2016-07-13 14:22:29 +01:00
James Brooks
fdfebc18fb Implement the system status api endpoint. Closes #1936 2016-07-13 14:21:57 +01:00
James Brooks
0cd3ea0e92 Merge branch '2.3' 2016-07-13 14:21:00 +01:00
James Brooks
47a5569f02 Improve how we work out system status with scheduled maintenance 2016-07-13 14:19:35 +01:00
James Brooks
ca4a72c518 Merge pull request #1960 from PeterDaveHello/bump-node-dependencies
bump nodejs package dependencies
2016-07-13 13:57:49 +01:00
Peter Dave Hello
6e45b5ae88 bump nodejs package dependencies 2016-07-13 20:57:16 +08:00
James Brooks
0f10522e9c Merge pull request #1957 from CachetHQ/apple-system-font
Update the font-stack to be -apple-system font
2016-07-12 22:41:07 +01:00
James Brooks
3913ab65ac Merge pull request #1962 from CachetHQ/user-management-api
Added Team Member API
2016-07-12 18:00:48 +01:00
James Brooks
2048e0899c Added Team Member API. Closes #1822 2016-07-12 17:59:50 +01:00
James Brooks
83e1013771 Merge branch '2.3' 2016-07-12 09:37:11 +01:00
James Brooks
99dbc2cd6c Merge pull request #1959 from PeterDaveHello/fix-file-permission
remove executable permission from the files don't need it
2016-07-12 09:31:22 +01:00
James Brooks
7d4bab478f Merge branch '2.3' 2016-07-12 09:29:47 +01:00
Peter Dave Hello
2f2ed53b58 remove executable permission from the files don't need it 2016-07-12 16:28:28 +08:00
James Brooks
7e1ead91ed Merge pull request #1958 from PeterDaveHello/image-optimize
optimize png images using zopflipng
2016-07-12 09:23:02 +01:00
Peter Dave Hello
28578474b9 optimize png images using zopflipng 2016-07-12 16:20:14 +08:00
James Brooks
18d7af2b35 Update the font-stack to be apple-system-font 2016-07-12 09:18:07 +01:00
James Brooks
e3cfb47d66 Merge branch '2.3' 2016-07-12 09:16:07 +01:00
James Brooks
d4e332bf55 Merge pull request #1956 from PeterDaveHello/patch-1
Update README.md
2016-07-12 09:15:37 +01:00
Peter Dave Hello
13f0f67a7b Update README.md
Use svg instead of png to get localized percentage badge for better image quality.
2016-07-12 16:14:54 +08:00
James Brooks
716d357738 Resize the footer elements 2016-07-12 09:14:27 +01:00
James Brooks
cee336fd7c Merge pull request #1955 from CachetHQ/system-timezones
System Timezones
2016-07-12 09:10:23 +01:00
James Brooks
b3497820f9 Merge pull request #1954 from CachetHQ/analysis-8jlaNr
Applied fixes from StyleCI

[ci skip] [skip ci]
2016-07-11 21:44:19 +01:00
James Brooks
67152806d7 Applied fixes from StyleCI
[ci skip] [skip ci]
2016-07-11 16:44:15 -04:00
James Brooks
5298ad241a Show the timezone in the footer. 2016-07-11 21:43:59 +01:00
James Brooks
709cac9332 Merge pull request #1953 from CachetHQ/fix-setup
fix setup env writing
2016-07-11 19:03:48 +01:00
Joseph Cohen
e17196d4c9 fix setup env writing 2016-07-11 13:00:00 -05:00
James Brooks
e2da8ee1fa Merge pull request #1952 from CachetHQ/disable-external-dependencies
Option to disable external dependencies
2016-07-11 10:12:27 +01:00
James Brooks
b6c22c1029 Option to disable external dependencies. Closes #1929 2016-07-11 10:11:44 +01:00
James Brooks
5c54830b0f Merged 2.3 2016-07-11 09:56:11 +01:00
James Brooks
80be140c1f Update ISSUE_TEMPLATE 2016-07-11 09:50:33 +01:00
James Brooks
4f9af8bca0 Remove blank line 2016-07-10 17:04:08 +01:00
James Brooks
af3b7836ff Back to dev 2016-07-10 10:39:42 +01:00
James Brooks
cc4a960ea6 Release v2.3.3 2016-07-10 10:39:19 +01:00
James Brooks
467d29ca11 Use numeric validation for metric points. Fixes #1950 2016-07-10 10:37:00 +01:00
James Brooks
ac1355771c Merge pull request #1947 from CachetHQ/set-locale
Set Date locale
2016-07-08 19:43:04 +01:00
James Brooks
c41adc1019 Override date locale again. Fixes #1727 2016-07-08 19:42:20 +01:00
James Brooks
5b74b2d625 Merge pull request #1949 from CachetHQ/dashboard-api-bus
The dashboard API needs to use the Command Bus
2016-07-08 18:39:38 +01:00
James Brooks
d7835f68ed Merge pull request #1948 from CachetHQ/analysis-zO37Lk
Applied fixes from StyleCI

[ci skip] [skip ci]
2016-07-08 17:42:17 +01:00
James Brooks
a1f1a2b969 Applied fixes from StyleCI
[ci skip] [skip ci]
2016-07-08 12:42:13 -04:00
James Brooks
77394995e4 The dashboard API needs to use the Command Bus. Fixes #1927 2016-07-08 17:42:01 +01:00
James Brooks
9953557497 Back to dev 2016-07-06 21:54:50 +01:00
James Brooks
4dc175b2be Correct dev version 2016-07-06 21:53:15 +01:00
James Brooks
4a2fe00c89 Bump version 2016-07-06 21:52:32 +01:00
James Brooks
db55283b85 Merge pull request #1940 from CachetHQ/analysis-86V7RW
Applied fixes from StyleCI

[ci skip] [skip ci]
2016-07-06 19:14:04 +01:00
James Brooks
5c6440e890 Sync languages 2016-07-06 19:14:21 +01:00
James Brooks
6b299b0a90 Applied fixes from StyleCI
[ci skip] [skip ci]
2016-07-06 14:14:00 -04:00
James Brooks
9b5d4aa7c4 Merge pull request #1939 from CachetHQ/metric-repository-prefix
Metric repository now knows prefixes
2016-07-06 19:03:42 +01:00
James Brooks
1fdda03199 Metric repository now knows prefixes. Fixes #1938 2016-07-06 18:42:31 +01:00
James Brooks
7c846d06ff Updated deps 2016-07-06 18:32:04 +01:00
James Brooks
e34e4381d4 Update VERSION 2016-07-06 18:24:58 +01:00
Graham Campbell
b255f71958 Merge pull request #1934 from odannyc/patch-1
Misspelled 'email'
2016-07-02 10:59:51 +01:00
Danny Carrillo
9560b2a0dc Misspelled 'email' 2016-07-01 13:55:28 -07:00
James Brooks
1a6c22a8a9 Write the readme gooder 2016-06-30 08:48:30 +01:00
James Brooks
f8491ceead Back to dev 2016-06-27 22:10:37 +01:00
James Brooks
823fe6e9e2 Bump version 2016-06-27 22:10:13 +01:00
James Brooks
b7e9c07a05 Merge pull request #1924 from CachetHQ/analysis-zDyveB
Applied fixes from StyleCI

[ci skip] [skip ci]
2016-06-27 21:18:57 +01:00
James Brooks
a9d83e1337 Applied fixes from StyleCI
[ci skip] [skip ci]
2016-06-27 16:18:52 -04:00
James Brooks
86cfcb501a Added /admin route redirect to /dashboard 2016-06-27 21:18:44 +01:00
James Brooks
8f68b2a347 Re-compiled assets 2016-06-27 18:39:31 +01:00
Graham Campbell
690290449e Merge branch 'master' into develop 2016-06-27 15:52:51 +01:00
Graham Campbell
cb5badefcc Merge branch '2.3' 2016-06-27 15:50:43 +01:00
Graham Campbell
1423a9bbd0 Updated dependencies 2016-06-27 15:48:35 +01:00
James Brooks
39d302175c Merge pull request #1919 from travelton/group-dashboard-components
Component Grouping in Dashboard
2016-06-27 15:41:01 +01:00
Travis Swientek
fffb4d964c Component Grouping in Dashboard, Spelling Adjustment. 2016-06-27 09:05:34 -05:00
James Brooks
7ba12960dd Added missing events to EventServiceProvider 2016-06-27 12:22:18 +01:00
James Brooks
440f45ed4a Merge pull request #1920 from juniorb2ss/2.3
Fix language name.
2016-06-24 17:42:11 +01:00
Carlos Eduardo
549eaa3382 Fix language name.
Correct name of slugs portuguese.
2016-06-24 12:27:10 -03:00
James Brooks
5305f71c2b Updated deps 2016-06-20 13:49:55 +01:00
James Brooks
bf749c54ee Move helpers.php out of Http namespace 2016-06-17 09:16:23 +01:00
James Brooks
f1e2c1ef68 Merge pull request #1911 from CachetHQ/fix-lastpass
Help password managers
2016-06-15 08:54:50 +01:00
James Brooks
4ab9807cbe Help password managers. Fixes #1910 2016-06-15 08:54:13 +01:00
James Brooks
9f9c9a10c5 Merge pull request #1886 from CachetHQ/wizard-smtp
Wizard email configuration
2016-06-13 20:06:51 +01:00
Joseph Cohen
a5ed3c40a9 Fix write env to work with nulls and change from to address 2016-06-13 20:06:40 +01:00
James Brooks
1fe4789760 Fix spacing 2016-06-13 20:06:39 +01:00
James Brooks
9c1e94c550 Put mail log to bottom 2016-06-13 20:06:39 +01:00
Joseph Cohen
958c9eadc7 Add mail data to wizard 2016-06-13 20:06:39 +01:00
Joseph Cohen
ca3f516457 Add mail driver to the wizard 2016-06-13 20:06:28 +01:00
Graham Campbell
e326381604 Merge branch 'master' into develop
# Conflicts:
#	composer.json
#	composer.lock
2016-06-11 00:55:48 +01:00
Graham Campbell
c25437871a Merge branch '2.3'
# Conflicts:
#	composer.lock
2016-06-11 00:49:49 +01:00
Graham Campbell
04215fc37a Back to dev 2016-06-11 00:47:41 +01:00
Graham Campbell
8d90357f40 Released 2.3.0 RC6 2016-06-11 00:47:07 +01:00
Graham Campbell
46add8d841 Merge branch '2.2' into 2.3
# Conflicts:
#	VERSION
#	composer.json
#	composer.lock
2016-06-11 00:46:01 +01:00
Graham Campbell
1e695d51b5 Added the aws sdk as a dependency 2016-06-11 00:45:26 +01:00
Graham Campbell
65f864d743 Back to dev 2016-06-11 00:40:45 +01:00
Graham Campbell
bc51aac622 Released 2.2.4 2016-06-11 00:40:10 +01:00
Graham Campbell
3c39ccd5df Updated dependencies 2016-06-11 00:32:51 +01:00
Graham Campbell
cd4a96983e Updated laravel 2016-06-11 00:21:03 +01:00
Graham Campbell
c0d3602a91 Updated dependencies 2016-06-11 00:19:19 +01:00
James Brooks
08175b89e9 Merge pull request #1905 from CachetHQ/analysis-qMPD92
Applied fixes from StyleCI

[ci skip] [skip ci]
2016-06-10 17:27:37 +01:00
James Brooks
ece696d7db Merge pull request #1904 from CachetHQ/analysis-z327Ep
Applied fixes from StyleCI

[ci skip] [skip ci]
2016-06-10 17:27:33 +01:00
James Brooks
e7052f5aff Applied fixes from StyleCI
[ci skip] [skip ci]
2016-06-10 12:27:33 -04:00
James Brooks
ff97327803 Applied fixes from StyleCI
[ci skip] [skip ci]
2016-06-10 12:27:29 -04:00
James Brooks
8dda99c499 Compiled assets 2016-06-10 17:27:26 +01:00
James Brooks
947aa27e40 Move dashboard version check into version api endpoint 2016-06-10 17:27:21 +01:00
James Brooks
1425c15ee8 Don't rely on jQuery to be ready 2016-06-10 17:13:42 +01:00
James Brooks
cdbd2db8e9 Re-compile assets 2016-06-10 13:46:28 +01:00
James Brooks
ef02d77439 Remove the login background 2016-06-10 13:42:13 +01:00
Graham Campbell
662fff9edf Merge branch 'master' into develop
# Conflicts:
#	VERSION
#	composer.json
#	composer.lock
2016-06-10 09:02:30 +01:00
Graham Campbell
e96088fc0f Updated lock file 2016-06-10 08:56:40 +01:00
Graham Campbell
7472657812 Merge branch '2.3' 2016-06-10 08:56:18 +01:00
Graham Campbell
88ce241785 Updated dependencies 2016-06-10 08:53:26 +01:00
Graham Campbell
6becaf2acd Bumped version to 2.4 2016-06-10 08:40:57 +01:00
Graham Campbell
c5c21cd8db Merge branch '2.3'
# Conflicts:
#	composer.lock
2016-06-07 11:21:25 +01:00
Graham Campbell
b64dd1e87e Properly fixed metric updating
// cc @jbrooksuk
2016-06-07 11:11:17 +01:00
Graham Campbell
a0b9856d61 Updated deps 2016-06-07 11:07:02 +01:00
James Brooks
d6552982a3 Order by id if order is all the same 2016-06-07 08:54:56 +01:00
James Brooks
42eac92737 Pass update order as null from the dashboard 2016-06-07 08:53:41 +01:00
Graham Campbell
a2cee97f33 Rebuilt assets 2016-06-07 00:13:41 +01:00
Graham Campbell
0541a662ff Fixed path 2016-06-07 00:12:17 +01:00
Graham Campbell
b960146512 Merge branch '2.3'
# Conflicts:
#	composer.json
#	composer.lock
2016-06-06 20:42:12 +01:00
Graham Campbell
6c9b7a6fde Updated dependencies 2016-06-06 20:32:49 +01:00
James Brooks
ff9a2802f8 Back to dev 2016-06-06 11:20:10 +01:00
James Brooks
06ca0ffb21 Released v2.2.3 2016-06-06 11:19:28 +01:00
James Brooks
80e5655be9 Merge pull request #1895 from CachetHQ/str-include
Fix the Str import. Fixes #1749
2016-06-06 11:18:26 +01:00
James Brooks
0b7ca97e53 Fix the Str include 2016-06-06 11:03:09 +01:00
James Brooks
812160839f Support a Redis passwords 2016-06-05 16:52:18 +01:00
James Brooks
27e46d77e6 Publish the cache table migration 2016-06-05 10:16:50 +01:00
James Brooks
a10d12e589 Merge pull request #1869 from CachetHQ/update-login-page
Updated login page
2016-06-04 15:55:40 +01:00
James Brooks
ac7652f3aa Remove unused divs 2016-06-04 15:55:01 +01:00
James Brooks
c63fedefe9 Updated login page 2016-06-04 14:57:16 +01:00
Graham Campbell
3b6fb9f64e Use the new exception handler 2016-06-03 17:30:13 +01:00
Graham Campbell
acfb32bf1d Merge branch '2.3'
# Conflicts:
#	composer.json
#	composer.lock
2016-06-03 17:29:40 +01:00
Graham Campbell
c17ef87651 Merge pull request #1891 from CachetHQ/deps
Updated dependencies
2016-06-03 17:23:47 +01:00
Graham Campbell
846f77b054 Updated dependencies 2016-06-03 17:20:14 +01:00
Graham Campbell
d5c29a6c4b Merge pull request #1890 from CachetHQ/fixes
Fixed the integrations
2016-06-03 17:11:00 +01:00
Graham Campbell
31861f020f Fixed typo 2016-06-03 17:10:24 +01:00
Graham Campbell
abf83361e8 Fixed the integrations 2016-06-03 17:07:36 +01:00
James Brooks
3e8801d8d4 Merge pull request #1887 from CachetHQ/analysis-XkYWW1
Applied fixes from StyleCI

[ci skip] [skip ci]
2016-06-03 14:00:33 +01:00
James Brooks
bbc9eb1f81 Applied fixes from StyleCI
[ci skip] [skip ci]
2016-06-03 09:00:29 -04:00
James Brooks
c8b602d349 Handle failing to fetch blog posts. Fixes #1878 2016-06-03 14:00:23 +01:00
James Brooks
715eb02844 Use default_view or view. Fixes #1842 2016-06-03 13:54:26 +01:00
James Brooks
c8f7e92124 Only test the seed command 2016-06-03 10:44:02 +01:00
James Brooks
eae44ee6cb Fix redirecting back to the correct settings page 2016-06-03 10:16:44 +01:00
James Brooks
3fde593a86 Standardise the error message 2016-06-03 10:15:08 +01:00
James Brooks
1527ec8ddc Test all app: commands 2016-06-02 18:40:51 +01:00
James Brooks
f9946928c1 Merge pull request #1712 from CachetHQ/tags-api
Tags API
2016-06-02 11:25:14 +01:00
James Brooks
5176fca8f0 Implement the component tag API 2016-06-02 11:19:28 +01:00
James Brooks
4852f5558a Create a Tag api 2016-06-02 11:19:28 +01:00
Graham Campbell
c90584bda5 Merge pull request #1879 from CachetHQ/deps
Updated dependencies
2016-06-02 10:46:20 +01:00
Graham Campbell
aea3b40c54 Updated dependencies 2016-06-02 10:43:40 +01:00
Graham Campbell
d394e108bd Fix the feed package 2016-06-02 10:37:47 +01:00
Graham Campbell
0df9f01ffe Updated dependencies 2016-06-02 10:30:38 +01:00
James Brooks
9745bb7543 Merge pull request #1876 from CachetHQ/metric-ordering-api
Set an order on metrics via the API
2016-06-02 10:16:35 +01:00
James Brooks
cab030237b Set an order on metrics via the API. Closes #1874 2016-06-02 10:16:23 +01:00
James Brooks
439ac9fe44 Updated dependencies 2016-06-02 09:21:33 +01:00
James Brooks
7eef9467aa Don't go resetting the threshold value 2016-06-02 09:09:03 +01:00
James Brooks
15387b1da8 Allow searching incidents by component_id. Closes #1873 2016-06-02 08:46:59 +01:00
James Brooks
c33d297fa4 Merge pull request #1871 from CachetHQ/analysis-8jlox9
Applied fixes from StyleCI

[ci skip]
2016-06-01 11:50:39 +01:00
James Brooks
c8af103498 Applied fixes from StyleCI
[ci skip]
2016-06-01 06:50:35 -04:00
James Brooks
0e2610eee0 Fix indentation of setting 2016-06-01 11:50:27 +01:00
James Brooks
e201a6ed06 Seed with Patreon page component 2016-06-01 11:50:27 +01:00
James Brooks
1e4d616b88 Merge pull request #1870 from CachetHQ/analysis-8wOpew
Applied fixes from StyleCI

[ci skip]
2016-06-01 11:49:11 +01:00
James Brooks
2de01671e9 Applied fixes from StyleCI
[ci skip]
2016-06-01 06:49:07 -04:00
James Brooks
dd26a3af34 Fix default settings for enable_subscribers 2016-06-01 11:48:59 +01:00
Graham Campbell
4b41395144 Tweak 2016-06-01 11:42:25 +01:00
James Brooks
2dacc71e8a Set the default show_support setting 2016-06-01 08:04:16 +01:00
James Brooks
4869c7ee21 Merge pull request #1867 from CachetHQ/analysis-8maVvE
Applied fixes from StyleCI

[ci skip]
2016-05-31 20:19:00 +01:00
James Brooks
9293dcf0df Applied fixes from StyleCI
[ci skip]
2016-05-31 15:18:56 -04:00
James Brooks
150057ef50 Sync languages 2016-05-31 20:18:39 +01:00
James Brooks
c81f18c3bc Back to dev 2016-05-31 19:31:56 +01:00
James Brooks
42aa437ac2 Released 2.3.0 RC5 2016-05-31 19:31:34 +01:00
James Brooks
6a780314fb Rebuild assets 2016-05-31 19:29:28 +01:00
James Brooks
ffae9cf3d4 Merge pull request #1866 from CachetHQ/analysis-zRP0lp
Applied fixes from StyleCI

[ci skip]
2016-05-31 19:27:14 +01:00
James Brooks
091f59c241 Applied fixes from StyleCI
[ci skip]
2016-05-31 14:27:10 -04:00
James Brooks
288fa6180b Publish the css-inliner config 2016-05-31 19:27:00 +01:00
James Brooks
7ecb546a86 Merge pull request #1865 from CachetHQ/dashboard-feed
Dashboard feed
2016-05-31 19:25:30 +01:00
James Brooks
f7c8dd6254 Merge pull request #1864 from CachetHQ/analysis-XN4p11
Applied fixes from StyleCI

[ci skip]
2016-05-31 19:12:36 +01:00
James Brooks
2adc9d032a Applied fixes from StyleCI
[ci skip]
2016-05-31 14:12:32 -04:00
James Brooks
f53075ec4f Add Patreon link and latest Cachet blog posts to dashboard 2016-05-31 19:12:23 +01:00
James Brooks
0190813012 Dashboard RSS 2016-05-31 18:02:10 +01:00
Graham Campbell
b0c75a2319 Merge pull request #1863 from CachetHQ/analysis-8jl73Z
Applied fixes from StyleCI

[ci skip]
2016-05-30 12:15:20 +01:00
Graham Campbell
73d7303b6e Applied fixes from StyleCI
[ci skip]
2016-05-30 07:15:16 -04:00
Graham Campbell
2d8f2cbd63 Fixed typo 2016-05-30 12:14:56 +01:00
Graham Campbell
cb2ce8f67f Synced with laravel 5.3 2016-05-30 12:12:43 +01:00
Graham Campbell
d6d103cf15 Merge branch '2.3' 2016-05-29 19:38:59 +01:00
Graham Campbell
20d187d642 Back to dev 2016-05-29 19:28:42 +01:00
Graham Campbell
91bd9288f5 Released 2.3.0 RC4 2016-05-29 19:28:10 +01:00
Graham Campbell
24df32e9a9 Fixed bad caching 2016-05-29 19:20:56 +01:00
Graham Campbell
fb75ad6902 Include our user agent 2016-05-29 19:17:22 +01:00
Graham Campbell
aa87274378 Another fix 2016-05-29 18:49:40 +01:00
Graham Campbell
696a1126c7 Fixed lang file 2016-05-29 18:47:33 +01:00
Graham Campbell
7c4787a1a7 Merge pull request #1815 from CachetHQ/backers-credits-dashboard
Added credits page
2016-05-29 18:44:52 +01:00
Graham Campbell
74d24b6809 Link the images 2016-05-29 18:40:29 +01:00
Graham Campbell
22226c666f Force size 2016-05-29 18:34:08 +01:00
Graham Campbell
b3244a4639 Fixed import 2016-05-29 18:27:04 +01:00
Graham Campbell
6cf3c4c109 Merge pull request #1861 from CachetHQ/analysis-z4waDG
Applied fixes from StyleCI

[ci skip]
2016-05-29 18:24:17 +01:00
Graham Campbell
8f47bd4a4f Applied fixes from StyleCI
[ci skip]
2016-05-29 13:24:13 -04:00
Graham Campbell
c03f01ca44 Added credits 2016-05-29 18:14:40 +01:00
Graham Campbell
7f36783582 Merge branch '2.3' 2016-05-29 12:10:20 +01:00
Graham Campbell
ab0ed775e1 Merge pull request #1860 from CachetHQ/tests
Cleanup travis test config
2016-05-29 12:09:48 +01:00
Graham Campbell
5a600c0e17 Removed old badge 2016-05-29 12:00:59 +01:00
Graham Campbell
601a863fc4 Cleanup tests 2016-05-29 12:00:02 +01:00
Graham Campbell
366eab9cae Merge pull request #1859 from CachetHQ/typo
Fixed typo
2016-05-29 11:13:14 +01:00
Graham Campbell
021c2890d2 Fixed typo 2016-05-29 10:57:45 +01:00
Graham Campbell
ed851c232a Merge branch '2.3'
# Conflicts:
#	composer.lock
2016-05-28 22:07:52 +01:00
Graham Campbell
2eff325a23 Back to dev 2016-05-28 22:02:11 +01:00
Graham Campbell
d7e70c1870 Released 2.3.0 RC3 2016-05-28 22:01:44 +01:00
Graham Campbell
0311d59e78 Updated dependencies 2016-05-28 20:27:19 +01:00
Graham Campbell
6a6c8d866e Merge pull request #1843 from CachetHQ/improve-emails
Improve email designs, use theme colours
2016-05-28 18:36:55 +01:00
Graham Campbell
11d82a22c3 Merge pull request #1856 from CachetHQ/fix-flash-msg
Fix login flash messages #1850
2016-05-28 18:36:26 +01:00
Joseph Cohen
dcfe55e881 Fix login flash messages #1850 2016-05-28 12:34:52 -05:00
Graham Campbell
494d1a021c Merge pull request #1855 from CachetHQ/proxies
Synced the trusted proxies
2016-05-28 18:32:42 +01:00
Graham Campbell
d95557d683 Synced the trusted proxies 2016-05-28 18:31:41 +01:00
Joe Cohen
48ccc02799 Applied fixes from StyleCI
[ci skip]
2016-05-28 12:30:39 -05:00
Joseph Cohen
f3440389be Improve email content and subject, fix component notification presenter 2016-05-28 12:30:39 -05:00
James Brooks
bad9b1d550 Improve email designs, use theme colours 2016-05-28 12:30:39 -05:00
Graham Campbell
920a3ef6a9 Updated dependencies 2016-05-28 16:40:26 +01:00
Graham Campbell
15816c56bb Merge branch '2.3'
# Conflicts:
#	composer.json
#	composer.lock
2016-05-28 16:36:06 +01:00
Graham Campbell
e1d07fdc99 Updated the throttle package again 2016-05-28 16:28:53 +01:00
Graham Campbell
e69395a5ad Merge pull request #1852 from CachetHQ/tests
Added more service provider tests
2016-05-28 16:27:35 +01:00
Graham Campbell
1c10cba5fc Added more service provider tests 2016-05-28 16:19:33 +01:00
Graham Campbell
3a1042e6ae Tweaked the metric repo binding 2016-05-28 16:19:17 +01:00
Graham Campbell
a2a008b108 Updated the throttle package 2016-05-28 16:18:28 +01:00
Graham Campbell
11f8ba81fd Merge pull request #1851 from CachetHQ/throttling
Fix crap login throttling
2016-05-28 15:52:25 +01:00
Graham Campbell
e8d216b671 Enabled the new displayer 2016-05-28 15:50:03 +01:00
Graham Campbell
167d076edc Fix crap login throttling 2016-05-28 15:45:38 +01:00
James Brooks
5c5634d355 We no longer need to pass the app_name in 2016-05-27 11:35:59 +01:00
Graham Campbell
1eea34e832 Updated laravel 2016-05-27 08:57:12 +01:00
James Brooks
3873fd90ba Make sure subscribers are enabled before displaying add subscriber 2016-05-26 11:51:25 +01:00
James Brooks
38a659b08c Back to dev 2016-05-26 11:44:40 +01:00
James Brooks
55b6961a4b Released 2.3.0 RC2 2016-05-26 11:43:39 +01:00
James Brooks
2b87629dca Fix issues with localizations not applying properly 2016-05-26 11:35:00 +01:00
James Brooks
48c4240c38 Removed un-needed equality param 2016-05-26 11:28:52 +01:00
James Brooks
f84793bfab Remove strong tag 2016-05-26 11:22:23 +01:00
James Brooks
0200ac848f Reduce indentation 2016-05-26 11:20:07 +01:00
James Brooks
787bb74b3b Fix trailing "email" string 2016-05-26 11:19:54 +01:00
James Brooks
8f58cdd182 Merge pull request #1831 from CachetHQ/reduce-size-settings-controller
Moved banner handling into a separate method as it's big
2016-05-26 08:43:20 +01:00
James Brooks
8f0691f3bd Merge pull request #1835 from CachetHQ/subscribers
Remove subscribers modal
2016-05-26 08:42:57 +01:00
James Brooks
a81ce21721 Merge pull request #1836 from CachetHQ/lang
Fixed English translations
2016-05-26 08:41:50 +01:00
Graham Campbell
1e0992be6c Restored the validation translations 2016-05-26 08:18:02 +01:00
Graham Campbell
00706ad744 Fixed uppercase letter 2016-05-26 08:16:49 +01:00
Joseph Cohen
31d47cfb35 Remove subscribers modal 2016-05-26 00:50:23 -05:00
James Brooks
7e29f7d363 Moved banner handling into a separate method as it's big 2016-05-25 22:16:41 +01:00
Graham Campbell
e5e4b04151 Fix merge 2016-05-25 22:03:36 +01:00
Graham Campbell
283d343dd6 Merge branch '2.3'
# Conflicts:
#	composer.json
#	composer.lock
2016-05-25 22:03:20 +01:00
Graham Campbell
71a1ab091f Updated laravel 2016-05-25 21:55:26 +01:00
James Brooks
9e020e5d59 Merge pull request #1830 from CachetHQ/default-enable-subscibers
Enable subscribers by default
2016-05-25 21:20:45 +01:00
James Brooks
5e10f1c777 Enable subscribers by default 2016-05-25 21:20:24 +01:00
Graham Campbell
a2aa116204 Merge pull request #1829 from CachetHQ/fix-config-seeding
Fix clearing of configs when seeding
2016-05-25 20:30:30 +01:00
Graham Campbell
ac65cc56bb I prefer clear 2016-05-25 20:26:58 +01:00
James Brooks
9e3f07742b Fix clearing of configs when seeding 2016-05-25 20:00:33 +01:00
Graham Campbell
aa85c8708e Merge pull request #1742 from CachetHQ/next
Upgraded to Laravel 5.3
2016-05-25 19:54:46 +01:00
James Brooks
b120c37cbc Fix colour of p and strong tags 2016-05-25 19:23:11 +01:00
Graham Campbell
f93506fed9 Updated to the latest laravel version 2016-05-25 16:06:11 +01:00
Graham Campbell
b92f9d30fc Use the new bindings substitution middleware 2016-05-25 15:56:28 +01:00
Graham Campbell
3673e57c6f Upgraded to laravel 5.3 2016-05-25 12:38:16 +01:00
Graham Campbell
9fb6ae4fc0 Merge branch '2.3' 2016-05-25 12:28:46 +01:00
James Brooks
6211e7a1f8 Drop the "| Cachet" extra from the site title 2016-05-25 12:23:22 +01:00
Graham Campbell
5d23f83db6 Modified english translations next/previous 2016-05-25 12:21:17 +01:00
Graham Campbell
a2ea9bf10b Merge pull request #1826 from CachetHQ/controller
Avoid the deprecated controller method
2016-05-25 12:17:38 +01:00
Graham Campbell
d6495dec96 Avoid the deprecated controller method 2016-05-25 12:15:42 +01:00
Graham Campbell
583601644c Merge branch '2.3'
# Conflicts:
#	composer.json
#	composer.lock
2016-05-25 12:04:37 +01:00
Graham Campbell
5cbe3ba708 Back to dev 2016-05-25 11:39:32 +01:00
Graham Campbell
375d2330de Released 2.3.0 RC1 2016-05-25 11:39:07 +01:00
Graham Campbell
e39a3cde16 Merge pull request #1823 from CachetHQ/settings-cache
Refactored settings caching
2016-05-25 11:34:02 +01:00
Graham Campbell
13d0ff320a Another attempt 2016-05-25 11:28:03 +01:00
Graham Campbell
72577a04b7 Fixed headers 2016-05-25 11:23:48 +01:00
James Brooks
0bf2039e60 Fix some bits 2016-05-25 11:14:16 +01:00
Graham Campbell
414efb0ce7 Fixed typo 2016-05-25 10:59:11 +01:00
Graham Campbell
0500d63654 Merge pull request #1825 from CachetHQ/analysis-X017pj
Applied fixes from StyleCI

[ci skip]
2016-05-25 10:58:44 +01:00
Graham Campbell
3a86862e4f Applied fixes from StyleCI
[ci skip]
2016-05-25 05:58:40 -04:00
Graham Campbell
8df65b2dc3 Finished off the subscriber 2016-05-25 10:58:14 +01:00
Graham Campbell
c3bc8fdd2d Refactor settings caching 2016-05-25 10:55:49 +01:00
Graham Campbell
200cd62dc9 Resolve via class name 2016-05-25 10:55:33 +01:00
Graham Campbell
527e5872df Fixed typo 2016-05-25 10:55:22 +01:00
Graham Campbell
ebaf4e9395 WIP 2016-05-25 10:33:06 +01:00
Graham Campbell
d0afcbffe4 Updated dependencies (#1824) 2016-05-25 10:31:05 +01:00
Graham Campbell
2e9d56d053 Fixed typo 2016-05-25 09:55:07 +01:00
James Brooks
90419e70cf Merge pull request #1821 from CachetHQ/analysis-Xa67jZ
Applied fixes from StyleCI

[ci skip]
2016-05-25 09:52:48 +01:00
Graham Campbell
0566133c12 Cleaned up the release class and provider (#1820) 2016-05-25 09:52:44 +01:00
James Brooks
8e824eb5e0 Applied fixes from StyleCI
[ci skip]
2016-05-25 04:45:43 -04:00
James Brooks
5534cdbdde Sync languages 2016-05-25 09:45:20 +01:00
James Brooks
2db0b011e6 Rebuild assets 2016-05-25 09:28:02 +01:00
gellu
962b40f0e9 Fixed undefined component variable (#1808) 2016-05-24 20:04:47 +01:00
Graham Campbell
96450c476c Merge pull request #1811 from CachetHQ/subscribe-multiple-subscribers
Subscribe multiple subscribers at one time
2016-05-24 20:03:45 +01:00
James Brooks
ba09b3f7cd Merge pull request #1818 from CachetHQ/settings
Renamed "Config" to "Settings"
2016-05-24 18:35:23 +01:00
Graham Campbell
053e3e9477 Renamed "Config" to "Settings" 2016-05-24 17:48:13 +01:00
Graham Campbell
ff939e356e Merge pull request #1816 from CachetHQ/caching
Settings Caching
2016-05-24 17:43:15 +01:00
Graham Campbell
e4d5c53d69 Derp fix 2016-05-24 17:20:23 +01:00
Graham Campbell
4549c51959 Deal with cases when we have no settings properly 2016-05-24 17:12:08 +01:00
Graham Campbell
20e4ae5ff8 Scaled things back 2016-05-24 17:00:48 +01:00
Graham Campbell
77f455651d Work on config caching 2016-05-24 16:44:21 +01:00
Graham Campbell
7a3c231f68 Merge pull request #1812 from CachetHQ/fix-subscriber-dates
Fix subscriber dates
2016-05-24 15:13:04 +01:00
Graham Campbell
0ec77d7652 Merge pull request #1813 from CachetHQ/dashboard-component-status-bug
Fixes toggling of component status box
2016-05-24 15:12:47 +01:00
James Brooks
4f886e15ed Fixes toggling of component status box. Fixes #1792 2016-05-24 15:07:36 +01:00
James Brooks
d3454d8126 Merge pull request #1810 from CachetHQ/allow-user-level-editing
Edit the user level from edit user page
2016-05-24 14:57:42 +01:00
James Brooks
ccc0ebb7d5 Fixes #1805. Subscribers no longer have subscribed_at dates 2016-05-24 14:52:13 +01:00
James Brooks
f6bfb10500 Outdent the template 2016-05-24 14:49:09 +01:00
James Brooks
e241f38dd7 Subscribe multiple subscribers at one time 2016-05-24 14:47:34 +01:00
James Brooks
fb0dd82fe2 Edit the user level from edit user page. Closes #1809 2016-05-24 14:39:59 +01:00
James Brooks
6997e0c451 Merge pull request #1803 from CachetHQ/rename-next-prev
Use only Previous and Next links
2016-05-23 08:20:07 +01:00
James Brooks
2e73d071c9 Use only Previous and Next links. Closes #1801 2016-05-23 08:05:32 +01:00
Graham Campbell
f86f6bbc08 Merge pull request #1799 from CachetHQ/deps
Updated dependencies
2016-05-20 17:51:03 +01:00
Graham Campbell
6c872e60fc Updated dependencies 2016-05-20 17:40:31 +01:00
James Brooks
23f77a7e72 Merge pull request #1798 from CachetHQ/backup
Cleanup the backup process
2016-05-20 15:54:47 +01:00
Graham Campbell
25dd45f47c Cleanup the backup process 2016-05-20 14:49:41 +01:00
Graham Campbell
2680bafd69 Merge pull request #1797 from CachetHQ/specify-component-group-components-order
Order components within group
2016-05-20 14:38:47 +01:00
James Brooks
08c1f105c2 Order components within group. Fixes #1793 2016-05-20 14:31:08 +01:00
James Brooks
c152892610 Merge pull request #1796 from CachetHQ/jbrooksuk-patch-1
Remove Paypal button in favour of Patreon link
2016-05-20 14:03:10 +01:00
James Brooks
d54ead2868 Remove Paypal button in favour of Patreon link 2016-05-20 13:21:49 +01:00
James Brooks
81ae63b2c0 Merge pull request #1795 from vinkla/patch-2
Remove npm dependencies
2016-05-20 12:56:52 +01:00
Vincent Klaiber
9f17c34f50 Remove npm dependencies
This closes #1794
2016-05-20 13:48:39 +02:00
Graham Campbell
5ea816ce2b Merge pull request #1595 from CachetHQ/incident-updates
Incident updates
2016-05-14 08:47:03 +01:00
Joseph Cohen
541d410e41 Implement Incident Updates 2016-05-14 02:38:07 -05:00
Graham Campbell
03348b8ff2 Merge branch '2.3'
# Conflicts:
#	composer.lock
2016-05-13 00:38:09 +01:00
Graham Campbell
d0be61ad96 Updated dependencies 2016-05-13 00:27:00 +01:00
James Brooks
89f99ef663 Merge pull request #1781 from CachetHQ/drop-bower
Remove Bower dependency
2016-05-11 20:38:39 +01:00
James Brooks
9f4270f4a5 Remove Bower dependency. Closes #1780 2016-05-11 20:11:46 +01:00
James Brooks
bda3484cac Merge pull request #1777 from CachetHQ/values
Use pluck rather than lists
2016-05-09 22:04:05 +01:00
James Brooks
aec2ef0198 Use pluck rather than lists 2016-05-09 20:43:24 +01:00
Joe Cohen
651edcc7c5 Merge pull request #1754 from CachetHQ/fix-spanish-cachet-translations
Fix translations in the cachet.php file
2016-05-09 14:08:47 -05:00
James Brooks
d975cd8ca1 Fix spanish translations 2016-05-09 13:30:07 -05:00
James Brooks
c315d04d5d Merge pull request #1773 from CachetHQ/remove-setup-key-generate
Setup doesn't need to generate the key anymore
2016-05-08 17:47:08 +01:00
James Brooks
e77562d469 Setup doesn't need to generate the key anymore 2016-05-08 17:46:29 +01:00
James Brooks
088fd6631d Merge pull request #1771 from CachetHQ/subscribers-api-specify-components
Specify components to subscribe to via API
2016-05-08 16:54:45 +01:00
James Brooks
cc102847f9 Specify components to subscribe to via API. Closes #1685 2016-05-08 16:26:59 +01:00
James Brooks
b88a102629 Merge pull request #1768 from CachetHQ/default-settings
Allow us to set better default settings
2016-05-08 16:24:57 +01:00
James Brooks
452eb653a5 Allow us to set better default settings. Closes #1755 2016-05-08 16:06:11 +01:00
James Brooks
1584883f39 Merge pull request #1767 from TheoBearman/2.3
Moving 'Automatically localise your status page to your visitor's language?' to its correct home
2016-05-07 21:12:30 +01:00
Theo Bearman
595a720d8b Moving 'Automatically localise your status page to your visitor's language?' to its correct home - Fixes #1765 2016-05-07 17:24:58 +01:00
Graham Campbell
2a0decc7c6 Merge pull request #1763 from CachetHQ/composer
Updated packages
2016-05-07 09:27:10 +01:00
James Brooks
d10386821e Updated lockfile 2016-05-07 08:52:26 +01:00
Graham Campbell
8da8e83e48 Updated packages 2016-05-06 22:46:51 +01:00
Graham Campbell
80bb601813 Merge pull request #1732 from CachetHQ/database-backups
Database backups
2016-05-06 21:56:26 +01:00
James Brooks
21b60e0708 Take a backup before calling app commands. Closes #1730 2016-05-06 21:11:57 +01:00
Graham Campbell
0fd88a6ba7 Merge pull request #1761 from CachetHQ/cleanup-subscribers-component-deletions
When removing a component, clean up the subscriptions
2016-05-06 14:12:39 +01:00
Graham Campbell
8da7bde2a5 Merge pull request #1760 from CachetHQ/update-deps
Update dependencies
2016-05-06 14:11:59 +01:00
James Brooks
ceb119b226 When removing a component, clean up the subscriptions. Closes #1739 2016-05-06 13:54:00 +01:00
James Brooks
6790d85a87 Update dependencies 2016-05-06 13:46:46 +01:00
Graham Campbell
873f61fde6 Merge pull request #1759 from CachetHQ/powered-by-change
Change the powered by text
2016-05-06 13:00:54 +01:00
James Brooks
f716c7fd1d Change the powered by text. Closes #1758 2016-05-06 12:50:30 +01:00
James Brooks
50ac69b234 Merge pull request #1757 from CachetHQ/fix-pgsql-metrics
Fixes metrics repository in PGSQL
2016-05-05 18:13:59 +01:00
James Brooks
712b1078f2 Fixes metrics repository in PGSQL. Closes #1741 2016-05-05 17:59:30 +01:00
James Brooks
893e61e319 Merge pull request #1756 from CachetHQ/command-bus-db-transactions
Command bus DB transactions
2016-05-05 17:47:59 +01:00
James Brooks
bfd0ccd652 Commands now use db transactions. Fixes #1745 2016-05-05 16:47:41 +01:00
James Brooks
3feb93c074 Remove dump and die call 2016-05-05 16:46:37 +01:00
James Brooks
a5ce958b92 Merge pull request #1753 from CachetHQ/configure-automatic-localization
Allow configuring of automatic localization
2016-05-05 11:22:24 +01:00
James Brooks
47e1dff5c5 Allow configuring of automatic localization. Closes #1747 2016-05-05 10:50:14 +01:00
James Brooks
9ddf9e3e1a Merge pull request #1751 from CachetHQ/fix-component-group-api
Fix component group api
2016-05-05 10:49:44 +01:00
James Brooks
9747cb9204 Added missing docblock 2016-05-05 10:24:01 +01:00
James Brooks
bd35db8d87 Default collapsed value to 0 (always open) 2016-05-05 10:23:18 +01:00
James Brooks
23ff795809 Don't pass through default order value when updating group 2016-05-05 10:23:02 +01:00
Graham Campbell
48d2721605 Updated dependencies 2016-05-04 21:52:01 +01:00
Graham Campbell
9d78092121 Merge pull request #1750 from CachetHQ/fix-str
Fixed a bad import
2016-05-04 20:08:21 +01:00
Graham Campbell
a0b1501b2a Fixed a bad import 2016-05-04 16:38:09 +01:00
Graham Campbell
2e8743eb6b Merge branch '2.3' 2016-05-01 16:25:09 +01:00
Graham Campbell
c4e724e0e6 Rebuilt assets 2016-05-01 16:24:16 +01:00
James Brooks
792a8f6a07 Bower has changed the rules in which a name must follow 2016-05-01 16:06:24 +01:00
Graham Campbell
684b480338 Merge pull request #1738 from CachetHQ/fix-subscribers
Fix subscribers
2016-05-01 16:05:41 +01:00
Joe Cohen
f1b61c7ef1 Applied fixes from StyleCI 2016-05-01 16:04:43 +01:00
Joseph Cohen
05bb91d2d9 Global subscribers and fix notifications 2016-05-01 16:04:43 +01:00
Joseph Cohen
5abd25c408 Redirect subscribers to manage 2016-05-01 16:04:43 +01:00
Graham Campbell
e1a8e2220d Merge branch '2.2' into 2.3
# Conflicts:
#	VERSION
#	public/build/dist/js/all-a62567215d.js
#	public/build/rev-manifest.json
2016-04-29 17:05:53 +01:00
Graham Campbell
9d9d3b2e6c Bumped version 2016-04-29 16:58:35 +01:00
Graham Campbell
f79fadab80 Released 2.2.2 2016-04-29 16:58:08 +01:00
Graham Campbell
e3dc7594e5 Updated dependencies 2016-04-29 16:54:08 +01:00
Graham Campbell
200771cdab Merge pull request #1733 from CachetHQ/2.2-rebuild-assets
Rebuild assets
2016-04-29 16:48:22 +01:00
James Brooks
56760c7445 Rebuild assets 2016-04-29 16:45:06 +01:00
Graham Campbell
66ff1cca65 Updated dependencies 2016-04-27 15:04:32 +01:00
Graham Campbell
64ff9b7d40 Updated phpunit and mockery 2016-04-27 15:01:48 +01:00
Graham Campbell
446aed6b9a Bumped min php version
# Conflicts:
#	composer.json
2016-04-27 15:01:30 +01:00
Graham Campbell
0281c44933 Bumped version 2016-04-27 15:00:45 +01:00
Graham Campbell
df373e93ef Merge branch '2.2' into 2.3
# Conflicts:
#	composer.lock
2016-04-27 14:58:20 +01:00
Graham Campbell
65ebfde315 Merge pull request #1729 from CachetHQ/fix-removal-customizations
Fixes removal of Customization values
2016-04-27 14:50:31 +01:00
Graham Campbell
4f7c50f7f4 Updated laravel 2016-04-27 14:49:37 +01:00
James Brooks
de232ab2b5 Fixes removal of Customization values 2016-04-27 14:47:47 +01:00
James Brooks
067018cf47 Use the Str facade 2016-04-27 14:37:17 +01:00
Graham Campbell
97e5fa07fa Updated dependencies 2016-04-27 09:41:39 +01:00
James Brooks
dec48a92f3 Merge pull request #1726 from alprs/fix-always_show_scrollbar
Always show vertical scrollbar
2016-04-27 09:28:58 +01:00
Andreas Lutro
0672fe046e Always show vertical scrollbar 2016-04-27 10:14:14 +02:00
James Brooks
b78009bee4 Merge pull request #1725 from alprs/fix-settings_localization_error
Fix a PHP error in settings -> localization
2016-04-27 08:56:56 +01:00
James Brooks
5907f54201 Merge pull request #1722 from alprs/fix-view_signup_notfound
Fix location of signup template
2016-04-27 08:56:07 +01:00
Andreas Lutro
555865d761 Fix a PHP error in settings -> localization
$langs is a nested array, not an array of strings.

Fixes #1723
2016-04-27 09:34:59 +02:00
Andreas Lutro
c0561ad8c0 fix location of signup template
fixes #1668
2016-04-27 09:00:05 +02:00
Graham Campbell
28e7af7107 Merge pull request #1582 from CachetHQ/metric-point-enhancement
Refactoring metric point storage
2016-04-25 20:42:11 +01:00
James Brooks
f9bc46b460 Refactored the way we store metrics 2016-04-25 20:42:00 +01:00
James Brooks
3730ca8811 Rebuild assets 2016-04-25 16:03:48 +01:00
James Brooks
69716730ac Update dependencies 2016-04-25 16:03:40 +01:00
Graham Campbell
ef8049c21d Updated laravel 2016-04-25 15:56:50 +01:00
Graham Campbell
cf80bf31f3 Synced with laravel/laravel 2016-04-25 15:25:52 +01:00
Graham Campbell
28bf01396c Merge branch '2.2'
# Conflicts:
#	VERSION
2016-04-23 11:04:10 +01:00
Graham Campbell
cf900e1390 Back to dev 2016-04-23 11:03:33 +01:00
Graham Campbell
df31b4d20e Released 2.2.1 2016-04-23 11:02:55 +01:00
Graham Campbell
a9185b7876 Bumped version 2016-04-23 11:00:30 +01:00
Graham Campbell
f383d50f16 Merge pull request #1718 from CachetHQ/js
Fixed chart.js and rebuilt assets
2016-04-23 10:53:06 +01:00
Graham Campbell
369073e636 Fixed chart.js and rebuilt assets 2016-04-23 10:52:16 +01:00
Graham Campbell
eb6a638a59 Updated dependencies 2016-04-23 10:24:21 +01:00
James Brooks
9a743ab425 Include default_view_name in metric results 2016-04-22 15:50:14 +01:00
James Brooks
36d89a9ad8 Specify use of the master branch 2016-04-22 15:30:59 +01:00
James Brooks
7dfe1b6fab Use sync as the default queue driver 2016-04-21 19:33:10 +01:00
James Brooks
ebc6525b65 Use query method rather than querying where 1 = 1 2016-04-21 18:53:12 +01:00
James Brooks
c5ae146683 A word 2016-04-21 17:05:25 +01:00
James Brooks
70daa9d3fa Round metric graphs to metric.places — closes #1704 2016-04-21 15:23:46 +01:00
James Brooks
95d3d427a4 Stop using the TwigBridge facade 2016-04-21 15:00:19 +01:00
James Brooks
8de387a92d Merge pull request #1699 from CachetHQ/tags-on-components-api
Add tag names array to components API
2016-04-21 12:51:48 +01:00
James Brooks
5e6055c9bd Merge pull request #1709 from CachetHQ/analysis-z3w4mr
Applied fixes from StyleCI
2016-04-21 12:33:20 +01:00
James Brooks
c4338aaaeb Applied fixes from StyleCI 2016-04-21 07:33:16 -04:00
James Brooks
ca06352bda Sync language files. Dutch, French, German, Spanish are 100% 2016-04-21 12:33:02 +01:00
Graham Campbell
edf78d7248 Merge pull request #1707 from CachetHQ/deps
Updated deps
2016-04-20 10:19:04 +01:00
Graham Campbell
d0d40c93d3 Updated deps 2016-04-20 10:14:15 +01:00
James Brooks
11730ed932 Merge pull request #1705 from rkgrep/lang-subsets
Use Google Fonts subsets for localizations
2016-04-19 13:55:33 +01:00
Roman Kinyakin
0c4737aca1 Use Google Fonts subsets for localizations 2016-04-19 18:08:40 +06:00
Graham Campbell
159390f989 Updated deps 2016-04-18 18:28:49 +01:00
James Brooks
5de8521ac8 Merge pull request #1702 from berlic/fix-component-tooltip
fix hidden (overlayed) tooltip
2016-04-18 09:48:23 +01:00
Konstantin Suvorov
d957474618 fix hidden tooltip
use 'body' as tooltip container
2016-04-18 11:38:04 +03:00
James Brooks
7c56785fcc Merge pull request #1703 from CachetHQ/analysis-8nNE05
Applied fixes from StyleCI
2016-04-17 17:37:29 +01:00
James Brooks
debc187874 Applied fixes from StyleCI 2016-04-17 12:18:24 -04:00
James Brooks
6ccac55e1d Sync languages 2016-04-17 17:17:29 +01:00
James Brooks
ed77a6753c Add tag names array to components api. Closes #1697 2016-04-17 03:16:06 +01:00
James Brooks
6e7df6e1f7 Added attributes to prevent bad default data in groups. Closes #1683 2016-04-16 12:19:16 +01:00
James Brooks
4f867dabe6 Updated dependencies 2016-04-15 18:57:14 +01:00
Graham Campbell
106a917dbc Merge pull request #1693 from CachetHQ/https
Serve analytics over https
2016-04-07 16:47:26 +01:00
Graham Campbell
2cf5b9710a Serve analytics over https 2016-04-07 15:15:26 +01:00
James Brooks
c60e7e906d Fix issue with go squared analytics setting 2016-04-06 20:12:29 +01:00
James Brooks
7521678e5f Requesting more info from issues 2016-04-06 17:10:25 +01:00
James Brooks
d828e961bd Added Installations and Donations sections 2016-04-06 10:13:30 +01:00
James Brooks
fef84f8559 Publish the sessions table 2016-04-05 15:30:57 +01:00
Graham Campbell
39b112dacc Updated dependencies 2016-04-02 15:28:58 +01:00
James Brooks
6054a6509c Updated dependencies 2016-04-02 09:49:40 +01:00
James Brooks
6f3a38d708 Fixes #1673 - Use previously sent data 2016-03-31 18:49:53 +01:00
James Brooks
8e0fa710ee Merge pull request #1680 from CachetHQ/unsafe-customization-settings
Allow unsafe code for Customization tab
2016-03-31 18:34:08 +01:00
James Brooks
309c6d345b Fixes #1677 2016-03-31 18:33:39 +01:00
James Brooks
6a466d2c9c Merge pull request #1678 from CachetHQ/maintenance
Fixed editing maintenance scheduled time
2016-03-31 14:09:32 +01:00
Graham Campbell
7a81d3b6ef Fixed editing maintenance scheduled time
Closes #1669.
2016-03-31 13:29:36 +01:00
Graham Campbell
b0a4820e80 Back to dev 2016-03-27 12:00:40 +01:00
Graham Campbell
fe569a6fbc Released 2.2.0 2016-03-27 12:00:15 +01:00
Graham Campbell
b556eac851 Merge pull request #1664 from CachetHQ/updates
Updated dependencies
2016-03-26 18:02:14 +00:00
Graham Campbell
84aea0e869 Merge pull request #1660 from CachetHQ/dashboard-component-group-order
Fixes #1659
2016-03-26 18:02:03 +00:00
Graham Campbell
841e102971 Updated dependencies 2016-03-26 17:59:51 +00:00
James Brooks
7f65e1e48c Fixes #1659 2016-03-25 18:11:14 +00:00
Graham Campbell
99a5a85248 Back to dev 2016-03-24 15:57:05 +00:00
Graham Campbell
6cc1eb2c0f 2.2.0-RC1 2016-03-24 15:56:22 +00:00
Graham Campbell
3d77a7a2cd Merge pull request #1655 from CachetHQ/sync
Sync with laravel
2016-03-24 15:36:45 +00:00
Graham Campbell
53dd12e339 Updated storage path config calls 2016-03-24 15:29:11 +00:00
Graham Campbell
0c3d388f5a Synced mail config 2016-03-24 15:26:04 +00:00
Graham Campbell
f73788fab3 Tweaked the model factory 2016-03-24 15:25:58 +00:00
Graham Campbell
b5bac7690e Synced up db stuff 2016-03-24 15:25:48 +00:00
Graham Campbell
1438783c07 Sync with laravel 2016-03-24 15:21:02 +00:00
James Brooks
bca7c5340a Set default component group view to 1 2016-03-24 14:10:46 +00:00
Graham Campbell
794d3733c1 Merge pull request #1654 from CachetHQ/revert
Revert broken scroll bars implementation
2016-03-24 14:03:56 +00:00
Graham Campbell
f63f63bb43 Rebuilt css 2016-03-24 14:03:23 +00:00
Graham Campbell
10c821c466 Revert broken scroll bars implementation
This reverts commit 06284ecd13.

Closes #1626.
Closes #1640.
2016-03-24 13:59:40 +00:00
Graham Campbell
85094805f2 Merge pull request #1653 from CachetHQ/updates
Updates
2016-03-24 13:58:35 +00:00
Graham Campbell
adab5487fd Rebuilt assets 2016-03-24 13:53:55 +00:00
Graham Campbell
263933c589 Updated dependencies 2016-03-24 13:53:48 +00:00
Graham Campbell
120fcf3b37 Tweaked composer.json 2016-03-24 13:53:37 +00:00
James Brooks
d5542f7555 Merge pull request #1645 from CachetHQ/github-markdown-css
Implement Github Markdown CSS
2016-03-23 16:23:26 +00:00
James Brooks
82e4411b45 Allow setting of DB_SCHEMA and DB_PREFIX. Closes #1649 2016-03-23 10:12:56 +00:00
James Brooks
62bba0ffa6 Rebuilt assets 2016-03-22 20:23:22 +00:00
James Brooks
f5e45ce938 Merge pull request #1648 from CachetHQ/navbar
Navbar
2016-03-22 20:21:31 +00:00
James Brooks
d342cdb6ad Finished basic navbar 2016-03-22 20:18:51 +00:00
James Brooks
9b69ed417e Merge pull request #1644 from CachetHQ/analysis-qgOQA6
Applied fixes from StyleCI
2016-03-21 20:28:23 +00:00
James Brooks
e689f206cb Applied fixes from StyleCI 2016-03-21 16:28:18 -04:00
James Brooks
8f80498c2e Implement Github Markdown CSS. Closes #1643 2016-03-21 20:28:01 +00:00
James Brooks
4d07d2c8b1 Working on a new navbar and minor design tweaks for the status page 2016-03-21 17:38:50 +00:00
James Brooks
ac31067333 Sync the session config 2016-03-21 16:38:40 +00:00
James Brooks
c293c39118 Sync up the database config 2016-03-21 16:38:39 +00:00
James Brooks
b8d148e79d Remove Stripe service 2016-03-21 16:38:39 +00:00
James Brooks
b29cc6824c Merge pull request #1639 from CachetHQ/analysis-zOMoVR
Applied fixes from StyleCI
2016-03-20 16:26:43 +00:00
James Brooks
7d73bc8b23 Applied fixes from StyleCI 2016-03-20 12:26:38 -04:00
James Brooks
22dbf290b4 Sync language files 2016-03-20 16:26:21 +00:00
James Brooks
dcec1e2e95 Show last updated for components. Closes #1627 2016-03-20 16:23:21 +00:00
James Brooks
a64b5c1046 Merge pull request #1638 from CachetHQ/update-deps
Update dependencies. Closes #1633
2016-03-20 16:14:08 +00:00
James Brooks
a5b0b2a1b5 Update dependencies. Closes #1633 2016-03-20 16:13:37 +00:00
James Brooks
6643d417b7 Merge pull request #1637 from CachetHQ/fix-acceptable-middleware
We don't need to pass "accepts:"
2016-03-20 14:54:39 +00:00
James Brooks
9ad20d013b We don't need to pass "accepts:". Fixes #1636 2016-03-20 12:07:07 +00:00
James Brooks
37c8e5924f Merge pull request #1632 from CachetHQ/fix-change-profile-password
Change others password
2016-03-18 09:15:03 +00:00
James Brooks
ea62a22998 Fixes #1630 - change others password 2016-03-18 09:00:25 +00:00
James Brooks
fa744b1b97 Merge pull request #1628 from fabian/chartjs2
Improvements for new Chart.js
2016-03-17 12:38:32 +00:00
Fabian Vogler
15907a6112 Set Chart.js animation duration
Animate lines after loading

https://github.com/CachetHQ/Cachet/pull/1625#issuecomment-197856024
2016-03-17 13:32:06 +01:00
Fabian Vogler
b58b6d8375 Increase Chart.js point hit detection radius
Default was 1

https://github.com/CachetHQ/Cachet/pull/1625#issuecomment-197819293
2016-03-17 12:11:27 +01:00
James Brooks
ffa1fdbf1a Rebuilt assets 2016-03-17 09:20:55 +00:00
James Brooks
5b646f9618 Merge pull request #1625 from fabian/chartjs2
Upgrade to Chart.js 2.0-beta2
2016-03-17 09:18:23 +00:00
Fabian Vogler
cbff8d50fa Add border color for metrics 2016-03-17 09:49:25 +01:00
Fabian Vogler
cc37fcfa78 Upgrade to Chart.js 2.0-beta2 2016-03-17 09:21:05 +01:00
James Brooks
71d6e692eb Merge pull request #1624 from CachetHQ/fix-component-group-collapsed-migration
Fixes #1608
2016-03-16 19:49:50 +00:00
James Brooks
045667dce8 Fixes #1608 2016-03-16 19:43:19 +00:00
Joe Cohen
93dcf5b68a Merge pull request #1623 from CachetHQ/missing-important
Add missing in important outline buttons
2016-03-16 13:42:20 -06:00
Joseph Cohen
1b383e1d57 Add missing in important outline buttons 2016-03-16 13:29:44 -06:00
James Brooks
83c03cc3c7 Merge pull request #1622 from CachetHQ/fix-scheduled-templates
Scheduled maintenance templates now work
2016-03-16 17:55:59 +00:00
James Brooks
419fa31d6e Fixes #1620 2016-03-16 17:40:26 +00:00
James Brooks
17bb3f66e8 Merge pull request #1621 from CachetHQ/truncate-incident-templates
Truncate incident templates
2016-03-16 09:41:52 +00:00
James Brooks
97ba43a898 Show incident template counts in the sidebar 2016-03-16 09:27:44 +00:00
James Brooks
51bbcc2a7d Always truncate incident templates 2016-03-16 09:26:39 +00:00
James Brooks
8e8a78ca10 Updated dashboard translations 2016-03-16 09:15:43 +00:00
James Brooks
dd062c673f Fix lost translations 2016-03-16 09:09:09 +00:00
James Brooks
4cb57c5f1e Rebuild assets 2016-03-16 09:05:41 +00:00
Graham Campbell
bf1ef04ce2 Merge pull request #1619 from CachetHQ/fix-subscribe-button
Fix status page subscribe button style
2016-03-15 23:43:31 +00:00
Joseph Cohen
4a86604bcc Fix status page subscribe button style 2016-03-15 16:29:48 -06:00
Joseph Cohen
6610c1a50c Rebuild assets 2016-03-15 15:31:43 -06:00
James Brooks
957d7e5722 Merge pull request #1618 from CachetHQ/fresh-look
New backoffice theme
2016-03-15 21:30:15 +00:00
Joseph Cohen
9844d0cff4 New backoffice theme 2016-03-15 15:15:40 -06:00
James Brooks
141ffeb474 Merge pull request #1616 from CachetHQ/sync-langs
Sync the language files
2016-03-15 17:50:16 +00:00
James Brooks
31614d0c4d Merge pull request #1615 from CachetHQ/analysis-8L3QVl
Applied fixes from StyleCI
2016-03-15 17:26:20 +00:00
James Brooks
3817fc2cc6 Applied fixes from StyleCI 2016-03-15 13:26:15 -04:00
James Brooks
3a278c1f5b Sync the language files 2016-03-15 17:25:56 +00:00
James Brooks
6c8a6b2822 Merge pull request #1612 from ManneW/ManneW-release-notes-1
Added section about release notes to README.md
2016-03-14 13:49:15 +00:00
Emanuel Winblad
0d4c7a7e28 Added section about release notes to README.md
A section for Release Notes has been added as a sub-item to the section "Installation, Upgrades and Documentation".
2016-03-14 14:21:19 +01:00
Graham Campbell
97b23cd002 Merge pull request #1609 from CachetHQ/fix-pg-change
Default to 2
2016-03-13 17:21:33 +00:00
James Brooks
97ec85ba2a Default to 2 2016-03-13 11:39:15 +00:00
Graham Campbell
cdfaadf986 Updated dependencies 2016-03-13 11:02:36 +00:00
James Brooks
9919853d07 Merge pull request #1604 from CachetHQ/auto-expand-component-groups
Auto expand component groups
2016-03-10 16:01:04 +00:00
James Brooks
a0477b03e3 Option to auto-expand groups when components are down. Closes #1602 2016-03-10 15:01:13 +00:00
James Brooks
d4d31efeb7 Show the y-axis scale bars. Closes #1600 2016-03-10 08:54:22 +00:00
James Brooks
5fd3f379fc Rebuilt assets 2016-03-09 11:33:36 +00:00
James Brooks
b2fca4c55a Reduce the border-radius on .pager links 2016-03-09 11:33:31 +00:00
James Brooks
1a7b97b8b2 Remove unused _variables.scss 2016-03-09 11:29:44 +00:00
James Brooks
247016b61d Updated dependencies 2016-03-09 11:26:27 +00:00
James Brooks
13f1e6a713 Fix docblocks 2016-03-09 11:25:41 +00:00
James Brooks
f9e332cac7 Merge pull request #1579 from CachetHQ/basic-api-searching
Implement very basic API searching
2016-03-08 20:20:52 +00:00
James Brooks
0b3483fb8a Implement very basic API searching. Closes #1348 2016-03-08 18:55:04 +00:00
James Brooks
9379ab131c Merge pull request #1596 from CachetHQ/custom-headers-footers
Custom headers footers
2016-03-08 15:16:36 +00:00
James Brooks
5fa698f5b7 Custom headers and footers! Closes #1594 2016-03-08 15:00:29 +00:00
James Brooks
83991c132a Merge branch 'master' of github.com:CachetHQ/Cachet 2016-03-08 12:57:01 +00:00
Graham Campbell
6e7190b6bd Merge pull request #1593 from CachetHQ/deps
Updated dependencies
2016-03-08 09:19:30 +00:00
Graham Campbell
9791118581 Updated dependencies 2016-03-08 08:56:25 +00:00
James Brooks
186ea7e8c3 Updated dependencies 2016-03-07 11:58:10 +00:00
James Brooks
3184df7d6c Merge pull request #1580 from CachetHQ/scrolling-components-list
Scrolls the component list
2016-03-05 13:53:42 +00:00
James Brooks
06284ecd13 Closes #1500 2016-03-05 13:53:29 +00:00
James Brooks
4150f8c032 Fixes #1586 2016-03-05 13:38:06 +00:00
James Brooks
8051186de3 Merge pull request #1583 from CachetHQ/typehint-routers
Typehint router classes
2016-03-02 15:30:10 +00:00
James Brooks
d9c97d3ef5 Typehint all of the routers 2016-03-02 12:18:30 +00:00
James Brooks
73d59e082d Added cachet:seed command to docs 2016-02-29 22:12:41 +00:00
James Brooks
57273dd96f Added contributing help for non-developers, designers and developers 2016-02-29 22:10:40 +00:00
James Brooks
b4e023b7ce Added short description 2016-02-29 22:01:59 +00:00
James Brooks
924e74d3c8 Added Packagist badge 2016-02-29 22:00:58 +00:00
James Brooks
335d326a73 Updated node packages 2016-02-29 21:58:09 +00:00
James Brooks
d572a67855 Update bower assets. Rebuild. 2016-02-29 21:48:22 +00:00
James Brooks
328608dfff Colour the panel message arrows. Closes #1567 2016-02-29 21:40:40 +00:00
James Brooks
be78216ff3 Added a version endpoint 2016-02-29 21:31:25 +00:00
James Brooks
24a29f2251 Merge branch 'master' of github.com:CachetHQ/Cachet 2016-02-29 21:24:30 +00:00
James Brooks
d4655112ca Don't override existing data when updating metrics 2016-02-29 21:24:11 +00:00
James Brooks
f30710c5a8 Fixes #1574 - default display_chart to true 2016-02-29 21:23:58 +00:00
James Brooks
eee94086db Fix French not being German! 2016-02-29 20:45:35 +00:00
James Brooks
ca152ecbc0 Merge pull request #1573 from CachetHQ/analysis-8L3RaG
Applied fixes from StyleCI
2016-02-29 20:45:30 +00:00
James Brooks
fce4823d2c Applied fixes from StyleCI 2016-02-29 15:45:25 -05:00
James Brooks
a20b95b87c Updated dependencies 2016-02-29 20:34:09 +00:00
James Brooks
640571a6bc Moved CONTRIBUTING doc back to root 2016-02-29 20:32:49 +00:00
James Brooks
2ad0085370 Merge pull request #1568 from CachetHQ/meta-updates
Updated meta content for inline-previewing
2016-02-26 11:51:24 +00:00
James Brooks
053d3191c8 Updated meta content for inline-previewing 2016-02-26 11:35:53 +00:00
Graham Campbell
6b6f5ee09d Merge pull request #1566 from CachetHQ/remove-chmod
Remove chmod script
2016-02-26 10:43:33 +00:00
James Brooks
481296ad21 Remove chmod script 2016-02-26 10:10:25 +00:00
James Brooks
55d4a639d9 Merge pull request #1565 from CachetHQ/move-contributing-doc
Move the CONTRIBUTING.md file into .github
2016-02-26 08:34:48 +00:00
James Brooks
b19c9fc885 Move the CONTRIBUTING.md file into .github 2016-02-26 08:21:33 +00:00
Graham Campbell
a2abd43fd2 Merge pull request #1404 from CachetHQ/native-throttling
Native throttling
2016-02-25 21:40:40 +00:00
Graham Campbell
1ab9d95b9c Native throttling 2016-02-25 21:26:46 +00:00
Graham Campbell
08b490a3cc Merge pull request #1550 from CachetHQ/fix-api-paging
Start fixing sorting on API
2016-02-25 19:14:37 +00:00
Joseph Cohen
919c7127e7 Fixes API sorting and filtering. Closes #1489 2016-02-25 18:58:42 +00:00
Graham Campbell
98550c31c9 Merge pull request #1553 from CachetHQ/update-cors
Update cors
2016-02-25 17:51:18 +00:00
James Brooks
4deff42aff Updated laravel-cors. Closes #1485 2016-02-25 17:50:51 +00:00
Graham Campbell
e8cbd81ad0 Merge pull request #1561 from CachetHQ/deps
Updated dependencies
2016-02-25 17:45:03 +00:00
Graham Campbell
54a8fbd185 Updated dependencies 2016-02-25 17:35:37 +00:00
James Brooks
49c6a7806b Rebuilt assets 2016-02-24 13:51:08 +00:00
James Brooks
251e90433e Merge pull request #1554 from CachetHQ/tweaks
Tweaks
2016-02-24 13:50:13 +00:00
James Brooks
3f7d1f588b Remove unused styles 2016-02-24 13:39:17 +00:00
James Brooks
9a3b073fc6 Split up component groups to make it more obvious 2016-02-24 13:36:27 +00:00
James Brooks
f92761437d Move position of "About This Site". Don't double wrap text. 2016-02-24 13:20:33 +00:00
James Brooks
f186907d8b Seed with app_about data 2016-02-24 13:16:58 +00:00
James Brooks
718bd99c24 Merge pull request #1549 from CachetHQ/model-factory-change
Make the model factories more dynamic
2016-02-24 12:34:28 +00:00
James Brooks
5c0f39759e Make the model factories more dynamic 2016-02-24 12:14:33 +00:00
Graham Campbell
bc9607a735 Merge pull request #1543 from CachetHQ/paginate-metric-points-api
Paginate the points API for metrics
2016-02-22 16:58:56 +00:00
James Brooks
01e40c4684 Paginate the points API for metrics 2016-02-22 14:53:34 +00:00
Graham Campbell
69fe2d7b3a Merge pull request #1539 from CachetHQ/deps
Updated dependencies
2016-02-21 16:09:27 +00:00
Graham Campbell
363dd5358f Updated dependencies 2016-02-21 16:04:25 +00:00
Graham Campbell
3487194415 Merge pull request #1470 from CachetHQ/view-subscriptions
Subscription changes
2016-02-21 15:55:17 +00:00
James Brooks
08dc9e0be9 Merge pull request #1538 from CachetHQ/remove-badger-dependency
Remove JamesForks/badger dependency
2016-02-21 10:52:01 +00:00
James Brooks
781b2238c6 Remove JamesForks/badger dependency. Closes #1537 2016-02-21 10:25:30 +00:00
Joseph Cohen
e51504b3ec Add manage link to email notifications 2016-02-20 21:32:14 +00:00
James Brooks
af0e578a44 Manage my subscriptions page 2016-02-20 21:32:13 +00:00
James Brooks
140970ac37 Changed subscribers page description 2016-02-20 21:32:12 +00:00
James Brooks
0b78332a20 Display what subscriptions (if any) a subscriber has 2016-02-20 21:32:11 +00:00
James Brooks
c9f08a3e6e Show the verified subscriber count in the sidebar 2016-02-20 21:32:09 +00:00
Graham Campbell
52a1f42426 Merge branch '2.1'
# Conflicts:
#	VERSION
2016-02-20 21:31:04 +00:00
Graham Campbell
7bbba6e897 Bumped version 2016-02-20 21:29:33 +00:00
Graham Campbell
0f5008f301 Released 2.1.2 2016-02-20 21:28:45 +00:00
Graham Campbell
dc1022e6f3 Merge pull request #1536 from CachetHQ/merge
Merge from 2.1, and updates
2016-02-20 21:19:32 +00:00
Graham Campbell
63eaaa325e Updated dependencies 2016-02-20 21:18:26 +00:00
Graham Campbell
819738cc77 Updated badger 2016-02-20 21:14:42 +00:00
Graham Campbell
d096e603d4 Merge branch '2.1' into merge
# Conflicts:
#	composer.json
#	composer.lock
2016-02-20 21:14:25 +00:00
Graham Campbell
0d614fe0c3 Merge pull request #1535 from CachetHQ/composer
Updated deps
2016-02-20 21:12:08 +00:00
Graham Campbell
d8ed965282 Updated deps 2016-02-20 21:00:41 +00:00
Graham Campbell
39092ff18e Bumped min laravel version 2016-02-20 20:40:44 +00:00
Graham Campbell
7d297a5c96 Merge pull request #1534 from CachetHQ/fix
Removed bad file
2016-02-20 20:40:05 +00:00
Graham Campbell
785fdea56d Removed bad file 2016-02-20 20:38:45 +00:00
James Brooks
b8198c0d4f Merge pull request #1533 from CachetHQ/fix-hourly-metric-points
Fix Last hour metric points
2016-02-20 20:25:35 +00:00
James Brooks
58f755d136 Fix Last hour metric points. Closes #1482 2016-02-20 19:39:07 +00:00
James Brooks
8d1c244e02 Merge pull request #1430 from CachetHQ/component-shields
Added Component badges/shields
2016-02-20 14:00:10 +00:00
James Brooks
37898bee60 Added Component badges/shields. Closes #1313 2016-02-20 13:14:29 +00:00
James Brooks
7b05d1d1b6 Merge pull request #1524 from CachetHQ/issue-template
Create ISSUE_TEMPLATE
2016-02-20 12:22:02 +00:00
James Brooks
625b7d9a81 Create ISSUE_TEMPLATE 2016-02-20 11:58:54 +00:00
James Brooks
cb08443b27 Merge pull request #1525 from CachetHQ/change-metric-points-value-column
Change metric_points.value to DECIMAL(15,3)
2016-02-20 11:54:40 +00:00
James Brooks
207361d227 Merge pull request #1527 from CachetHQ/sync-langs
Sync language files
2016-02-18 14:41:53 +00:00
James Brooks
de5b5bdda5 Sync language files 2016-02-18 14:16:40 +00:00
James Brooks
e25472fc18 Merge pull request #1523 from CachetHQ/timezone-error
Use create instead of createNormalized on handlers
2016-02-18 14:05:13 +00:00
James Brooks
026d296d8f Change metric_points.value to DECIMAL(15,3). Closes #1508 2016-02-18 08:53:16 +00:00
Joseph Cohen
537017925f Use create instead of createNormalized on handlers 2016-02-17 17:08:36 -06:00
Graham Campbell
37af01483a Merge pull request #1519 from CachetHQ/merge
Merge branch '2.1'
2016-02-17 20:22:26 +00:00
Graham Campbell
726f5e851d Merge branch '2.1' 2016-02-17 20:08:56 +00:00
Graham Campbell
1ddd868449 Merge pull request #1518 from CachetHQ/deps
Updated laravel again
2016-02-17 20:01:24 +00:00
Graham Campbell
4a6e47c86b Updated laravel again 2016-02-17 19:55:47 +00:00
Graham Campbell
02b893cc89 Merge pull request #1517 from CachetHQ/fix-js-object
Fix [object object] notification error with js
2016-02-17 19:46:53 +00:00
Joseph Cohen
b8f89e97cd Fix [object object] notification error with js 2016-02-17 13:46:02 -06:00
Graham Campbell
42c8ee8adf Merge pull request #1515 from CachetHQ/laravel
Updated Laravel
2016-02-17 19:23:08 +00:00
Graham Campbell
9d0a49b2be Updated composer.lock 2016-02-17 18:36:30 +00:00
Graham Campbell
5de5a5cd91 Bumped laravel version 2016-02-17 18:33:42 +00:00
Graham Campbell
73fa0951f7 Merge pull request #1514 from CachetHQ/version
Bumped version to target 2.2
2016-02-17 17:34:13 +00:00
Graham Campbell
4e3879a949 Updated composer.lock hashes 2016-02-17 17:33:53 +00:00
Graham Campbell
7f55829035 Bumped version to target 2.2 2016-02-17 17:28:29 +00:00
Graham Campbell
63dd826377 Merge pull request #1512 from CachetHQ/ajax-charts
Load metrics via AJAX
2016-02-17 17:27:09 +00:00
James Brooks
2565774fea Load metrics via AJAX. Fixes #819 2016-02-17 17:08:15 +00:00
Graham Campbell
c72974de27 Merge pull request #1509 from CachetHQ/deps
Updated deps
2016-02-17 11:59:52 +00:00
Graham Campbell
676e7be9fb Updated deps 2016-02-17 11:43:52 +00:00
Graham Campbell
cfca0434ba Merge pull request #1506 from CachetHQ/dont-notify-incident-default
Fixes #1496
2016-02-16 13:00:14 +00:00
James Brooks
8264f72a5a Fixes #1496 2016-02-16 08:58:44 +00:00
James Brooks
3cb6ba237c Merge pull request #1502 from CachetHQ/ignore-token-field
Ignore the _token field when updating settings
2016-02-15 13:00:48 +00:00
James Brooks
e8e8dc2828 Ignore the _token field when updating settings 2016-02-15 10:42:05 +00:00
James Brooks
8a5b07f8d2 Merge pull request #1501 from CachetHQ/fix-piwik-siteid
Properly store the piwik site id
2016-02-15 10:41:32 +00:00
James Brooks
98f0d7ed31 Properly store the piwik site id
Fixes #1499
2016-02-15 10:17:37 +00:00
Graham Campbell
dc45f7625a Bumped version 2016-02-13 21:38:05 +00:00
Graham Campbell
694727f6d6 Released 2.1.1 2016-02-13 21:37:19 +00:00
Graham Campbell
3f991ddb63 Lock down laravel version 2016-02-13 21:36:43 +00:00
Joe Cohen
17b7aa1ca7 Merge pull request #1492 from CachetHQ/env
Fixed env issues in the setup
2016-02-12 18:30:25 -06:00
Graham Campbell
62bed608cb Fixed env issues in the setup 2016-02-12 21:40:05 +00:00
James Brooks
c089d9f5a5 Merge pull request #1483 from CachetHQ/middelware-typehinting
Typehint middlewares
2016-02-11 13:38:11 +00:00
James Brooks
45843a2c89 Typehint middlewares
Closes #1478
2016-02-11 11:37:01 +00:00
James Brooks
d812485386 Merge pull request #1479 from CachetHQ/typo
Fixed typo
2016-02-11 11:36:53 +00:00
Graham Campbell
0746abd2f1 Fixed typo 2016-02-10 14:33:16 +00:00
Graham Campbell
534a546efb Merge pull request #1476 from CachetHQ/tweak
Tweaked deps
2016-02-10 11:39:40 +00:00
Graham Campbell
e5166ca42a Updated deps 2016-02-10 11:32:43 +00:00
Graham Campbell
8368c669ce Tweaked min dep version 2016-02-10 11:28:11 +00:00
James Brooks
b33c31eb81 Merge pull request #1472 from CachetHQ/feed-updates
Feed updates
2016-02-10 07:48:26 +00:00
James Brooks
27d97c1287 Updated roumen/feed 2016-02-09 19:57:20 +00:00
Graham Campbell
314a310dce Merge pull request #1469 from clbn/patch-1
Make the Y axis start at zero

Closes #1363
2016-02-09 09:11:11 +00:00
Alex Olshansky
f2365e6e67 Make the Y axis start at zero
Because tiny changes in, say, response time (210ms -> 219ms -> 208ms) on the non-zero Y scale (200ms to 220ms) might look like really big scary peaks or dips even if they are actually not.
2016-02-09 09:57:27 +01:00
James Brooks
025373aa1a Merge pull request #1468 from lenovouser/fix-sidebar-border
Fix sidebar buttons
2016-02-08 13:43:35 +00:00
lenovouser
248918f875 Fix sidebar buttons
If you hover it moves because the border at the bottom gets changed.
2016-02-08 14:34:46 +01:00
James Brooks
9666dc67f9 Merge pull request #1467 from CachetHQ/fix-invite-claimed-event
Fix bad import of invite was claimed event
2016-02-08 12:15:09 +00:00
James Brooks
c7af76af56 Fix bad import of invite was claimed event. Fixes #1466 2016-02-08 12:03:40 +00:00
Graham Campbell
9fe1d2ee50 Merge pull request #1458 from CachetHQ/fix
Fixed division by zero error
2016-02-06 22:47:09 +00:00
Graham Campbell
c11daf2898 Fixed division by zero error 2016-02-06 22:26:26 +00:00
Graham Campbell
992627f1f2 Bumped version 2016-02-06 17:00:20 +00:00
Graham Campbell
4d27b189d7 Released 2.1.0 2016-02-06 16:59:15 +00:00
Graham Campbell
221735cd40 Updated dependencies 2016-02-06 16:57:07 +00:00
Graham Campbell
94c768c823 Update VERSION 2016-02-05 14:46:03 +00:00
Graham Campbell
9d31926401 Released 2.1.0-RC2 2016-02-05 14:45:12 +00:00
Graham Campbell
6b875b8218 Merge pull request #1454 from CachetHQ/phpunit
Updated phpunit config
2016-02-05 14:44:05 +00:00
Graham Campbell
6806c018af Updated phpunit config 2016-02-05 14:21:54 +00:00
Graham Campbell
26f6bdeaca Merge pull request #1450 from CachetHQ/incident-presenter-date-factory
Incident presenter date factory
2016-02-05 11:04:00 +00:00
James Brooks
50a7441808 Switch to the DateFactory. Closes #1444 2016-02-05 09:32:42 +00:00
Graham Campbell
ced993af1f Merge pull request #1448 from CachetHQ/update
Updated dependencies
2016-02-04 22:05:55 +00:00
Graham Campbell
3f664ca6f6 Updated dependencies 2016-02-04 21:27:13 +00:00
James Brooks
3f59a11ddc Merge pull request #1447 from CachetHQ/metrics
Fixed bug in the metric repo provider
2016-02-03 09:25:46 +00:00
Graham Campbell
ab2ab5d606 Fixed bug in the metric repo provider 2016-02-02 23:46:42 +00:00
James Brooks
a0e1845658 Merge pull request #1446 from CachetHQ/fix-incident-templates
Twigbridge fixes
2016-02-02 22:29:40 +00:00
James Brooks
69e1bc3948 Fixes #1437, fixes # 2016-02-02 22:08:03 +00:00
Graham Campbell
02816f99c0 Merge pull request #1443 from CachetHQ/stuffs
Working on datetime mess
2016-02-02 22:05:41 +00:00
Graham Campbell
9edba5aacc Minor fixes 2016-02-02 20:49:00 +00:00
Graham Campbell
921116a198 More fixes 2016-02-02 20:46:46 +00:00
Graham Campbell
4923a59b76 Working on datetime mess 2016-02-02 20:35:43 +00:00
Graham Campbell
705b9e62dc Merge pull request #1442 from CachetHQ/bug
Fixed bug in the createNormalized function
2016-02-02 20:35:04 +00:00
Graham Campbell
149ea9a3ff Fixed bug in the createNormalized function 2016-02-02 20:19:55 +00:00
Graham Campbell
87c261a42d Merge pull request #1441 from CachetHQ/remove
Removed old code
2016-02-02 20:18:24 +00:00
Graham Campbell
ff6d26cc59 Removed old code 2016-02-02 20:06:16 +00:00
James Brooks
6c098cc1fa Merge pull request #1438 from CachetHQ/fix-timezone-metrics
Remove converting timezone for fetching
2016-02-02 19:45:05 +00:00
Joseph Cohen
47bba0b927 Remove converting timezone for fetching 2016-02-02 11:15:47 -06:00
James Brooks
7f80b13e2d Merge pull request #1434 from CachetHQ/fix-dashboard-issus
Fix some dashboard issues
2016-02-01 19:38:07 +00:00
James Brooks
3e834f0104 Fix some dashbiard issues 2016-02-01 19:26:00 +00:00
Graham Campbell
2c26bd7396 Merge pull request #1424 from CachetHQ/fixes
Fixes
2016-01-31 17:03:29 +00:00
James Brooks
a1206af764 Initialize the response array 2016-01-31 16:46:30 +00:00
James Brooks
9c4c3d3843 Fix AlreadySubscribedException import 2016-01-31 16:38:15 +00:00
James Brooks
a82f1ce09a Remove unused Config facade 2016-01-31 16:38:08 +00:00
James Brooks
0a6f16a5b9 Update VERSION 2016-01-31 16:37:45 +00:00
555 changed files with 18490 additions and 8555 deletions

View File

@@ -1,4 +0,0 @@
{
"directory": "vendor/bower_components",
"interactive": false
}

View File

@@ -9,10 +9,11 @@ DB_DATABASE=cachet
DB_USERNAME=homestead
DB_PASSWORD=secret
DB_PORT=null
DB_PREFIX=null
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=database
QUEUE_DRIVER=sync
CACHET_EMOJI=false
MAIL_DRIVER=smtp

2
.gitattributes vendored
View File

@@ -1,3 +1,5 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
/.github export-ignore
/tests export-ignore

20
.github/ISSUE_TEMPLATE vendored Normal file
View File

@@ -0,0 +1,20 @@
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.6.4. *You can check this by running `php -v`.*
- [ ] I have ran `rm -rf bootstrap/cache/*`.
### Expected behaviour
*Please describe what you're expecting to see happen.*
### Actual behaviour
*Please describe what you're actually seeing happen.*
### Steps to reproduce
*If your issue requires any specific steps to reproduce, please outline them here.*
1. First step
2. Second step

View File

@@ -1,21 +1,12 @@
language: php
php:
- 5.5.9
- 5.5
- 5.6
- 7.0
- hhvm
sudo: false
install:
- travis_retry composer install --no-interaction --no-scripts --prefer-source
install: travis_retry composer install --no-interaction --no-scripts --prefer-source
script:
- if [ "$TRAVIS_PHP_VERSION" != "5.6" ] || [ "$TRAVIS_PULL_REQUEST" != false ]; then vendor/bin/phpunit; fi
- if [ "$TRAVIS_PHP_VERSION" == "5.6" ] && [ "$TRAVIS_PULL_REQUEST" == false ]; then vendor/bin/phpunit --coverage-clover build/logs/clover.xml; fi
after_script:
- if [ "$TRAVIS_PHP_VERSION" == "5.6" ] && [ "$TRAVIS_PULL_REQUEST" == false ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [ "$TRAVIS_PHP_VERSION" == "5.6" ] && [ "$TRAVIS_PULL_REQUEST" == false ]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi
script: vendor/bin/phpunit

View File

@@ -1,13 +1,19 @@
# Cachet
[![StyleCI](https://styleci.io/repos/26730195/shield)](https://styleci.io/repos/26730195/)
[![Build Status](https://img.shields.io/travis/CachetHQ/Cachet.svg?style=flat-square)](https://travis-ci.org/CachetHQ/Cachet)
[![Quality Score](https://img.shields.io/scrutinizer/g/CachetHQ/Cachet.svg?style=flat-square)](https://scrutinizer-ci.com/g/CachetHQ/Cachet)
[![Build Status](https://img.shields.io/travis/CachetHQ/Cachet/master.svg?style=flat-square)](https://travis-ci.org/CachetHQ/Cachet)
[![Software License](https://img.shields.io/badge/license-BSD3-brightgreen.svg?style=flat-square)](LICENSE)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/cachet/localized.png)](http://translate.cachethq.io/project/cachet)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/cachet/localized.svg)](http://translate.cachethq.io/project/cachet)
[![Packagist](https://img.shields.io/packagist/v/cachethq/cachet.svg?style=flat-square)](https://packagist.org/packages/cachethq/cachet)
![Screenshot](https://cachethq.io/img/main-interface.jpg)
Cachet is a beautiful and powerful open source status page system, a free replacement to services such as StatusPage.io, Status.io and others.
## Show your support
Cachet is a BSD-3-licensed open source project. If you'd like to support future development, check out the [Patreon campaign](https://patreon.com/jbrooksuk).
## Features
- List your services components
@@ -23,20 +29,49 @@
## 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)
### Development Requirements
## How to contribute
These extra dependencies are required to develop Cachet:
We're always looking for contributions that improve Cachet. It's easy to get started and you don't even need to know how to write a single line of code!
### Contributing as a non-developer/non-designer
We're always looking for new [translations](#translations).
Of course bug reports, feature requests and [documentation](https://docs.cachethq.io) are always appreciated.
### Contributing as a designer
As Cachet gains new features, the design and ideas that were once a perfect fit need updating and in some cases designing from scratch. This is where you come in! Fancy giving Cachet a lick of paint? Sweet!
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. 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 make life easier for you!
### Contributing as a developer
Built using [Laravel](https://laravel.com).
We use these extra dependencies to develop Cachet:
- Node.js
- Bower
- Gulp
- Git
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
@@ -44,7 +79,6 @@ You can now find our documentation at [https://docs.cachethq.io](https://docs.ca
- [Installing Cachet](https://docs.cachethq.io/docs/installing-cachet)
- [Getting started with Docker](https://docs.cachethq.io/docs/get-started-with-docker)
- [Getting started with Vagrant](https://docs.cachethq.io/docs/get-started-with-vagrant)
### Demo Account
@@ -55,10 +89,20 @@ To test out the demo, you may login to the [Dashboard](https://demo.cachethq.io/
The demo is reset every half hour.
### Release Notes
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
A special thank you to our [translators](https://crowdin.com/project/cachet/activity_stream), who have allowed us to share Cachet with the world. If you'd like to contribute translations, please check out our [CrowdIn project](https://crowdin.com/project/cachet).
## 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
We offer a paid installation service, which starts at $99 but is subject to change, dependant on your setup and infrastructure.
To find out more, email us at support@alt-three.com

View File

@@ -1 +1 @@
2.1.0-RC1
3.0.0-dev

View File

@@ -11,6 +11,11 @@
namespace CachetHQ\Cachet\Bus\Commands\ComponentGroup;
/**
* This is the add component group command.
*
* @author James Brooks <james@alt-three.com>
*/
final class AddComponentGroupCommand
{
/**
@@ -30,7 +35,7 @@ final class AddComponentGroupCommand
/**
* Is the component group collapsed?
*
* @var bool
* @var int
*/
public $collapsed;
@@ -42,7 +47,7 @@ final class AddComponentGroupCommand
public $rules = [
'name' => 'required|string',
'order' => 'int',
'collapsed' => 'bool',
'collapsed' => 'int|between:0,3',
];
/**
@@ -50,7 +55,7 @@ final class AddComponentGroupCommand
*
* @param string $name
* @param int $order
* @param bool $collapsed
* @param int $collapsed
*
* @return void
*/

View File

@@ -13,6 +13,11 @@ namespace CachetHQ\Cachet\Bus\Commands\ComponentGroup;
use CachetHQ\Cachet\Models\ComponentGroup;
/**
* This is the update component group command.
*
* @author James Brooks <james@alt-three.com>
*/
final class UpdateComponentGroupCommand
{
/**
@@ -39,7 +44,7 @@ final class UpdateComponentGroupCommand
/**
* Is the component group collapsed?
*
* @var bool
* @var int
*/
public $collapsed;
@@ -51,7 +56,7 @@ final class UpdateComponentGroupCommand
public $rules = [
'name' => 'string',
'order' => 'int',
'collapsed' => 'bool',
'collapsed' => 'int|between:0,3',
];
/**
@@ -60,7 +65,7 @@ final class UpdateComponentGroupCommand
* @param \CachetHQ\Cachet\Models\ComponentGroup $group
* @param string $name
* @param int $order
* @param bool $collapsed
* @param int $collapsed
*
* @return void
*/

View File

@@ -0,0 +1,61 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
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;
}
}

View File

@@ -0,0 +1,61 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
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;
}
}

View 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\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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -69,6 +69,20 @@ final class AddMetricCommand
*/
public $default_view;
/**
* The threshold to buffer the metric points in.
*
* @var int
*/
public $threshold;
/**
* The order of which to place the metric in.
*
* @var int
*/
public $order;
/**
* The validation rules.
*
@@ -84,6 +98,8 @@ final class AddMetricCommand
'display_chart' => 'int',
'places' => 'int|between:0,4',
'default_view' => 'int|between:0,3',
'threshold' => 'numeric|between:0,10',
'order' => 'int',
];
/**
@@ -97,10 +113,12 @@ final class AddMetricCommand
* @param int $display_chart
* @param int $places
* @param int $default_view
* @param int $threshold
* @param int $order
*
* @return void
*/
public function __construct($name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view)
public function __construct($name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order = 0)
{
$this->name = $name;
$this->suffix = $suffix;
@@ -110,5 +128,7 @@ final class AddMetricCommand
$this->display_chart = $display_chart;
$this->places = $places;
$this->default_view = $default_view;
$this->threshold = $threshold;
$this->order = $order;
}
}

View File

@@ -42,7 +42,7 @@ final class AddMetricPointCommand
* @var string[]
*/
public $rules = [
'value' => 'int',
'value' => 'numeric',
'created_at' => 'string',
];

View File

@@ -78,6 +78,20 @@ final class UpdateMetricCommand
*/
public $default_view;
/**
* The threshold to buffer the metric points in.
*
* @var int
*/
public $threshold;
/**
* The order of which to place the metric in.
*
* @var int|null
*/
public $order;
/**
* The validation rules.
*
@@ -93,6 +107,8 @@ final class UpdateMetricCommand
'display_chart' => 'int',
'places' => 'numeric|between:0,4',
'default_view' => 'numeric|between:0,4',
'threshold' => 'numeric|between:0,10',
'order' => 'int',
];
/**
@@ -107,10 +123,12 @@ final class UpdateMetricCommand
* @param int $display_chart
* @param int $places
* @param int $default_view
* @param int $threshold
* @param int|null $order
*
* @return void
*/
public function __construct(Metric $metric, $name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view)
public function __construct(Metric $metric, $name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order = null)
{
$this->metric = $metric;
$this->name = $name;
@@ -121,5 +139,7 @@ final class UpdateMetricCommand
$this->display_chart = $display_chart;
$this->places = $places;
$this->default_view = $default_view;
$this->threshold = $threshold;
$this->order = $order;
}
}

View File

@@ -14,6 +14,11 @@ namespace CachetHQ\Cachet\Bus\Commands\Metric;
use CachetHQ\Cachet\Models\Metric;
use CachetHQ\Cachet\Models\MetricPoint;
/**
* This is the update metric point command.
*
* @author James Brooks <james@alt-three.com>
*/
final class UpdateMetricPointCommand
{
/**
@@ -33,7 +38,7 @@ final class UpdateMetricPointCommand
/**
* The metric point value.
*
* @var int
* @var float
*/
public $value;
@@ -50,7 +55,7 @@ final class UpdateMetricPointCommand
* @var string[]
*/
public $rules = [
'value' => 'int',
'value' => 'numeric',
'created_at' => 'string',
];
@@ -59,7 +64,7 @@ final class UpdateMetricPointCommand
*
* @param \CachetHQ\Cachet\Models\MetricPoint $point
* @param \CachetHQ\Cachet\Models\Metric $metric
* @param int $value
* @param float $value
* @param string $created_at
*
* @return void

View File

@@ -33,7 +33,7 @@ final class SubscribeSubscriberCommand
public $verified;
/**
* The subscriptions that we want to add.
* The list of subscriptions to set the subscriber up with.
*
* @var array|null
*/
@@ -53,7 +53,7 @@ final class SubscribeSubscriberCommand
*
* @param string $email
* @param bool $verified
* @param null|array $subscriptions
* @param array|null $subscriptions
*
* @return void
*/

View 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\Subscriber;
use CachetHQ\Cachet\Models\Subscriber;
/**
* This is the subscribe subscriber command.
*
* @author Joseph Cohen <joe@alt-three.com>
*/
final class UpdateSubscriberSubscriptionCommand
{
/**
* The subscriber email.
*
* @var \CachetHQ\Cachet\Models\Subscriber
*/
public $subscriber;
/**
* The subscriptions that we want to add.
*
* @var array|null
*/
public $subscriptions;
/**
* Create a new subscribe subscriber command instance.
*
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
* @param null|array $subscriptions
*
* @return void
*/
public function __construct($subscriber, $subscriptions = null)
{
$this->subscriber = $subscriber;
$this->subscriptions = $subscriptions;
}
}

View 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;
}
}

View 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;
}
}

View File

@@ -0,0 +1,70 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\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;
}
}

View File

@@ -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',
];
/**

View File

@@ -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
*

View File

@@ -0,0 +1,90 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
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;
}
}

View 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\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
{
//
}

View 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\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;
}
}

View 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\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;
}
}

View 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\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;
}
}

View 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;
}
}

View 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 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
{
//
}

View File

@@ -9,18 +9,16 @@
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Bus\Exceptions\Subscriber;
namespace CachetHQ\Cachet\Bus\Exceptions\Tag;
use CachetHQ\Cachet\Bus\Exceptions\ExceptionInterface;
use Exception;
/**
* This is the already subscribed exception class.
* This is the tag exception interface.
*
* @author Graham Campbell <graham@alt-three.com>
* @author James Brooks <james@alt-three.com>
*/
class AlreadySubscribedException extends Exception implements ExceptionInterface
interface TagExceptionInterface extends ExceptionInterface
{
//
}

View File

@@ -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;
}
}

View 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\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();
}
}

View File

@@ -18,8 +18,13 @@ use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\IncidentTemplate;
use Twig_Loader_String;
use TwigBridge\Facade\Twig;
use TwigBridge\Bridge;
/**
* This is the report incident command handler.
*
* @author James Brooks <james@alt-three.com>
*/
class ReportIncidentCommandHandler
{
/**
@@ -29,16 +34,25 @@ class ReportIncidentCommandHandler
*/
protected $dates;
/**
* The twig bridge instance.
*
* @var \TwigBridge\Bridge
*/
protected $twig;
/**
* Create a new report incident command handler instance.
*
* @param \CachetHQ\Cachet\Dates\DateFactory $dates
* @param \TwigBridge\Bridge $twig
*
* @return void
*/
public function __construct(DateFactory $dates)
public function __construct(DateFactory $dates, Bridge $twig)
{
$this->dates = $dates;
$this->twig = $twig;
}
/**
@@ -50,17 +64,18 @@ class ReportIncidentCommandHandler
*/
public function handle(ReportIncidentCommand $command)
{
if ($command->template) {
$command->message = $this->parseIncidentTemplate($command->template, $command->template_vars);
}
$data = [
'name' => $command->name,
'status' => $command->status,
'message' => $command->message,
'visible' => $command->visible,
];
if ($command->template) {
$data['message'] = $this->parseIncidentTemplate($command->template, $command->template_vars);
} else {
$data['message'] = $command->message;
}
// Link with the component.
if ($command->component_id) {
$data['component_id'] = $command->component_id;
@@ -68,7 +83,7 @@ class ReportIncidentCommandHandler
// The incident occurred at a different time.
if ($command->incident_date) {
$incidentDate = $this->dates->createNormalized('d/m/Y H:i', $command->incident_date);
$incidentDate = $this->dates->create('d/m/Y H:i', $command->incident_date);
$data['created_at'] = $incidentDate;
$data['updated_at'] = $incidentDate;
@@ -101,9 +116,13 @@ class ReportIncidentCommandHandler
*/
protected function parseIncidentTemplate($templateSlug, $vars)
{
Twig::setLoader(new Twig_Loader_String());
if ($vars === null) {
$vars = [];
}
$this->twig->setLoader(new Twig_Loader_String());
$template = IncidentTemplate::forSlug($templateSlug)->first();
return Twig::render($template->template, $vars);
return $this->twig->render($template->template, $vars);
}
}

View File

@@ -46,7 +46,7 @@ class ReportMaintenanceCommandHandler
*/
public function handle(ReportMaintenanceCommand $command)
{
$scheduledAt = $this->dates->createNormalized('d/m/Y H:i', $command->timestamp);
$scheduledAt = $this->dates->create('d/m/Y H:i', $command->timestamp);
$maintenanceEvent = Incident::create([
'name' => $command->name,

View File

@@ -18,8 +18,13 @@ use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\IncidentTemplate;
use Twig_Loader_String;
use TwigBridge\Facade\Twig;
use TwigBridge\Bridge;
/**
* This is the update incident command handler.
*
* @author James Brooks <james@alt-three.com>
*/
class UpdateIncidentCommandHandler
{
/**
@@ -29,16 +34,25 @@ class UpdateIncidentCommandHandler
*/
protected $dates;
/**
* The twig bridge instance.
*
* @var \TwigBridge\Bridge
*/
protected $twig;
/**
* Create a new update incident command handler instance.
*
* @param \CachetHQ\Cachet\Dates\DateFactory $dates
* @param \TwigBridge\Bridge $twig
*
* @return void
*/
public function __construct(DateFactory $dates)
public function __construct(DateFactory $dates, Bridge $twig)
{
$this->dates = $dates;
$this->twig = $twig;
}
/**
@@ -59,7 +73,7 @@ class UpdateIncidentCommandHandler
// The incident occurred at a different time.
if ($command->incident_date) {
$incidentDate = $this->dates->createNormalized('d/m/Y H:i', $command->incident_date);
$incidentDate = $this->dates->create('d/m/Y H:i', $command->incident_date);
$incident->update([
'created_at' => $incidentDate,
@@ -113,9 +127,9 @@ class UpdateIncidentCommandHandler
*/
protected function parseIncidentTemplate($templateSlug, $vars)
{
Twig::setLoader(new Twig_Loader_String());
$this->twig->setLoader(new Twig_Loader_String());
$template = IncidentTemplate::forSlug($templateSlug)->first();
return Twig::render($template->template, $vars);
return $this->twig->render($template->template, $vars);
}
}

View File

@@ -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();
}
}

View File

@@ -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;
}
}

View File

@@ -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;
});
}
}

View File

@@ -12,7 +12,7 @@
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Invite;
use CachetHQ\Cachet\Bus\Commands\Invite\ClaimInviteCommand;
use CachetHQ\Cachet\Bus\Events\Invite\InviteWasClaimed;
use CachetHQ\Cachet\Bus\Events\Invite\InviteWasClaimedEvent;
use Carbon\Carbon;
class ClaimInviteCommandHandler
@@ -31,6 +31,6 @@ class ClaimInviteCommandHandler
$invite->claimed_at = Carbon::now();
$invite->save();
event(new InviteWasClaimed($invite));
event(new InviteWasClaimedEvent($invite));
}
}

View File

@@ -35,6 +35,8 @@ class AddMetricCommandHandler
'display_chart' => $command->display_chart,
'places' => $command->places,
'default_view' => $command->default_view,
'threshold' => $command->threshold,
'order' => $command->order,
]);
event(new MetricWasAddedEvent($metric));

View File

@@ -15,6 +15,7 @@ use CachetHQ\Cachet\Bus\Commands\Metric\AddMetricPointCommand;
use CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasAddedEvent;
use CachetHQ\Cachet\Dates\DateFactory;
use CachetHQ\Cachet\Models\MetricPoint;
use Carbon\Carbon;
class AddMetricPointCommandHandler
{
@@ -49,19 +50,35 @@ class AddMetricPointCommandHandler
$metric = $command->metric;
$createdAt = $command->created_at;
$data = [
'metric_id' => $metric->id,
'value' => $command->value,
];
// Do we have an existing point with the same value?
$point = $this->findOrCreatePoint($command);
if ($createdAt) {
$data['created_at'] = $this->dates->create('U', $createdAt)->format('Y-m-d H:i:s');
$point->increment('counter', 1);
event(new MetricPointWasAddedEvent($point));
return $point;
}
protected function findOrCreatePoint(AddMetricPointCommand $command)
{
$buffer = Carbon::now()->subMinutes($command->metric->threshold);
$point = MetricPoint::where('metric_id', $command->metric->id)->where('value', $command->value)->where('created_at', '>=', $buffer)->first();
if ($point) {
return $point;
}
$metricPoint = MetricPoint::create($data);
$data = [
'metric_id' => $command->metric->id,
'value' => $command->value,
'counter' => 0,
];
event(new MetricPointWasAddedEvent($metricPoint));
if ($command->created_at) {
$data['created_at'] = $this->dates->create('U', $command->created_at)->format('Y-m-d H:i:s');
}
return $metricPoint;
return MetricPoint::create($data);
}
}

View File

@@ -53,6 +53,8 @@ class UpdateMetricCommandHandler
'display_chart' => $command->display_chart,
'places' => $command->places,
'default_view' => $command->default_view,
'threshold' => $command->threshold,
'order' => $command->order,
];
return array_filter($params, function ($val) {

View File

@@ -51,7 +51,7 @@ class UpdateMetricPointCommandHandler
$data = [
'metric_id' => $metric->id,
'value' => $command->value,
'value' => (float) $command->value,
];
if ($createdAt) {

View File

@@ -14,8 +14,7 @@ namespace CachetHQ\Cachet\Bus\Handlers\Commands\Subscriber;
use CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand;
use CachetHQ\Cachet\Bus\Commands\Subscriber\VerifySubscriberCommand;
use CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasSubscribedEvent;
use CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasUpdatedSubscriptionsEvent;
use CachetHQ\Cachet\Bus\Exceptions\Subscriber\AlreadySubscribedException;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\Subscriber;
use CachetHQ\Cachet\Models\Subscription;
@@ -23,6 +22,8 @@ use CachetHQ\Cachet\Models\Subscription;
* This is the subscribe subscriber command handler.
*
* @author James Brooks <james@alt-three.com>
* @author Joe Cohen <joe@alt-three.com>
* @author Graham Campbell <graham@alt-three.com>
*/
class SubscribeSubscriberCommandHandler
{
@@ -31,35 +32,34 @@ class SubscribeSubscriberCommandHandler
*
* @param \CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand $command
*
* @throws \CachetHQ\Cachet\Exceptions\AlreadySubscribedException
*
* @return \CachetHQ\Cachet\Models\Subscriber
*/
public function handle(SubscribeSubscriberCommand $command)
{
if (Subscriber::where('email', $command->email)->first() && $command->subscriptions === null) {
throw new AlreadySubscribedException("Cannot subscribe {$command->email} because they're already subscribed.");
if ($subscriber = Subscriber::where('email', $command->email)->first()) {
return $subscriber;
}
$subscriber = Subscriber::firstOrCreate(['email' => $command->email]);
// Decide what to subscribe the subscriber to.
if ($subscriptions = $command->subscriptions) {
foreach ($subscriptions as $subscription => $subscriptionValue) {
Subscription::firstOrCreate([
'subscriber_id' => $subscriber->id,
$subscription => $subscriptionValue,
]);
}
$subscriptions = Component::whereIn('id', $subscriptions);
} else {
$subscriptions = Component::all();
}
if ($subscriber->is_verified === false) {
if ($command->verified) {
dispatch(new VerifySubscriberCommand($subscriber));
} else {
event(new SubscriberHasSubscribedEvent($subscriber));
}
foreach ($subscriptions as $component) {
Subscription::create([
'subscriber_id' => $subscriber->id,
'component_id' => $component->id,
]);
}
if ($command->verified) {
dispatch(new VerifySubscriberCommand($subscriber));
} else {
event(new SubscriberHasUpdatedSubscriptionsEvent($subscriber));
event(new SubscriberHasSubscribedEvent($subscriber));
}
return $subscriber;

View File

@@ -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\Subscriber;
use CachetHQ\Cachet\Bus\Commands\Subscriber\UpdateSubscriberSubscriptionCommand;
use CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasUpdatedSubscriptionsEvent;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\Subscriber;
use CachetHQ\Cachet\Models\Subscription;
/**
* This is the subscribe subscriber command handler.
*
* @author Joseph Cohen <joe@alt-three.com>
*/
class UpdateSubscriberSubscriptionCommandHandler
{
/**
* Handle the subscribe subscriber command.
*
* @param \CachetHQ\Cachet\Bus\Commands\Subscriber\UpdateSubscriberSubscriptionCommand $command
*
* @return \CachetHQ\Cachet\Models\Subscriber
*/
public function handle(UpdateSubscriberSubscriptionCommand $command)
{
$subscriber = $command->subscriber;
$subscriptions = $command->subscriptions ?: [];
$components = Component::all();
$updateSubscriptions = $components->filter(function ($item) use ($subscriptions) {
return in_array($item->id, $subscriptions);
});
$subscriber->global = ($updateSubscriptions->count() === $components->count());
$subscriber->subscriptions()->delete();
if (!$updateSubscriptions->isEmpty()) {
foreach ($updateSubscriptions as $subscription) {
Subscription::firstOrCreate([
'subscriber_id' => $subscriber->id,
'component_id' => $subscription->id,
]);
}
}
$subscriber->save();
event(new SubscriberHasUpdatedSubscriptionsEvent($subscriber));
return $subscriber;
}
}

View 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;
}
}

View 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();
}
}

View 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;
});
}
}

View File

@@ -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,

View File

@@ -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([

View File

@@ -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;
});
}
}

View File

@@ -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\Events\Component;
use CachetHQ\Cachet\Bus\Events\Component\ComponentWasRemovedEvent;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\Subscription;
/**
* This is the cleanup component subscriptions handler.
*
* @author James Brooks <james@alt-three.com>
*/
class CleanupComponentSubscriptionsHandler
{
/**
* Handle the event.
*
* @param \CachetHQ\Cachet\Bus\Events\Component\ComponentWasRemovedEvent $event
*
* @return void
*/
public function handle(ComponentWasRemovedEvent $event)
{
$component = $event->component;
$subscription = Subscription::forComponent($component->id);
// Cleanup the subscriptions.
$subscription->delete();
}
}

View File

@@ -13,7 +13,7 @@ namespace CachetHQ\Cachet\Bus\Handlers\Events\Component;
use CachetHQ\Cachet\Bus\Events\Component\ComponentWasUpdatedEvent;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\Subscription;
use CachetHQ\Cachet\Models\Subscriber;
use Illuminate\Contracts\Mail\MailQueue;
use Illuminate\Mail\Message;
use McCool\LaravelAutoPresenter\Facades\AutoPresenter;
@@ -27,16 +27,25 @@ class SendComponentUpdateEmailNotificationHandler
*/
protected $mailer;
/**
* The subscriber instance.
*
* @var \CachetHQ\Cachet\Models\Subscriber
*/
protected $subscriber;
/**
* Create a new send incident email notification handler.
*
* @param \Illuminate\Contracts\Mail\Mailer $mailer
* @param \Illuminate\Contracts\Mail\Mailer $mailer
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
*
* @return void
*/
public function __construct(MailQueue $mailer)
public function __construct(MailQueue $mailer, Subscriber $subscriber)
{
$this->mailer = $mailer;
$this->subscriber = $subscriber;
}
/**
@@ -48,7 +57,42 @@ class SendComponentUpdateEmailNotificationHandler
*/
public function handle(ComponentWasUpdatedEvent $event)
{
$component = AutoPresenter::decorate($event->component);
$component = $event->component;
// First notify all global subscribers.
$globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get();
foreach ($globalSubscribers as $subscriber) {
$this->notify($component, $subscriber);
}
$notified = $globalSubscribers->pluck('id')->all();
// Notify the remaining component specific subscribers.
$componentSubscribers = $this->subscriber
->isVerified()
->forComponent($component->id)
->get()
->reject(function ($subscriber) use ($notified) {
return in_array($subscriber->id, $notified);
});
foreach ($componentSubscribers as $subscriber) {
$this->notify($component, $subscriber);
}
}
/**
* Send notification to subscriber.
*
* @param \CachetHQ\Cachet\Models\Component $component
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public function notify(Component $component, Subscriber $subscriber)
{
$component = AutoPresenter::decorate($component);
$mail = [
'subject' => trans('cachet.subscriber.email.component.subject'),
@@ -56,17 +100,14 @@ class SendComponentUpdateEmailNotificationHandler
'component_human_status' => $component->human_status,
];
foreach (Subscription::isVerifiedForComponent($component->id)->with('subscriber')->get() as $subscription) {
$subscriber = $subscription->subscriber;
$mail['email'] = $subscriber->email;
$mail['unsubscribe_link'] = route('subscribe.unsubscribe', ['code' => $subscriber->verify_code, 'subscription' => $subscription->id]);
$mail['email'] = $subscriber->email;
$mail['manage_link'] = route('subscribe.manage', ['code' => $subscriber->verify_code]);
$this->mailer->queue([
'html' => 'emails.components.update-html',
'text' => 'emails.components.update-text',
], $mail, function (Message $message) use ($mail) {
$message->to($mail['email'])->subject($mail['subject']);
});
}
$this->mailer->queue([
'html' => 'emails.components.update-html',
'text' => 'emails.components.update-text',
], $mail, function (Message $message) use ($mail) {
$message->to($mail['email'])->subject($mail['subject']);
});
}
}

View File

@@ -50,7 +50,7 @@ class SendIncidentEmailNotificationHandler
/**
* Handle the event.
*
* @param \CachetHQ\Cachet\Bus\Events\Incident\IncidentHasReportedEvent $event
* @param \CachetHQ\Cachet\Bus\Events\Incident\IncidentWasReportedEvent $event
*
* @return void
*/
@@ -60,31 +60,74 @@ class SendIncidentEmailNotificationHandler
return false;
}
// Only send emails for public incidents.
if ($event->incident->visible === 0) {
return;
}
// First notify all global subscribers.
$globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get();
foreach ($globalSubscribers as $subscriber) {
$this->notify($event, $subscriber);
}
if (!$event->incident->component) {
return;
}
$notified = $globalSubscribers->pluck('id')->all();
// Notify the remaining component specific subscribers.
$componentSubscribers = $this->subscriber
->isVerified()
->forComponent($event->incident->component->id)
->get()
->reject(function ($subscriber) use ($notified) {
return in_array($subscriber->id, $notified);
});
foreach ($componentSubscribers as $subscriber) {
$this->notify($event, $subscriber);
}
}
/**
* Send notification to subscriber.
*
* @param \CachetHQ\Cachet\Bus\Events\IncidentWasReportedEvent $event
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public function notify(IncidentWasReportedEvent $event, $subscriber)
{
$incident = AutoPresenter::decorate($event->incident);
$component = AutoPresenter::decorate($event->incident->component);
// Only send emails for public incidents.
if ($event->incident->visible === 1) {
foreach ($this->subscriber->isVerified()->get() as $subscriber) {
$mail = [
'email' => $subscriber->email,
'subject' => 'New incident reported.',
'has_component' => ($event->incident->component) ? true : false,
'component_name' => $component ? $component->name : null,
'status' => $incident->human_status,
'html_content' => $incident->formattedMessage,
'text_content' => $incident->message,
'token' => $subscriber->token,
'unsubscribe_link' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code]),
];
$mail = [
'email' => $subscriber->email,
'subject' => trans('cachet.subscriber.email.incident.subject', [
'status' => $incident->human_status,
'name' => $incident->name,
]),
'has_component' => ($event->incident->component) ? true : false,
'component_name' => $component ? $component->name : null,
'name' => $incident->name,
'timestamp' => $incident->created_at_formatted,
'status' => $incident->human_status,
'html_content' => $incident->formattedMessage,
'text_content' => $incident->message,
'token' => $subscriber->token,
'manage_link' => route('subscribe.manage', ['code' => $subscriber->verify_code]),
'unsubscribe_link' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code]),
];
$this->mailer->queue([
'html' => 'emails.incidents.new-html',
'text' => 'emails.incidents.new-text',
], $mail, function (Message $message) use ($mail) {
$message->to($mail['email'])->subject($mail['subject']);
});
}
}
$this->mailer->queue([
'html' => 'emails.incidents.new-html',
'text' => 'emails.incidents.new-text',
], $mail, function (Message $message) use ($mail) {
$message->to($mail['email'])->subject($mail['subject']);
});
}
}

View File

@@ -50,7 +50,7 @@ class SendMaintenanceEmailNotificationHandler
/**
* Handle the event.
*
* @param \CachetHQ\Cachet\Bus\Events\MaintenanceHasScheduledEvent $event
* @param \CachetHQ\Cachet\Bus\Events\MaintenanceWasScheduledEvent $event
*
* @return void
*/
@@ -60,26 +60,73 @@ class SendMaintenanceEmailNotificationHandler
return false;
}
$data = AutoPresenter::decorate($event->incident);
// Only send emails for public incidents.
if ($event->incident->visible === 0) {
return;
}
foreach ($this->subscriber->isVerified()->get() as $subscriber) {
$mail = [
'email' => $subscriber->email,
'subject' => 'Scheduled maintenance.',
'status' => $data->human_status,
'html_content' => $data->formattedMessage,
'text_content' => $data->message,
'scheduled_at' => $data->scheduled_at_formatted,
'token' => $subscriber->token,
'unsubscribe_link' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code]),
];
// First notify all global subscribers.
$globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get();
$this->mailer->queue([
'html' => 'emails.incidents.maintenance-html',
'text' => 'emails.incidents.maintenance-text',
], $mail, function (Message $message) use ($mail) {
$message->to($mail['email'])->subject($mail['subject']);
foreach ($globalSubscribers as $subscriber) {
$this->notify($event, $subscriber);
}
if (!$event->incident->component) {
return;
}
$notified = $globalSubscribers->pluck('id')->all();
// Notify the remaining component specific subscribers.
$componentSubscribers = $this->subscriber
->isVerified()
->forComponent($event->incident->component->id)
->get()
->reject(function ($subscriber) use ($notified) {
return in_array($subscriber->id, $notified);
});
foreach ($componentSubscribers as $subscriber) {
$this->notify($event, $subscriber);
}
}
/**
* Send notification to subscriber.
*
* @param \CachetHQ\Cachet\Bus\Events\MaintenanceWasScheduledEvent $event
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public function notify(MaintenanceWasScheduledEvent $event, $subscriber)
{
$incident = AutoPresenter::decorate($event->incident);
$component = AutoPresenter::decorate($event->incident->component);
$mail = [
'email' => $subscriber->email,
'subject' => trans('cachet.subscriber.email.maintenance.subject', [
'name' => $incident->name,
]),
'has_component' => ($event->incident->component) ? true : false,
'component_name' => $component ? $component->name : null,
'name' => $incident->name,
'timestamp' => $incident->scheduled_at_formatted,
'status' => $incident->human_status,
'html_content' => $incident->formattedMessage,
'text_content' => $incident->message,
'token' => $subscriber->token,
'manage_link' => route('subscribe.manage', ['code' => $subscriber->verify_code]),
'unsubscribe_link' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code]),
];
$this->mailer->queue([
'html' => 'emails.incidents.maintenance-html',
'text' => 'emails.incidents.maintenance-text',
], $mail, function (Message $message) use ($mail) {
$message->to($mail['email'])->subject($mail['subject']);
});
}
}

View File

@@ -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([

View File

@@ -0,0 +1,38 @@
<?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\Middleware;
use Closure;
use Illuminate\Support\Facades\DB;
/**
* This is the use database transactions bus middleware class.
*
* @author James Brooks <james@alt-three.com>
*/
class UseDatabaseTransactions
{
/**
* Handle the current command in the pipeline.
*
* @param mixed $command
* @param \Closure $next
*
* @return bool
*/
public function handle($command, Closure $next)
{
return DB::transaction(function () use ($command, $next) {
return $next($command);
});
}
}

View File

@@ -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,27 +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_go_squared'));
$view->withAppAnalyticsPiwikUrl(Config::get('setting.app_analytics_piwik_url'));
$view->withAppAnalyticsPiwikSiteId(Config::get('setting.app_analytics_piwik_siteid'));
$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->withAppName($name = Config::get('setting.app_name'));
$view->withShowSupport($support = Config::get('setting.show_support'));
if ($support) {
$view->withSiteTitle(Config::get('setting.app_name').' | Cachet');
} else {
$view->withSiteTitle(Config::get('setting.app_name'));
}
$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'));
}
}

View File

@@ -13,6 +13,8 @@ namespace CachetHQ\Cachet\Composers;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\IncidentTemplate;
use CachetHQ\Cachet\Models\Subscriber;
use Illuminate\Contracts\View\View;
class DashboardComposer
@@ -27,6 +29,8 @@ class DashboardComposer
public function compose(View $view)
{
$view->withIncidentCount(Incident::notScheduled()->count());
$view->withIncidentTemplateCount(IncidentTemplate::count());
$view->withComponentCount(Component::all()->count());
$view->withSubscriberCount(Subscriber::isVerified()->count());
}
}

View File

@@ -12,27 +12,28 @@
namespace CachetHQ\Cachet\Composers;
use CachetHQ\Cachet\Models\Metric;
use CachetHQ\Cachet\Repositories\Metric\MetricRepository;
use Illuminate\Contracts\Config\Repository;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Config;
class MetricsComposer
{
/**
* @var \CachetHQ\Cachet\Repositories\Metric\MetricRepository
* The illuminate config instance.
*
* @var \Illuminate\Contracts\Config\Repository
*/
protected $metricRepository;
protected $config;
/**
* Construct a new home controller instance.
* Create a new metrics composer.
*
* @param \CachetHQ\Cachet\Repositories\Metric\MetricRepository $metricRepository
* @param \Illuminate\Contracts\Config\Repository $config
*
* @return void
*/
public function __construct(MetricRepository $metricRepository)
public function __construct(Repository $config)
{
$this->metricRepository = $metricRepository;
$this->config = $config;
}
/**
@@ -45,22 +46,11 @@ class MetricsComposer
public function compose(View $view)
{
$metrics = null;
$metricData = [];
if ($displayMetrics = Config::get('setting.display_graphs')) {
$metrics = Metric::where('display_chart', 1)->orderBy('id')->get();
$metrics->map(function ($metric) use (&$metricData) {
$metricData[$metric->id] = [
'last_hour' => $this->metricRepository->listPointsLastHour($metric),
'today' => $this->metricRepository->listPointsToday($metric),
'week' => $this->metricRepository->listPointsForWeek($metric),
'month' => $this->metricRepository->listPointsForMonth($metric),
];
});
if ($displayMetrics = $this->config->get('setting.display_graphs')) {
$metrics = Metric::displayable()->orderBy('order')->orderBy('id')->get();
}
$view->withDisplayMetrics($displayMetrics)
->withMetrics($metrics)
->withMetricData($metricData);
->withMetrics($metrics);
}
}

View File

@@ -11,13 +11,38 @@
namespace CachetHQ\Cachet\Composers;
use CachetHQ\Cachet\Integrations\Core\System;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\ComponentGroup;
use CachetHQ\Cachet\Models\Incident;
use Illuminate\Contracts\View\View;
/**
* This is the status page composer.
*
* @author James Brooks <james@alt-three.com>
*/
class StatusPageComposer
{
/**
* The system instance.
*
* @var \CachetHQ\Cachet\Integrations\Contracts\System
*/
protected $system;
/**
* Create a new status page composer instance.
*
* @param \CachetHQ\Cachet\Integrations\Contracts\System $system
*
* @return void
*/
public function __construct(System $system)
{
$this->system = $system;
}
/**
* Index page view composer.
*
@@ -27,40 +52,7 @@ class StatusPageComposer
*/
public function compose(View $view)
{
$totalComponents = Component::enabled()->count();
$majorOutages = Component::enabled()->status(4)->count();
$isMajorOutage = ($majorOutages / $totalComponents) >= 0.5;
// 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();
$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();
@@ -70,7 +62,7 @@ class StatusPageComposer
$componentGroups = ComponentGroup::whereIn('id', $usedComponentGroups)->orderBy('order')->get();
$ungroupedComponents = Component::enabled()->where('group_id', 0)->orderBy('order')->orderBy('created_at')->get();
$view->with($withData)
$view->with($status)
->withComponentGroups($componentGroups)
->withUngroupedComponents($ungroupedComponents)
->withScheduledMaintenance($scheduledMaintenance);

View File

@@ -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'));
}
}

View File

@@ -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);

View File

@@ -14,11 +14,13 @@ namespace CachetHQ\Cachet\Console\Commands;
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\Setting;
use CachetHQ\Cachet\Models\Subscriber;
use CachetHQ\Cachet\Models\User;
use CachetHQ\Cachet\Settings\Repository;
use DateInterval;
use DateTime;
use Illuminate\Console\Command;
@@ -48,6 +50,27 @@ class DemoSeederCommand extends Command
*/
protected $description = 'Seeds Cachet with demo data.';
/**
* The settings repository.
*
* @var \CachetHQ\Cache\Settings\Repository
*/
protected $settings;
/**
* Create a new demo seeder command instance.
*
* @param \CachetHQ\Cache\Settings\Repository $settings
*
* @return void
*/
public function __construct(Repository $settings)
{
parent::__construct();
$this->settings = $settings;
}
/**
* Execute the console command.
*
@@ -62,6 +85,7 @@ class DemoSeederCommand extends Command
$this->seedComponentGroups();
$this->seedComponents();
$this->seedIncidents();
$this->seedIncidentTemplates();
$this->seedMetricPoints();
$this->seedMetrics();
$this->seedSettings();
@@ -82,11 +106,11 @@ class DemoSeederCommand extends Command
[
'name' => 'Websites',
'order' => 1,
'collapsed' => false,
'collapsed' => 0,
], [
'name' => 'Alt Three',
'order' => 2,
'collapsed' => true,
'collapsed' => 1,
],
];
@@ -140,6 +164,13 @@ class DemoSeederCommand extends Command
'order' => 1,
'group_id' => 2,
'link' => 'https://styleci.io',
], [
'name' => 'Patreon Page',
'description' => 'Support future development of Cachet.',
'status' => 1,
'order' => 0,
'group_id' => 0,
'link' => 'https://patreon.com/jbrooksuk',
],
];
@@ -159,51 +190,80 @@ class DemoSeederCommand extends Command
{
$defaultIncidents = [
[
'name' => 'Awesome',
'message' => ':+1: We totally nailed the fix.',
'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' => 'Monitoring the fix',
'message' => ":ship: We've deployed a fix.",
'status' => 3,
], [
'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' => '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);
}
}
/**
* Seed the incident templates table.
*
* @return void
*/
protected function seedIncidentTemplates()
{
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);
}
}
@@ -263,47 +323,45 @@ class DemoSeederCommand extends Command
{
$defaultSettings = [
[
'name' => 'app_name',
'key' => 'app_name',
'value' => 'Cachet Demo',
],
[
'name' => 'app_domain',
], [
'key' => 'app_domain',
'value' => 'https://demo.cachethq.io',
],
[
'name' => 'show_support',
], [
'key' => 'show_support',
'value' => '1',
],
[
'name' => 'app_locale',
], [
'key' => 'app_locale',
'value' => 'en',
],
[
'name' => 'app_timezone',
], [
'key' => 'app_timezone',
'value' => 'Europe/London',
],
[
'name' => 'app_incident_days',
], [
'key' => 'app_incident_days',
'value' => '7',
],
[
'name' => 'app_analytics',
], [
'key' => 'app_analytics',
'value' => 'UA-58442674-3',
],
[
'name' => 'app_analytics_gs',
], [
'key' => 'app_analytics_gs',
'value' => 'GSN-712462-P',
],
[
'name' => 'display_graphs',
], [
'key' => 'display_graphs',
'value' => '1',
], [
'key' => 'app_about',
'value' => 'This is the demo instance of [Cachet](https://cachethq.io?ref=demo). The open source status page system, for everyone. An [Alt Three](https://alt-three.com) product.',
], [
'key' => 'enable_subscribers',
'value' => '0',
],
];
Setting::truncate();
$this->settings->clear();
foreach ($defaultSettings as $setting) {
Setting::create($setting);
$this->settings->set($setting['key'], $setting['value']);
}
}

View File

@@ -11,6 +11,7 @@
namespace CachetHQ\Cachet\Dates;
use DateTimeZone;
use Jenssegers\Date\Date;
class DateFactory
@@ -72,6 +73,33 @@ class DateFactory
*/
public function createNormalized($format, $time)
{
return $this->create($format, $time)->setTimezone($this->appTimezone);
return Date::createFromFormat($format, $time)->setTimezone($this->appTimezone);
}
/**
* Make a Carbon instance from a string.
*
* @param string|null $time
*
* @throws \InvalidArgumentException
*
* @return \Carbon\Carbon
*/
public function make($time = null)
{
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');
}
}

View File

@@ -0,0 +1,88 @@
<?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\Exceptions\Displayers;
use Exception;
use GrahamCampbell\Exceptions\Displayers\DisplayerInterface;
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException;
class ThrottleDisplayer implements DisplayerInterface
{
/**
* The request instance.
*
* @var \Illuminate\Http\Request
*/
protected $request;
/**
* Create a new redirect displayer instance.
*
* @param \Illuminate\Http\Request $request
*
* @return void
*/
public function __construct(Request $request)
{
$this->request = $request;
}
/**
* Get the error response associated with the given exception.
*
* @param \Exception $exception
* @param string $id
* @param int $code
* @param string[] $headers
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function display(Exception $exception, $id, $code, array $headers)
{
return redirect()->route('auth.login')->withError(trans('forms.login.rate-limit'));
}
/**
* Get the supported content type.
*
* @return string
*/
public function contentType()
{
return 'text/html';
}
/**
* Can we display the exception?
*
* @param \Exception $original
* @param \Exception $transformed
* @param int $code
*
* @return bool
*/
public function canDisplay(Exception $original, Exception $transformed, $code)
{
return $transformed instanceof TooManyRequestsHttpException && $this->request->is('auth*');
}
/**
* Do we provide verbose information about the exception?
*
* @return bool
*/
public function isVerbose()
{
return false;
}
}

View File

@@ -12,10 +12,18 @@
namespace CachetHQ\Cachet\Foundation\Providers;
use AltThree\Bus\Dispatcher;
use CachetHQ\Cachet\Bus\Middleware\UseDatabaseTransactions;
use CachetHQ\Cachet\Dates\DateFactory;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
/**
* This is the app service provider.
*
* @author James Brooks <james@alt-three.com>
* @author Joe Cohen <joe@alt-three.com>
* @author Graham Campbell <graham@alt-three.com>
*/
class AppServiceProvider extends ServiceProvider
{
/**
@@ -29,6 +37,8 @@ class AppServiceProvider extends ServiceProvider
return Dispatcher::simpleMapping($command, 'CachetHQ\Cachet\Bus', 'CachetHQ\Cachet\Bus\Handlers');
});
$dispatcher->pipeThrough([UseDatabaseTransactions::class]);
Str::macro('canonicalize', function ($url) {
return preg_replace('/([^\/])$/', '$1/', $url);
});
@@ -52,8 +62,8 @@ class AppServiceProvider extends ServiceProvider
protected function registerDateFactory()
{
$this->app->singleton(DateFactory::class, function ($app) {
$appTimezone = $app->config->get('app.timezone');
$cacheTimezone = $app->config->get('cachet.timezone');
$appTimezone = $app['config']->get('app.timezone');
$cacheTimezone = $app['config']->get('cachet.timezone');
return new DateFactory($appTimezone, $cacheTimezone);
});

View File

@@ -33,8 +33,8 @@ class ComposerServiceProvider extends ServiceProvider
$factory->composer('*', AppComposer::class);
$factory->composer('*', CurrentUserComposer::class);
$factory->composer(['index'], MetricsComposer::class);
$factory->composer(['index', 'incident', 'subscribe', 'signup'], StatusPageComposer::class);
$factory->composer(['index', 'incident', 'subscribe', 'signup', 'dashboard.settings.theme'], ThemeComposer::class);
$factory->composer(['index', 'single-incident', 'subscribe', 'signup'], StatusPageComposer::class);
$factory->composer(['index', 'single-incident', 'subscribe.*', 'signup', 'dashboard.settings.theme', 'emails.*'], ThemeComposer::class);
$factory->composer('dashboard.*', DashboardComposer::class);
$factory->composer(['setup', 'dashboard.settings.localization'], TimezoneLocaleComposer::class);
}

View File

@@ -11,12 +11,20 @@
namespace CachetHQ\Cachet\Foundation\Providers;
use CachetHQ\Cachet\Config\Repository;
use CachetHQ\Cachet\Models\Setting as SettingModel;
use CachetHQ\Cachet\Settings\Cache;
use CachetHQ\Cachet\Settings\Repository;
use Exception;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\ServiceProvider;
use Jenssegers\Date\Date;
/**
* This is the config service provider class.
*
* @author James Brooks <james@alt-three.com>
* @author Graham Campbell <graham@alt-three.com>
* @author Joe Cohen <joe@alt-three.com>
*/
class ConfigServiceProvider extends ServiceProvider
{
/**
@@ -26,8 +34,26 @@ class ConfigServiceProvider extends ServiceProvider
*/
public function boot()
{
$env = $this->app->environment();
$repo = $this->app->make(Repository::class);
$cache = $this->app->make(Cache::class);
$loaded = $cache->load($env);
$this->app->terminating(function () use ($repo, $cache) {
if ($repo->stale()) {
$cache->clear();
}
});
try {
$this->app->config->set('setting', $this->app->setting->all());
if ($loaded === false) {
$loaded = $repo->all();
$cache->store($env, $loaded);
}
$settings = array_merge($this->app->config->get('setting'), $loaded);
$this->app->config->set('setting', $settings);
} catch (Exception $e) {
//
}
@@ -36,9 +62,10 @@ class ConfigServiceProvider extends ServiceProvider
$this->app->config->set('app.url', $appDomain);
}
if ($appLocale = $this->app->config->get('setting.app.locale')) {
if ($appLocale = $this->app->config->get('setting.app_locale')) {
$this->app->config->set('app.locale', $appLocale);
$this->app->translator->setLocale($appLocale);
Date::setLocale($appLocale);
}
if ($appTimezone = $this->app->config->get('setting.app_timezone')) {
@@ -66,10 +93,12 @@ class ConfigServiceProvider extends ServiceProvider
*/
public function register()
{
$this->app->singleton('setting', function () {
return new Repository(new SettingModel());
$this->app->singleton(Cache::class, function ($app) {
return new Cache($app->files, $app->bootstrapPath().'/cachet');
});
$this->app->alias('setting', Repository::class);
$this->app->singleton(Repository::class, function () {
return new Repository(new SettingModel());
});
}
}

View File

@@ -11,11 +11,28 @@
namespace CachetHQ\Cachet\Foundation\Providers;
use CachetHQ\Cachet\GitHub\Release;
use CachetHQ\Cachet\Subscribers\CommandSubscriber;
use Illuminate\Support\ServiceProvider;
class GitHubServiceProvider extends ServiceProvider
/**
* This is the console service provider.
*
* @author James Brooks <james@alt-three.com>
*/
class ConsoleServiceProvider extends ServiceProvider
{
/**
* Boot the service provider.
*
* @return void
*/
public function boot()
{
$subscriber = $this->app->make(CommandSubscriber::class);
$this->app->events->subscribe($subscriber);
}
/**
* Register the service provider.
*
@@ -23,23 +40,6 @@ class GitHubServiceProvider extends ServiceProvider
*/
public function register()
{
$this->registerRelease();
}
/**
* Register the releases class.
*
* @return void
*/
protected function registerRelease()
{
$this->app->singleton('cachet.release', function ($app) {
$cache = $app['cache.store'];
$config = $app['config'];
return new Release($cache, $config);
});
$this->app->alias('cachet.release', Release::class);
//
}
}

View File

@@ -34,14 +34,23 @@ class EventServiceProvider extends ServiceProvider
//
],
'CachetHQ\Cachet\Bus\Events\Component\ComponentWasRemovedEvent' => [
//
'CachetHQ\Cachet\Bus\Handlers\Events\Component\CleanupComponentSubscriptionsHandler',
],
'CachetHQ\Cachet\Bus\Events\Component\ComponentWasUpdatedEvent' => [
'CachetHQ\Cachet\Bus\Handlers\Events\Component\SendComponentUpdateEmailNotificationHandler',
],
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasRemovedEvent' => [
//
],
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasReportedEvent' => [
'CachetHQ\Cachet\Bus\Handlers\Events\Incident\SendIncidentEmailNotificationHandler',
],
'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',
],
@@ -84,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' => [
//
],
];
}

View 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);
});
}
}

View File

@@ -11,12 +11,20 @@
namespace CachetHQ\Cachet\Foundation\Providers;
use CachetHQ\Cachet\Dates\DateFactory;
use CachetHQ\Cachet\Repositories\Metric\MetricRepository;
use CachetHQ\Cachet\Repositories\Metric\MySqlRepository as MetricMySqlRepository;
use CachetHQ\Cachet\Repositories\Metric\PgSqlRepository as MetricPgSqlRepository;
use CachetHQ\Cachet\Repositories\Metric\SqliteRepository as MetricSqliteRepository;
use Illuminate\Contracts\Config\Repository as ConfigRepository;
use Illuminate\Contracts\Container\Container;
use Illuminate\Support\ServiceProvider;
/**
* This is the repository service provider.
*
* @author James Brooks <james@alt-three.com>
*/
class RepositoryServiceProvider extends ServiceProvider
{
/**
@@ -36,20 +44,21 @@ class RepositoryServiceProvider extends ServiceProvider
*/
protected function registerMetricRepository()
{
$this->app->singleton('cachet.metricrepository', function ($app) {
$dbDriver = $app['config']->get('database.default');
$this->app->singleton(MetricRepository::class, function (Container $app) {
$config = $app->make(ConfigRepository::class);
$driver = $config->get('database.default');
if ($dbDriver == 'mysql') {
$repository = new MetricMySqlRepository();
} elseif ($dbDriver == 'pgsql') {
$repository = new MetricPgSqlRepository();
} elseif ($dbDriver == 'sqlite') {
$repository = new MetricSqliteRepository();
if ($driver == 'mysql') {
$repository = new MetricMySqlRepository($config);
} elseif ($driver == 'pgsql') {
$repository = new MetricPgSqlRepository($config);
} elseif ($driver == 'sqlite') {
$repository = new MetricSqliteRepository($config);
}
return new MetricRepository($repository);
});
$dates = $app->make(DateFactory::class);
$this->app->alias('cachet.metricrepository', MetricRepository::class);
return new MetricRepository($repository, $dates);
});
}
}

View File

@@ -17,7 +17,7 @@ use Illuminate\Routing\Router;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to the controller routes in your routes file.
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
@@ -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');
}
/**

View File

@@ -1,70 +0,0 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\GitHub;
use GuzzleHttp\Client;
use Illuminate\Contracts\Cache\Repository as CacheRepository;
use Illuminate\Contracts\Config\Repository as ConfigRepository;
class Release
{
/**
* Cache instance.
*
* @var \Illuminate\Contracts\Cache\Repository
*/
protected $cache;
/**
* Config repository.
*
* @var \Illuminate\Contracts\Config\Repository
*/
protected $config;
/**
* Creates a new release instance.
*
* @param \Illuminate\Contracts\Cache\Repository $cache
* @param \Illuminate\Contracts\Config\Repository $config
*
* @return void
*/
public function __construct(CacheRepository $cache, ConfigRepository $config)
{
$this->cache = $cache;
$this->config = $config;
}
/**
* Returns the latest GitHub release.
*
* @return string
*/
public function latest()
{
$release = $this->cache->remember('version', 720, function () {
$headers = ['Accept' => 'application/vnd.github.v3+json'];
// We can re-use the Emoji token here, if we have it.
if ($token = $this->config->get('services.github.token')) {
$headers['OAUTH-TOKEN'] = $token;
}
return json_decode((new Client())->get('https://api.github.com/repos/cachethq/cachet/releases/latest', [
'headers' => $headers,
])->getBody(), true);
});
return $release['tag_name'];
}
}

View File

@@ -161,12 +161,6 @@ abstract class AbstractApiController extends Controller
$items = $paginator->getCollection();
if ($sortBy = $request->get('sort')) {
$direction = $request->has('order') && $request->get('order') == 'desc';
$items = $items->sortBy($sortBy, SORT_REGULAR, $direction);
}
return $this->setMetaData($pagination)->setData(AutoPresenter::decorate($items->values()))->respond();
}
@@ -187,6 +181,8 @@ abstract class AbstractApiController extends Controller
*/
protected function respond()
{
$response = [];
if (!empty($this->meta)) {
$response['meta'] = $this->meta;
}

View File

@@ -32,12 +32,22 @@ class ComponentController extends AbstractApiController
public function getComponents()
{
if (app(Guard::class)->check()) {
$components = Component::whereRaw('1 = 1');
$components = Component::query();
} else {
$components = Component::enabled();
}
return $this->paginator($components->paginate(Binput::get('per_page', 20)), Request::instance());
$components->search(Binput::except(['sort', 'order', 'per_page']));
if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';
$components->sort($sortBy, $direction);
}
$components = $components->paginate(Binput::get('per_page', 20));
return $this->paginator($components, Request::instance());
}
/**

View File

@@ -20,6 +20,13 @@ use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Request;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
/**
* This is the component group controller.
*
* @author James Brooks <james@alt-three.com>
* @author Graham Campbell <graham@alt-three.com>
* @author Joe Cohen <joe@alt-three.com>
*/
class ComponentGroupController extends AbstractApiController
{
/**
@@ -29,7 +36,17 @@ class ComponentGroupController extends AbstractApiController
*/
public function getGroups()
{
$groups = ComponentGroup::paginate(Binput::get('per_page', 20));
$groups = ComponentGroup::query();
$groups->search(Binput::except(['sort', 'order', 'per_page']));
if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';
$groups->sort($sortBy, $direction);
}
$groups = $groups->paginate(Binput::get('per_page', 20));
return $this->paginator($groups, Request::instance());
}
@@ -57,7 +74,7 @@ class ComponentGroupController extends AbstractApiController
$group = dispatch(new AddComponentGroupCommand(
Binput::get('name'),
Binput::get('order', 0),
Binput::get('collapsed')
Binput::get('collapsed', 0)
));
} catch (QueryException $e) {
throw new BadRequestHttpException();
@@ -79,7 +96,7 @@ class ComponentGroupController extends AbstractApiController
$group = dispatch(new UpdateComponentGroupCommand(
$group,
Binput::get('name'),
Binput::get('order', 0),
Binput::get('order'),
Binput::get('collapsed')
));
} catch (QueryException $e) {

View 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();
}
}

View File

@@ -11,6 +11,14 @@
namespace CachetHQ\Cachet\Http\Controllers\Api;
use CachetHQ\Cachet\Integrations\Contracts\Releases;
use CachetHQ\Cachet\Integrations\Contracts\System;
/**
* This is the general api controller.
*
* @author James Brooks <james@bluebaytravel.co.uk>
*/
class GeneralController extends AbstractApiController
{
/**
@@ -22,4 +30,31 @@ class GeneralController extends AbstractApiController
{
return $this->item('Pong!');
}
/**
* Endpoint to show the Cachet version.
*
* @return \Illuminate\Http\JsonResponse
*/
public function version()
{
$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']);
}
}

View File

@@ -32,7 +32,17 @@ class IncidentController extends AbstractApiController
{
$incidentVisibility = app(Guard::class)->check() ? 0 : 1;
$incidents = Incident::where('visible', '>=', $incidentVisibility)->paginate(Binput::get('per_page', 20));
$incidents = Incident::where('visible', '>=', $incidentVisibility);
$incidents->search(Binput::except(['sort', 'order', 'per_page']));
if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';
$incidents->sort($sortBy, $direction);
}
$incidents = $incidents->paginate(Binput::get('per_page', 20));
return $this->paginator($incidents, Request::instance());
}

View 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();
}
}

View File

@@ -29,7 +29,15 @@ class MetricController extends AbstractApiController
*/
public function getMetrics()
{
$metrics = Metric::paginate(Binput::get('per_page', 20));
$metrics = Metric::query();
if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';
$metrics->sort($sortBy, $direction);
}
$metrics = $metrics->paginate(Binput::get('per_page', 20));
return $this->paginator($metrics, Request::instance());
}
@@ -55,7 +63,9 @@ class MetricController extends AbstractApiController
*/
public function getMetricPoints(Metric $metric)
{
return $this->collection($metric->points);
$points = $metric->points()->paginate(Binput::get('per_page', 20));
return $this->paginator($points, Request::instance());
}
/**
@@ -72,9 +82,11 @@ class MetricController extends AbstractApiController
Binput::get('description'),
Binput::get('default_value'),
Binput::get('calc_type', 0),
Binput::get('display_chart'),
Binput::get('display_chart', true),
Binput::get('places', 2),
Binput::get('view', 1)
Binput::get('default_view', Binput::get('view', 1)),
Binput::get('threshold', 5),
Binput::get('order', 0)
));
} catch (QueryException $e) {
throw new BadRequestHttpException();
@@ -99,10 +111,12 @@ class MetricController extends AbstractApiController
Binput::get('suffix'),
Binput::get('description'),
Binput::get('default_value'),
Binput::get('calc_type', 0),
Binput::get('calc_type'),
Binput::get('display_chart'),
Binput::get('places', 2),
Binput::get('view', 1)
Binput::get('places'),
Binput::get('default_view', Binput::get('view')),
Binput::get('threshold'),
Binput::get('order')
));
} catch (QueryException $e) {
throw new BadRequestHttpException();

View File

@@ -48,8 +48,8 @@ class MetricPointController extends AbstractApiController
$metricPoint = dispatch(new AddMetricPointCommand(
$metric,
Binput::get('value'),
Binput::get('timestamp'))
);
Binput::get('timestamp')
));
} catch (QueryException $e) {
throw new BadRequestHttpException();
}

View File

@@ -17,10 +17,17 @@ 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;
/**
* This is the subscriber controller class.
*
* @author James Brooks <james@alt-three.com>
* @author Graham Campbell <graham@alt-three.com>
*/
class SubscriberController extends AbstractApiController
{
/**
@@ -42,8 +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), null));
$subscriber = dispatch(new SubscribeSubscriberCommand(Binput::get('email'), $verified, Binput::get('components')));
} catch (QueryException $e) {
throw new BadRequestHttpException();
}

View 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();
}
}

View 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();
}
}

View File

@@ -41,11 +41,11 @@ class AuthController extends Controller
*/
public function postLogin()
{
$loginData = Binput::only(['login', 'password']);
$loginData = Binput::only(['username', 'password']);
// Login with username or email.
$loginKey = Str::contains($loginData['login'], '@') ? 'email' : 'username';
$loginData[$loginKey] = array_pull($loginData, 'login');
$loginKey = Str::contains($loginData['username'], '@') ? 'email' : 'username';
$loginData[$loginKey] = array_pull($loginData, 'username');
// Validate login credentials.
if (Auth::validate($loginData)) {

View File

@@ -11,34 +11,46 @@
namespace CachetHQ\Cachet\Http\Controllers\Dashboard;
use CachetHQ\Cachet\GitHub\Release;
use CachetHQ\Cachet\Bus\Commands\Component\UpdateComponentCommand;
use CachetHQ\Cachet\Bus\Commands\ComponentGroup\UpdateComponentGroupCommand;
use CachetHQ\Cachet\Http\Controllers\Api\AbstractApiController;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\ComponentGroup;
use CachetHQ\Cachet\Models\IncidentTemplate;
use Exception;
use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Response;
use Illuminate\Database\QueryException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
class ApiController extends Controller
class ApiController extends AbstractApiController
{
/**
* Updates a component with the entered info.
*
* @param \CachetHQ\Cachet\Models\Component $component
*
* @throws \Exception
* @throws \Symfony\Component\HttpKernel\Exception\BadRequestHttpException
*
* @return \CachetHQ\Cachet\Models\Component
*/
public function postUpdateComponent(Component $component)
{
if (!$component->update(Binput::except(['_token']))) {
throw new Exception(trans('dashboard.components.edit.failure'));
try {
dispatch(new UpdateComponentCommand(
$component,
$component->name,
$component->description,
Binput::get('status'),
$component->link,
$component->order,
$component->group_id,
$component->enabled
));
} catch (QueryException $e) {
throw new BadRequestHttpException();
}
return $component;
return $this->item($component);
}
/**
@@ -51,11 +63,25 @@ class ApiController extends Controller
$componentData = Binput::get('ids');
foreach ($componentData as $order => $componentId) {
// Ordering should be 1-based, data comes in 0-based
Component::find($componentId)->update(['order' => $order + 1]);
try {
$component = Component::find($componentId);
dispatch(new UpdateComponentCommand(
$component,
$component->name,
$component->description,
$component->status,
$component->link,
$order + 1,
$component->group_id,
$component->enabled
));
} catch (QueryException $e) {
throw new BadRequestHttpException();
}
}
return $componentData;
return $this->collection(Component::query()->orderBy('order')->get());
}
/**
@@ -68,10 +94,17 @@ class ApiController extends Controller
$groupData = Binput::get('ids');
foreach ($groupData as $order => $groupId) {
ComponentGroup::find($groupId)->update(['order' => $order + 1]);
$group = ComponentGroup::find($groupId);
dispatch(new UpdateComponentGroupCommand(
$group,
$group->name,
$order + 1,
$group->collapsed
));
}
return $groupData;
return $this->collection(ComponentGroup::query()->orderBy('order')->get());
}
/**
@@ -91,20 +124,4 @@ class ApiController extends Controller
throw new ModelNotFoundException("Incident template for $templateSlug could not be found.");
}
/**
* Checks if Cachet is up to date.
*
* @return \Illuminate\Http\JsonResponse
*/
public function checkVersion()
{
$latest = app(Release::class)->latest();
return Response::json([
'cachet_version' => CACHET_VERSION,
'latest_version' => $latest,
'is_latest' => version_compare(CACHET_VERSION, $latest) === 1,
]);
}
}

View File

@@ -303,7 +303,7 @@ class ComponentController extends Controller
$group = dispatch(new UpdateComponentGroupCommand(
$group,
Binput::get('name'),
Binput::get('order', 0),
$group->order,
Binput::get('collapsed')
));
} catch (ValidationException $e) {

View File

@@ -11,11 +11,14 @@
namespace CachetHQ\Cachet\Http\Controllers\Dashboard;
use CachetHQ\Cachet\Integrations\Contracts\Feed;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\ComponentGroup;
use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\Subscriber;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
use Jenssegers\Date\Date;
@@ -36,16 +39,36 @@ class DashboardController extends Controller
protected $timeZone;
/**
* Creates a new dashboard controller.
* The feed integration.
*
* @var \CachetHQ\Cachet\Integrations\Feed
*/
protected $feed;
/**
* Creates a new dashboard controller instance.
*
* @param \CachetHQ\Cachet\Integrations\Feed $feed
*
* @return void
*/
public function __construct()
public function __construct(Feed $feed)
{
$this->feed = $feed;
$this->startDate = new Date();
$this->dateTimeZone = Config::get('cachet.timezone');
}
/**
* Redirect /admin to /dashboard.
*
* @return \Illuminate\Http\RedirectResponse
*/
public function redirectAdmin()
{
return Redirect::route('dashboard.index');
}
/**
* Shows the dashboard view.
*
@@ -56,12 +79,23 @@ class DashboardController extends Controller
$components = Component::orderBy('order')->get();
$incidents = $this->getIncidents();
$subscribers = $this->getSubscribers();
$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();
$entries = null;
if ($feed = $this->feed->latest()) {
$entries = array_slice($feed->channel->item, 0, 5);
}
return View::make('dashboard.index')
->withPageTitle(trans('dashboard.dashboard'))
->withComponents($components)
->withIncidents($incidents)
->withSubscribers($subscribers);
->withSubscribers($subscribers)
->withEntries($entries)
->withComponentGroups($componentGroups)
->withUngroupedComponents($ungroupedComponents);
}
/**

View File

@@ -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'),
@@ -114,7 +132,7 @@ class IncidentController extends Controller
Binput::get('visible', true),
Binput::get('component_id'),
Binput::get('component_status'),
Binput::get('notify', true),
Binput::get('notify', false),
Binput::get('created_at'),
null,
null
@@ -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')));
}
}

View File

@@ -31,7 +31,7 @@ class MetricController extends Controller
*/
public function showMetrics()
{
$metrics = Metric::orderBy('created_at', 'desc')->get();
$metrics = Metric::orderBy('order')->orderBy('id')->get();
return View::make('dashboard.metrics.index')
->withPageTitle(trans('dashboard.metrics.metrics').' - '.trans('dashboard.dashboard'))
@@ -79,7 +79,8 @@ class MetricController extends Controller
$metricData['calc_type'],
$metricData['display_chart'],
$metricData['places'],
$metricData['default_view']
$metricData['default_view'],
$metricData['threshold']
));
} catch (ValidationException $e) {
return Redirect::route('dashboard.metrics.add')
@@ -151,7 +152,8 @@ class MetricController extends Controller
Binput::get('calc_type', null, false),
Binput::get('display_chart', null, false),
Binput::get('places', null, false),
Binput::get('default_view', null, false)
Binput::get('default_view', null, false),
Binput::get('threshold', null, false)
));
} catch (ValidationException $e) {
return Redirect::route('dashboard.metrics.edit', ['id' => $metric->id])

View File

@@ -95,10 +95,10 @@ class ScheduleController extends Controller
{
try {
$incident = dispatch(new ReportMaintenanceCommand(
Binput::get('incident.name'),
Binput::get('incident.message'),
Binput::get('incident.notify'),
Binput::get('incident.scheduled_at')
Binput::get('name'),
Binput::get('message'),
Binput::get('notify'),
Binput::get('scheduled_at')
));
} catch (ValidationException $e) {
return Redirect::route('dashboard.schedule.add')
@@ -140,7 +140,7 @@ class ScheduleController extends Controller
$scheduleData = Binput::get('incident');
// Parse the schedule date.
$scheduledAt = app(DateFactory::class)->createNormalized('d/m/Y H:i', $scheduleData['scheduled_at']);
$scheduledAt = app(DateFactory::class)->create('d/m/Y H:i', $scheduleData['scheduled_at']);
if ($scheduledAt->isPast()) {
$messageBag = new MessageBag();

View File

@@ -11,7 +11,9 @@
namespace CachetHQ\Cachet\Http\Controllers\Dashboard;
use CachetHQ\Cachet\Integrations\Contracts\Credits;
use CachetHQ\Cachet\Models\User;
use CachetHQ\Cachet\Settings\Repository;
use Exception;
use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Routing\Controller;
@@ -20,6 +22,7 @@ use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Str;
class SettingsController extends Controller
{
@@ -56,6 +59,12 @@ class SettingsController extends Controller
'icon' => 'ion-paintbucket',
'active' => false,
],
'customization' => [
'title' => trans('dashboard.settings.customization.customization'),
'url' => route('dashboard.settings.customization'),
'icon' => 'ion-wand',
'active' => false,
],
'localization' => [
'title' => trans('dashboard.settings.localization.localization'),
'url' => route('dashboard.settings.localization'),
@@ -74,6 +83,12 @@ class SettingsController extends Controller
'icon' => 'ion-stats-bars',
'active' => false,
],
'credits' => [
'title' => trans('dashboard.settings.credits.credits'),
'url' => route('dashboard.settings.credits'),
'icon' => 'ion-ios-list',
'active' => false,
],
'about' => [
'title' => CACHET_VERSION,
'url' => 'javascript: void(0);',
@@ -137,6 +152,22 @@ class SettingsController extends Controller
->withSubMenu($this->subMenu);
}
/**
* Shows the settings customization view.
*
* @return \Illuminate\View\View
*/
public function showCustomizationView()
{
$this->subMenu['customization']['active'] = true;
Session::flash('redirect_to', $this->subMenu['customization']['url']);
return View::make('dashboard.settings.customization')
->withPageTitle(trans('dashboard.settings.customization.customization').' - '.trans('dashboard.dashboard'))
->withSubMenu($this->subMenu);
}
/**
* Shows the settings theme view.
*
@@ -188,6 +219,30 @@ class SettingsController extends Controller
->withSubMenu($this->subMenu);
}
/**
* Show the credits view.
*
* @return \Illuminate\View\View
*/
public function showCreditsView()
{
$this->subMenu['credits']['active'] = true;
$credits = app(Credits::class)->latest();
$backers = $credits['backers'];
$contributors = $credits['contributors'];
shuffle($backers);
shuffle($contributors);
return View::make('dashboard.settings.credits')
->withPageTitle(trans('dashboard.settings.credits.credits').' - '.trans('dashboard.dashboard'))
->withBackers($backers)
->withContributors($contributors)
->withSubMenu($this->subMenu);
}
/**
* Updates the status page settings.
*
@@ -195,42 +250,44 @@ class SettingsController extends Controller
*/
public function postSettings()
{
$redirectUrl = Session::get('redirect_to', route('dashboard.settings.setup'));
$setting = app('setting');
$setting = app(Repository::class);
if (Binput::get('remove_banner') === '1') {
$setting->set('app_banner', null);
}
if (Binput::hasFile('app_banner')) {
$file = Binput::file('app_banner');
$parameters = Binput::all();
// Image Validation.
// Image size in bytes.
$maxSize = $file->getMaxFilesize();
if ($file->getSize() > $maxSize) {
return Redirect::to($redirectUrl)->withErrors(trans('dashboard.settings.app-setup.too-big', ['size' => $maxSize]));
if (isset($parameters['header'])) {
if ($header = Binput::get('header', null, false, false)) {
$setting->set('header', $header);
} else {
$setting->delete('header');
}
if (!$file->isValid() || $file->getError()) {
return Redirect::to($redirectUrl)->withErrors($file->getErrorMessage());
}
if (!starts_with($file->getMimeType(), 'image/')) {
return Redirect::to($redirectUrl)->withErrors(trans('dashboard.settings.app-setup.images-only'));
}
// Store the banner.
$setting->set('app_banner', base64_encode(file_get_contents($file->getRealPath())));
// Store the banner type.
$setting->set('app_banner_type', $file->getMimeType());
}
if (isset($parameters['footer'])) {
if ($footer = Binput::get('footer', null, false, false)) {
$setting->set('footer', $footer);
} else {
$setting->delete('footer');
}
}
if (Binput::hasFile('app_banner')) {
$this->handleUpdateBanner($setting);
}
$excludedParams = [
'_token',
'app_banner',
'remove_banner',
'header',
'footer',
];
try {
foreach (Binput::except(['app_banner', 'remove_banner']) as $settingName => $settingValue) {
foreach (Binput::except($excludedParams) as $settingName => $settingValue) {
if ($settingName === 'app_analytics_pi_url') {
$settingValue = rtrim($settingValue, '/');
}
@@ -238,13 +295,47 @@ class SettingsController extends Controller
$setting->set($settingName, $settingValue);
}
} catch (Exception $e) {
return Redirect::to($redirectUrl)->withErrors(trans('dashboard.settings.edit.failure'));
return Redirect::back()->withErrors(trans('dashboard.settings.edit.failure'));
}
if (Binput::has('app_locale')) {
Lang::setLocale(Binput::get('app_locale'));
}
return Redirect::to($redirectUrl)->withSuccess(trans('dashboard.settings.edit.success'));
return Redirect::back()->withSuccess(trans('dashboard.settings.edit.success'));
}
/**
* Handle updating of the banner image.
*
* @param \CachetHQ\Cachet\Settings\Repository $setting
*
* @return void
*/
protected function handleUpdateBanner(Repository $setting)
{
$file = Binput::file('app_banner');
// Image Validation.
// Image size in bytes.
$maxSize = $file->getMaxFilesize();
if ($file->getSize() > $maxSize) {
return Redirect::to($redirectUrl)->withErrors(trans('dashboard.settings.app-setup.too-big', ['size' => $maxSize]));
}
if (!$file->isValid() || $file->getError()) {
return Redirect::to($redirectUrl)->withErrors($file->getErrorMessage());
}
if (!Str::startsWith($file->getMimeType(), 'image/')) {
return Redirect::to($redirectUrl)->withErrors(trans('dashboard.settings.app-setup.images-only'));
}
// Store the banner.
$setting->set('app_banner', base64_encode(file_get_contents($file->getRealPath())));
// Store the banner type.
$setting->set('app_banner_type', $file->getMimeType());
}
}

View File

@@ -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,8 +53,14 @@ class SubscriberController extends Controller
*/
public function createSubscriberAction()
{
$verified = app(Repository::class)->get('setting.skip_subscriber_verification');
try {
dispatch(new SubscribeSubscriberCommand(Binput::get('email')));
$subscribers = preg_split("/\r\n|\n|\r/", Binput::get('email'));
foreach ($subscribers as $subscriber) {
dispatch(new SubscribeSubscriberCommand($subscriber, $verified));
}
} catch (ValidationException $e) {
return Redirect::route('dashboard.subscribers.add')
->withInput(Binput::all())

View File

@@ -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) {

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