From 9671b49f9fc19004b15b8b0c4b2aa6cc3ea574e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Teller=C3=ADa?= Date: Thu, 18 Apr 2024 14:48:22 +0200 Subject: [PATCH] Add posibility to set Queue Name for inmediate Job Calls. This is very util for debugging in some scenearios for development. --- src/Content/management.js | 4 +- src/Pages/ManagementBasePage.cs | 4 +- src/Pages/Partials/ButtonPartial.cshtml | 7 +- src/Pages/Partials/ButtonPartial.cshtml.cs | 104 +++++++++++++-------- src/package-lock.json | 47 ++++++++-- 5 files changed, 115 insertions(+), 51 deletions(-) diff --git a/src/Content/management.js b/src/Content/management.js index 902c1f9..2d1d2dd 100644 --- a/src/Content/management.js +++ b/src/Content/management.js @@ -157,7 +157,9 @@ if (send.type === 'Enqueue') { - // Nothing extra to read here + let queueNameInput = $(".commands-options.Enqueue .hdm-execution-input[id^='" + id + "']", container) + let val = queueNameInput.val(); + send[queueNameInput.prop('id')] = val; } else if (send.type === 'ScheduleDateTime') { let sdtTd = $(".commands-options.ScheduleDateTime .hdm-execution-input[id^='" + id + "']", container) diff --git a/src/Pages/ManagementBasePage.cs b/src/Pages/ManagementBasePage.cs index bb3133d..569580a 100644 --- a/src/Pages/ManagementBasePage.cs +++ b/src/Pages/ManagementBasePage.cs @@ -233,7 +233,9 @@ string GetFormVariable(string key) { try { - var jobId = client.Create(job, new EnqueuedState(jobMetadata.Queue)); + var queueName = GetFormVariable($"{id}_queuename")??"default"; + queueName = string.IsNullOrEmpty(queueName)? "default" : queueName; + var jobId = client.Create(job, new EnqueuedState(queueName)); jobLink = new UrlHelper(context).JobDetails(jobId); } catch (Exception e) diff --git a/src/Pages/Partials/ButtonPartial.cshtml b/src/Pages/Partials/ButtonPartial.cshtml index aa323a9..677f3c7 100644 --- a/src/Pages/Partials/ButtonPartial.cshtml +++ b/src/Pages/Partials/ButtonPartial.cshtml @@ -40,7 +40,12 @@ -
+
+ + +
+ +
\r\n\r\n
\r\n\t
+ +
+ + \r\n
\r\n\r\n
\r\n\t
+
=6" + } }, - "@popperjs/core": { + "node_modules/@popperjs/core": { "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "dev": true + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } }, - "inputmask": { + "node_modules/inputmask": { "version": "5.0.9-beta.45", "resolved": "https://registry.npmjs.org/inputmask/-/inputmask-5.0.9-beta.45.tgz", "integrity": "sha512-Nh6RHifykvEfPvnpCiwEER8LcDTAWvWKWUnVsRjqOyutGwAdjFuucCDI3YAm8tTVmhsmAydqEs+ORwllkN7Pfw==",