You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That would be something you would need to develop yourself.
One way is patch our printing code directly.
Another way, would be if you want your changes to survive our future updates, is to write your own custom print label code, that only listen to the CmProvisioningComplete event cmprovision generates, and consult your own database for additional information that should be printed on the label based on serial number or other properties of the CM.
As in create /var/lib/cmprovision/app/Listeners/CustomPrintCode.php
<?php
namespace App\Listeners;
use App\Events\CmProvisioningComplete;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Http;
use App\Models\Cm;
use App\Models\Setting;
class CustomPrintCode implements ShouldQueue
{
use InteractsWithQueue;
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
}
/**
* Handle the event.
*
* @param App\Events\CmProvisioningComplete $event
* @return void
*/
public function handle(CmProvisioningComplete $event)
{
$cm = $event->cm;
/* $cm contains information about the compute module that just finished provisioning
Do something useful with it here. */
}
}
This way you only need to ADD a single file to cmprovision, and do not have to modify existing code.
Less work to merge changes on updates.
Hello,
if I set the host name after writing the image via postscript, I would like to print the new host name on the label. is that possible?
The text was updated successfully, but these errors were encountered: