@acarmisc/backstage-plugin-litellm 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +7 -13
- package/dist/index.cjs.js.map +2 -2
- package/dist/index.esm.js +10 -16
- package/dist/index.esm.js.map +3 -3
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -143,7 +143,7 @@ var init_DashboardHeader = __esm({
|
|
|
143
143
|
});
|
|
144
144
|
|
|
145
145
|
// src/components/KeysTable.tsx
|
|
146
|
-
import React2, {
|
|
146
|
+
import React2, { useState } from "react";
|
|
147
147
|
import {
|
|
148
148
|
Paper as Paper2,
|
|
149
149
|
Table,
|
|
@@ -191,7 +191,7 @@ var init_KeysTable = __esm({
|
|
|
191
191
|
alias: "",
|
|
192
192
|
models: [],
|
|
193
193
|
duration: "30d",
|
|
194
|
-
max_budget:
|
|
194
|
+
max_budget: 100,
|
|
195
195
|
tpm_limit: void 0,
|
|
196
196
|
team_id: void 0,
|
|
197
197
|
key_type: "llm_api"
|
|
@@ -216,12 +216,6 @@ var init_KeysTable = __esm({
|
|
|
216
216
|
const [newKeyValue, setNewKeyValue] = useState(null);
|
|
217
217
|
const [formData, setFormData] = useState(emptyForm());
|
|
218
218
|
const [submitting, setSubmitting] = useState(false);
|
|
219
|
-
useEffect(() => {
|
|
220
|
-
if (!generateModalOpen) return;
|
|
221
|
-
if (!formData.team_id && teams.length > 0) {
|
|
222
|
-
setFormData((f) => ({ ...f, team_id: teams[0].team_id }));
|
|
223
|
-
}
|
|
224
|
-
}, [generateModalOpen, teams, formData.team_id]);
|
|
225
219
|
const canGenerate = true;
|
|
226
220
|
const [editingKey, setEditingKey] = useState(null);
|
|
227
221
|
const [editForm, setEditForm] = useState({});
|
|
@@ -235,10 +229,6 @@ var init_KeysTable = __esm({
|
|
|
235
229
|
const response = await onGenerateKey(formData);
|
|
236
230
|
setNewKeyValue(response.key);
|
|
237
231
|
setFormData(emptyForm());
|
|
238
|
-
setTimeout(() => {
|
|
239
|
-
setGenerateModalOpen(false);
|
|
240
|
-
setNewKeyValue(null);
|
|
241
|
-
}, 1500);
|
|
242
232
|
} catch (error) {
|
|
243
233
|
console.error("Failed to generate key:", error);
|
|
244
234
|
} finally {
|
|
@@ -310,7 +300,9 @@ var init_KeysTable = __esm({
|
|
|
310
300
|
mt: 2,
|
|
311
301
|
p: 2,
|
|
312
302
|
sx: {
|
|
313
|
-
backgroundColor: "
|
|
303
|
+
backgroundColor: "action.hover",
|
|
304
|
+
border: "1px solid",
|
|
305
|
+
borderColor: "divider",
|
|
314
306
|
borderRadius: 1
|
|
315
307
|
}
|
|
316
308
|
},
|
|
@@ -330,6 +322,7 @@ var init_KeysTable = __esm({
|
|
|
330
322
|
label: "Alias",
|
|
331
323
|
value: formData.alias || "",
|
|
332
324
|
onChange: (e) => setFormData({ ...formData, alias: e.target.value }),
|
|
325
|
+
required: true,
|
|
333
326
|
fullWidth: true
|
|
334
327
|
}
|
|
335
328
|
), /* @__PURE__ */ React2.createElement(
|
|
@@ -373,7 +366,7 @@ var init_KeysTable = __esm({
|
|
|
373
366
|
value: selectedModels,
|
|
374
367
|
onChange: (_e, selected) => setFormData({ ...formData, models: selected.map((m) => m.model_name) }),
|
|
375
368
|
renderOption: (props, m) => /* @__PURE__ */ React2.createElement("li", { ...props }, m.model_name, m.supports_function_calling && " \u{1F527}", m.supports_vision && " \u{1F441}\uFE0F"),
|
|
376
|
-
renderInput: (params) => /* @__PURE__ */ React2.createElement(TextField, { ...params, label: "Models", fullWidth: true })
|
|
369
|
+
renderInput: (params) => /* @__PURE__ */ React2.createElement(TextField, { ...params, label: "Models", helperText: "Leave empty to allow all models", fullWidth: true })
|
|
377
370
|
}
|
|
378
371
|
), /* @__PURE__ */ React2.createElement(
|
|
379
372
|
TextField,
|
|
@@ -382,6 +375,7 @@ var init_KeysTable = __esm({
|
|
|
382
375
|
type: "number",
|
|
383
376
|
value: formData.max_budget ?? "",
|
|
384
377
|
onChange: (e) => setFormData({ ...formData, max_budget: e.target.value ? Number(e.target.value) : void 0 }),
|
|
378
|
+
required: true,
|
|
385
379
|
fullWidth: true
|
|
386
380
|
}
|
|
387
381
|
), /* @__PURE__ */ React2.createElement(
|
|
@@ -956,7 +950,7 @@ init_TeamUsage();
|
|
|
956
950
|
|
|
957
951
|
// src/components/LiteLLMHomeWidget.tsx
|
|
958
952
|
init_api();
|
|
959
|
-
import React7, { useState as useState5, useEffect
|
|
953
|
+
import React7, { useState as useState5, useEffect } from "react";
|
|
960
954
|
import {
|
|
961
955
|
Paper as Paper6,
|
|
962
956
|
Box as Box6,
|
|
@@ -995,7 +989,7 @@ var LiteLLMHomeWidget = ({
|
|
|
995
989
|
const [error, setError] = useState5(null);
|
|
996
990
|
const [usage, setUsage] = useState5(null);
|
|
997
991
|
const [keys, setKeys] = useState5([]);
|
|
998
|
-
|
|
992
|
+
useEffect(() => {
|
|
999
993
|
let cancelled = false;
|
|
1000
994
|
setLoading(true);
|
|
1001
995
|
setError(null);
|