Revision f815dda9
Von Moritz Bunkus vor mehr als 12 Jahren hinzugefügt
SL/Controller/TaskServer.pm | ||
---|---|---|
1 |
package SL::Controller::TaskServer; |
|
2 |
|
|
3 |
use strict; |
|
4 |
|
|
5 |
use parent qw(SL::Controller::Base); |
|
6 |
|
|
7 |
use SL::Helper::Flash; |
|
8 |
use SL::System::TaskServer; |
|
9 |
|
|
10 |
use Rose::Object::MakeMethods::Generic |
|
11 |
( |
|
12 |
'scalar --get_set_init' => [ qw(task_server) ], |
|
13 |
); |
|
14 |
|
|
15 |
__PACKAGE__->run_before('check_auth'); |
|
16 |
|
|
17 |
# |
|
18 |
# actions |
|
19 |
# |
|
20 |
|
|
21 |
sub action_show { |
|
22 |
my ($self) = @_; |
|
23 |
|
|
24 |
$::form->use_stylesheet('lx-office-erp/background_jobs.css'); |
|
25 |
|
|
26 |
flash('warning', $::locale->text('The task server does not appear to be running.')) if !$self->task_server->is_running; |
|
27 |
|
|
28 |
$self->render('task_server/show', |
|
29 |
title => $::locale->text('Task server status'), |
|
30 |
last_command_output => $::auth->get_session_value('TaskServer::last_command_output')); |
|
31 |
} |
|
32 |
|
|
33 |
sub action_start { |
|
34 |
my ($self) = @_; |
|
35 |
|
|
36 |
if ($self->task_server->is_running) { |
|
37 |
flash_later('error', $::locale->text('The task server is already running.')); |
|
38 |
|
|
39 |
} else { |
|
40 |
if ($self->task_server->start) { |
|
41 |
flash_later('info', $::locale->text('The task server was started successfully.')); |
|
42 |
} else { |
|
43 |
flash_later('error', $::locale->text('Starting the task server failed.')); |
|
44 |
} |
|
45 |
|
|
46 |
$::auth->set_session_value('TaskServer::last_command_output' => $self->task_server->last_command_output); |
|
47 |
} |
|
48 |
|
|
49 |
$self->redirect_to(action => 'show'); |
|
50 |
} |
|
51 |
|
|
52 |
sub action_stop { |
|
53 |
my ($self) = @_; |
|
54 |
|
|
55 |
if (!$self->task_server->is_running) { |
|
56 |
flash_later('error', $::locale->text('The task server is not running.')); |
|
57 |
|
|
58 |
} else { |
|
59 |
if ($self->task_server->stop) { |
|
60 |
flash_later('info', $::locale->text('The task server was stopped successfully.')); |
|
61 |
} else { |
|
62 |
flash_later('error', $::locale->text('Stopping the task server failed. Output:')); |
|
63 |
} |
|
64 |
|
|
65 |
$::auth->set_session_value('TaskServer::last_command_output' => $self->task_server->last_command_output); |
|
66 |
} |
|
67 |
|
|
68 |
$self->redirect_to(action => 'show'); |
|
69 |
} |
|
70 |
|
|
71 |
# |
|
72 |
# filters |
|
73 |
# |
|
74 |
|
|
75 |
sub check_auth { |
|
76 |
$::auth->assert('admin'); |
|
77 |
} |
|
78 |
|
|
79 |
# |
|
80 |
# helpers |
|
81 |
# |
|
82 |
|
|
83 |
sub init_task_server { |
|
84 |
return SL::System::TaskServer->new; |
|
85 |
} |
|
86 |
|
|
87 |
1; |
css/lx-office-erp/background_jobs.css | ||
---|---|---|
1 | 1 |
/* Jobverwaltung */ |
2 |
.background_job_history_list tbody pre,
|
|
3 |
.background_job_history_details tbody pre {
|
|
2 |
.background_job_list tbody pre, |
|
3 |
.background_job_details tbody pre { |
|
4 | 4 |
margin: 0px; |
5 | 5 |
} |
6 | 6 |
|
7 |
.background_job_history_details tbody th {
|
|
7 |
.background_job_details tbody th { |
|
8 | 8 |
text-align: right; |
9 | 9 |
vertical-align: top; |
10 | 10 |
} |
11 | 11 |
|
12 |
.background_job_history_details tbody td {
|
|
12 |
.background_job_details tbody td { |
|
13 | 13 |
vertical-align: top; |
14 | 14 |
} |
locale/de/all | ||
---|---|---|
505 | 505 |
'Current Earnings' => 'Gewinn', |
506 | 506 |
'Current assets account' => 'Konto für Umlaufvermögen', |
507 | 507 |
'Current profile' => 'Aktuelles Profil', |
508 |
'Current status' => 'Aktueller Status', |
|
508 | 509 |
'Current unit' => 'Aktuelle Einheit', |
509 | 510 |
'Current value:' => 'Aktueller Wert:', |
510 | 511 |
'Custom Variables' => 'Benutzerdefinierte Variablen', |
... | ... | |
1078 | 1079 |
'Last Service Number' => 'Letzte Dienstleistungsnr.', |
1079 | 1080 |
'Last Transaction' => 'Letzte Buchung', |
1080 | 1081 |
'Last Vendor Number' => 'Letzte Lieferantennummer', |
1082 |
'Last command output' => 'Ausgabe des letzten Befehls', |
|
1081 | 1083 |
'Last run at' => 'Zeitpunkt letzter Ausführung', |
1082 | 1084 |
'Lastcost (with X being a number)' => 'Einkaufspreis (X ist eine fortlaufende Zahl)', |
1083 | 1085 |
'Lead' => 'Kundenquelle', |
... | ... | |
1716 | 1718 |
'Start Dunning Process' => 'Mahnprozess starten', |
1717 | 1719 |
'Start analysis' => 'Analyse beginnen', |
1718 | 1720 |
'Start date' => 'Startdatum', |
1721 |
'Start task server' => 'Task-Server starten', |
|
1719 | 1722 |
'Start the correction assistant' => 'Korrekturassistenten starten', |
1720 | 1723 |
'Startdate_coa' => 'Gültig ab', |
1721 | 1724 |
'Starting Balance' => 'Eröffnungsbilanzwerte', |
1725 |
'Starting the task server failed.' => 'Das Starten des Task-Servers schlug fehl.', |
|
1722 | 1726 |
'Starting with version 2.6.3 the configuration files in "config" have been consolidated.' => 'Ab Version 2.6.3 wurden die Konfiguration vereinfacht und es gibt nur noch eine Konfigurationsdatei im Verzeichnis config', |
1723 | 1727 |
'Statement' => 'Sammelrechnung', |
1724 | 1728 |
'Statement Balance' => 'Sammelrechnungsbilanz', |
... | ... | |
1735 | 1739 |
'Stock Qty for Date' => 'Lagerbestand am', |
1736 | 1740 |
'Stock value' => 'Bestandswert', |
1737 | 1741 |
'Stocked Qty' => 'Lagermenge', |
1742 |
'Stop task server' => 'Task-Server beenden', |
|
1743 |
'Stopping the task server failed. Output:' => 'Das Beenden des Task-Servers schlug fehl.', |
|
1738 | 1744 |
'Storno' => 'Storno', |
1739 | 1745 |
'Storno (one letter abbreviation)' => 'S', |
1740 | 1746 |
'Storno Invoice' => 'Stornorechnung', |
... | ... | |
1763 | 1769 |
'Target bank account' => 'Zielkonto', |
1764 | 1770 |
'Target table' => 'Zieltabelle', |
1765 | 1771 |
'Task server control' => 'Task-Server-Steuerung', |
1772 |
'Task server status' => 'Task-Server-Status', |
|
1766 | 1773 |
'Tax' => 'Steuer', |
1767 | 1774 |
'Tax Consultant' => 'Steuerberater/-in', |
1768 | 1775 |
'Tax Included' => 'Steuer im Preis inbegriffen', |
... | ... | |
1948 | 1955 |
'The tables for user management and authentication do not exist. They will be created in the next step in the following database:' => 'Die Tabellen zum Speichern der Benutzerdaten und zur Benutzerauthentifizierung wurden nicht gefunden. Sie werden in der folgenden Datenbank angelegt:', |
1949 | 1956 |
'The tabulator character' => 'Das Tabulator-Symbol', |
1950 | 1957 |
'The task server does not appear to be running.' => 'Der Task-Server scheint nicht zu laufen.', |
1958 |
'The task server is already running.' => 'Der Task-Server läuft bereits.', |
|
1959 |
'The task server is not running.' => 'Der Task-Server läuft nicht.', |
|
1960 |
'The task server was started successfully.' => 'Der Task-Server wurde erfolgreich gestartet.', |
|
1961 |
'The task server was stopped successfully.' => 'Der Task-Server wurde erfolgreich beendet.', |
|
1951 | 1962 |
'The third way is to download the module from the above mentioned URL and to install the module manually following the installations instructions contained in the source archive.' => 'Die dritte Variante besteht darin, das Paket von der oben genannten URL herunterzuladen und es manuell zu installieren. Beachten Sie dabei die im Paket enthaltenen Installationsanweisungen.', |
1952 | 1963 |
'The transaction is shown below in its current state.' => 'Nachfolgend wird angezeigt, wie die Buchung momentan aussieht.', |
1953 | 1964 |
'The unit has been saved.' => 'Die Einheit wurde gespeichert.', |
... | ... | |
2129 | 2140 |
'View SEPA export' => 'SEPA-Export-Details ansehen', |
2130 | 2141 |
'View background job execution result' => 'Verlauf der Hintergrund-Job-Ausführungen anzeigen', |
2131 | 2142 |
'View background job history' => 'Hintergrund-Job-Verlauf anzeigen', |
2132 |
'View background jobs' => '', |
|
2143 |
'View background jobs' => 'Hintergrund-Jobs anzeigen',
|
|
2133 | 2144 |
'View warehouse content' => 'Lagerbestand ansehen', |
2134 | 2145 |
'View/edit all employees sales documents' => 'Bearbeiten/ansehen der Verkaufsdokumente aller Mitarbeiter', |
2135 | 2146 |
'Von Konto: ' => 'von Konto: ', |
... | ... | |
2323 | 2334 |
'not delivered' => 'nicht geliefert', |
2324 | 2335 |
'not executed' => 'nicht ausgeführt', |
2325 | 2336 |
'not logged in' => 'nicht eingeloggt', |
2337 |
'not running' => 'läuft nicht', |
|
2326 | 2338 |
'not set' => 'nicht gesetzt', |
2327 | 2339 |
'not transferred in yet' => 'noch nicht eingelagert', |
2328 | 2340 |
'not transferred out yet' => 'noch nicht ausgelagert', |
... | ... | |
2364 | 2376 |
'reset' => 'zurücksetzen', |
2365 | 2377 |
'return_material' => 'Materialrückgabe', |
2366 | 2378 |
'rfq_list' => 'anfragenliste', |
2379 |
'running' => 'läuft', |
|
2367 | 2380 |
'sales tax identification number' => 'USt-IdNr.', |
2368 | 2381 |
'sales_delivery_order_list' => 'lieferscheinliste_verkauf', |
2369 | 2382 |
'sales_order' => 'Kundenauftrag', |
templates/webpages/background_job_history/list.html | ||
---|---|---|
12 | 12 |
</p> |
13 | 13 |
|
14 | 14 |
[%- ELSE %] |
15 |
<table id="background_job_history_list" class="background_job_history_list" width="100%">
|
|
15 |
<table id="background_job_history_list" class="background_job_list" width="100%"> |
|
16 | 16 |
<thead> |
17 | 17 |
<tr class="listheading"> |
18 | 18 |
<th>[%- LxERP.t8('Package name') %]</th> |
templates/webpages/background_job_history/show.html | ||
---|---|---|
5 | 5 |
|
6 | 6 |
[%- INCLUDE 'common/flash.html' %] |
7 | 7 |
|
8 |
<table id="background_job_history_details" class="background_job_history_details">
|
|
8 |
<table id="background_job_history_details" class="background_job_details"> |
|
9 | 9 |
<tbody> |
10 | 10 |
<tr class="listrow0"> |
11 | 11 |
<th>[%- LxERP.t8('Package name') %]</th> |
templates/webpages/task_server/show.html | ||
---|---|---|
1 |
[% USE HTML %][% USE L %][% USE LxERP %] |
|
2 |
<body> |
|
3 |
|
|
4 |
<div class="listtop">[% FORM.title %]</div> |
|
5 |
|
|
6 |
[%- INCLUDE 'common/flash.html' %] |
|
7 |
|
|
8 |
<table id="background_job_history_details" class="background_job_details"> |
|
9 |
<tbody> |
|
10 |
<tr class="listrow0"> |
|
11 |
<th>[%- LxERP.t8('Current status') %]</th> |
|
12 |
<td>[% IF SELF.task_server.is_running %][%- LxERP.t8('running') %][%- ELSE %][%- LxERP.t8('not running') %][%- END %]</td> |
|
13 |
</tr> |
|
14 |
|
|
15 |
[%- IF last_command_output %] |
|
16 |
<tr class="listrow1"> |
|
17 |
<th>[%- LxERP.t8('Last command output') %]</th> |
|
18 |
<td><pre>[% HTML.escape(last_command_output) %]</pre></td> |
|
19 |
</tr> |
|
20 |
[%- END %] |
|
21 |
|
|
22 |
</tbody> |
|
23 |
</table> |
|
24 |
|
|
25 |
<p> |
|
26 |
[% IF SELF.task_server.is_running %] |
|
27 |
<a href="[% SELF.url_for(action => 'stop') %]">[%- LxERP.t8('Stop task server') %]</a> |
|
28 |
[%- ELSE %] |
|
29 |
<a href="[% SELF.url_for(action => 'start') %]">[%- LxERP.t8('Start task server') %]</a> |
|
30 |
[%- END %] |
|
31 |
| |
|
32 |
<a href="[% SELF.url_for(controller => 'BackgroundJob', action => 'list') %]">[%- LxERP.t8('View background jobs') %]</a> |
|
33 |
| |
|
34 |
<a href="[% SELF.url_for(controller => 'BackgroundJobHistory', action => 'list') %]">[%- LxERP.t8('View background job history') %]</a> |
|
35 |
</p> |
|
36 |
</body> |
|
37 |
</html> |
Auch abrufbar als: Unified diff
Controller für Task-Server-Steuerung