visual warning when max_label_length exceeded

This commit is contained in:
Gavin McDonald
2025-05-11 15:01:19 -04:00
parent 8a42947995
commit 9cc3621144
5 changed files with 19 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
defmodule LabelmakerWeb.LabelController do
use LabelmakerWeb, :controller
alias LabelmakerWeb.Constants
alias LabelmakerWeb.Tools
@label_dir Path.join(:code.priv_dir(:labelmaker), "static/labels")
@@ -36,7 +37,7 @@ defmodule LabelmakerWeb.LabelController do
options.size,
"-font",
options.font,
"label:#{options.label}",
"label:#{String.slice(options.label, 0, Constants.max_label_length())}",
"-set",
"comment",
inspect(Jason.encode!(options)),