-
-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add ability to re-arrange job queue's items (#1692)
* feat: Add job queue entry position change feature Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com> * feat: Add ability to move queue item to the queue top Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com> * feat: Allow to move queue item up Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com> * feat: Print button on the first queue item should be controlled via flag Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com> * feat: Allow to move queue item down Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com> * feat: Add ability to move queue item to the queue bottom Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com> * feat: Change the nomenclature of queue's start & end Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com> * feat: Do not display duplicated re-arrangement features (second & next to last items) Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com> * feat: Formatting & linting fixes Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com> * feat: Simplify changePosition's code Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com> * feat: Add reusable convertJobToFilenames() Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com> * refactor: refactor some code syntax Signed-off-by: Stefan Dej <meteyou@gmail.com> * refactor: refactor jobqueue entry and add draggable sort function Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix: fix job counter in status panel for jobqueue Signed-off-by: Stefan Dej <meteyou@gmail.com> * feat: add function to start with every job in the jobqueue Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix: hide start button in jobqueue panel Signed-off-by: Stefan Dej <meteyou@gmail.com> * refactor: remove unused style section Signed-off-by: Stefan Dej <meteyou@gmail.com> * locale(en): remove unused keys Signed-off-by: Stefan Dej <meteyou@gmail.com> * locale(pl): remove unused keys Signed-off-by: Stefan Dej <meteyou@gmail.com> --------- Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com> Signed-off-by: Stefan Dej <meteyou@gmail.com> Co-authored-by: Stefan Dej <meteyou@gmail.com>
- Loading branch information
Showing
9 changed files
with
500 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<template> | ||
<v-dialog :value="show" max-width="400"> | ||
<panel | ||
:title="$t('JobQueue.ChangeCount')" | ||
:icon="mdiCounter" | ||
card-class="jobqueue-change-count-dialog" | ||
:margin-bottom="false"> | ||
<template #buttons> | ||
<v-btn icon tile @click="closeDialog"> | ||
<v-icon>{{ mdiCloseThick }}</v-icon> | ||
</v-btn> | ||
</template> | ||
|
||
<v-card-text> | ||
<v-text-field | ||
ref="inputFieldAddToQueueCount" | ||
v-model="count" | ||
:label="$t('JobQueue.Count')" | ||
required | ||
:rules="countInputRules" | ||
hide-spin-buttons | ||
type="number" | ||
@keyup.enter="update"> | ||
<template #append-outer> | ||
<div class="_spin_button_group"> | ||
<v-btn class="mt-n3" icon plain small @click="count++"> | ||
<v-icon>{{ mdiChevronUp }}</v-icon> | ||
</v-btn> | ||
<v-btn :disabled="count <= 1" class="mb-n3" icon plain small @click="count--"> | ||
<v-icon>{{ mdiChevronDown }}</v-icon> | ||
</v-btn> | ||
</div> | ||
</template> | ||
</v-text-field> | ||
</v-card-text> | ||
<v-card-actions> | ||
<v-spacer /> | ||
<v-btn color="" text @click="closeDialog">{{ $t('JobQueue.Cancel') }}</v-btn> | ||
<v-btn color="primary" text @click="update">{{ $t('JobQueue.ChangeCount') }}</v-btn> | ||
</v-card-actions> | ||
</panel> | ||
</v-dialog> | ||
</template> | ||
<script lang="ts"> | ||
import { Component, Mixins, Prop, Watch } from 'vue-property-decorator' | ||
import BaseMixin from '@/components/mixins/base' | ||
import Panel from '@/components/ui/Panel.vue' | ||
import { mdiCloseThick, mdiChevronUp, mdiChevronDown, mdiCounter } from '@mdi/js' | ||
import { ServerJobQueueStateJob } from '@/store/server/jobQueue/types' | ||
@Component({ | ||
components: { Panel }, | ||
}) | ||
export default class JobqueueEntryChangeCountDialog extends Mixins(BaseMixin) { | ||
mdiCloseThick = mdiCloseThick | ||
mdiChevronUp = mdiChevronUp | ||
mdiChevronDown = mdiChevronDown | ||
mdiCounter = mdiCounter | ||
@Prop({ type: Boolean, required: true }) show!: boolean | ||
@Prop({ type: Object, required: true }) job!: ServerJobQueueStateJob | ||
count = 1 | ||
countInputRules = [ | ||
(value: string) => !!value || this.$t('JobQueue.InvalidCountEmpty'), | ||
(value: string) => parseInt(value) > 0 || this.$t('JobQueue.InvalidCountGreaterZero'), | ||
] | ||
update() { | ||
this.$store.dispatch('server/jobQueue/changeCount', { | ||
job_id: this.job.job_id, | ||
count: this.count, | ||
}) | ||
this.closeDialog() | ||
} | ||
closeDialog() { | ||
this.$emit('close') | ||
} | ||
@Watch('show') | ||
showChanged(show: boolean) { | ||
if (show) this.count = (this.job.combinedIds?.length ?? 0) + 1 | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.