@flamingo-stack/openframe-frontend-core 0.0.740 → 0.0.741
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/build/export-map.json +1 -1
- package/dist/{chunk-3ZIQOYNX.cjs → chunk-4XL4YEZM.cjs} +3 -3
- package/dist/{chunk-WFPCCBOM.cjs → chunk-7AM3AFM4.cjs} +10 -10
- package/dist/{chunk-KHXZFLIN.cjs → chunk-DKOLQPE7.cjs} +8 -2
- package/dist/{chunk-7UIQPMBJ.cjs → chunk-FQN6STIM.cjs} +1 -144
- package/dist/{chunk-ZLTCQKTD.cjs → chunk-I6UE6YVM.cjs} +2 -2
- package/dist/{chunk-VC4IV3AY.cjs → chunk-IK2RJUEA.cjs} +2049 -199
- package/dist/{chunk-D5KEWWLW.cjs → chunk-ITPEFCQ2.cjs} +10 -10
- package/dist/{chunk-2Y5Y4FLM.cjs → chunk-JFS6TZDX.cjs} +15 -15
- package/dist/{chunk-VU4CKUJW.cjs → chunk-LZ6NOVXX.cjs} +23 -23
- package/dist/{chunk-UW3YXDC4.cjs → chunk-QEUGYHFB.cjs} +4 -4
- package/dist/{chunk-II4QMH26.cjs → chunk-STEJZPIO.cjs} +3 -3
- package/dist/{chunk-4RLGLB45.cjs → chunk-XJ36TEGE.cjs} +11 -11
- package/dist/{chunk-BDA5F6RM.cjs → chunk-YQ37ZCD2.cjs} +2 -2
- package/dist/{chunk-LLAC2UZ3.cjs → chunk-ZJPDGVA6.cjs} +3 -3
- package/dist/{chunk-SWR22DOZ.cjs → chunk-ZYOS7LVQ.cjs} +22 -22
- package/dist/{cloud-tenants-PVXDI5MU.cjs → cloud-tenants-MVJK52I2.cjs} +12 -12
- package/dist/components/case-studies/index.cjs +10 -10
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/docs/index.cjs +5 -5
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/features/capability-explorer.d.ts +9 -2
- package/dist/components/features/capability-explorer.d.ts.map +1 -1
- package/dist/components/features/capability-explorer.js +113 -6
- package/dist/components/features/index.cjs +140 -2
- package/dist/components/features/index.d.ts +1 -0
- package/dist/components/features/index.d.ts.map +1 -1
- package/dist/components/features/index.js +1 -0
- package/dist/components/features/scripts/execution-cells.d.ts +65 -0
- package/dist/components/features/scripts/execution-cells.d.ts.map +1 -0
- package/dist/components/features/scripts/execution-cells.js +75 -0
- package/dist/components/features/scripts/execution-status.d.ts +48 -0
- package/dist/components/features/scripts/execution-status.d.ts.map +1 -0
- package/dist/components/features/scripts/execution-status.js +15 -0
- package/dist/components/features/scripts/index.d.ts +20 -0
- package/dist/components/features/scripts/index.d.ts.map +1 -0
- package/dist/components/features/scripts/index.js +59 -0
- package/dist/components/features/scripts/schedule-form/index.d.ts +18 -0
- package/dist/components/features/scripts/schedule-form/index.d.ts.map +1 -0
- package/dist/components/features/scripts/schedule-form/index.js +84 -0
- package/dist/components/features/scripts/schedule-form/schedule-enums.d.ts +24 -0
- package/dist/components/features/scripts/schedule-form/schedule-enums.d.ts.map +1 -0
- package/dist/components/features/scripts/schedule-form/schedule-enums.js +18 -0
- package/dist/components/features/scripts/schedule-form/schedule-form-fields.d.ts +57 -0
- package/dist/components/features/scripts/schedule-form/schedule-form-fields.d.ts.map +1 -0
- package/dist/components/features/scripts/schedule-form/schedule-form-fields.js +169 -0
- package/dist/components/features/scripts/schedule-form/schedule-form-types.d.ts +138 -0
- package/dist/components/features/scripts/schedule-form/schedule-form-types.d.ts.map +1 -0
- package/dist/components/features/scripts/schedule-form/schedule-form-types.js +72 -0
- package/dist/components/features/scripts/schedule-form/schedule-interval-input.d.ts +54 -0
- package/dist/components/features/scripts/schedule-form/schedule-interval-input.d.ts.map +1 -0
- package/dist/components/features/scripts/schedule-form/schedule-interval-input.js +60 -0
- package/dist/components/features/scripts/schedule-form/schedule-offline-fields.d.ts +29 -0
- package/dist/components/features/scripts/schedule-form/schedule-offline-fields.d.ts.map +1 -0
- package/dist/components/features/scripts/schedule-form/schedule-offline-fields.js +124 -0
- package/dist/components/features/scripts/schedule-form/schedule-script-picker-card.d.ts +52 -0
- package/dist/components/features/scripts/schedule-form/schedule-script-picker-card.d.ts.map +1 -0
- package/dist/components/features/scripts/schedule-form/schedule-script-picker-card.js +244 -0
- package/dist/components/features/scripts/schedule-form/schedule-script-search-field.d.ts +35 -0
- package/dist/components/features/scripts/schedule-form/schedule-script-search-field.d.ts.map +1 -0
- package/dist/components/features/scripts/schedule-form/schedule-script-search-field.js +58 -0
- package/dist/components/features/scripts/schedule-form/schedule-scripts-field.d.ts +25 -0
- package/dist/components/features/scripts/schedule-form/schedule-scripts-field.d.ts.map +1 -0
- package/dist/components/features/scripts/schedule-form/schedule-scripts-field.js +66 -0
- package/dist/components/features/scripts/schedule-form/schedule-timing-fields.d.ts +77 -0
- package/dist/components/features/scripts/schedule-form/schedule-timing-fields.d.ts.map +1 -0
- package/dist/components/features/scripts/schedule-form/schedule-timing-fields.js +262 -0
- package/dist/components/features/scripts/schedule-form/schedule-timing.d.ts +288 -0
- package/dist/components/features/scripts/schedule-form/schedule-timing.d.ts.map +1 -0
- package/dist/components/features/scripts/schedule-form/schedule-timing.js +165 -0
- package/dist/components/features/scripts/script-cells.d.ts +11 -0
- package/dist/components/features/scripts/script-cells.d.ts.map +1 -0
- package/dist/components/features/scripts/script-cells.js +19 -0
- package/dist/components/features/scripts/script-executions-table.d.ts +58 -0
- package/dist/components/features/scripts/script-executions-table.d.ts.map +1 -0
- package/dist/components/features/scripts/script-executions-table.js +88 -0
- package/dist/components/features/scripts/script-schedules-table.d.ts +38 -0
- package/dist/components/features/scripts/script-schedules-table.d.ts.map +1 -0
- package/dist/components/features/scripts/script-schedules-table.js +71 -0
- package/dist/components/features/scripts/script-shell-badge.d.ts +9 -0
- package/dist/components/features/scripts/script-shell-badge.d.ts.map +1 -0
- package/dist/components/features/scripts/script-shell-badge.js +15 -0
- package/dist/components/features/scripts/scripts-table-columns.d.ts +162 -0
- package/dist/components/features/scripts/scripts-table-columns.d.ts.map +1 -0
- package/dist/components/features/scripts/scripts-table-columns.js +69 -0
- package/dist/components/features/scripts/scripts-table-shared.d.ts +19 -0
- package/dist/components/features/scripts/scripts-table-shared.d.ts.map +1 -0
- package/dist/components/features/scripts/scripts-table-shared.js +35 -0
- package/dist/components/features/scripts/scripts-table.d.ts +40 -0
- package/dist/components/features/scripts/scripts-table.d.ts.map +1 -0
- package/dist/components/features/scripts/scripts-table.js +84 -0
- package/dist/components/features/scripts/scripts-tabs.d.ts +5 -0
- package/dist/components/features/scripts/scripts-tabs.d.ts.map +1 -0
- package/dist/components/features/scripts/scripts-tabs.js +10 -0
- package/dist/components/features/scripts/shell-types.d.ts +13 -0
- package/dist/components/features/scripts/shell-types.d.ts.map +1 -0
- package/dist/components/features/scripts/shell-types.js +21 -0
- package/dist/components/help-center-pages/index.cjs +44 -44
- package/dist/components/index.cjs +162 -24
- package/dist/components/meeting-scheduler/index.cjs +11 -11
- package/dist/components/navigation/index.cjs +3 -3
- package/dist/components/onboarding-guides/index.cjs +4 -4
- package/dist/components/product-demo/fixtures/scripts.d.ts +34 -0
- package/dist/components/product-demo/fixtures/scripts.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/scripts.js +123 -0
- package/dist/components/product-demo/fixtures/shared.d.ts +8 -0
- package/dist/components/product-demo/fixtures/shared.d.ts.map +1 -1
- package/dist/components/product-demo/fixtures/shared.js +7 -1
- package/dist/components/product-demo/fixtures/software-update.d.ts.map +1 -1
- package/dist/components/product-demo/fixtures/software-update.js +1 -5
- package/dist/components/product-demo/index.cjs +16 -13
- package/dist/components/product-demo/product-screen.d.ts.map +1 -1
- package/dist/components/product-demo/product-screen.js +2 -1
- package/dist/components/product-demo/registry.d.ts.map +1 -1
- package/dist/components/product-demo/registry.js +2 -1
- package/dist/components/product-demo/screen-keys.cjs +2 -1
- package/dist/components/product-demo/screen-keys.d.ts +1 -0
- package/dist/components/product-demo/screen-keys.d.ts.map +1 -1
- package/dist/components/product-demo/screen-keys.js +2 -1
- package/dist/components/product-demo/screens/scripts.d.ts +11 -0
- package/dist/components/product-demo/screens/scripts.d.ts.map +1 -0
- package/dist/components/product-demo/screens/scripts.js +130 -0
- package/dist/components/tickets/index.cjs +5 -5
- package/dist/components/ui/index.cjs +2 -2
- package/dist/{devices-TWEA7XOR.cjs → devices-W3S7Q2PG.cjs} +8 -8
- package/dist/index.cjs +143 -5
- package/dist/{knowledge-4GQDBNQB.cjs → knowledge-AIYQ4FC3.cjs} +6 -6
- package/dist/{logs-EVU6GJHZ.cjs → logs-7SHJ2ARE.cjs} +24 -24
- package/dist/{policies-OZUEA5YS.cjs → policies-EIZJ5SUP.cjs} +9 -9
- package/dist/{remote-session-DNFZ5OLY.cjs → remote-session-BZMNE6D2.cjs} +5 -5
- package/dist/scripts-J2FWC7E4.cjs +2112 -0
- package/dist/{software-update-BLIVYOY2.cjs → software-update-QAMNASVF.cjs} +13 -17
- package/dist/{tickets-board-CKZRB6YV.cjs → tickets-board-CEDHD3KB.cjs} +17 -17
- package/package.json +1 -1
- package/src/components/features/capability-explorer.tsx +134 -7
- package/src/components/features/index.ts +1 -0
- package/src/components/features/scripts/execution-cells.tsx +149 -0
- package/src/components/features/scripts/execution-status.ts +42 -0
- package/src/components/features/scripts/index.ts +42 -0
- package/src/components/features/scripts/schedule-form/index.ts +59 -0
- package/src/components/features/scripts/schedule-form/schedule-enums.ts +26 -0
- package/src/components/features/scripts/schedule-form/schedule-form-fields.tsx +249 -0
- package/src/components/features/scripts/schedule-form/schedule-form-types.ts +189 -0
- package/src/components/features/scripts/schedule-form/schedule-interval-input.tsx +121 -0
- package/src/components/features/scripts/schedule-form/schedule-offline-fields.tsx +218 -0
- package/src/components/features/scripts/schedule-form/schedule-script-picker-card.tsx +321 -0
- package/src/components/features/scripts/schedule-form/schedule-script-search-field.tsx +115 -0
- package/src/components/features/scripts/schedule-form/schedule-scripts-field.tsx +97 -0
- package/src/components/features/scripts/schedule-form/schedule-timing-fields.tsx +482 -0
- package/src/components/features/scripts/schedule-form/schedule-timing.ts +484 -0
- package/src/components/features/scripts/script-cells.tsx +29 -0
- package/src/components/features/scripts/script-executions-table.tsx +145 -0
- package/src/components/features/scripts/script-schedules-table.tsx +113 -0
- package/src/components/features/scripts/script-shell-badge.tsx +25 -0
- package/src/components/features/scripts/scripts-table-columns.ts +95 -0
- package/src/components/features/scripts/scripts-table-shared.tsx +43 -0
- package/src/components/features/scripts/scripts-table.tsx +124 -0
- package/src/components/features/scripts/scripts-tabs.ts +11 -0
- package/src/components/features/scripts/shell-types.ts +26 -0
- package/src/components/product-demo/fixtures/scripts.ts +186 -0
- package/src/components/product-demo/fixtures/shared.ts +7 -0
- package/src/components/product-demo/fixtures/software-update.ts +1 -7
- package/src/components/product-demo/product-screen.tsx +3 -1
- package/src/components/product-demo/registry.ts +1 -0
- package/src/components/product-demo/screen-keys.ts +1 -0
- package/src/components/product-demo/screens/scripts.tsx +192 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/** One schedule, as the table shows it. The host formats the start and the repeat. */
|
|
3
|
+
export interface ScriptScheduleTableRow {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string | null;
|
|
7
|
+
supportedPlatforms: string[];
|
|
8
|
+
/** When it starts. Null: it has no date (`trigger` then says what starts it). */
|
|
9
|
+
startsAt?: {
|
|
10
|
+
date: string;
|
|
11
|
+
time: string;
|
|
12
|
+
} | null;
|
|
13
|
+
/** What starts a schedule with no date ("Device Online"). */
|
|
14
|
+
trigger?: string | null;
|
|
15
|
+
/** How often it runs ("Every day"). Null: it does not repeat on a clock. */
|
|
16
|
+
repeat?: string | null;
|
|
17
|
+
deviceCount: number;
|
|
18
|
+
href?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ScriptSchedulesTableProps {
|
|
21
|
+
rows: ScriptScheduleTableRow[];
|
|
22
|
+
isLoading?: boolean;
|
|
23
|
+
/** Column ids to leave out (`'deviceCount'`, `'supportedPlatforms'`, `'open'`). */
|
|
24
|
+
hideColumns?: readonly string[];
|
|
25
|
+
/** The row menu. Without it the table has no actions column. */
|
|
26
|
+
renderActions?: (row: ScriptScheduleTableRow) => ReactNode;
|
|
27
|
+
emptyMessage?: string;
|
|
28
|
+
stickyHeader?: boolean;
|
|
29
|
+
stickyHeaderOffset?: string;
|
|
30
|
+
rightSlot?: ReactNode;
|
|
31
|
+
skeletonRows?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The script schedules as a table: what runs, on which operating systems,
|
|
35
|
+
* when, how often and on how many devices.
|
|
36
|
+
*/
|
|
37
|
+
export declare function ScriptSchedulesTable({ rows, isLoading, hideColumns, renderActions, emptyMessage, stickyHeader, stickyHeaderOffset, rightSlot, skeletonRows, }: ScriptSchedulesTableProps): import("react").JSX.Element;
|
|
38
|
+
//# sourceMappingURL=script-schedules-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-schedules-table.d.ts","sourceRoot":"","sources":["../../../../src/components/features/scripts/script-schedules-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;AAQ7D,sFAAsF;AACtF,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjD,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,sBAAsB,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mFAAmF;IACnF,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,gEAAgE;IAChE,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,sBAAsB,KAAK,SAAS,CAAC;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,SAAiB,EACjB,WAAW,EACX,aAAa,EACb,YAAoC,EACpC,YAAoB,EACpB,kBAAkB,EAClB,SAAS,EACT,YAAiB,GAClB,EAAE,yBAAyB,+BAwD3B"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useMemo } from "react";
|
|
4
|
+
import { DataTable, useDataTable } from "../../ui/data-table/index.js";
|
|
5
|
+
import { TruncateText } from "../../ui/truncate-text.js";
|
|
6
|
+
import { OSTypeBadgeGroup } from "../os-type-badge-group.js";
|
|
7
|
+
import { ScheduleDateTimeCell, ScriptNameCell } from "./script-cells.js";
|
|
8
|
+
import { SCHEDULE_COLUMNS } from "./scripts-table-columns.js";
|
|
9
|
+
import { OpenInNewTabCell, RowActionsCell, scriptsColumnMeta } from "./scripts-table-shared.js";
|
|
10
|
+
const VALUE_CLASS = "text-ods-text-primary text-h4";
|
|
11
|
+
function ScriptSchedulesTable({
|
|
12
|
+
rows,
|
|
13
|
+
isLoading = false,
|
|
14
|
+
hideColumns,
|
|
15
|
+
renderActions,
|
|
16
|
+
emptyMessage = "No schedules found.",
|
|
17
|
+
stickyHeader = false,
|
|
18
|
+
stickyHeaderOffset,
|
|
19
|
+
rightSlot,
|
|
20
|
+
skeletonRows = 10
|
|
21
|
+
}) {
|
|
22
|
+
const columns = useMemo(() => {
|
|
23
|
+
const cell = (layout, render) => ({
|
|
24
|
+
id: layout.id,
|
|
25
|
+
header: layout.header ?? "",
|
|
26
|
+
cell: ({ row }) => render(row.original),
|
|
27
|
+
enableSorting: false,
|
|
28
|
+
// A picture of the table sorts nothing: the layout's sort icon is the live page's.
|
|
29
|
+
meta: { ...scriptsColumnMeta(layout), sortable: false }
|
|
30
|
+
});
|
|
31
|
+
const all = [
|
|
32
|
+
cell(SCHEDULE_COLUMNS.name, (row) => /* @__PURE__ */ jsx(ScriptNameCell, { name: row.name, description: row.description })),
|
|
33
|
+
cell(SCHEDULE_COLUMNS.supportedPlatforms, (row) => /* @__PURE__ */ jsx(OSTypeBadgeGroup, { osTypes: row.supportedPlatforms, iconSize: "w-4 h-4 content-md:w-6 content-md:h-6" })),
|
|
34
|
+
cell(
|
|
35
|
+
SCHEDULE_COLUMNS.dateTime,
|
|
36
|
+
(row) => row.startsAt ? /* @__PURE__ */ jsx(ScheduleDateTimeCell, { date: row.startsAt.date, time: row.startsAt.time }) : row.trigger ? /* @__PURE__ */ jsx(TruncateText, { tone: "secondary", children: row.trigger }) : null
|
|
37
|
+
),
|
|
38
|
+
cell(SCHEDULE_COLUMNS.repeat, (row) => row.repeat ? /* @__PURE__ */ jsx("span", { className: VALUE_CLASS, children: row.repeat }) : null),
|
|
39
|
+
cell(SCHEDULE_COLUMNS.deviceCount, (row) => /* @__PURE__ */ jsx("span", { className: VALUE_CLASS, children: row.deviceCount }))
|
|
40
|
+
];
|
|
41
|
+
if (renderActions) {
|
|
42
|
+
all.push(cell(SCHEDULE_COLUMNS.actions, (row) => /* @__PURE__ */ jsx(RowActionsCell, { children: renderActions(row) })));
|
|
43
|
+
}
|
|
44
|
+
all.push(cell(SCHEDULE_COLUMNS.open, (row) => row.href ? /* @__PURE__ */ jsx(OpenInNewTabCell, { href: row.href }) : null));
|
|
45
|
+
return hideColumns ? all.filter((column) => !hideColumns.includes(column.id ?? "")) : all;
|
|
46
|
+
}, [hideColumns, renderActions]);
|
|
47
|
+
const table = useDataTable({
|
|
48
|
+
data: rows,
|
|
49
|
+
columns,
|
|
50
|
+
getRowId: (row) => row.id,
|
|
51
|
+
enableSorting: false
|
|
52
|
+
});
|
|
53
|
+
const rowHref = useCallback((row) => row.href, []);
|
|
54
|
+
const showHeader = isLoading || rows.length > 0;
|
|
55
|
+
return /* @__PURE__ */ jsxs(DataTable, { table, children: [
|
|
56
|
+
showHeader && /* @__PURE__ */ jsx(DataTable.Header, { stickyHeader, stickyHeaderOffset, rightSlot }),
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
DataTable.Body,
|
|
59
|
+
{
|
|
60
|
+
loading: isLoading,
|
|
61
|
+
skeletonRows,
|
|
62
|
+
emptyMessage,
|
|
63
|
+
rowClassName: "mb-1",
|
|
64
|
+
rowHref
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
] });
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
ScriptSchedulesTable
|
|
71
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ScriptShellBadgeProps {
|
|
2
|
+
/** Lowercase shell id (`'cmd'`). */
|
|
3
|
+
value: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
iconClassName?: string;
|
|
6
|
+
}
|
|
7
|
+
/** A script's shell: its icon and label from `SCRIPT_SHELL_TYPES`. */
|
|
8
|
+
export declare function ScriptShellBadge({ value, className, iconClassName }: ScriptShellBadgeProps): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=script-shell-badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-shell-badge.d.ts","sourceRoot":"","sources":["../../../../src/components/features/scripts/script-shell-badge.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,qBAAqB;IACpC,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,qBAAqB,+BAW1F"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../../utils/cn.js";
|
|
4
|
+
import { scriptShellType } from "./shell-types.js";
|
|
5
|
+
function ScriptShellBadge({ value, className, iconClassName }) {
|
|
6
|
+
const shell = scriptShellType(value);
|
|
7
|
+
const Icon = shell?.icon;
|
|
8
|
+
return /* @__PURE__ */ jsxs("span", { className: cn("flex items-center gap-2", className), children: [
|
|
9
|
+
Icon && /* @__PURE__ */ jsx(Icon, { className: cn("h-5 w-5 text-ods-text-secondary", iconClassName) }),
|
|
10
|
+
/* @__PURE__ */ jsx("span", { children: shell?.label ?? value })
|
|
11
|
+
] });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
ScriptShellBadge
|
|
15
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column layout of the Scripts tables (the library, the schedules and the
|
|
3
|
+
* Execution History of a script or a schedule) and the two tabs over them. Data only, with no imports, so a
|
|
4
|
+
* live table, its loading skeleton and a picture of the page read the same
|
|
5
|
+
* widths without loading each other.
|
|
6
|
+
*/
|
|
7
|
+
export interface ScriptsTableColumnLayout {
|
|
8
|
+
id: string;
|
|
9
|
+
header?: string;
|
|
10
|
+
/** The column's `meta.width` class. */
|
|
11
|
+
width: string;
|
|
12
|
+
hideAt?: 'md' | 'lg' | 'xl' | '2xl';
|
|
13
|
+
align?: 'right';
|
|
14
|
+
/** The header carries a sort icon. */
|
|
15
|
+
sortable?: boolean;
|
|
16
|
+
/** The header carries a filter dropdown, so it stays below `lg`. */
|
|
17
|
+
filterable?: boolean;
|
|
18
|
+
/** The header carries a calendar, so it stays below `lg`. */
|
|
19
|
+
dateFilterable?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const SCRIPT_COLUMNS: {
|
|
22
|
+
name: {
|
|
23
|
+
id: string;
|
|
24
|
+
header: string;
|
|
25
|
+
width: string;
|
|
26
|
+
};
|
|
27
|
+
shellType: {
|
|
28
|
+
id: string;
|
|
29
|
+
header: string;
|
|
30
|
+
width: string;
|
|
31
|
+
filterable: true;
|
|
32
|
+
};
|
|
33
|
+
supportedPlatforms: {
|
|
34
|
+
id: string;
|
|
35
|
+
header: string;
|
|
36
|
+
width: string;
|
|
37
|
+
hideAt: "lg";
|
|
38
|
+
filterable: true;
|
|
39
|
+
};
|
|
40
|
+
authorId: {
|
|
41
|
+
id: string;
|
|
42
|
+
header: string;
|
|
43
|
+
width: string;
|
|
44
|
+
hideAt: "lg";
|
|
45
|
+
filterable: true;
|
|
46
|
+
};
|
|
47
|
+
actions: {
|
|
48
|
+
id: string;
|
|
49
|
+
width: string;
|
|
50
|
+
align: "right";
|
|
51
|
+
};
|
|
52
|
+
open: {
|
|
53
|
+
id: string;
|
|
54
|
+
width: string;
|
|
55
|
+
hideAt: "md";
|
|
56
|
+
align: "right";
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export declare const SCHEDULE_COLUMNS: {
|
|
60
|
+
name: {
|
|
61
|
+
id: string;
|
|
62
|
+
header: string;
|
|
63
|
+
width: string;
|
|
64
|
+
};
|
|
65
|
+
supportedPlatforms: {
|
|
66
|
+
id: string;
|
|
67
|
+
header: string;
|
|
68
|
+
width: string;
|
|
69
|
+
hideAt: "lg";
|
|
70
|
+
filterable: true;
|
|
71
|
+
};
|
|
72
|
+
dateTime: {
|
|
73
|
+
id: string;
|
|
74
|
+
header: string;
|
|
75
|
+
width: string;
|
|
76
|
+
hideAt: "md";
|
|
77
|
+
dateFilterable: true;
|
|
78
|
+
};
|
|
79
|
+
repeat: {
|
|
80
|
+
id: string;
|
|
81
|
+
header: string;
|
|
82
|
+
width: string;
|
|
83
|
+
hideAt: "md";
|
|
84
|
+
sortable: true;
|
|
85
|
+
};
|
|
86
|
+
deviceCount: {
|
|
87
|
+
id: string;
|
|
88
|
+
header: string;
|
|
89
|
+
width: string;
|
|
90
|
+
hideAt: "lg";
|
|
91
|
+
};
|
|
92
|
+
actions: {
|
|
93
|
+
id: string;
|
|
94
|
+
width: string;
|
|
95
|
+
align: "right";
|
|
96
|
+
};
|
|
97
|
+
open: {
|
|
98
|
+
id: string;
|
|
99
|
+
width: string;
|
|
100
|
+
hideAt: "md";
|
|
101
|
+
align: "right";
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
export declare const EXECUTION_COLUMNS: {
|
|
105
|
+
executionId: {
|
|
106
|
+
id: string;
|
|
107
|
+
header: string;
|
|
108
|
+
width: string;
|
|
109
|
+
dateFilterable: true;
|
|
110
|
+
};
|
|
111
|
+
status: {
|
|
112
|
+
id: string;
|
|
113
|
+
header: string;
|
|
114
|
+
width: string;
|
|
115
|
+
filterable: true;
|
|
116
|
+
};
|
|
117
|
+
machineId: {
|
|
118
|
+
id: string;
|
|
119
|
+
header: string;
|
|
120
|
+
width: string;
|
|
121
|
+
hideAt: "lg";
|
|
122
|
+
filterable: true;
|
|
123
|
+
};
|
|
124
|
+
initiatorId: {
|
|
125
|
+
id: string;
|
|
126
|
+
header: string;
|
|
127
|
+
width: string;
|
|
128
|
+
hideAt: "md";
|
|
129
|
+
filterable: true;
|
|
130
|
+
};
|
|
131
|
+
result: {
|
|
132
|
+
id: string;
|
|
133
|
+
header: string;
|
|
134
|
+
width: string;
|
|
135
|
+
hideAt: "xl";
|
|
136
|
+
};
|
|
137
|
+
actions: {
|
|
138
|
+
id: string;
|
|
139
|
+
width: string;
|
|
140
|
+
align: "right";
|
|
141
|
+
};
|
|
142
|
+
open: {
|
|
143
|
+
id: string;
|
|
144
|
+
width: string;
|
|
145
|
+
hideAt: "md";
|
|
146
|
+
align: "right";
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
/** Cell widths of the Scripts / Schedules switcher, for its loading state. */
|
|
150
|
+
export declare const SCRIPTS_TAB_WIDTHS: readonly string[];
|
|
151
|
+
/** The library's columns, in render order. */
|
|
152
|
+
export declare const SCRIPTS_TABLE_COLUMNS: readonly ScriptsTableColumnLayout[];
|
|
153
|
+
/** The schedules' columns, in render order. */
|
|
154
|
+
export declare const SCHEDULES_TABLE_COLUMNS: readonly ScriptsTableColumnLayout[];
|
|
155
|
+
/**
|
|
156
|
+
* The Execution History's columns, in render order. The table ends in two
|
|
157
|
+
* 48px action columns with no header text: they carry width, so a skeleton
|
|
158
|
+
* that left them out laid the `flex-1` columns ~128px wider than the loaded
|
|
159
|
+
* table, and every label jumped left when the rows arrived.
|
|
160
|
+
*/
|
|
161
|
+
export declare const EXECUTIONS_TABLE_COLUMNS: readonly ScriptsTableColumnLayout[];
|
|
162
|
+
//# sourceMappingURL=scripts-table-columns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts-table-columns.d.ts","sourceRoot":"","sources":["../../../../src/components/features/scripts/scripts-table-columns.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oEAAoE;IACpE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOyB,CAAC;AAErD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcuB,CAAC;AAErD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQsB,CAAC;AAErD,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAA+B,CAAC;AAEhF,8CAA8C;AAC9C,eAAO,MAAM,qBAAqB,EAAE,SAAS,wBAAwB,EAOpE,CAAC;AAEF,+CAA+C;AAC/C,eAAO,MAAM,uBAAuB,EAAE,SAAS,wBAAwB,EAQtE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,EAAE,SAAS,wBAAwB,EAQvE,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const SCRIPT_COLUMNS = {
|
|
3
|
+
name: { id: "name", header: "Name", width: "flex-1 min-w-0" },
|
|
4
|
+
shellType: { id: "shellType", header: "Shell Type", width: "w-[100px] content-md:w-[160px]", filterable: true },
|
|
5
|
+
supportedPlatforms: { id: "supportedPlatforms", header: "OS", width: "w-[80px]", hideAt: "lg", filterable: true },
|
|
6
|
+
authorId: { id: "authorId", header: "Added by", width: "w-[250px]", hideAt: "lg", filterable: true },
|
|
7
|
+
actions: { id: "actions", width: "w-12 shrink-0 flex-none", align: "right" },
|
|
8
|
+
open: { id: "open", width: "w-12 shrink-0 flex-none", hideAt: "md", align: "right" }
|
|
9
|
+
};
|
|
10
|
+
const SCHEDULE_COLUMNS = {
|
|
11
|
+
name: { id: "name", header: "Script", width: "flex-1 min-w-0" },
|
|
12
|
+
supportedPlatforms: { id: "supportedPlatforms", header: "OS", width: "w-[90px]", hideAt: "lg", filterable: true },
|
|
13
|
+
dateTime: {
|
|
14
|
+
id: "dateTime",
|
|
15
|
+
header: "Date & Time",
|
|
16
|
+
width: "w-[100px] content-md:w-[160px]",
|
|
17
|
+
hideAt: "md",
|
|
18
|
+
dateFilterable: true
|
|
19
|
+
},
|
|
20
|
+
repeat: { id: "repeat", header: "Repeat", width: "w-[120px]", hideAt: "md", sortable: true },
|
|
21
|
+
deviceCount: { id: "deviceCount", header: "Devices", width: "w-[100px] content-md:w-[140px]", hideAt: "lg" },
|
|
22
|
+
actions: { id: "actions", width: "w-12 shrink-0 flex-none", align: "right" },
|
|
23
|
+
open: { id: "open", width: "w-12 shrink-0 flex-none", hideAt: "md", align: "right" }
|
|
24
|
+
};
|
|
25
|
+
const EXECUTION_COLUMNS = {
|
|
26
|
+
executionId: { id: "executionId", header: "Execution", width: "w-[160px]", dateFilterable: true },
|
|
27
|
+
status: { id: "status", header: "Status", width: "w-[120px]", filterable: true },
|
|
28
|
+
machineId: { id: "machineId", header: "Device", width: "w-[200px]", hideAt: "lg", filterable: true },
|
|
29
|
+
initiatorId: { id: "initiatorId", header: "Executed by", width: "flex-1 min-w-0", hideAt: "md", filterable: true },
|
|
30
|
+
result: { id: "result", header: "Result", width: "flex-1 min-w-0", hideAt: "xl" },
|
|
31
|
+
actions: { id: "actions", width: "w-12 shrink-0 flex-none", align: "right" },
|
|
32
|
+
open: { id: "open", width: "w-12 shrink-0 flex-none", hideAt: "md", align: "right" }
|
|
33
|
+
};
|
|
34
|
+
const SCRIPTS_TAB_WIDTHS = ["w-[160px]", "w-[200px]"];
|
|
35
|
+
const SCRIPTS_TABLE_COLUMNS = [
|
|
36
|
+
SCRIPT_COLUMNS.name,
|
|
37
|
+
SCRIPT_COLUMNS.shellType,
|
|
38
|
+
SCRIPT_COLUMNS.supportedPlatforms,
|
|
39
|
+
SCRIPT_COLUMNS.authorId,
|
|
40
|
+
SCRIPT_COLUMNS.actions,
|
|
41
|
+
SCRIPT_COLUMNS.open
|
|
42
|
+
];
|
|
43
|
+
const SCHEDULES_TABLE_COLUMNS = [
|
|
44
|
+
SCHEDULE_COLUMNS.name,
|
|
45
|
+
SCHEDULE_COLUMNS.supportedPlatforms,
|
|
46
|
+
SCHEDULE_COLUMNS.dateTime,
|
|
47
|
+
SCHEDULE_COLUMNS.repeat,
|
|
48
|
+
SCHEDULE_COLUMNS.deviceCount,
|
|
49
|
+
SCHEDULE_COLUMNS.actions,
|
|
50
|
+
SCHEDULE_COLUMNS.open
|
|
51
|
+
];
|
|
52
|
+
const EXECUTIONS_TABLE_COLUMNS = [
|
|
53
|
+
EXECUTION_COLUMNS.executionId,
|
|
54
|
+
EXECUTION_COLUMNS.status,
|
|
55
|
+
EXECUTION_COLUMNS.machineId,
|
|
56
|
+
EXECUTION_COLUMNS.initiatorId,
|
|
57
|
+
EXECUTION_COLUMNS.result,
|
|
58
|
+
EXECUTION_COLUMNS.actions,
|
|
59
|
+
EXECUTION_COLUMNS.open
|
|
60
|
+
];
|
|
61
|
+
export {
|
|
62
|
+
EXECUTIONS_TABLE_COLUMNS,
|
|
63
|
+
EXECUTION_COLUMNS,
|
|
64
|
+
SCHEDULES_TABLE_COLUMNS,
|
|
65
|
+
SCHEDULE_COLUMNS,
|
|
66
|
+
SCRIPTS_TABLE_COLUMNS,
|
|
67
|
+
SCRIPTS_TAB_WIDTHS,
|
|
68
|
+
SCRIPT_COLUMNS
|
|
69
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ScriptsTableColumnLayout } from './scripts-table-columns';
|
|
3
|
+
/** A column's `meta` from its layout: the fields a live table and its skeleton agree on. */
|
|
4
|
+
export declare function scriptsColumnMeta(column: ScriptsTableColumnLayout): {
|
|
5
|
+
width: string;
|
|
6
|
+
hideAt: "md" | "lg" | "xl" | "2xl" | undefined;
|
|
7
|
+
align: "right" | undefined;
|
|
8
|
+
sortable: boolean | undefined;
|
|
9
|
+
alwaysShowHeader: boolean | undefined;
|
|
10
|
+
};
|
|
11
|
+
/** The row menu's cell: outside the row's own link. */
|
|
12
|
+
export declare function RowActionsCell({ children }: {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
/** The last cell of a row: its page in a new tab. The row is a link itself, so this opens by script. */
|
|
16
|
+
export declare function OpenInNewTabCell({ href }: {
|
|
17
|
+
href: string;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=scripts-table-shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts-table-shared.d.ts","sourceRoot":"","sources":["../../../../src/components/features/scripts/scripts-table-shared.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAExE,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,wBAAwB;;;;;;EAQjE;AAED,uDAAuD;AACvD,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAMnE;AAED,wGAAwG;AACxG,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAa1D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { openInNewTab } from "../../../utils/open-in-new-tab.js";
|
|
4
|
+
import { ArrowRightUpIcon } from "../../icons-v2-generated/arrows/arrow-right-up-icon.js";
|
|
5
|
+
import { Button } from "../../ui/button/index.js";
|
|
6
|
+
function scriptsColumnMeta(column) {
|
|
7
|
+
return {
|
|
8
|
+
width: column.width,
|
|
9
|
+
hideAt: column.hideAt,
|
|
10
|
+
align: column.align,
|
|
11
|
+
sortable: column.sortable,
|
|
12
|
+
alwaysShowHeader: column.dateFilterable
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function RowActionsCell({ children }) {
|
|
16
|
+
return /* @__PURE__ */ jsx("div", { "data-no-row-click": true, className: "pointer-events-auto flex items-center justify-end gap-2", children });
|
|
17
|
+
}
|
|
18
|
+
function OpenInNewTabCell({ href }) {
|
|
19
|
+
return /* @__PURE__ */ jsx("div", { "data-no-row-click": true, className: "pointer-events-auto flex items-center justify-end", children: /* @__PURE__ */ jsx(
|
|
20
|
+
Button,
|
|
21
|
+
{
|
|
22
|
+
onClick: openInNewTab(href),
|
|
23
|
+
variant: "outline",
|
|
24
|
+
size: "icon",
|
|
25
|
+
leftIcon: /* @__PURE__ */ jsx(ArrowRightUpIcon, { className: "h-5 w-5" }),
|
|
26
|
+
"aria-label": "Open in new tab",
|
|
27
|
+
className: "bg-ods-card"
|
|
28
|
+
}
|
|
29
|
+
) });
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
OpenInNewTabCell,
|
|
33
|
+
RowActionsCell,
|
|
34
|
+
scriptsColumnMeta
|
|
35
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/** One script of the library, as the table shows it. */
|
|
3
|
+
export interface ScriptTableRow {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string | null;
|
|
7
|
+
/** Lowercase shell id (`'powershell'`). */
|
|
8
|
+
shellType: string;
|
|
9
|
+
/** OS ids the script runs on (`'windows'`, `'darwin'`, `'linux'`). */
|
|
10
|
+
supportedPlatforms: string[];
|
|
11
|
+
/** Who added it. Null: nobody is recorded. */
|
|
12
|
+
author?: {
|
|
13
|
+
name: string;
|
|
14
|
+
initials: string;
|
|
15
|
+
image?: string;
|
|
16
|
+
} | null;
|
|
17
|
+
/** The script's page: the row's link and the open-in-new-tab button. */
|
|
18
|
+
href?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ScriptsTableProps {
|
|
21
|
+
rows: ScriptTableRow[];
|
|
22
|
+
isLoading?: boolean;
|
|
23
|
+
/** Column ids to leave out (`'authorId'`, `'supportedPlatforms'`, `'open'`). */
|
|
24
|
+
hideColumns?: readonly string[];
|
|
25
|
+
/** The row menu. Without it the table has no actions column. */
|
|
26
|
+
renderActions?: (row: ScriptTableRow) => ReactNode;
|
|
27
|
+
emptyMessage?: string;
|
|
28
|
+
stickyHeader?: boolean;
|
|
29
|
+
stickyHeaderOffset?: string;
|
|
30
|
+
/** Rendered at the right edge of the header (a row count). */
|
|
31
|
+
rightSlot?: ReactNode;
|
|
32
|
+
skeletonRows?: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The script library as a table: name and description, shell, the operating
|
|
36
|
+
* systems it runs on and who added it. Rows are a view-model the host maps its
|
|
37
|
+
* own scripts into.
|
|
38
|
+
*/
|
|
39
|
+
export declare function ScriptsTable({ rows, isLoading, hideColumns, renderActions, emptyMessage, stickyHeader, stickyHeaderOffset, rightSlot, skeletonRows, }: ScriptsTableProps): import("react").JSX.Element;
|
|
40
|
+
//# sourceMappingURL=scripts-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts-table.d.ts","sourceRoot":"","sources":["../../../../src/components/features/scripts/scripts-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;AAU7D,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,8CAA8C;IAC9C,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACnE,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gFAAgF;IAChF,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,gEAAgE;IAChE,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,SAAS,CAAC;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8DAA8D;IAC9D,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,SAAiB,EACjB,WAAW,EACX,aAAa,EACb,YAAkC,EAClC,YAAoB,EACpB,kBAAkB,EAClB,SAAS,EACT,YAAiB,GAClB,EAAE,iBAAiB,+BAgEnB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useMemo } from "react";
|
|
4
|
+
import { DataTable, useDataTable } from "../../ui/data-table/index.js";
|
|
5
|
+
import { SquareAvatar } from "../../ui/square-avatar.js";
|
|
6
|
+
import { TruncateText } from "../../ui/truncate-text.js";
|
|
7
|
+
import { OSTypeBadgeGroup } from "../os-type-badge-group.js";
|
|
8
|
+
import { ScriptNameCell } from "./script-cells.js";
|
|
9
|
+
import { ScriptShellBadge } from "./script-shell-badge.js";
|
|
10
|
+
import { SCRIPT_COLUMNS } from "./scripts-table-columns.js";
|
|
11
|
+
import { OpenInNewTabCell, RowActionsCell, scriptsColumnMeta } from "./scripts-table-shared.js";
|
|
12
|
+
const BADGE_ICON = "h-4 w-4 content-md:h-6 content-md:w-6";
|
|
13
|
+
function ScriptsTable({
|
|
14
|
+
rows,
|
|
15
|
+
isLoading = false,
|
|
16
|
+
hideColumns,
|
|
17
|
+
renderActions,
|
|
18
|
+
emptyMessage = "No scripts found.",
|
|
19
|
+
stickyHeader = false,
|
|
20
|
+
stickyHeaderOffset,
|
|
21
|
+
rightSlot,
|
|
22
|
+
skeletonRows = 10
|
|
23
|
+
}) {
|
|
24
|
+
const columns = useMemo(() => {
|
|
25
|
+
const cell = (layout, render) => ({
|
|
26
|
+
id: layout.id,
|
|
27
|
+
header: layout.header ?? "",
|
|
28
|
+
cell: ({ row }) => render(row.original),
|
|
29
|
+
enableSorting: false,
|
|
30
|
+
meta: scriptsColumnMeta(layout)
|
|
31
|
+
});
|
|
32
|
+
const all = [
|
|
33
|
+
cell(SCRIPT_COLUMNS.name, (row) => /* @__PURE__ */ jsx(ScriptNameCell, { name: row.name, description: row.description })),
|
|
34
|
+
cell(SCRIPT_COLUMNS.shellType, (row) => /* @__PURE__ */ jsx(ScriptShellBadge, { value: row.shellType, iconClassName: BADGE_ICON })),
|
|
35
|
+
cell(SCRIPT_COLUMNS.supportedPlatforms, (row) => /* @__PURE__ */ jsx(OSTypeBadgeGroup, { osTypes: row.supportedPlatforms, iconSize: "w-4 h-4 content-md:w-6 content-md:h-6" })),
|
|
36
|
+
cell(
|
|
37
|
+
SCRIPT_COLUMNS.authorId,
|
|
38
|
+
(row) => row.author ? /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
39
|
+
/* @__PURE__ */ jsx(
|
|
40
|
+
SquareAvatar,
|
|
41
|
+
{
|
|
42
|
+
variant: "round",
|
|
43
|
+
size: "sm",
|
|
44
|
+
src: row.author.image,
|
|
45
|
+
fallback: row.author.initials,
|
|
46
|
+
alt: row.author.name,
|
|
47
|
+
initialsClassName: "text-ods-text-secondary"
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx(TruncateText, { children: row.author.name }) })
|
|
51
|
+
] }) : null
|
|
52
|
+
)
|
|
53
|
+
];
|
|
54
|
+
if (renderActions) {
|
|
55
|
+
all.push(cell(SCRIPT_COLUMNS.actions, (row) => /* @__PURE__ */ jsx(RowActionsCell, { children: renderActions(row) })));
|
|
56
|
+
}
|
|
57
|
+
all.push(cell(SCRIPT_COLUMNS.open, (row) => row.href ? /* @__PURE__ */ jsx(OpenInNewTabCell, { href: row.href }) : null));
|
|
58
|
+
return hideColumns ? all.filter((column) => !hideColumns.includes(column.id ?? "")) : all;
|
|
59
|
+
}, [hideColumns, renderActions]);
|
|
60
|
+
const table = useDataTable({
|
|
61
|
+
data: rows,
|
|
62
|
+
columns,
|
|
63
|
+
getRowId: (row) => row.id,
|
|
64
|
+
enableSorting: false
|
|
65
|
+
});
|
|
66
|
+
const rowHref = useCallback((row) => row.href, []);
|
|
67
|
+
const showHeader = isLoading || rows.length > 0;
|
|
68
|
+
return /* @__PURE__ */ jsxs(DataTable, { table, children: [
|
|
69
|
+
showHeader && /* @__PURE__ */ jsx(DataTable.Header, { stickyHeader, stickyHeaderOffset, rightSlot }),
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
DataTable.Body,
|
|
72
|
+
{
|
|
73
|
+
loading: isLoading,
|
|
74
|
+
skeletonRows,
|
|
75
|
+
emptyMessage,
|
|
76
|
+
rowClassName: "mb-1",
|
|
77
|
+
rowHref
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
ScriptsTable
|
|
84
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts-tabs.d.ts","sourceRoot":"","sources":["../../../../src/components/features/scripts/scripts-tabs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,WAAW,CAAC;AAEhD,mEAAmE;AACnE,eAAO,MAAM,YAAY,EAAE,OAAO,EAGjC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { BracketCurlyIcon } from "../../icons-v2-generated/coding/bracket-curly-icon.js";
|
|
3
|
+
import { TimerIcon } from "../../icons-v2-generated/date-and-time/timer-icon.js";
|
|
4
|
+
const SCRIPTS_TABS = [
|
|
5
|
+
{ id: "list", label: "Scripts List", icon: BracketCurlyIcon },
|
|
6
|
+
{ id: "schedules", label: "Scripts Schedules", icon: TimerIcon }
|
|
7
|
+
];
|
|
8
|
+
export {
|
|
9
|
+
SCRIPTS_TABS
|
|
10
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ShellTypeDefinition } from '../../../types/shell.types';
|
|
2
|
+
/**
|
|
3
|
+
* The shells the product's Scripts pages offer, as they are shown there: the
|
|
4
|
+
* `CMD` label (not "Batch"), the v2 icons and a grey PowerShell glyph. The
|
|
5
|
+
* wider `SHELL_TYPES` list of `types/shell.types` is every shell the agent can
|
|
6
|
+
* run; this one is what a person picks from.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SCRIPT_SHELL_TYPES: ShellTypeDefinition[];
|
|
9
|
+
/** The shell with this lowercase id (`'cmd'`). */
|
|
10
|
+
export declare function scriptShellType(value: string): ShellTypeDefinition | undefined;
|
|
11
|
+
/** The label of a lowercase shell id, else the id itself. */
|
|
12
|
+
export declare function scriptShellLabel(value: string): string;
|
|
13
|
+
//# sourceMappingURL=shell-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-types.d.ts","sourceRoot":"","sources":["../../../../src/components/features/scripts/shell-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAmB,MAAM,4BAA4B,CAAC;AAKvF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,mBAAmB,EAInD,CAAC;AAEF,kDAAkD;AAClD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAE9E;AAED,6DAA6D;AAC7D,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ShellTypeValues } from "../../../types/shell.types.js";
|
|
3
|
+
import { PowershellLogoGreyIcon } from "../../icons-v2-generated/brand-logos/powershell-logo-grey-icon.js";
|
|
4
|
+
import { TerminalIcon } from "../../icons-v2-generated/coding/terminal-icon.js";
|
|
5
|
+
import { TerminalSquareIcon } from "../../icons-v2-generated/coding/terminal-square-icon.js";
|
|
6
|
+
const SCRIPT_SHELL_TYPES = [
|
|
7
|
+
{ id: ShellTypeValues.POWERSHELL, label: "PowerShell", value: "powershell", icon: PowershellLogoGreyIcon },
|
|
8
|
+
{ id: ShellTypeValues.CMD, label: "CMD", value: "cmd", icon: TerminalSquareIcon },
|
|
9
|
+
{ id: ShellTypeValues.BASH, label: "Bash", value: "bash", icon: TerminalIcon }
|
|
10
|
+
];
|
|
11
|
+
function scriptShellType(value) {
|
|
12
|
+
return SCRIPT_SHELL_TYPES.find((shell) => shell.value === value);
|
|
13
|
+
}
|
|
14
|
+
function scriptShellLabel(value) {
|
|
15
|
+
return scriptShellType(value)?.label ?? value;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
SCRIPT_SHELL_TYPES,
|
|
19
|
+
scriptShellLabel,
|
|
20
|
+
scriptShellType
|
|
21
|
+
};
|