mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-24 16:10:37 -06:00
A bunch of empty pages as a place-holder for future telemetry efforts.
This commit is contained in:
parent
9e9b55da8e
commit
9f8bf6d495
78
app/Http/Controllers/Admin/TelemetryController.php
Normal file
78
app/Http/Controllers/Admin/TelemetryController.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* TelemetryController.php
|
||||
* Copyright (c) 2020 thegrumpydictator@gmail.com
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Admin;
|
||||
|
||||
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
|
||||
/**
|
||||
* Class TelemetryController
|
||||
*/
|
||||
class TelemetryController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->middleware(
|
||||
static function ($request, $next) {
|
||||
app('view')->share('title', (string)trans('firefly.administration'));
|
||||
app('view')->share('mainTitleIcon', 'fa-hand-spock-o');
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
session()->flash('info', 'No telemetry to delete. Does not work yet.');
|
||||
|
||||
return redirect(route('admin.telemetry.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
app('view')->share('subTitleIcon', 'fa-eye');
|
||||
app('view')->share('subTitle', (string)trans('firefly.telemetry_admin_index'));
|
||||
$version = config('firefly.version');
|
||||
$enabled = config('firefly.telemetry', false);
|
||||
$count = 1;
|
||||
|
||||
return view('admin.telemetry.index', compact('version', 'enabled', 'count'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function view()
|
||||
{
|
||||
return view('admin.telemetry.view');
|
||||
}
|
||||
|
||||
}
|
@ -134,6 +134,7 @@ return [
|
||||
],
|
||||
'feature_flags' => [
|
||||
'export' => true,
|
||||
'telemetry' => false,
|
||||
],
|
||||
|
||||
'encryption' => null === env('USE_ENCRYPTION') || true === env('USE_ENCRYPTION'),
|
||||
@ -160,6 +161,7 @@ return [
|
||||
'login_provider' => envNonEmpty('LOGIN_PROVIDER', 'eloquent'),
|
||||
'cer_provider' => envNonEmpty('CER_PROVIDER', 'fixer'),
|
||||
'update_endpoint' => 'https://version.firefly-iii.org/index.json',
|
||||
'send_telemetry' => env('SEND_TELEMETRY', false),
|
||||
'update_minimum_age' => 6,
|
||||
'default_location' => [
|
||||
'longitude' => env('MAP_DEFAULT_LONG', '5.916667'),
|
||||
|
@ -57,4 +57,6 @@ return [
|
||||
'edit_tag' => 'Edit tag ":tag"',
|
||||
'delete_tag' => 'Delete tag ":tag"',
|
||||
'delete_journal_link' => 'Delete link between transactions',
|
||||
'telemetry_index' => 'Telemetry',
|
||||
'telemetry_view' => 'View telemetry',
|
||||
];
|
||||
|
@ -1566,4 +1566,20 @@ return [
|
||||
'box_net_worth_in_currency' => 'Net worth (:currency)',
|
||||
'box_spend_per_day' => 'Left to spend per day: :amount',
|
||||
|
||||
// telemetry
|
||||
'telemetry_admin_index' => 'Telemetry',
|
||||
'telemetry_intro' => 'Firefly III supports the collection and sending of usage telemetry. This means that Firefly III will try to collect info on how you use Firefly III, and send it to the developer of Firefly III. This is always opt-in, and is disabled by default. Firefly III will never collect or send financial information. Firefly III will also never collect or send financial meta-information, like sums or calculations. The collected data will never be made publicly accessible.',
|
||||
'telemetry_what_collected' => 'What Firefly III collects and sends exactly is different for each version. You are running version :version. What Firefly III collects in version :version is something you can read in the help pages. Click the (?)-icon in the top-right corner <a href="https://github.com/firefly-iii/help/blob/master/en_US/admin.telemetry.index.md">or visit the help page directly on GitHub</a>.',
|
||||
'telemetry_is_enabled_yes_no' => 'Is Firefly III telemetry enabled?',
|
||||
'telemetry_disabled_no' => 'Telemetry is NOT enabled',
|
||||
'telemetry_disabled_yes' => 'Telemetry is enabled',
|
||||
'telemetry_enabled_now_what' => 'You can disable telemetry the same way you enabled it: in your .env file or in your Docker configuration.',
|
||||
'telemetry_disabled_now_what' => 'If you want to, you can enable telemetry in your .env file or in your Docker configuration.',
|
||||
'telemetry_collected_info' => 'Collected information',
|
||||
'no_telemetry_present' => 'Firefly III has collected zero telemetry records.',
|
||||
'records_telemetry_present' => 'Firefly III has collected :count telemetry record(s).',
|
||||
'telemetry_button_view' => 'View telemetry',
|
||||
'telemetry_button_delete' => 'Delete telemetry',
|
||||
'telemetry_admin_overview' => 'Telemetry overview',
|
||||
'telemetry_back_to_index' => 'Back to telemetry'
|
||||
];
|
||||
|
@ -14,8 +14,11 @@
|
||||
<ul>
|
||||
<li><a href="{{ route('admin.configuration.index') }}">{{ 'firefly_instance_configuration'|_ }}</a></li>
|
||||
<li><a href="{{ route('admin.links.index') }}">{{ 'journal_link_configuration'|_ }}</a></li>
|
||||
{% if config('firefly.feature_flags.telemetry') %}
|
||||
<li><a href="{{ route('admin.telemetry.index') }}">{{ 'telemetry_admin_index'|_ }}</a></li>
|
||||
{% endif %}
|
||||
{% if not sandstorm %}
|
||||
<li><a href="{{ route('admin.update-check') }}">{{ 'update_check_title'|_ }}</a></li>
|
||||
<li><a href="{{ route('admin.update-check') }}">{{ 'update_check_title'|_ }}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
|
72
resources/views/v1/admin/telemetry/index.twig
Normal file
72
resources/views/v1/admin/telemetry/index.twig
Normal file
@ -0,0 +1,72 @@
|
||||
{% extends "./layout/default" %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
{{ Breadcrumbs.render }}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'telemetry_admin_index'|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>
|
||||
{{ 'telemetry_intro'|_ }}
|
||||
</p>
|
||||
<p>
|
||||
{{ trans('firefly.telemetry_what_collected', {version: version})|raw }}
|
||||
</p>
|
||||
<p class="lead">
|
||||
{{ 'telemetry_is_enabled_yes_no'|_ }}
|
||||
{% if enabled %}
|
||||
<strong class="text-warning">{{ 'telemetry_disabled_yes'|_ }}</strong>
|
||||
{% else %}
|
||||
<strong class="text-success">{{ 'telemetry_disabled_no'|_ }}</strong>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% if enabled %}
|
||||
<p>
|
||||
{{ 'telemetry_enabled_now_what'|_ }}
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
{{ 'telemetry_disabled_now_what'|_ }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'telemetry_collected_info'|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{% if count == 0 %}
|
||||
<p>
|
||||
{{ 'no_telemetry_present'|_ }}
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
{{ trans('firefly.records_telemetry_present', {count: count}) }}
|
||||
</p>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a class="btn btn-default" href="{{ route('admin.telemetry.view') }}" title="{{ 'telemetry_button_view'|_ }}">
|
||||
<i class="fa fa-eye"></i>
|
||||
{{ 'telemetry_button_view'|_ }}
|
||||
</a>
|
||||
<a class="btn btn-danger" href="{{ route('admin.telemetry.delete') }}" title="{{ 'telemetry_button_delete'|_ }}">
|
||||
<i class="fa fa-trash"></i>
|
||||
{{ 'telemetry_button_delete'|_ }}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
{% endblock %}
|
27
resources/views/v1/admin/telemetry/view.twig
Normal file
27
resources/views/v1/admin/telemetry/view.twig
Normal file
@ -0,0 +1,27 @@
|
||||
{% extends "./layout/default" %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
{{ Breadcrumbs.render }}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'telemetry_admin_overview'|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>
|
||||
<em>(this version does not yet support telemetry)</em>
|
||||
</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-default" href="{{ route('admin.telemetry.index') }}">{{ 'telemetry_back_to_index'|_ }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
{% endblock %}
|
@ -271,6 +271,22 @@ try {
|
||||
}
|
||||
);
|
||||
|
||||
Breadcrumbs::register(
|
||||
'admin.telemetry.index',
|
||||
static function (BreadcrumbsGenerator $breadcrumbs) {
|
||||
$breadcrumbs->parent('admin.index');
|
||||
$breadcrumbs->push(trans('breadcrumbs.telemetry_index'), route('admin.telemetry.index'));
|
||||
}
|
||||
);
|
||||
|
||||
Breadcrumbs::register(
|
||||
'admin.telemetry.view',
|
||||
static function (BreadcrumbsGenerator $breadcrumbs) {
|
||||
$breadcrumbs->parent('admin.telemetry.index');
|
||||
$breadcrumbs->push(trans('breadcrumbs.telemetry_view'));
|
||||
}
|
||||
);
|
||||
|
||||
Breadcrumbs::register(
|
||||
'transactions.link.delete',
|
||||
function (BreadcrumbsGenerator $breadcrumbs, TransactionJournalLink $link) {
|
||||
|
@ -1081,6 +1081,11 @@ Route::group(
|
||||
Route::post('users/update/{user}', ['uses' => 'UserController@update', 'as' => 'users.update']);
|
||||
Route::post('users/destroy/{user}', ['uses' => 'UserController@destroy', 'as' => 'users.destroy']);
|
||||
|
||||
// telemetry manager:
|
||||
Route::get('telemetry', ['uses' => 'TelemetryController@index', 'as' => 'telemetry.index']);
|
||||
Route::get('telemetry/view', ['uses' => 'TelemetryController@view', 'as' => 'telemetry.view']);
|
||||
Route::get('telemetry/delete', ['uses' => 'TelemetryController@delete', 'as' => 'telemetry.delete']);
|
||||
|
||||
// journal links manager
|
||||
Route::get('links', ['uses' => 'LinkController@index', 'as' => 'links.index']);
|
||||
Route::get('links/create', ['uses' => 'LinkController@create', 'as' => 'links.create']);
|
||||
|
Loading…
Reference in New Issue
Block a user