In case if cron isn't set, in Settings/Server tab you will see suggestions for cron command

This commit is contained in:
Čarodej
2022-08-08 16:57:15 +02:00
parent 88fa5732d3
commit 60cdcff4ff
6 changed files with 38 additions and 5 deletions

View File

@@ -2,6 +2,7 @@
#### Release date: 8. August 2022 #### Release date: 8. August 2022
- Account verification email is now sending in preferred app language - Account verification email is now sending in preferred app language
- Fixed issue where metered billing mode still count in some cases members after team folder was deleted - Fixed issue where metered billing mode still count in some cases members after team folder was deleted
- In case if cron isn't set, in Settings/Server tab you will see suggestions for cron command
## Version 2.2.3 ## Version 2.2.3
#### Release date: 6. August 2022 #### Release date: 6. August 2022

View File

@@ -46,7 +46,7 @@
"/chunks/app-others.js": "/chunks/app-others.js?id=cd9bd5ffc795124d", "/chunks/app-others.js": "/chunks/app-others.js?id=cd9bd5ffc795124d",
"/chunks/app-sign-in-out.js": "/chunks/app-sign-in-out.js?id=f0dd52d555f292ac", "/chunks/app-sign-in-out.js": "/chunks/app-sign-in-out.js?id=f0dd52d555f292ac",
"/chunks/app-adsense.js": "/chunks/app-adsense.js?id=8ecab69b4de459b6", "/chunks/app-adsense.js": "/chunks/app-adsense.js?id=8ecab69b4de459b6",
"/chunks/app-server.js": "/chunks/app-server.js?id=79490aac32eb76b5", "/chunks/app-server.js": "/chunks/app-server.js?id=b107f5d9a2198650",
"/chunks/app-language.js": "/chunks/app-language.js?id=edbc5cc194c3105f", "/chunks/app-language.js": "/chunks/app-language.js?id=edbc5cc194c3105f",
"/chunks/homepage.js": "/chunks/homepage.js?id=be5cc12af74b5fa5", "/chunks/homepage.js": "/chunks/homepage.js?id=be5cc12af74b5fa5",
"/chunks/dynamic-page.js": "/chunks/dynamic-page.js?id=16a07effb03aec7f", "/chunks/dynamic-page.js": "/chunks/dynamic-page.js?id=16a07effb03aec7f",

View File

@@ -26,6 +26,23 @@
</span> </span>
</div> </div>
</div> </div>
<div v-if="!cron.running" class="mt-8">
<AppInputText
:title="$t('Shared Web Hosting (Cpanel, Plesk, etc...) Command')"
:description="$t('Proposed command for Shared Web Hosting (Cpanel, Plesk, etc...)')"
>
<CopyInput size="small" :str="cron.command.shared" />
</AppInputText>
<AppInputText
:title="$t('Crontab Command')"
:description="$t('Proposed command for crontab. Available only for setup via linux terminal.')"
:is-last="true"
>
<CopyInput size="small" :str="cron.command.vps" />
</AppInputText>
</div>
</div> </div>
<!--Broadcasting--> <!--Broadcasting-->
@@ -217,6 +234,8 @@
</template> </template>
<script> <script>
import AppInputText from "../../../../components/Forms/Layouts/AppInputText";
import CopyInput from "../../../../components/Inputs/CopyInput";
import { CheckIcon, XIcon, DownloadCloudIcon } from 'vue-feather-icons' import { CheckIcon, XIcon, DownloadCloudIcon } from 'vue-feather-icons'
import FormLabel from '../../../../components/UI/Labels/FormLabel' import FormLabel from '../../../../components/UI/Labels/FormLabel'
import PageTab from '../../../../components/Layout/PageTab' import PageTab from '../../../../components/Layout/PageTab'
@@ -228,6 +247,8 @@ import ButtonBase from "../../../../components/UI/Buttons/ButtonBase";
export default { export default {
name: 'Server', name: 'Server',
components: { components: {
AppInputText,
CopyInput,
ButtonBase, ButtonBase,
FormLabel, FormLabel,
InfoBox, InfoBox,

View File

@@ -41,10 +41,7 @@ class GetDashboardDataController extends Controller
'app' => [ 'app' => [
'cron' => [ 'cron' => [
'isRunning' => isRunningCron(), 'isRunning' => isRunningCron(),
'command' => [ 'command' => getCronCommandSuggestions(),
'shared' => PHP_BINARY . ' ' . base_path() . '/artisan schedule:run >> /dev/null 2>&1',
'vps' => '* * * * * cd ' . base_path() . ' && ' . PHP_BINARY . ' artisan schedule:run >> /dev/null 2>&1',
],
], ],
'license' => get_settings('license'), 'license' => get_settings('license'),
'version' => config('vuefilemanager.version'), 'version' => config('vuefilemanager.version'),

View File

@@ -31,6 +31,7 @@ class GetServerStatusController
$status['cron'] = [ $status['cron'] = [
'running' => isRunningCron(), 'running' => isRunningCron(),
'lastUpdate' => isRunningCron() ? format_date(cache()->get('latest_cron_update')) : null, 'lastUpdate' => isRunningCron() ? format_date(cache()->get('latest_cron_update')) : null,
'command' => getCronCommandSuggestions(),
]; ];
return response()->json($status); return response()->json($status);

View File

@@ -69,6 +69,19 @@ if (! function_exists('isRunningCron')) {
} }
} }
if (! function_exists('getCronCommandSuggestions')) {
/**
* it gets cron command suggestion for VPS and admin panels
*/
function getCronCommandSuggestions(): array
{
return [
'shared' => PHP_BINARY . ' ' . base_path() . '/artisan schedule:run >> /dev/null 2>&1',
'vps' => '* * * * * cd ' . base_path() . ' && ' . PHP_BINARY . ' artisan schedule:run >> /dev/null 2>&1',
];
}
}
if (! function_exists('getInnerFolderIds')) { if (! function_exists('getInnerFolderIds')) {
/** /**
* Get all folder children ids * Get all folder children ids