Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/gui/app/controllers/effect-queues.controller.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use strict";
(function() {
(function () {
angular
.module("firebotApp")
.controller("effectQueuesController", function(
.controller("effectQueuesController", function (
$scope,
effectQueuesService,
utilityService,
Expand All @@ -15,8 +15,8 @@
};

$scope.getQueueModeName = (modeId) => {
const mode = effectQueuesService.queueModes.find(m => m.id === modeId);
return mode ? mode.display : "Unknown";
const mode = effectQueuesService.queueModes.find(m => m.value === modeId);
return mode ? mode.label : "Unknown";
};

$scope.headers = [
Expand All @@ -26,7 +26,7 @@
dataField: "name",
sortable: true,
cellTemplate: `{{data.name}}`,
cellController: () => {}
cellController: () => { }
},
{
name: "MODE",
Expand All @@ -36,8 +36,8 @@
cellTemplate: `{{getQueueModeName(data.mode)}}`,
cellController: ($scope) => {
$scope.getQueueModeName = (modeId) => {
const mode = effectQueuesService.queueModes.find(m => m.id === modeId);
return mode ? mode.display : "Unknown";
const mode = effectQueuesService.queueModes.find(m => m.value === modeId);
return mode ? mode.label : "Unknown";
};
}
},
Expand All @@ -47,7 +47,7 @@
dataField: "interval",
sortable: true,
cellTemplate: `{{(data.mode === 'interval' || data.mode === 'auto') ? (data.interval || 0) + 's' : 'n/a'}}`,
cellController: () => {}
cellController: () => { }
}
];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use strict";
(function() {
(function () {
angular.module("firebotApp").component("addOrEditEffectQueueModal", {
template: `
<scroll-sentinel element-class="edit-effect-queue-header"></scroll-sentinel>
Expand All @@ -23,27 +23,14 @@
</div>
</div>

<div class="mt-6">
<div class="modal-subheader pb-2 pt-0 px-0">MODE</div>
<div>
<ui-select ng-model="$ctrl.effectQueue.mode" theme="bootstrap" class="control-type-list">
<ui-select-match placeholder="Select queue mode">{{$select.selected.display}}</ui-select-match>
<ui-select-choices repeat="mode.id as mode in $ctrl.queueModes | filter: { display: $select.search }" style="position:relative;">
<div class="flex-row-center">
<div class="my-0 mx-5" style="width: 30px;height: 100%;font-size:20px;text-align: center;flex-shrink: 0;">
<i class="fas" ng-class="mode.iconClass"></i>
</div>
<div>
<div ng-bind-html="mode.display | highlight: $select.search"></div>
<small class="muted">{{mode.description}}</small>
</div>

</div>

</ui-select-choices>
</ui-select>
</div>
</div>
<div class="modal-subheader pb-2 pt-0 px-0">MODE</div>
<firebot-radio-cards
options="$ctrl.queueModes"
ng-model="$ctrl.effectQueue.mode"
id="queueMode"
name="queueMode"
grid-columns="1"
></firebot-radio-cards>

<div class="mt-6" ng-show="$ctrl.effectQueue.mode != null && ($ctrl.effectQueue.mode ==='interval' || $ctrl.effectQueue.mode ==='auto')">
<div class="modal-subheader pb-2 pt-0 px-0">Interval/Delay (secs)</div>
Expand All @@ -66,14 +53,14 @@
dismiss: "&",
modalInstance: "<"
},
controller: function(effectQueuesService, ngToast) {
controller: function (effectQueuesService, ngToast) {
const $ctrl = this;

$ctrl.isNewQueue = true;

$ctrl.effectQueue = {
name: "",
mode: "custom",
mode: "auto",
sortTags: [],
active: true,
length: 0
Expand Down
42 changes: 21 additions & 21 deletions src/gui/app/services/effect-queues.service.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use strict";

(function() {
(function () {

angular
.module("firebotApp")
.factory("effectQueuesService", function(backendCommunicator, utilityService,
.factory("effectQueuesService", function (backendCommunicator, utilityService,
objectCopyHelper, ngToast) {
const service = {};

Expand All @@ -26,20 +26,20 @@
}
};

backendCommunicator.on("all-queues", effectQueues => {
backendCommunicator.on("all-queues", (effectQueues) => {
if (effectQueues != null) {
service.effectQueues = effectQueues;
}
});

backendCommunicator.on("updateQueueLength", queue => {
backendCommunicator.on("updateQueueLength", (queue) => {
const index = service.effectQueues.findIndex(eq => eq.id === queue.id);
if (service.effectQueues[index] != null) {
service.effectQueues[index].length = queue.length;
}
});

backendCommunicator.on("updateQueueStatus", queue => {
backendCommunicator.on("updateQueueStatus", (queue) => {
const index = service.effectQueues.findIndex(eq => eq.id === queue.id);
if (service.effectQueues[index] != null) {
service.effectQueues[index].active = queue.active;
Expand All @@ -48,20 +48,20 @@

service.queueModes = [
{
id: "custom",
display: "Custom",
description: "Wait the custom amount of time defined for each individual effect list.",
iconClass: "fa-clock"
},
{
id: "auto",
display: "Sequential",
value: "auto",
label: "Sequential",
description: "Runs effect list in the queue sequentially. Priority items will be added before non-priority. Optional delay defaults to 0s.",
iconClass: "fa-sort-numeric-down"
},
{
id: "interval",
display: "Interval",
value: "custom",
label: "Custom",
description: "Wait the custom amount of time defined for each individual effect list.",
iconClass: "fa-clock"
},
{
value: "interval",
label: "Interval",
description: "Runs effect lists on a set interval.",
iconClass: "fa-stopwatch"
}
Expand Down Expand Up @@ -118,7 +118,7 @@
copiedEffectQueue.name += " copy";
}

service.saveEffectQueue(copiedEffectQueue).then(successful => {
service.saveEffectQueue(copiedEffectQueue).then((successful) => {
if (successful) {
ngToast.create({
className: 'success',
Expand All @@ -136,7 +136,7 @@
};

service.showAddEditEffectQueueModal = (effectQueueId) => {
return new Promise(resolve => {
return new Promise((resolve) => {
let effectQueue;

if (effectQueueId != null) {
Expand All @@ -145,19 +145,19 @@

utilityService.showModal({
component: "addOrEditEffectQueueModal",
size: "sm",
size: "md",
resolveObj: {
effectQueue: () => effectQueue
},
closeCallback: response => {
closeCallback: (response) => {
resolve(response.effectQueue.id);
}
});
});
};

service.showDeleteEffectQueueModal = (effectQueueId) => {
return new Promise(resolve => {
return new Promise((resolve) => {
if (effectQueueId == null) {
resolve(false);
}
Expand All @@ -174,7 +174,7 @@
confirmLabel: "Delete",
confirmBtnType: "btn-danger"
})
.then(confirmed => {
.then((confirmed) => {
if (confirmed) {
service.deleteEffectQueue(effectQueueId);
}
Expand Down