Give the machine console its own session with PIN sign-in, make counters cumulative
The console under console/ has its own session cookie and console guard (UseConsoleSession), so signing out or changing user there leaves the normal interface alone. Links open it in a new window through a one-time handoff key; a signed-out console asks for a PIN code or password on its own login page. Users set their 4-6 digit PIN on the profile's PIN page, and the console's change user dialog takes it on a keypad; five wrong PINs lock PIN sign-in for 15 minutes. Machine counters are cumulative: users record how much a job used and it is added to the latest reading. A maintenance record restarts the whole counter interval from the reading at the record. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
|
||||
namespace App\Modules\Machines\Presentation\Livewire\Concerns;
|
||||
|
||||
use App\Modules\Machines\Application\DTOs\CounterSummary;
|
||||
use App\Modules\Machines\Application\DTOs\MaintenanceItemStatus;
|
||||
use App\Modules\Machines\Domain\ValueObjects\Reading;
|
||||
|
||||
/**
|
||||
* Texts of a maintenance item's state, shared by the machine page and the
|
||||
@@ -68,4 +70,17 @@ trait DescribesMaintenance
|
||||
|
||||
return implode(__('machines.maintenance.or'), $parts);
|
||||
}
|
||||
|
||||
/**
|
||||
* E.g. "Laskuriin Tulosteet lisätty 350 kpl, laskuri nyt 20 350 kpl."
|
||||
*/
|
||||
public function usageSaved(CounterSummary $counter, string $usage, int $readingMilli): string
|
||||
{
|
||||
return __('machines.maintenance.usage_saved', [
|
||||
'counter' => $counter->name,
|
||||
'usage' => $this->reading((int) Reading::parse($usage)),
|
||||
'reading' => $this->reading($readingMilli),
|
||||
'unit' => __('machines.counter_units.'.$counter->unit->value),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user