mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Add code samples to Queue config screen
This commit is contained in:
parent
d4cd5e3d75
commit
097cecece8
6 changed files with 124 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
<config autoescape="on" />
|
||||
|
||||
<include target="config_header.html" />
|
||||
<load target="css/queue_config.scss" />
|
||||
<load target="js/queue_config.js" />
|
||||
|
||||
<div class="message">
|
||||
|
|
@ -96,6 +97,69 @@
|
|||
|
||||
<h2>{$lang->cmd_queue_call_script}</h2>
|
||||
|
||||
<div class="queue-script-setup">
|
||||
<ul class="qss-tabs x_nav x_nav-tabs">
|
||||
<li class="x_active"><a href="#" data-value="crontab">crontab</a></li>
|
||||
<li><a href="#" data-value="webcron">webcron</a></li>
|
||||
<li><a href="#" data-value="systemd-timer">systemd timer</a></li>
|
||||
</ul>
|
||||
<div class="qss-content crontab active">
|
||||
{@
|
||||
if (function_exists('posix_getpwuid') && function_exists('posix_getuid')):
|
||||
$user_info = posix_getpwuid(posix_getuid());
|
||||
if (!empty($user_info['dir'])):
|
||||
$user_info['dir'] .= DIRECTORY_SEPARATOR;
|
||||
endif;
|
||||
else:
|
||||
$user_info = [];
|
||||
$user_info['name'] = $lang->msg_queue_instructions['same_as_php'];
|
||||
endif;
|
||||
}
|
||||
<p class="qss-instruction">
|
||||
{sprintf($lang->msg_queue_instructions['crontab1'], $user_info['name'] ?? 'PHP', $user_info['dir'] . 'logs')|noescape}
|
||||
</p>
|
||||
<pre><code>* * * * * php {\RX_BASEDIR}index.php common.cron >> {$user_info['dir']}logs{\DIRECTORY_SEPARATOR}queue.log 2>&1</code></pre>
|
||||
<p class="qss-instruction">
|
||||
{$lang->msg_queue_instructions['crontab2']|noescape}
|
||||
</p>
|
||||
</div>
|
||||
<div class="qss-content webcron">
|
||||
<p class="qss-instruction">
|
||||
{$lang->msg_queue_instructions['webcron']|noescape}
|
||||
</p>
|
||||
<pre><code class="webcron-url">{getFullUrl('')}common/scripts/cron.php?key={config('queue.key')}</code></pre>
|
||||
</div>
|
||||
<div class="qss-content systemd-timer">
|
||||
<p class="qss-instruction">
|
||||
{$lang->msg_queue_instructions['systemd1']|noescape}
|
||||
</p>
|
||||
<pre><code>[Unit]
|
||||
Description=Rhymix Queue Service
|
||||
|
||||
[Service]
|
||||
ExecStart=php {\RX_BASEDIR}index.php common.cron
|
||||
User={$user_info['name']}</code></pre>
|
||||
<p class="qss-instruction">
|
||||
{$lang->msg_queue_instructions['systemd2']|noescape}
|
||||
</p>
|
||||
<pre><code>[Unit]
|
||||
Description=Rhymix Queue Timer
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* *:*:00
|
||||
Unit=rhymix-queue.service
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target</code></pre>
|
||||
<p class="qss-instruction">
|
||||
{$lang->msg_queue_instructions['systemd3']|noescape}
|
||||
</p>
|
||||
<pre><code>systemctl daemon-reload
|
||||
systemctl start rhymix-queue.timer
|
||||
systemctl enable rhymix-queue.timer</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="queue_key">{$lang->cmd_queue_webcron_key}</label>
|
||||
<div class="x_controls">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue