diff --git a/README.md b/README.md index b7ae345..50b6ed9 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,11 @@ Create a shortcut in `shell:startup` folder. Just pass `-m` to the argument list. -# The Snipe-IT part +## The Snipe-IT part -## Keys Available +### Keys Available -All keys are prepended with a prefix (e.g. `S: ` for serial) except for `asset_tag` and `id`. +All keys are prepended with a prefix (e.g. `S:` for serial) except for `asset_tag` and `asset_url`. | Key | Description | | --------- | -------------------------- | @@ -37,75 +37,12 @@ All keys are prepended with a prefix (e.g. `S: ` for serial) except for `asset_t | model | Model name | | company | Company name | | asset_tag | The asset tag, for 1D-code | +| asset_url | The asset URL, for 2D-code | -## labels.blade.php +### Install labels.blade.php -Replace `resources/views/hardware/labels.blade.php` with content below. +Take a look at [labels.blade.php](./labels.blade.php), modify the top `define` lines according to your configuration. The first PHP codeblock is dead simple, you may modify it according to your needs too. -Specifically, if you're using docker, mount it to `/var/www/html/resources/views/hardware/labels.blade.php`. - -```php - 'ID: ' . $asset->id, - 'name' => empty($asset->name) ? '' : 'N: ' . $asset->name, - 'serial' => empty($asset->serial) ? '' : 'S: ' . $asset->serial, - 'model' => empty($asset->model->name) ? '' : 'M: ' . $asset->model->name, - 'company' => $asset->company === null ? null : 'C: ' . $asset->company->name, - 'asset_tag' => $asset->asset_tag, - ]; -} -?> - - - - - - - Labels Print - +Then, replace `resources/views/hardware/labels.blade.php` with it, and you're good to go. - -
- Labels Data: -
- -
- -
- - - - -``` +Specifically, if you're using docker, mount it to `/var/www/html/resources/views/hardware/labels.blade.php`. diff --git a/labels.blade.php b/labels.blade.php new file mode 100644 index 0000000..34d5aa0 --- /dev/null +++ b/labels.blade.php @@ -0,0 +1,64 @@ + 'ID: ' . $asset->id, + 'name' => empty($asset->name) ? '' : 'N: ' . $asset->name, + 'serial' => empty($asset->serial) ? '' : 'S: ' . $asset->serial, + 'model' => empty($asset->model->name) ? '' : 'M: ' . $asset->model->name, + 'company' => $asset->company === null ? null : 'C: ' . $asset->company->name, + 'asset_tag' => $asset->asset_tag, + 'asset_url' => $_ENV['APP_URL'] . '/hardware/' . $asset->id, + ]; +} +?> + + + + + + + Labels Print + + + +
+ Labels Data: +
+ +
+ +
+ + + +