@celljs/ta-web 4.19.0 → 4.20.0
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/esm/browser/assistant/assistant-chat-list.js +2 -1
- package/esm/browser/components/account-menu.js +3 -1
- package/esm/browser/components/app-view.js +2 -2
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/dino-look.d.ts +9 -1
- package/esm/browser/components/dino-look.js +46 -1
- package/esm/browser/components/environment-view.js +12 -1
- package/esm/browser/components/face-pictures.d.ts +10 -0
- package/esm/browser/components/face-pictures.js +24 -0
- package/esm/browser/components/face.d.ts +4 -1
- package/esm/browser/components/face.js +16 -1
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/picture-dialog.d.ts +18 -0
- package/esm/browser/components/picture-dialog.js +116 -0
- package/esm/browser/extension/icons.js +2 -1
- package/esm/browser/extension/web-api-home.d.ts +13 -0
- package/esm/browser/extension/web-api-home.js +2 -0
- package/esm/browser/extension/web-extension-api.d.ts +4 -4
- package/esm/browser/extension/web-extension-context.js +2 -1
- package/esm/browser/extension/web-home.d.ts +8 -0
- package/esm/browser/extension/web-home.js +20 -0
- package/esm/browser/gateway/console-limits.d.ts +15 -0
- package/esm/browser/gateway/console-limits.js +2 -2
- package/esm/browser/gateway/console-tenant.js +33 -2
- package/esm/browser/gateway/console-updates.d.ts +12 -0
- package/esm/browser/gateway/console-updates.js +76 -0
- package/esm/browser/gateway/console-util.d.ts +7 -1
- package/esm/browser/gateway/console-util.js +18 -0
- package/esm/browser/gateway/console-view.js +9 -2
- package/esm/browser/i18n/locales.d.ts +44 -3
- package/esm/browser/i18n/locales.js +9 -3
- package/esm/browser/i18n/messages-all.d.ts +7 -0
- package/esm/browser/i18n/messages-all.js +14 -0
- package/esm/browser/i18n/messages-ja.js +39 -0
- package/esm/browser/i18n/messages-zh-tw.js +39 -0
- package/esm/browser/i18n/messages.d.ts +45 -8
- package/esm/browser/i18n/messages.js +111 -11
- package/esm/browser/i18n/use-t.js +4 -3
- package/esm/browser/settings/settings.js +3 -1
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +5 -0
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +1 -0
- package/esm/browser/util/picture.d.ts +5 -0
- package/esm/browser/util/picture.js +43 -0
- package/lib/browser/assistant/assistant-chat-list.js +2 -1
- package/lib/browser/components/account-menu.js +2 -0
- package/lib/browser/components/app-view.js +1 -1
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/dino-look.d.ts +9 -1
- package/lib/browser/components/dino-look.js +48 -1
- package/lib/browser/components/environment-view.js +11 -0
- package/lib/browser/components/face-pictures.d.ts +11 -0
- package/lib/browser/components/face-pictures.js +60 -0
- package/lib/browser/components/face.d.ts +4 -1
- package/lib/browser/components/face.js +16 -1
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/picture-dialog.d.ts +19 -0
- package/lib/browser/components/picture-dialog.js +153 -0
- package/lib/browser/extension/icons.js +1 -0
- package/lib/browser/extension/web-api-home.d.ts +14 -0
- package/lib/browser/extension/web-api-home.js +3 -0
- package/lib/browser/extension/web-extension-api.d.ts +4 -4
- package/lib/browser/extension/web-extension-context.js +2 -1
- package/lib/browser/extension/web-home.d.ts +8 -0
- package/lib/browser/extension/web-home.js +54 -1
- package/lib/browser/gateway/console-limits.d.ts +15 -0
- package/lib/browser/gateway/console-limits.js +2 -0
- package/lib/browser/gateway/console-tenant.js +32 -1
- package/lib/browser/gateway/console-updates.d.ts +13 -0
- package/lib/browser/gateway/console-updates.js +113 -0
- package/lib/browser/gateway/console-util.d.ts +7 -1
- package/lib/browser/gateway/console-util.js +18 -0
- package/lib/browser/gateway/console-view.js +9 -2
- package/lib/browser/i18n/locales.d.ts +44 -3
- package/lib/browser/i18n/locales.js +8 -2
- package/lib/browser/i18n/messages-all.d.ts +8 -0
- package/lib/browser/i18n/messages-all.js +17 -0
- package/lib/browser/i18n/messages-ja.js +39 -0
- package/lib/browser/i18n/messages-zh-tw.js +39 -0
- package/lib/browser/i18n/messages.d.ts +45 -8
- package/lib/browser/i18n/messages.js +113 -13
- package/lib/browser/i18n/use-t.js +4 -3
- package/lib/browser/settings/settings.js +3 -1
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +5 -0
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +1 -0
- package/lib/browser/util/picture.d.ts +6 -0
- package/lib/browser/util/picture.js +46 -0
- package/package.json +7 -7
|
@@ -90,6 +90,7 @@ function TenantRow({ tenant, onOpen }) {
|
|
|
90
90
|
React.createElement("span", { className: "ta-console-entry-label ta-ellipsis" },
|
|
91
91
|
label,
|
|
92
92
|
React.createElement(RoleChip, { role: tenant.role }),
|
|
93
|
+
environment.latest && React.createElement("span", { className: "ta-console-chip" }, t('ta.console.updatable')),
|
|
93
94
|
quota.blocked && (React.createElement("span", { className: "ta-console-chip ta-console-chip-warn" }, t(quota.blocked === 'suspended' ? 'ta.console.suspended' : 'ta.console.outOfMinutes')))),
|
|
94
95
|
React.createElement("span", { className: "ta-console-entry-hint ta-ellipsis" }, label !== tenant.account ? `${tenant.account} · ${state}` : state)),
|
|
95
96
|
React.createElement("span", { className: "ta-console-side" },
|
|
@@ -101,6 +102,7 @@ function TenantRow({ tenant, onOpen }) {
|
|
|
101
102
|
/** One account's Ta: who and where, what can be done to it, what it may use and took, its agents and its log. */
|
|
102
103
|
function TenantDetail({ tenant, info, onChanged }) {
|
|
103
104
|
var _a;
|
|
105
|
+
var _b, _c;
|
|
104
106
|
const t = (0, use_t_1.useT)();
|
|
105
107
|
const language = (0, use_t_1.useLanguage)();
|
|
106
108
|
const [, bench] = (0, hooks_1.useWorkbench)();
|
|
@@ -131,6 +133,16 @@ function TenantDetail({ tenant, info, onChanged }) {
|
|
|
131
133
|
if (environment.status !== 'running' && environment.status !== 'starting' && !tenant.quota.blocked) {
|
|
132
134
|
actions.push({ key: 'start', icon: lucide_react_1.Play, label: t('ta.console.start'), run: () => act('start', () => bench.gateway.startTenant(tenant.id)) });
|
|
133
135
|
}
|
|
136
|
+
if (environment.status === 'running' && environment.latest) {
|
|
137
|
+
const version = console_util_1.ConsoleUtil.version(environment.latest);
|
|
138
|
+
const working = (_b = (_a = tenant.agents) === null || _a === void 0 ? void 0 : _a.working) !== null && _b !== void 0 ? _b : 0;
|
|
139
|
+
actions.push({
|
|
140
|
+
key: 'update',
|
|
141
|
+
icon: lucide_react_1.ArrowUpCircle,
|
|
142
|
+
label: t('ta.console.update'),
|
|
143
|
+
run: () => void confirmThen('update', t('ta.console.updateConfirm', { account: name, version }), working > 0 ? `${t('ta.console.updateDetail')} ${t('ta.console.updateWorking', { count: working })}` : t('ta.console.updateDetail'), t('ta.console.update'), () => bench.gateway.updateTenant(tenant.id)),
|
|
144
|
+
});
|
|
145
|
+
}
|
|
134
146
|
if (environment.status === 'running') {
|
|
135
147
|
actions.push({
|
|
136
148
|
key: 'restart',
|
|
@@ -161,6 +173,15 @@ function TenantDetail({ tenant, info, onChanged }) {
|
|
|
161
173
|
},
|
|
162
174
|
});
|
|
163
175
|
}
|
|
176
|
+
if (environment.previous && !own) {
|
|
177
|
+
const version = console_util_1.ConsoleUtil.version(environment.previous);
|
|
178
|
+
rows.push({
|
|
179
|
+
key: 'rollback',
|
|
180
|
+
icon: lucide_react_1.Undo2,
|
|
181
|
+
label: t('ta.console.rollback', { version }),
|
|
182
|
+
run: () => void confirmThen('rollback', t('ta.console.rollbackConfirm', { account: name, version }), t('ta.console.rollbackDetail'), t('ta.console.rollback', { version }), () => bench.gateway.rollbackTenant(tenant.id)),
|
|
183
|
+
});
|
|
184
|
+
}
|
|
164
185
|
if (info.role === 'owner' && tenant.role !== 'owner') {
|
|
165
186
|
const admin = tenant.role === 'admin';
|
|
166
187
|
rows.push({
|
|
@@ -203,7 +224,7 @@ function TenantDetail({ tenant, info, onChanged }) {
|
|
|
203
224
|
React.createElement(console_parts_1.Section, { title: t('ta.console.quota') },
|
|
204
225
|
React.createElement(console_parts_1.QuotaMeters, { quota: tenant.quota })),
|
|
205
226
|
manage && tenant.role !== 'owner' && (React.createElement(console_parts_1.Section, { title: t('ta.console.limits'), hint: t('ta.console.limitsHint') },
|
|
206
|
-
React.createElement(console_limits_1.LimitsCard, { value: (
|
|
227
|
+
React.createElement(console_limits_1.LimitsCard, { value: (_c = tenant.limits) !== null && _c !== void 0 ? _c : {}, defaults: info.policy.defaults, providers: info.providers, nullable: true, metered: info.models.length > 0, onSave: limits => bench.gateway
|
|
207
228
|
.setTenantLimits(tenant.id, Object.keys(limits).length ? limits : null)
|
|
208
229
|
.then(onChanged)
|
|
209
230
|
.catch(error => notices.error(error)) }))),
|
|
@@ -220,6 +241,16 @@ function TenantDetail({ tenant, info, onChanged }) {
|
|
|
220
241
|
React.createElement(console_parts_1.Section, { title: t('ta.console.about') },
|
|
221
242
|
React.createElement(console_parts_1.Card, null, [
|
|
222
243
|
[t('ta.console.environment'), environment.url ? `${environment.name} · ${environment.url}` : environment.name],
|
|
244
|
+
...(environment.version
|
|
245
|
+
? [
|
|
246
|
+
[
|
|
247
|
+
t('ta.console.version'),
|
|
248
|
+
environment.latest
|
|
249
|
+
? console_util_1.ConsoleUtil.move(environment.version, environment.latest)
|
|
250
|
+
: console_util_1.ConsoleUtil.version(environment.version),
|
|
251
|
+
],
|
|
252
|
+
]
|
|
253
|
+
: []),
|
|
223
254
|
[t('ta.console.connectionsLabel'), String(tenant.connections)],
|
|
224
255
|
[t('ta.console.active'), date(tenant.lastActiveAt)],
|
|
225
256
|
[t('ta.console.created'), date(tenant.createdAt)],
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TaGatewayConsole } from '@celljs/ta-protocol';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/** How many running Ta may move to a newer version, to move them all; or how far a move of all went. */
|
|
4
|
+
export declare function UpdatesCallout({ info, onChanged }: {
|
|
5
|
+
info: TaGatewayConsole;
|
|
6
|
+
onChanged(): Promise<unknown>;
|
|
7
|
+
}): React.JSX.Element | null;
|
|
8
|
+
/** When running Ta move to a newer version, picked as a limit is; and a look for a newer one now. */
|
|
9
|
+
export declare function UpdatesSection({ info, onChanged }: {
|
|
10
|
+
info: TaGatewayConsole;
|
|
11
|
+
onChanged(): Promise<unknown>;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
//# sourceMappingURL=console-updates.d.ts.map
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.UpdatesCallout = UpdatesCallout;
|
|
37
|
+
exports.UpdatesSection = UpdatesSection;
|
|
38
|
+
const lucide_react_1 = require("lucide-react");
|
|
39
|
+
const React = __importStar(require("react"));
|
|
40
|
+
const busy_1 = require("../components/busy");
|
|
41
|
+
const callout_1 = require("../components/callout");
|
|
42
|
+
const icon_1 = require("../components/icon");
|
|
43
|
+
const hooks_1 = require("../hooks");
|
|
44
|
+
const use_t_1 = require("../i18n/use-t");
|
|
45
|
+
const console_limits_1 = require("./console-limits");
|
|
46
|
+
const console_parts_1 = require("./console-parts");
|
|
47
|
+
const console_util_1 = require("./console-util");
|
|
48
|
+
/*
|
|
49
|
+
* Newer versions of Ta for the sandboxes (docs/design/ta-sandbox-update.md): on the overview, how many running Ta may
|
|
50
|
+
* move and a way to move them all, or how far that went; in the policy, when running ones move on their own.
|
|
51
|
+
*/
|
|
52
|
+
const MODES = [
|
|
53
|
+
{ value: 'idle', label: 'ta.console.updateIdle', hint: 'ta.console.updateIdleHint' },
|
|
54
|
+
{ value: 'manual', label: 'ta.console.updateManual', hint: 'ta.console.updateManualHint' },
|
|
55
|
+
];
|
|
56
|
+
/** How many running Ta may move to a newer version, to move them all; or how far a move of all went. */
|
|
57
|
+
function UpdatesCallout({ info, onChanged }) {
|
|
58
|
+
const t = (0, use_t_1.useT)();
|
|
59
|
+
const [, bench] = (0, hooks_1.useWorkbench)();
|
|
60
|
+
const [, notices] = (0, hooks_1.useNotices)();
|
|
61
|
+
const [busy, run] = (0, busy_1.useBusy)();
|
|
62
|
+
const behind = console_util_1.ConsoleUtil.behind(info);
|
|
63
|
+
if (info.updating) {
|
|
64
|
+
const { done, total } = info.updating;
|
|
65
|
+
return React.createElement(callout_1.Callout, { level: "info" }, t('ta.console.updatingProgress', { done: Math.min(total, done + 1), total }));
|
|
66
|
+
}
|
|
67
|
+
if (behind.length === 0) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
const version = console_util_1.ConsoleUtil.version(behind[0].environment.latest);
|
|
71
|
+
const updateAll = async () => {
|
|
72
|
+
const confirmed = await notices.confirm({
|
|
73
|
+
title: t('ta.console.updateAllConfirm', { count: behind.length, version }),
|
|
74
|
+
message: t('ta.console.updateAllDetail'),
|
|
75
|
+
confirmLabel: t('ta.console.updateAll'),
|
|
76
|
+
});
|
|
77
|
+
if (confirmed) {
|
|
78
|
+
await run(() => bench.gateway
|
|
79
|
+
.updateTenants()
|
|
80
|
+
.then(onChanged)
|
|
81
|
+
.catch(error => notices.error(error)));
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
return (React.createElement(callout_1.Callout, { level: "info", action: React.createElement("button", { type: "button", className: `ta-link-button${busy ? ' ta-busy' : ''}`, disabled: busy, onClick: () => void updateAll() }, t('ta.console.updateAll')) }, t('ta.console.updatesAvailable', { count: behind.length, version })));
|
|
85
|
+
}
|
|
86
|
+
/** When running Ta move to a newer version, picked as a limit is; and a look for a newer one now. */
|
|
87
|
+
function UpdatesSection({ info, onChanged }) {
|
|
88
|
+
var _a;
|
|
89
|
+
const t = (0, use_t_1.useT)();
|
|
90
|
+
const [, bench] = (0, hooks_1.useWorkbench)();
|
|
91
|
+
const [, notices] = (0, hooks_1.useNotices)();
|
|
92
|
+
const [saving, save] = (0, busy_1.useBusy)();
|
|
93
|
+
const [checking, check] = (0, busy_1.useBusy)();
|
|
94
|
+
const mode = (_a = MODES.find(each => each.value === info.policy.updates)) !== null && _a !== void 0 ? _a : MODES[0];
|
|
95
|
+
const pick = (value) => void save(() => bench.gateway
|
|
96
|
+
.setUpdatePolicy(value)
|
|
97
|
+
.then(onChanged)
|
|
98
|
+
.catch(error => notices.error(error)));
|
|
99
|
+
const look = () => void check(() => bench.gateway
|
|
100
|
+
.checkUpdates()
|
|
101
|
+
.then(count => notices.notify(t('ta.console.checked', { count }), { level: 'success' }))
|
|
102
|
+
.then(onChanged)
|
|
103
|
+
.catch(error => notices.error(error)));
|
|
104
|
+
return (React.createElement(console_parts_1.Section, { title: t('ta.console.updates'), hint: t('ta.console.updatesHint') },
|
|
105
|
+
React.createElement(console_parts_1.Card, null,
|
|
106
|
+
React.createElement(console_limits_1.LimitRow, { label: t('ta.console.updateMode'), hint: t(mode.hint) },
|
|
107
|
+
React.createElement(console_limits_1.ValueButton, { text: t(mode.label), busy: saving, disabled: info.role !== 'owner', label: t('ta.console.updateMode'), items: () => MODES.map(each => ({ label: t(each.label), checked: each.value === mode.value, run: () => pick(each.value) })) })),
|
|
108
|
+
React.createElement("button", { type: "button", className: `ta-console-entry ta-console-press ta-console-command${checking ? ' ta-busy' : ''}`, disabled: checking, onClick: look },
|
|
109
|
+
React.createElement(icon_1.Icon, { icon: lucide_react_1.RefreshCw, size: 16 }),
|
|
110
|
+
React.createElement("span", { className: "ta-console-entry-label" }, t('ta.console.checkUpdates')),
|
|
111
|
+
checking && React.createElement("span", { className: "ta-spinner ta-busy-mark", "aria-hidden": "true" })))));
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=console-updates.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TaGatewayConsole, TaGatewayTenant, TaQuotaState, TaUsageTrend } from '@celljs/ta-protocol';
|
|
1
|
+
import type { TaGatewayConsole, TaGatewayTenant, TaQuotaState, TaSandboxVersion, TaUsageTrend } from '@celljs/ta-protocol';
|
|
2
2
|
/** A bar of a trend: an hour or a day of the page's time zone. */
|
|
3
3
|
export interface TrendPoint {
|
|
4
4
|
/** Its start. */
|
|
@@ -33,6 +33,12 @@ export declare namespace ConsoleUtil {
|
|
|
33
33
|
working: number;
|
|
34
34
|
limited: number;
|
|
35
35
|
};
|
|
36
|
+
/** `4.18.0`, else the start of the id of its image. */
|
|
37
|
+
function version(value: TaSandboxVersion | undefined): string;
|
|
38
|
+
/** `4.17.0 → 4.18.0`; two builds of one version told apart by their revisions. */
|
|
39
|
+
function move(from: TaSandboxVersion | undefined, to: TaSandboxVersion | undefined): string;
|
|
40
|
+
/** The running Ta that may move to a newer version: those an update of all moves. */
|
|
41
|
+
function behind(info: TaGatewayConsole): TaGatewayTenant[];
|
|
36
42
|
/** 12.3k, 4.5M: as a person reads a count of tokens. */
|
|
37
43
|
function count(value: number): string;
|
|
38
44
|
/** $0.42, $12: what a model's prices made; none for nothing. */
|
|
@@ -73,6 +73,24 @@ var ConsoleUtil;
|
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
ConsoleUtil.counts = counts;
|
|
76
|
+
/** `4.18.0`, else the start of the id of its image. */
|
|
77
|
+
function version(value) {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
return (_b = (_a = value === null || value === void 0 ? void 0 : value.version) !== null && _a !== void 0 ? _a : value === null || value === void 0 ? void 0 : value.id.replace(/^sha256:/, '').slice(0, 12)) !== null && _b !== void 0 ? _b : '';
|
|
80
|
+
}
|
|
81
|
+
ConsoleUtil.version = version;
|
|
82
|
+
/** `4.17.0 → 4.18.0`; two builds of one version told apart by their revisions. */
|
|
83
|
+
function move(from, to) {
|
|
84
|
+
const same = (from === null || from === void 0 ? void 0 : from.version) !== undefined && from.version === (to === null || to === void 0 ? void 0 : to.version);
|
|
85
|
+
const each = (value) => (same && (value === null || value === void 0 ? void 0 : value.revision) ? `${version(value)} (${value.revision})` : version(value));
|
|
86
|
+
return `${each(from)} → ${each(to)}`;
|
|
87
|
+
}
|
|
88
|
+
ConsoleUtil.move = move;
|
|
89
|
+
/** The running Ta that may move to a newer version: those an update of all moves. */
|
|
90
|
+
function behind(info) {
|
|
91
|
+
return info.tenants.filter(tenant => tenant.environment.latest && tenant.environment.status === 'running');
|
|
92
|
+
}
|
|
93
|
+
ConsoleUtil.behind = behind;
|
|
76
94
|
/** 12.3k, 4.5M: as a person reads a count of tokens. */
|
|
77
95
|
function count(value) {
|
|
78
96
|
if (value >= 1e9) {
|
|
@@ -51,6 +51,7 @@ const console_limits_1 = require("./console-limits");
|
|
|
51
51
|
const console_parts_1 = require("./console-parts");
|
|
52
52
|
const console_tenant_1 = require("./console-tenant");
|
|
53
53
|
const console_trend_1 = require("./console-trend");
|
|
54
|
+
const console_updates_1 = require("./console-updates");
|
|
54
55
|
const console_util_1 = require("./console-util");
|
|
55
56
|
const FILTERS = [
|
|
56
57
|
{ value: 'all', label: 'ta.console.filterAll' },
|
|
@@ -68,6 +69,10 @@ const ACTIONS = {
|
|
|
68
69
|
startTenant: 'ta.console.auditStart',
|
|
69
70
|
stopTenant: 'ta.console.auditStop',
|
|
70
71
|
restartTenant: 'ta.console.auditRestart',
|
|
72
|
+
updateTenant: 'ta.console.auditUpdate',
|
|
73
|
+
updateTenants: 'ta.console.auditUpdateAll',
|
|
74
|
+
rollbackTenant: 'ta.console.auditRollback',
|
|
75
|
+
setUpdatePolicy: 'ta.console.auditUpdatePolicy',
|
|
71
76
|
getTenantLogs: 'ta.console.auditLogs',
|
|
72
77
|
getAgentActivity: 'ta.console.auditActivity',
|
|
73
78
|
createSignInLink: 'ta.console.auditInvite',
|
|
@@ -114,7 +119,7 @@ function useInvite(info) {
|
|
|
114
119
|
t('ta.console.copy')))));
|
|
115
120
|
return [shown, start];
|
|
116
121
|
}
|
|
117
|
-
function Overview({ info, onTenant, onTab }) {
|
|
122
|
+
function Overview({ info, onTenant, onTab, onChanged, }) {
|
|
118
123
|
const t = (0, use_t_1.useT)();
|
|
119
124
|
const [, host] = (0, hooks_1.useWebExtensions)();
|
|
120
125
|
const counts = console_util_1.ConsoleUtil.counts(info);
|
|
@@ -136,6 +141,7 @@ function Overview({ info, onTenant, onTab }) {
|
|
|
136
141
|
{ value: counts.connections, label: t('ta.console.connectionsLabel') },
|
|
137
142
|
] }),
|
|
138
143
|
info.requests > 0 && (React.createElement(callout_1.Callout, { level: "info", action: React.createElement("button", { type: "button", className: "ta-link-button", onClick: () => host.openSettings('access') }, t('ta.console.review')) }, t('ta.console.requestsWaiting', { count: info.requests }))),
|
|
144
|
+
React.createElement(console_updates_1.UpdatesCallout, { info: info, onChanged: onChanged }),
|
|
139
145
|
counts.limited > 0 && (React.createElement(callout_1.Callout, { level: "warning", action: React.createElement("button", { type: "button", className: "ta-link-button", onClick: () => onTab('accounts', 'limited') }, t('ta.console.view')) }, t('ta.console.limitedCount', { count: counts.limited }))),
|
|
140
146
|
React.createElement(console_parts_1.Section, { title: t('ta.console.trend') },
|
|
141
147
|
React.createElement(console_trend_1.TrendCard, { tenants: info.tenants, onTenant: onTenant })),
|
|
@@ -261,6 +267,7 @@ function Policy({ info, onChanged }) {
|
|
|
261
267
|
React.createElement("span", { className: "ta-console-entry-label ta-ellipsis" }, provider.name || provider.id),
|
|
262
268
|
React.createElement("span", { className: "ta-console-entry-hint" }, t('ta.console.modelsOf', { api: provider.api, count: provider.models }))))))))),
|
|
263
269
|
React.createElement(Egress, { info: info, onChanged: onChanged }),
|
|
270
|
+
React.createElement(console_updates_1.UpdatesSection, { info: info, onChanged: onChanged }),
|
|
264
271
|
React.createElement(console_parts_1.Section, { title: t('ta.console.managers'), hint: t('ta.console.managersHint') },
|
|
265
272
|
React.createElement(console_parts_1.Card, null, info.policy.admins.map(admin => (React.createElement("div", { key: admin.account, className: "ta-console-entry" },
|
|
266
273
|
React.createElement("span", { className: "ta-console-tile" },
|
|
@@ -304,7 +311,7 @@ function ConsolePage() {
|
|
|
304
311
|
{ value: 'accounts', label: 'ta.console.tabAccounts' },
|
|
305
312
|
{ value: 'policy', label: 'ta.console.tabPolicy' },
|
|
306
313
|
] }),
|
|
307
|
-
tab === 'overview' && React.createElement(Overview, { info: info, onTenant: open, onTab: goTo }),
|
|
314
|
+
tab === 'overview' && React.createElement(Overview, { info: info, onTenant: open, onTab: goTo, onChanged: read }),
|
|
308
315
|
tab === 'accounts' && React.createElement(Accounts, { info: info, onOpen: open, filter: filter, onFilter: setFilter }),
|
|
309
316
|
tab === 'policy' && React.createElement(Policy, { info: info, onChanged: read }),
|
|
310
317
|
React.createElement("p", { className: "ta-console-foot" }, [
|