Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 0b81801

Browse files
committed
fix updating tokens etc
1 parent 980a48c commit 0b81801

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

assets/javascripts/discourse/components/ai-llm-quota-editor.gjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ export default class AiLlmQuotaEditor extends Component {
1818
@tracked newQuotaUsages = null;
1919
@tracked newQuotaDuration = 86400; // 1 day default
2020

21+
@action
22+
updateExistingQuotaTokens(quota, event) {
23+
quota.max_tokens = event.target.value;
24+
}
25+
26+
@action
27+
updateExistingQuotaUsages(quota, event) {
28+
quota.max_usages = event.target.value;
29+
}
30+
31+
@action
32+
updateExistingQuotaDuration(quota, event) {
33+
quota.duration_seconds = event.target.value;
34+
}
35+
2136
get canAddQuota() {
2237
return (
2338
this.newQuotaGroupId &&
@@ -96,6 +111,7 @@ export default class AiLlmQuotaEditor extends Component {
96111
value={{quota.max_tokens}}
97112
class="ai-llm-quotas__input"
98113
min="1"
114+
{{on "input" (fn this.updateExistingQuotaTokens quota)}}
99115
/>
100116
</td>
101117
<td class="ai-llm-quotas__cell">
@@ -104,6 +120,7 @@ export default class AiLlmQuotaEditor extends Component {
104120
value={{quota.max_usages}}
105121
class="ai-llm-quotas__input"
106122
min="1"
123+
{{on "input" (fn this.updateExistingQuotaUsages quota)}}
107124
/>
108125
</td>
109126
<td class="ai-llm-quotas__cell">
@@ -112,6 +129,7 @@ export default class AiLlmQuotaEditor extends Component {
112129
value={{quota.duration_seconds}}
113130
class="ai-llm-quotas__input"
114131
min="1"
132+
{{on "input" (fn this.updateExistingQuotaDuration quota)}}
115133
/>
116134
</td>
117135
<td class="ai-llm-quotas__cell ai-llm-quotas__cell--actions">

0 commit comments

Comments
 (0)