Skip to content

Commit

Permalink
feat(frontend): command expiration display
Browse files Browse the repository at this point in the history
  • Loading branch information
danluki committed Oct 25, 2024
1 parent ced1656 commit 708173a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions frontend/dashboard/src/api/commands/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export const useCommandsApi = createGlobalState(() => {
name
color
}
expiredIn
expired
}
}
`),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const defaultFormValue: EditableCommand = {
cooldownRolesIds: [],
enabledCategories: [],
module: 'CUSTOM',
expiredIn: 0,
}

export const useCommandEdit = createGlobalState(() => {
Expand Down
10 changes: 9 additions & 1 deletion frontend/dashboard/src/features/commands/ui/edit-modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import {
NGridItem,
NInput,
NInputGroup,
NInputGroupLabel,
NInputNumber,
NModal,
NSelect,
NSpace,
Expand Down Expand Up @@ -492,6 +492,14 @@ const showCategoryModal = ref(false)
autosize
/>
</NFormItem>
<NFormItem
:label="t('commands.modal.expiration.label')" path="expiredIn"
>
<NInputNumber
v-model:value="formValue.expiredIn"
:min="0"
/>
</NFormItem>

<NFormItem :label="t('commands.modal.settings.other.commandGroup')" path="groupId">
<NButton v-if="!commandsGroupsOptions.length" secondary disabled>
Expand Down
3 changes: 3 additions & 0 deletions frontend/dashboard/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@
"gameCategories": {
"label": "Enable command only in certain categories (leave empty for disable)"
},
"expiration": {
"label": "Choose expiration time in minutes from now, 0 for not expiring",
},
"description": {
"label": "Command Description"
},
Expand Down

0 comments on commit 708173a

Please sign in to comment.