mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-19 08:00:19 +00:00
Lots of stuff gets cached now.
This commit is contained in:
@@ -8,7 +8,7 @@ use Carbon\Carbon;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Support\ChartProperties;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use Grumpydictator\Gchart\GChart;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
@@ -43,7 +43,7 @@ class AccountController extends Controller
|
||||
$end->endOfMonth();
|
||||
|
||||
// chart properties for cache:
|
||||
$chartProperties = new ChartProperties();
|
||||
$chartProperties = new CacheProperties();
|
||||
$chartProperties->addProperty($start);
|
||||
$chartProperties->addProperty($end);
|
||||
$chartProperties->addProperty('all');
|
||||
@@ -118,7 +118,7 @@ class AccountController extends Controller
|
||||
$accounts = $repository->getFrontpageAccounts($frontPage);
|
||||
|
||||
// chart properties for cache:
|
||||
$chartProperties = new ChartProperties();
|
||||
$chartProperties = new CacheProperties();
|
||||
$chartProperties->addProperty($start);
|
||||
$chartProperties->addProperty($end);
|
||||
$chartProperties->addProperty('frontpage');
|
||||
@@ -182,7 +182,7 @@ class AccountController extends Controller
|
||||
$today = new Carbon;
|
||||
|
||||
// chart properties for cache:
|
||||
$chartProperties = new ChartProperties();
|
||||
$chartProperties = new CacheProperties();
|
||||
$chartProperties->addProperty($start);
|
||||
$chartProperties->addProperty($end);
|
||||
$chartProperties->addProperty('frontpage');
|
||||
|
||||
@@ -8,7 +8,7 @@ use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use FireflyIII\Support\ChartProperties;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use Grumpydictator\Gchart\GChart;
|
||||
use Illuminate\Support\Collection;
|
||||
use Response;
|
||||
@@ -40,7 +40,7 @@ class BillController extends Controller
|
||||
$chart->addColumn(trans('firefly.minAmount'), 'number');
|
||||
$chart->addColumn(trans('firefly.billEntry'), 'number');
|
||||
|
||||
$chartProperties = new ChartProperties;
|
||||
$chartProperties = new CacheProperties;
|
||||
$chartProperties->addProperty('single');
|
||||
$chartProperties->addProperty('bill');
|
||||
$chartProperties->addProperty($bill->id);
|
||||
@@ -87,7 +87,7 @@ class BillController extends Controller
|
||||
|
||||
|
||||
// chart properties for cache:
|
||||
$chartProperties = new ChartProperties();
|
||||
$chartProperties = new CacheProperties();
|
||||
$chartProperties->addProperty($start);
|
||||
$chartProperties->addProperty($end);
|
||||
$chartProperties->addProperty('bills');
|
||||
|
||||
@@ -8,7 +8,7 @@ use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\LimitRepetition;
|
||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||
use FireflyIII\Support\ChartProperties;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use Grumpydictator\Gchart\GChart;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
@@ -45,7 +45,7 @@ class BudgetController extends Controller
|
||||
$last = Navigation::endOfX($last, $range, $final);
|
||||
|
||||
// chart properties for cache:
|
||||
$chartProperties = new ChartProperties();
|
||||
$chartProperties = new CacheProperties();
|
||||
$chartProperties->addProperty($first);
|
||||
$chartProperties->addProperty($last);
|
||||
$chartProperties->addProperty('budget');
|
||||
@@ -93,7 +93,7 @@ class BudgetController extends Controller
|
||||
$end = $repetition->enddate;
|
||||
|
||||
// chart properties for cache:
|
||||
$chartProperties = new ChartProperties();
|
||||
$chartProperties = new CacheProperties();
|
||||
$chartProperties->addProperty($start);
|
||||
$chartProperties->addProperty($end);
|
||||
$chartProperties->addProperty('budget');
|
||||
@@ -153,7 +153,7 @@ class BudgetController extends Controller
|
||||
$allEntries = new Collection;
|
||||
|
||||
// chart properties for cache:
|
||||
$chartProperties = new ChartProperties();
|
||||
$chartProperties = new CacheProperties();
|
||||
$chartProperties->addProperty($start);
|
||||
$chartProperties->addProperty($end);
|
||||
$chartProperties->addProperty('budget');
|
||||
@@ -227,7 +227,7 @@ class BudgetController extends Controller
|
||||
$budgets = $repository->getBudgets();
|
||||
|
||||
// chart properties for cache:
|
||||
$chartProperties = new ChartProperties();
|
||||
$chartProperties = new CacheProperties();
|
||||
$chartProperties->addProperty($start);
|
||||
$chartProperties->addProperty($end);
|
||||
$chartProperties->addProperty('budget');
|
||||
|
||||
@@ -8,7 +8,7 @@ use Carbon\Carbon;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Models\Category;
|
||||
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
||||
use FireflyIII\Support\ChartProperties;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use Grumpydictator\Gchart\GChart;
|
||||
use Log;
|
||||
use Navigation;
|
||||
@@ -80,7 +80,7 @@ class CategoryController extends Controller
|
||||
$end = Session::get('end', Carbon::now()->endOfMonth());
|
||||
|
||||
// chart properties for cache:
|
||||
$chartProperties = new ChartProperties;
|
||||
$chartProperties = new CacheProperties;
|
||||
$chartProperties->addProperty($start);
|
||||
$chartProperties->addProperty($end);
|
||||
$chartProperties->addProperty('category');
|
||||
|
||||
@@ -62,9 +62,11 @@ class HomeController extends Controller
|
||||
public function index(AccountRepositoryInterface $repository)
|
||||
{
|
||||
|
||||
|
||||
$types = Config::get('firefly.accountTypesByIdentifier.asset');
|
||||
$count = $repository->countAccounts($types);
|
||||
|
||||
|
||||
if ($count == 0) {
|
||||
return Redirect::route('new-user.index');
|
||||
}
|
||||
@@ -78,8 +80,11 @@ class HomeController extends Controller
|
||||
$end = Session::get('end', Carbon::now()->endOfMonth());
|
||||
$accounts = $repository->getFrontpageAccounts($frontPage);
|
||||
$savings = $repository->getSavingsAccounts();
|
||||
|
||||
$piggyBankAccounts = $repository->getPiggyBankAccounts();
|
||||
|
||||
|
||||
|
||||
$savingsTotal = 0;
|
||||
foreach ($savings as $savingAccount) {
|
||||
$savingsTotal += Steam::balance($savingAccount, $end);
|
||||
@@ -100,7 +105,6 @@ class HomeController extends Controller
|
||||
$transactions[] = [$set, $account];
|
||||
}
|
||||
}
|
||||
|
||||
return view('index', compact('count', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions', 'savingsTotal', 'piggyBankAccounts'));
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||
use FireflyIII\Support\ChartProperties;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
use Response;
|
||||
@@ -40,7 +40,7 @@ class JsonController extends Controller
|
||||
$end = Session::get('end', Carbon::now()->endOfMonth());
|
||||
|
||||
// works for json too!
|
||||
$prop = new ChartProperties;
|
||||
$prop = new CacheProperties;
|
||||
$prop->addProperty($start);
|
||||
$prop->addProperty($end);
|
||||
$prop->addProperty('box-bills-paid');
|
||||
@@ -96,7 +96,7 @@ class JsonController extends Controller
|
||||
$end = Session::get('end', Carbon::now()->endOfMonth());
|
||||
|
||||
// works for json too!
|
||||
$prop = new ChartProperties;
|
||||
$prop = new CacheProperties;
|
||||
$prop->addProperty($start);
|
||||
$prop->addProperty($end);
|
||||
$prop->addProperty('box-bills-unpaid');
|
||||
@@ -158,7 +158,7 @@ class JsonController extends Controller
|
||||
$end = Session::get('end', Carbon::now()->endOfMonth());
|
||||
|
||||
// works for json too!
|
||||
$prop = new ChartProperties;
|
||||
$prop = new CacheProperties;
|
||||
$prop->addProperty($start);
|
||||
$prop->addProperty($end);
|
||||
$prop->addProperty('box-in');
|
||||
@@ -190,7 +190,7 @@ class JsonController extends Controller
|
||||
|
||||
|
||||
// works for json too!
|
||||
$prop = new ChartProperties;
|
||||
$prop = new CacheProperties;
|
||||
$prop->addProperty($start);
|
||||
$prop->addProperty($end);
|
||||
$prop->addProperty('box-out');
|
||||
|
||||
Reference in New Issue
Block a user