mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 02:44:35 -04:00
Ping route (#3541)
* minor fixes * minor fixes * Fixes for self update * fixes for template previews * Add report_errors variable * Ping route
This commit is contained in:
parent
24c9121b1b
commit
1d11358215
@ -62,8 +62,13 @@ class ArtisanUpgrade extends Command
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
/* Restart Horizon */
|
/* Restart Horizon */
|
||||||
Artisan::call('horizon:terminate');
|
//Artisan::call('horizon:terminate');
|
||||||
Artisan::call('horizon');
|
|
||||||
|
exec('cd '.base_path().' && /usr/bin/php artisan horizon:terminate');
|
||||||
|
exec('cd '.base_path().' && /usr/bin/php artisan horizon &');
|
||||||
|
|
||||||
|
//Artisan::call('horizon');
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
\Log::error("I wasn't able to start horizon");
|
\Log::error("I wasn't able to start horizon");
|
||||||
}
|
}
|
||||||
@ -71,7 +76,7 @@ class ArtisanUpgrade extends Command
|
|||||||
putenv('COMPOSER_HOME=' . __DIR__ . '/vendor/bin/composer');
|
putenv('COMPOSER_HOME=' . __DIR__ . '/vendor/bin/composer');
|
||||||
$input = new ArrayInput(array('command' => 'install'));
|
$input = new ArrayInput(array('command' => 'install'));
|
||||||
$application = new Application();
|
$application = new Application();
|
||||||
//$application->setAutoExit(false); // prevent `$application->run` method from exitting the script
|
$application->setAutoExit(true); // prevent `$application->run` method from exitting the script
|
||||||
$application->run($input);
|
$application->run($input);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,13 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Libraries\Account;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Models\Design;
|
use App\Models\Design;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Transformers\ArraySerializer;
|
use App\Transformers\ArraySerializer;
|
||||||
use App\Transformers\EntityTransformer;
|
use App\Transformers\EntityTransformer;
|
||||||
|
use App\Utils\Ninja;
|
||||||
use App\Utils\Statics;
|
use App\Utils\Statics;
|
||||||
use App\Utils\Traits\AppSetup;
|
use App\Utils\Traits\AppSetup;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@ -301,8 +303,17 @@ class BaseController extends Controller
|
|||||||
public function flutterRoute()
|
public function flutterRoute()
|
||||||
{
|
{
|
||||||
if (!$this->checkAppSetup());
|
if (!$this->checkAppSetup());
|
||||||
return redirect('/setup');
|
return redirect('/setup');
|
||||||
|
|
||||||
return view('index.index');
|
$data = [];
|
||||||
|
|
||||||
|
if(Ninja::isSelfHost()){
|
||||||
|
$account = Account::all()->first();
|
||||||
|
$data['report_errors'] = $account->report_errors;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$data['report_errors'] = true;
|
||||||
|
|
||||||
|
return view('index.index', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
29
app/Http/Controllers/PingController.php
Normal file
29
app/Http/Controllers/PingController.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://opensource.org/licenses/AAL
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class PingController extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return response()->json('success', 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -124,7 +124,6 @@ class TemplateController extends BaseController
|
|||||||
$subject = request()->input('subject') ?: '';
|
$subject = request()->input('subject') ?: '';
|
||||||
$body = request()->input('body') ?: '';
|
$body = request()->input('body') ?: '';
|
||||||
$template = request()->input('template') ?: '';
|
$template = request()->input('template') ?: '';
|
||||||
$include_wrapper = request()->input('include_wrapper') ?: false;
|
|
||||||
|
|
||||||
if(strlen($template) >1) {
|
if(strlen($template) >1) {
|
||||||
|
|
||||||
@ -151,12 +150,9 @@ class TemplateController extends BaseController
|
|||||||
|
|
||||||
$body = $converter->convertToHtml($body);
|
$body = $converter->convertToHtml($body);
|
||||||
|
|
||||||
if($include_wrapper){
|
/* wrapper */
|
||||||
|
|
||||||
$email_style = $settings_entity->getSetting('email_style');
|
$email_style = $settings_entity->getSetting('email_style');
|
||||||
|
|
||||||
$email_style = 'dark';
|
|
||||||
|
|
||||||
$data['title'] = '';
|
$data['title'] = '';
|
||||||
$data['body'] = $body;
|
$data['body'] = $body;
|
||||||
$data['footer'] = '';
|
$data['footer'] = '';
|
||||||
@ -164,22 +160,21 @@ class TemplateController extends BaseController
|
|||||||
if($email_style == 'custom') {
|
if($email_style == 'custom') {
|
||||||
|
|
||||||
$wrapper = $settings_entity->getSetting('email_style_custom');
|
$wrapper = $settings_entity->getSetting('email_style_custom');
|
||||||
$this->renderView($wrapper, $data);
|
$wrapper = $this->renderView($wrapper, $data);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
$wrapper = $this->getTemplate();
|
$wrapper = $this->getTemplate();
|
||||||
$body = view($this->getTemplatePath($email_style), $data)->render();
|
$wrapper = view($this->getTemplatePath($email_style), $data)->render();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'subject' => $subject,
|
'subject' => $subject,
|
||||||
'body' => $body,
|
'body' => $body,
|
||||||
|
'wrapper' => $wrapper,
|
||||||
];
|
];
|
||||||
|
|
||||||
return response()->json($data, 200);
|
return response()->json($data, 200);
|
||||||
|
@ -308,7 +308,7 @@ trait MakesInvoiceValues
|
|||||||
$data['$task.tax_name2'] = ['value' => '', 'label' => ctrans('texts.tax')];
|
$data['$task.tax_name2'] = ['value' => '', 'label' => ctrans('texts.tax')];
|
||||||
$data['$task.tax_name3'] = ['value' => '', 'label' => ctrans('texts.tax')];
|
$data['$task.tax_name3'] = ['value' => '', 'label' => ctrans('texts.tax')];
|
||||||
$data['$task.line_total'] = ['value' => '', 'label' => ctrans('texts.line_total')];
|
$data['$task.line_total'] = ['value' => '', 'label' => ctrans('texts.line_total')];
|
||||||
|
//$data['$contact.signature']
|
||||||
|
|
||||||
// $data['custom_label1'] = ['value' => '', 'label' => ctrans('texts.')];
|
// $data['custom_label1'] = ['value' => '', 'label' => ctrans('texts.')];
|
||||||
// $data['custom_label2'] = ['value' => '', 'label' => ctrans('texts.')];
|
// $data['custom_label2'] = ['value' => '', 'label' => ctrans('texts.')];
|
||||||
|
@ -146,8 +146,10 @@ return [
|
|||||||
'connection' => 'redis',
|
'connection' => 'redis',
|
||||||
'queue' => ['default'],
|
'queue' => ['default'],
|
||||||
'balance' => 'simple',
|
'balance' => 'simple',
|
||||||
'processes' => 8,
|
'processes' => 2,
|
||||||
'tries' => 1,
|
'memory'=> 512,
|
||||||
|
'timeout'=> 360,
|
||||||
|
'tries' => 3,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
@ -157,7 +159,9 @@ return [
|
|||||||
'queue' => ['default'],
|
'queue' => ['default'],
|
||||||
'balance' => 'simple',
|
'balance' => 'simple',
|
||||||
'processes' => 3,
|
'processes' => 3,
|
||||||
'tries' => 1,
|
'memory'=> 512,
|
||||||
|
'timeout'=> 360,
|
||||||
|
'tries' => 3,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
@ -125,6 +125,7 @@ class CreateUsersTable extends Migration
|
|||||||
$table->string('utm_term')->nullable();
|
$table->string('utm_term')->nullable();
|
||||||
$table->string('utm_content')->nullable();
|
$table->string('utm_content')->nullable();
|
||||||
$table->string('latest_version')->default('0.0.0');
|
$table->string('latest_version')->default('0.0.0');
|
||||||
|
$table->boolean('report_errors')->default(false);
|
||||||
|
|
||||||
$table->float('discount')->default(0);
|
$table->float('discount')->default(0);
|
||||||
$table->date('discount_expires')->nullable();
|
$table->date('discount_expires')->nullable();
|
||||||
|
@ -15,6 +15,7 @@ Route::middleware('auth:api')->get('/user', function (Request $request) {
|
|||||||
return $request->user();
|
return $request->user();
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
|
Route::get('/api/v1/ping', 'PingController@index')->name('ping');
|
||||||
|
|
||||||
Route::group(['middleware' => ['api_secret_check']], function () {
|
Route::group(['middleware' => ['api_secret_check']], function () {
|
||||||
Route::post('api/v1/signup', 'AccountController@store')->name('signup.submit');
|
Route::post('api/v1/signup', 'AccountController@store')->name('signup.submit');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user