@sparkelf/dsh-dataops-managed 0.3.30 → 0.3.32
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/lib/client.js +543 -200
- package/lib/client.js.map +1 -1
- package/lib/index.js +113 -4
- package/lib/types/client/ResourceCatalogSidebar.d.ts +17 -0
- package/lib/types/client/ResourceListPanel.d.ts +40 -0
- package/lib/types/client/ResourceTabIcon.d.ts +11 -0
- package/lib/types/client/locales.d.ts +2 -0
- package/lib/types/client/review-client.d.ts +8 -6
- package/lib/types/client/review-types.d.ts +20 -0
- package/lib/types/resource-management-api.d.ts +2 -5
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -24,9 +24,42 @@ window.__ModuleLoader__.load({
|
|
|
24
24
|
return target;
|
|
25
25
|
};
|
|
26
26
|
//#endregion
|
|
27
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
27
28
|
let react = require("react");
|
|
28
29
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
29
|
-
|
|
30
|
+
//#region src/client/ResourceTabIcon.tsx
|
|
31
|
+
/**
|
|
32
|
+
* 「数据资源」tab 的图标。
|
|
33
|
+
*
|
|
34
|
+
* 以**组件函数**形式提供:sidebar 的 tab 图标契约是
|
|
35
|
+
* `typeof descriptor.icon === 'function' ? descriptor.icon(14) : descriptor.icon`,
|
|
36
|
+
* 传函数可以让 sidebar 自己决定尺寸。用 JSX 而不是 createElement,是为了和同仓
|
|
37
|
+
* 其它插件走同一套 React 运行时(跨运行时创建的元素不会被渲染)。
|
|
38
|
+
*/
|
|
39
|
+
function ResourceTabIcon({ size = 14 }) {
|
|
40
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
41
|
+
width: size,
|
|
42
|
+
height: size,
|
|
43
|
+
viewBox: "0 0 24 24",
|
|
44
|
+
fill: "none",
|
|
45
|
+
stroke: "currentColor",
|
|
46
|
+
strokeWidth: 1.8,
|
|
47
|
+
strokeLinecap: "round",
|
|
48
|
+
strokeLinejoin: "round",
|
|
49
|
+
"aria-hidden": "true",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ellipse", {
|
|
52
|
+
cx: "12",
|
|
53
|
+
cy: "5.5",
|
|
54
|
+
rx: "7.5",
|
|
55
|
+
ry: "3"
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4.5 5.5v6c0 1.7 3.4 3 7.5 3s7.5-1.3 7.5-3v-6" }),
|
|
58
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4.5 11.5v6c0 1.7 3.4 3 7.5 3s7.5-1.3 7.5-3v-6" })
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
30
63
|
//#region src/client/brand-store.ts
|
|
31
64
|
/** Stable local preference key shared by Settings and brand-slot registration. */
|
|
32
65
|
const WANXIANG_BRAND_PREFERENCE_KEY = "dsh.dataops.wanxiangBrand";
|
|
@@ -464,6 +497,15 @@ window.__ModuleLoader__.load({
|
|
|
464
497
|
}]
|
|
465
498
|
}],
|
|
466
499
|
resources: [
|
|
500
|
+
{
|
|
501
|
+
kind: "builtin",
|
|
502
|
+
id: 1,
|
|
503
|
+
name: "Word 技能",
|
|
504
|
+
ownerName: "平台内置",
|
|
505
|
+
departmentCode: null,
|
|
506
|
+
visibility: "unshared",
|
|
507
|
+
reviewStatus: "unshared"
|
|
508
|
+
},
|
|
467
509
|
{
|
|
468
510
|
kind: "skill",
|
|
469
511
|
id: 9101,
|
|
@@ -747,22 +789,22 @@ window.__ModuleLoader__.load({
|
|
|
747
789
|
document.head.appendChild(tag);
|
|
748
790
|
}
|
|
749
791
|
var ManagedDataOpsSection_module_css_default = {
|
|
750
|
-
"
|
|
792
|
+
"fields": "_2dqzjG_fields",
|
|
793
|
+
"row": "_2dqzjG_row",
|
|
794
|
+
"copy": "_2dqzjG_copy",
|
|
795
|
+
"actions": "_2dqzjG_actions",
|
|
751
796
|
"meta": "_2dqzjG_meta",
|
|
797
|
+
"reviewRows": "_2dqzjG_reviewRows",
|
|
798
|
+
"heading": "_2dqzjG_heading",
|
|
799
|
+
"section": "_2dqzjG_section",
|
|
752
800
|
"card": "_2dqzjG_card",
|
|
753
|
-
"reviewHint": "_2dqzjG_reviewHint",
|
|
754
|
-
"reviewRow": "_2dqzjG_reviewRow",
|
|
755
|
-
"label": "_2dqzjG_label",
|
|
756
801
|
"refusal": "_2dqzjG_refusal",
|
|
757
|
-
"
|
|
758
|
-
"copy": "_2dqzjG_copy",
|
|
759
|
-
"reviewRows": "_2dqzjG_reviewRows",
|
|
760
|
-
"actions": "_2dqzjG_actions",
|
|
761
|
-
"fields": "_2dqzjG_fields",
|
|
762
|
-
"status": "_2dqzjG_status",
|
|
802
|
+
"reviewRow": "_2dqzjG_reviewRow",
|
|
763
803
|
"reviewActions": "_2dqzjG_reviewActions",
|
|
764
804
|
"title": "_2dqzjG_title",
|
|
765
|
-
"
|
|
805
|
+
"status": "_2dqzjG_status",
|
|
806
|
+
"reviewHint": "_2dqzjG_reviewHint",
|
|
807
|
+
"label": "_2dqzjG_label"
|
|
766
808
|
};
|
|
767
809
|
//#endregion
|
|
768
810
|
//#region src/client/ReviewSettingsCard.tsx
|
|
@@ -1309,6 +1351,32 @@ window.__ModuleLoader__.load({
|
|
|
1309
1351
|
function normalizeVisibility(value) {
|
|
1310
1352
|
return value === "department" || value === "private" ? value : "global";
|
|
1311
1353
|
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Whether this actor may edit one resource-scope row.
|
|
1356
|
+
*
|
|
1357
|
+
* Mirrors the backend policy: built-in skills are super-administrator only, global skills
|
|
1358
|
+
* belong to administrators, and a department administrator edits department rows in their
|
|
1359
|
+
* subtree (the list itself is already narrowed to that subtree).
|
|
1360
|
+
* @param subject - the row's kind and current scope.
|
|
1361
|
+
* @param actorRole - the caller's portal role.
|
|
1362
|
+
* @returns the decision and, when denied, the reason shown on the disabled control.
|
|
1363
|
+
*/
|
|
1364
|
+
function canEditResourceScopeRow(subject, actorRole) {
|
|
1365
|
+
if (subject.kind === "builtin") return actorRole === "SUPER_ADMIN" ? { allowed: true } : {
|
|
1366
|
+
allowed: false,
|
|
1367
|
+
reason: "只有超级管理员可以修改内置技能的可见范围。"
|
|
1368
|
+
};
|
|
1369
|
+
if (actorRole === "SUPER_ADMIN" || actorRole === "ADMIN") return { allowed: true };
|
|
1370
|
+
if (actorRole !== "DEPT_ADMIN") return {
|
|
1371
|
+
allowed: false,
|
|
1372
|
+
reason: "没有修改资源范围的权限。"
|
|
1373
|
+
};
|
|
1374
|
+
if (subject.visibility !== "department" || subject.departmentCode === null || subject.departmentCode === void 0) return {
|
|
1375
|
+
allowed: false,
|
|
1376
|
+
reason: "部门管理员只能修改本部门的技能。"
|
|
1377
|
+
};
|
|
1378
|
+
return { allowed: true };
|
|
1379
|
+
}
|
|
1312
1380
|
/** Whether the caller may see and act on the review queue. */
|
|
1313
1381
|
function canReview(context) {
|
|
1314
1382
|
if (context === null || context === void 0) return false;
|
|
@@ -1617,24 +1685,24 @@ window.__ModuleLoader__.load({
|
|
|
1617
1685
|
document.head.appendChild(tag);
|
|
1618
1686
|
}
|
|
1619
1687
|
var NotificationBell_module_css_default = {
|
|
1620
|
-
"rowMeta": "tE0trG_rowMeta",
|
|
1621
|
-
"rowIcon": "tE0trG_rowIcon",
|
|
1622
|
-
"rowBody": "tE0trG_rowBody",
|
|
1623
|
-
"demo": "tE0trG_demo",
|
|
1624
1688
|
"linkButton": "tE0trG_linkButton",
|
|
1689
|
+
"dot": "tE0trG_dot",
|
|
1690
|
+
"rowBody": "tE0trG_rowBody",
|
|
1691
|
+
"button": "tE0trG_button",
|
|
1692
|
+
"actions": "tE0trG_actions",
|
|
1693
|
+
"dialog": "tE0trG_dialog",
|
|
1625
1694
|
"pager": "tE0trG_pager",
|
|
1626
|
-
"badge": "tE0trG_badge",
|
|
1627
|
-
"rowTitle": "tE0trG_rowTitle",
|
|
1628
|
-
"bell": "tE0trG_bell",
|
|
1629
|
-
"list": "tE0trG_list",
|
|
1630
1695
|
"rowTime": "tE0trG_rowTime",
|
|
1696
|
+
"rowMeta": "tE0trG_rowMeta",
|
|
1697
|
+
"demo": "tE0trG_demo",
|
|
1631
1698
|
"rowText": "tE0trG_rowText",
|
|
1632
|
-
"
|
|
1633
|
-
"
|
|
1634
|
-
"
|
|
1699
|
+
"bell": "tE0trG_bell",
|
|
1700
|
+
"list": "tE0trG_list",
|
|
1701
|
+
"rowTitle": "tE0trG_rowTitle",
|
|
1702
|
+
"rowIcon": "tE0trG_rowIcon",
|
|
1635
1703
|
"row": "tE0trG_row",
|
|
1636
|
-
"
|
|
1637
|
-
"
|
|
1704
|
+
"empty": "tE0trG_empty",
|
|
1705
|
+
"badge": "tE0trG_badge"
|
|
1638
1706
|
};
|
|
1639
1707
|
//#endregion
|
|
1640
1708
|
//#region src/client/NotificationBell.tsx
|
|
@@ -1925,62 +1993,62 @@ window.__ModuleLoader__.load({
|
|
|
1925
1993
|
document.head.appendChild(tag);
|
|
1926
1994
|
}
|
|
1927
1995
|
var SkillPlazaSection_module_css_default = {
|
|
1928
|
-
"
|
|
1996
|
+
"rejectedTag": "_9FdZvq_rejectedTag",
|
|
1997
|
+
"title": "_9FdZvq_title",
|
|
1998
|
+
"cardTitle": "_9FdZvq_cardTitle",
|
|
1929
1999
|
"empty": "_9FdZvq_empty",
|
|
1930
|
-
"dialog": "_9FdZvq_dialog",
|
|
1931
|
-
"riskSummary": "_9FdZvq_riskSummary",
|
|
1932
|
-
"finding": "_9FdZvq_finding",
|
|
1933
|
-
"tab": "_9FdZvq_tab",
|
|
1934
|
-
"notice": "_9FdZvq_notice",
|
|
1935
|
-
"auditDialog": "_9FdZvq_auditDialog",
|
|
1936
|
-
"head": "_9FdZvq_head",
|
|
1937
|
-
"status": "_9FdZvq_status",
|
|
1938
|
-
"riskScore": "_9FdZvq_riskScore",
|
|
1939
|
-
"detailRow": "_9FdZvq_detailRow",
|
|
1940
|
-
"tabs": "_9FdZvq_tabs",
|
|
1941
|
-
"departmentBar": "_9FdZvq_departmentBar",
|
|
1942
|
-
"detailValue": "_9FdZvq_detailValue",
|
|
1943
2000
|
"tagTop": "_9FdZvq_tagTop",
|
|
1944
|
-
"
|
|
2001
|
+
"auditFooter": "_9FdZvq_auditFooter",
|
|
2002
|
+
"risk": "_9FdZvq_risk",
|
|
2003
|
+
"tabCount": "_9FdZvq_tabCount",
|
|
1945
2004
|
"riskFailed": "_9FdZvq_riskFailed",
|
|
1946
|
-
"findingHint": "_9FdZvq_findingHint",
|
|
1947
|
-
"cards": "_9FdZvq_cards",
|
|
1948
|
-
"titleCount": "_9FdZvq_titleCount",
|
|
1949
|
-
"tabActive": "_9FdZvq_tabActive",
|
|
1950
|
-
"departmentLabel": "_9FdZvq_departmentLabel",
|
|
1951
|
-
"severity": "_9FdZvq_severity",
|
|
1952
|
-
"cardMarks": "_9FdZvq_cardMarks",
|
|
1953
|
-
"reviewError": "_9FdZvq_reviewError",
|
|
1954
|
-
"cardDesc": "_9FdZvq_cardDesc",
|
|
1955
|
-
"mark": "_9FdZvq_mark",
|
|
1956
|
-
"cardTitle": "_9FdZvq_cardTitle",
|
|
1957
|
-
"demoTag": "_9FdZvq_demoTag",
|
|
1958
2005
|
"sharedTag": "_9FdZvq_sharedTag",
|
|
2006
|
+
"riskScore": "_9FdZvq_riskScore",
|
|
2007
|
+
"findings": "_9FdZvq_findings",
|
|
2008
|
+
"noteField": "_9FdZvq_noteField",
|
|
2009
|
+
"cardTop": "_9FdZvq_cardTop",
|
|
2010
|
+
"mine": "_9FdZvq_mine",
|
|
2011
|
+
"card": "_9FdZvq_card",
|
|
1959
2012
|
"cardEnd": "_9FdZvq_cardEnd",
|
|
1960
|
-
"
|
|
1961
|
-
"tabCount": "_9FdZvq_tabCount",
|
|
1962
|
-
"audit": "_9FdZvq_audit",
|
|
1963
|
-
"cardIcon": "_9FdZvq_cardIcon",
|
|
1964
|
-
"detail": "_9FdZvq_detail",
|
|
1965
|
-
"auditFooter": "_9FdZvq_auditFooter",
|
|
1966
|
-
"section": "_9FdZvq_section",
|
|
1967
|
-
"detailLabel": "_9FdZvq_detailLabel",
|
|
1968
|
-
"emptyText": "_9FdZvq_emptyText",
|
|
2013
|
+
"reviewButton": "_9FdZvq_reviewButton",
|
|
1969
2014
|
"findingText": "_9FdZvq_findingText",
|
|
2015
|
+
"section": "_9FdZvq_section",
|
|
2016
|
+
"cardDesc": "_9FdZvq_cardDesc",
|
|
2017
|
+
"cardMarks": "_9FdZvq_cardMarks",
|
|
1970
2018
|
"riskHead": "_9FdZvq_riskHead",
|
|
1971
|
-
"
|
|
1972
|
-
"
|
|
1973
|
-
"
|
|
2019
|
+
"findingHint": "_9FdZvq_findingHint",
|
|
2020
|
+
"departmentLabel": "_9FdZvq_departmentLabel",
|
|
2021
|
+
"emptyText": "_9FdZvq_emptyText",
|
|
2022
|
+
"mark": "_9FdZvq_mark",
|
|
2023
|
+
"auditDialog": "_9FdZvq_auditDialog",
|
|
1974
2024
|
"riskEmpty": "_9FdZvq_riskEmpty",
|
|
1975
|
-
"
|
|
1976
|
-
"
|
|
1977
|
-
"
|
|
2025
|
+
"reviewNote": "_9FdZvq_reviewNote",
|
|
2026
|
+
"reviewError": "_9FdZvq_reviewError",
|
|
2027
|
+
"tabActive": "_9FdZvq_tabActive",
|
|
2028
|
+
"cards": "_9FdZvq_cards",
|
|
2029
|
+
"finding": "_9FdZvq_finding",
|
|
1978
2030
|
"detailButton": "_9FdZvq_detailButton",
|
|
1979
|
-
"
|
|
1980
|
-
"
|
|
1981
|
-
"
|
|
2031
|
+
"demoTag": "_9FdZvq_demoTag",
|
|
2032
|
+
"riskSummary": "_9FdZvq_riskSummary",
|
|
2033
|
+
"notice": "_9FdZvq_notice",
|
|
2034
|
+
"detail": "_9FdZvq_detail",
|
|
2035
|
+
"detailValue": "_9FdZvq_detailValue",
|
|
2036
|
+
"severity": "_9FdZvq_severity",
|
|
2037
|
+
"pendingTag": "_9FdZvq_pendingTag",
|
|
1982
2038
|
"departmentSelect": "_9FdZvq_departmentSelect",
|
|
1983
|
-
"
|
|
2039
|
+
"emptyIcon": "_9FdZvq_emptyIcon",
|
|
2040
|
+
"departmentBar": "_9FdZvq_departmentBar",
|
|
2041
|
+
"dialog": "_9FdZvq_dialog",
|
|
2042
|
+
"status": "_9FdZvq_status",
|
|
2043
|
+
"cardIcon": "_9FdZvq_cardIcon",
|
|
2044
|
+
"detailRow": "_9FdZvq_detailRow",
|
|
2045
|
+
"titleCount": "_9FdZvq_titleCount",
|
|
2046
|
+
"tab": "_9FdZvq_tab",
|
|
2047
|
+
"audit": "_9FdZvq_audit",
|
|
2048
|
+
"head": "_9FdZvq_head",
|
|
2049
|
+
"headRow": "_9FdZvq_headRow",
|
|
2050
|
+
"detailLabel": "_9FdZvq_detailLabel",
|
|
2051
|
+
"tabs": "_9FdZvq_tabs"
|
|
1984
2052
|
};
|
|
1985
2053
|
//#endregion
|
|
1986
2054
|
//#region src/client/SkillPlazaSection.tsx
|
|
@@ -2645,19 +2713,19 @@ window.__ModuleLoader__.load({
|
|
|
2645
2713
|
document.head.appendChild(tag);
|
|
2646
2714
|
}
|
|
2647
2715
|
var WanxiangBrand_module_css_default = {
|
|
2648
|
-
"
|
|
2716
|
+
"unitCore": "s0HPxG_unitCore",
|
|
2717
|
+
"mark": "s0HPxG_mark",
|
|
2718
|
+
"unit-top": "s0HPxG_unit-top",
|
|
2649
2719
|
"sidebarName": "s0HPxG_sidebarName",
|
|
2650
|
-
"wordmark": "s0HPxG_wordmark",
|
|
2651
2720
|
"unit-right": "s0HPxG_unit-right",
|
|
2721
|
+
"wordmark": "s0HPxG_wordmark",
|
|
2722
|
+
"animatedMark": "s0HPxG_animatedMark",
|
|
2723
|
+
"unit-core": "s0HPxG_unit-core",
|
|
2652
2724
|
"unitTop": "s0HPxG_unitTop",
|
|
2653
2725
|
"harness": "s0HPxG_harness",
|
|
2654
|
-
"unitCore": "s0HPxG_unitCore",
|
|
2655
|
-
"unitRight": "s0HPxG_unitRight",
|
|
2656
|
-
"unit-core": "s0HPxG_unit-core",
|
|
2657
|
-
"unitLeft": "s0HPxG_unitLeft",
|
|
2658
2726
|
"unit-left": "s0HPxG_unit-left",
|
|
2659
|
-
"
|
|
2660
|
-
"
|
|
2727
|
+
"unitRight": "s0HPxG_unitRight",
|
|
2728
|
+
"unitLeft": "s0HPxG_unitLeft"
|
|
2661
2729
|
};
|
|
2662
2730
|
//#endregion
|
|
2663
2731
|
//#region src/client/WanxiangBrand.tsx
|
|
@@ -3074,72 +3142,72 @@ window.__ModuleLoader__.load({
|
|
|
3074
3142
|
document.head.appendChild(tag);
|
|
3075
3143
|
}
|
|
3076
3144
|
var PermissionCenterSection_module_css_default = {
|
|
3077
|
-
"
|
|
3078
|
-
"
|
|
3079
|
-
"
|
|
3145
|
+
"matrix": "PNbOqW_matrix",
|
|
3146
|
+
"treeName": "PNbOqW_treeName",
|
|
3147
|
+
"candidate": "PNbOqW_candidate",
|
|
3148
|
+
"protected": "PNbOqW_protected",
|
|
3149
|
+
"field": "PNbOqW_field",
|
|
3150
|
+
"tabs": "PNbOqW_tabs",
|
|
3151
|
+
"matrixScroll": "PNbOqW_matrixScroll",
|
|
3152
|
+
"comboboxOption": "PNbOqW_comboboxOption",
|
|
3153
|
+
"dialogBody": "PNbOqW_dialogBody",
|
|
3154
|
+
"matrixModule": "PNbOqW_matrixModule",
|
|
3155
|
+
"dialog": "PNbOqW_dialog",
|
|
3080
3156
|
"candidates": "PNbOqW_candidates",
|
|
3157
|
+
"detailGrid": "PNbOqW_detailGrid",
|
|
3158
|
+
"comboboxSearch": "PNbOqW_comboboxSearch",
|
|
3081
3159
|
"rowActions": "PNbOqW_rowActions",
|
|
3082
|
-
"
|
|
3083
|
-
"
|
|
3160
|
+
"treeActions": "PNbOqW_treeActions",
|
|
3161
|
+
"combobox": "PNbOqW_combobox",
|
|
3162
|
+
"treeRoot": "PNbOqW_treeRoot",
|
|
3084
3163
|
"comboboxTrigger": "PNbOqW_comboboxTrigger",
|
|
3085
|
-
"
|
|
3164
|
+
"comboboxPlaceholder": "PNbOqW_comboboxPlaceholder",
|
|
3086
3165
|
"demo": "PNbOqW_demo",
|
|
3087
|
-
"
|
|
3088
|
-
"
|
|
3089
|
-
"
|
|
3090
|
-
"
|
|
3166
|
+
"empty": "PNbOqW_empty",
|
|
3167
|
+
"dialogHint": "PNbOqW_dialogHint",
|
|
3168
|
+
"page": "PNbOqW_page",
|
|
3169
|
+
"notice": "PNbOqW_notice",
|
|
3170
|
+
"sectionTitle": "PNbOqW_sectionTitle",
|
|
3171
|
+
"readOnly": "PNbOqW_readOnly",
|
|
3172
|
+
"departments": "PNbOqW_departments",
|
|
3173
|
+
"adminTag": "PNbOqW_adminTag",
|
|
3174
|
+
"pager": "PNbOqW_pager",
|
|
3175
|
+
"subtitle": "PNbOqW_subtitle",
|
|
3176
|
+
"deptAdmins": "PNbOqW_deptAdmins",
|
|
3177
|
+
"title": "PNbOqW_title",
|
|
3178
|
+
"matrixPermission": "PNbOqW_matrixPermission",
|
|
3179
|
+
"comboboxList": "PNbOqW_comboboxList",
|
|
3180
|
+
"treeToggle": "PNbOqW_treeToggle",
|
|
3181
|
+
"comboboxEmpty": "PNbOqW_comboboxEmpty",
|
|
3182
|
+
"treeChildren": "PNbOqW_treeChildren",
|
|
3183
|
+
"scopeBadge": "PNbOqW_scopeBadge",
|
|
3184
|
+
"panelFoot": "PNbOqW_panelFoot",
|
|
3185
|
+
"comboboxCheck": "PNbOqW_comboboxCheck",
|
|
3186
|
+
"onlyAdmin": "PNbOqW_onlyAdmin",
|
|
3187
|
+
"head": "PNbOqW_head",
|
|
3188
|
+
"search": "PNbOqW_search",
|
|
3189
|
+
"matrixNote": "PNbOqW_matrixNote",
|
|
3091
3190
|
"comboboxOptionActive": "PNbOqW_comboboxOptionActive",
|
|
3191
|
+
"panelHead": "PNbOqW_panelHead",
|
|
3192
|
+
"error": "PNbOqW_error",
|
|
3092
3193
|
"department": "PNbOqW_department",
|
|
3194
|
+
"comboboxHint": "PNbOqW_comboboxHint",
|
|
3195
|
+
"matrixGroup": "PNbOqW_matrixGroup",
|
|
3093
3196
|
"permission": "PNbOqW_permission",
|
|
3094
|
-
"
|
|
3095
|
-
"
|
|
3096
|
-
"
|
|
3097
|
-
"permDescription": "PNbOqW_permDescription",
|
|
3098
|
-
"matrixModule": "PNbOqW_matrixModule",
|
|
3197
|
+
"dialogFooter": "PNbOqW_dialogFooter",
|
|
3198
|
+
"tab": "PNbOqW_tab",
|
|
3199
|
+
"treeSpacer": "PNbOqW_treeSpacer",
|
|
3099
3200
|
"tableScroll": "PNbOqW_tableScroll",
|
|
3100
|
-
"comboboxPlaceholder": "PNbOqW_comboboxPlaceholder",
|
|
3101
3201
|
"permCopy": "PNbOqW_permCopy",
|
|
3102
|
-
"
|
|
3103
|
-
"treeName": "PNbOqW_treeName",
|
|
3104
|
-
"head": "PNbOqW_head",
|
|
3105
|
-
"panelFoot": "PNbOqW_panelFoot",
|
|
3106
|
-
"panelHead": "PNbOqW_panelHead",
|
|
3107
|
-
"field": "PNbOqW_field",
|
|
3108
|
-
"matrixPermission": "PNbOqW_matrixPermission",
|
|
3109
|
-
"departments": "PNbOqW_departments",
|
|
3110
|
-
"readOnly": "PNbOqW_readOnly",
|
|
3111
|
-
"candidate": "PNbOqW_candidate",
|
|
3112
|
-
"treeToggle": "PNbOqW_treeToggle",
|
|
3113
|
-
"adminTag": "PNbOqW_adminTag",
|
|
3114
|
-
"onlyAdmin": "PNbOqW_onlyAdmin",
|
|
3115
|
-
"dialogBody": "PNbOqW_dialogBody",
|
|
3116
|
-
"comboboxMenu": "PNbOqW_comboboxMenu",
|
|
3117
|
-
"matrixScroll": "PNbOqW_matrixScroll",
|
|
3202
|
+
"tabActive": "PNbOqW_tabActive",
|
|
3118
3203
|
"table": "PNbOqW_table",
|
|
3119
|
-
"notice": "PNbOqW_notice",
|
|
3120
|
-
"page": "PNbOqW_page",
|
|
3121
3204
|
"waiting": "PNbOqW_waiting",
|
|
3122
|
-
"sectionTitle": "PNbOqW_sectionTitle",
|
|
3123
|
-
"protected": "PNbOqW_protected",
|
|
3124
|
-
"scopeBadge": "PNbOqW_scopeBadge",
|
|
3125
|
-
"treeSpacer": "PNbOqW_treeSpacer",
|
|
3126
3205
|
"treeRow": "PNbOqW_treeRow",
|
|
3127
|
-
"
|
|
3128
|
-
"matrixGroup": "PNbOqW_matrixGroup",
|
|
3129
|
-
"tabActive": "PNbOqW_tabActive",
|
|
3130
|
-
"panel": "PNbOqW_panel",
|
|
3131
|
-
"treeRoot": "PNbOqW_treeRoot",
|
|
3132
|
-
"comboboxHint": "PNbOqW_comboboxHint",
|
|
3206
|
+
"comboboxMenu": "PNbOqW_comboboxMenu",
|
|
3133
3207
|
"copied": "PNbOqW_copied",
|
|
3134
|
-
"
|
|
3135
|
-
"
|
|
3136
|
-
"
|
|
3137
|
-
"detailGrid": "PNbOqW_detailGrid",
|
|
3138
|
-
"title": "PNbOqW_title",
|
|
3139
|
-
"dialog": "PNbOqW_dialog",
|
|
3140
|
-
"comboboxEmpty": "PNbOqW_comboboxEmpty",
|
|
3141
|
-
"tabs": "PNbOqW_tabs",
|
|
3142
|
-
"matrixNote": "PNbOqW_matrixNote"
|
|
3208
|
+
"panel": "PNbOqW_panel",
|
|
3209
|
+
"muted": "PNbOqW_muted",
|
|
3210
|
+
"permDescription": "PNbOqW_permDescription"
|
|
3143
3211
|
};
|
|
3144
3212
|
//#endregion
|
|
3145
3213
|
//#region src/client/combobox.ts
|
|
@@ -3219,6 +3287,7 @@ window.__ModuleLoader__.load({
|
|
|
3219
3287
|
const departmentName = context?.departmentPath?.join(" / ") ?? "—";
|
|
3220
3288
|
const actorRole = context?.role ?? (knownAdmin ? "ADMIN" : "APP_USER");
|
|
3221
3289
|
const writable = context === null ? knownAdmin : canManagePermissions(context) || demo;
|
|
3290
|
+
const resourceWritable = writable || actorRole === "DEPT_ADMIN";
|
|
3222
3291
|
const superAdmin = context === null ? knownAdmin : context.role === "SUPER_ADMIN" || demo;
|
|
3223
3292
|
const canAssignDepartment = writable && (superAdmin || actorRole === "ADMIN");
|
|
3224
3293
|
const labels = [
|
|
@@ -3435,7 +3504,7 @@ window.__ModuleLoader__.load({
|
|
|
3435
3504
|
tab === "resources" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Resources, {
|
|
3436
3505
|
resources: overview.resources,
|
|
3437
3506
|
departments: overview.departments,
|
|
3438
|
-
writable,
|
|
3507
|
+
writable: resourceWritable,
|
|
3439
3508
|
actorRole,
|
|
3440
3509
|
actorDepartmentCode: context?.departmentCode,
|
|
3441
3510
|
busy,
|
|
@@ -4126,8 +4195,9 @@ window.__ModuleLoader__.load({
|
|
|
4126
4195
|
visibility: row.visibility,
|
|
4127
4196
|
departmentCode: row.departmentCode ?? null
|
|
4128
4197
|
};
|
|
4129
|
-
const visibilityLabel = (visibility) => visibility === "global" ? t("permGlobal") : visibility === "department" ? t("permDepartmentScope") : t("permPrivate");
|
|
4130
|
-
const
|
|
4198
|
+
const visibilityLabel = (visibility) => visibility === "global" ? t("permGlobal") : visibility === "department" ? t("permDepartmentScope") : visibility === "unshared" ? t("permUnshared") : t("permPrivate");
|
|
4199
|
+
const typeLabel = (kind) => kind === "builtin" ? t("permResourceBuiltin") : kind === "skill" ? t("permResourceSkill") : t("permResourceWorkflow");
|
|
4200
|
+
const statusLabel = (status) => status === "pending" ? t("permStatusPending") : status === "approved" ? t("permStatusApproved") : status === "rejected" ? t("permStatusRejected") : status === "unshared" ? t("permUnshared") : "—";
|
|
4131
4201
|
const departmentName = (code) => code === null || code === void 0 ? "—" : departments.find((department) => department.code === code)?.name ?? code;
|
|
4132
4202
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4133
4203
|
className: PermissionCenterSection_module_css_default.panel,
|
|
@@ -4146,13 +4216,19 @@ window.__ModuleLoader__.load({
|
|
|
4146
4216
|
] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: visible.map((row) => {
|
|
4147
4217
|
const key = keyOf(row);
|
|
4148
4218
|
const value = valueOf(row);
|
|
4149
|
-
const
|
|
4219
|
+
const edit = canEditResourceScopeRow({
|
|
4220
|
+
kind: row.kind,
|
|
4221
|
+
visibility: row.visibility,
|
|
4222
|
+
departmentCode: row.departmentCode ?? null
|
|
4223
|
+
}, actorRole);
|
|
4224
|
+
const editable = writable && !busy && edit.allowed;
|
|
4225
|
+
const visibilityOptions = row.kind === "builtin" ? actorRole === "SUPER_ADMIN" ? [
|
|
4226
|
+
"unshared",
|
|
4150
4227
|
"global",
|
|
4151
|
-
"department"
|
|
4152
|
-
|
|
4153
|
-
];
|
|
4228
|
+
"department"
|
|
4229
|
+
] : [row.visibility] : actorRole === "DEPT_ADMIN" ? [row.visibility] : ["global", "department"];
|
|
4154
4230
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
|
|
4155
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: row.kind
|
|
4231
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: typeLabel(row.kind) }),
|
|
4156
4232
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: row.name }) }),
|
|
4157
4233
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: ownerDisplay(row.ownerName) }),
|
|
4158
4234
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchCombobox, {
|
|
@@ -4160,7 +4236,7 @@ window.__ModuleLoader__.load({
|
|
|
4160
4236
|
value: value.visibility,
|
|
4161
4237
|
ariaLabel: t("permScope"),
|
|
4162
4238
|
placeholder: t("permSelect"),
|
|
4163
|
-
disabled: !
|
|
4239
|
+
disabled: !editable,
|
|
4164
4240
|
options: visibilityOptions.map((option) => ({
|
|
4165
4241
|
value: option,
|
|
4166
4242
|
label: visibilityLabel(option)
|
|
@@ -4181,7 +4257,7 @@ window.__ModuleLoader__.load({
|
|
|
4181
4257
|
value: value.departmentCode ?? "",
|
|
4182
4258
|
ariaLabel: t("permDepartment"),
|
|
4183
4259
|
placeholder: t("permNone"),
|
|
4184
|
-
disabled: !
|
|
4260
|
+
disabled: !editable || value.visibility !== "department" || actorRole === "DEPT_ADMIN",
|
|
4185
4261
|
options: [{
|
|
4186
4262
|
value: "",
|
|
4187
4263
|
label: t("permNone")
|
|
@@ -4212,7 +4288,8 @@ window.__ModuleLoader__.load({
|
|
|
4212
4288
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
4213
4289
|
variant: "outline",
|
|
4214
4290
|
size: "sm",
|
|
4215
|
-
disabled: !
|
|
4291
|
+
disabled: !editable,
|
|
4292
|
+
title: edit.allowed ? void 0 : edit.reason,
|
|
4216
4293
|
onClick: () => {
|
|
4217
4294
|
setError(null);
|
|
4218
4295
|
if (window.confirm(t("permSave") + "?")) onSave(row, value.visibility, value.departmentCode).then((result) => {
|
|
@@ -4258,7 +4335,7 @@ window.__ModuleLoader__.load({
|
|
|
4258
4335
|
className: PermissionCenterSection_module_css_default.detailGrid,
|
|
4259
4336
|
children: [
|
|
4260
4337
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailType") }),
|
|
4261
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: detail.kind
|
|
4338
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: typeLabel(detail.kind) }),
|
|
4262
4339
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailName") }),
|
|
4263
4340
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: detail.name }),
|
|
4264
4341
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailOwner") }),
|
|
@@ -4568,18 +4645,18 @@ window.__ModuleLoader__.load({
|
|
|
4568
4645
|
document.head.appendChild(tag);
|
|
4569
4646
|
}
|
|
4570
4647
|
var WorkspaceUpgradePrompt_module_css_default = {
|
|
4571
|
-
"error": "razUfG_error",
|
|
4572
4648
|
"sessionPath": "razUfG_sessionPath",
|
|
4573
|
-
"sessionTitle": "razUfG_sessionTitle",
|
|
4574
|
-
"banner": "razUfG_banner",
|
|
4575
|
-
"sessionRow": "razUfG_sessionRow",
|
|
4576
4649
|
"dialogBody": "razUfG_dialogBody",
|
|
4577
|
-
"
|
|
4578
|
-
"
|
|
4650
|
+
"error": "razUfG_error",
|
|
4651
|
+
"copy": "razUfG_copy",
|
|
4579
4652
|
"dialogText": "razUfG_dialogText",
|
|
4580
4653
|
"sessionList": "razUfG_sessionList",
|
|
4654
|
+
"banner": "razUfG_banner",
|
|
4581
4655
|
"title": "razUfG_title",
|
|
4582
|
-
"
|
|
4656
|
+
"body": "razUfG_body",
|
|
4657
|
+
"actions": "razUfG_actions",
|
|
4658
|
+
"sessionRow": "razUfG_sessionRow",
|
|
4659
|
+
"sessionTitle": "razUfG_sessionTitle"
|
|
4583
4660
|
};
|
|
4584
4661
|
//#endregion
|
|
4585
4662
|
//#region src/client/WorkspaceUpgradePrompt.tsx
|
|
@@ -4755,6 +4832,233 @@ window.__ModuleLoader__.load({
|
|
|
4755
4832
|
})] });
|
|
4756
4833
|
}
|
|
4757
4834
|
//#endregion
|
|
4835
|
+
//#region src/client/ResourceCatalogSidebar.tsx
|
|
4836
|
+
/**
|
|
4837
|
+
* The tab's own data-catalog tree (168px): 全部 / 收藏 / 置顶 + one row per catalog.
|
|
4838
|
+
*
|
|
4839
|
+
* The portal page inside the iframe is the product's card list and detail view; the host
|
|
4840
|
+
* sidebar owns the tree and only sends the active filter to that page, so the portal never
|
|
4841
|
+
* renders its own left column in embed mode.
|
|
4842
|
+
*
|
|
4843
|
+
* @module client/ResourceCatalogSidebar
|
|
4844
|
+
*/
|
|
4845
|
+
const CSS = `
|
|
4846
|
+
.dsh-cat{flex:0 0 168px;width:168px;min-width:0;border-right:1px solid var(--dsw-alias-border-l1,#2a2c33);padding:8px 6px;overflow-y:auto;display:flex;flex-direction:column;gap:2px;color:var(--dsw-alias-label-primary,#e6e8ee)}
|
|
4847
|
+
.dsh-cat__head{display:flex;align-items:center;gap:6px;height:34px;padding:0 6px 0 8px;flex:0 0 auto}
|
|
4848
|
+
.dsh-cat__head .ico{width:16px;height:16px;flex:0 0 auto;color:var(--dsw-alias-label-secondary,#aab2c2)}
|
|
4849
|
+
.dsh-cat__head .tt{font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary,#e6e8ee);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
4850
|
+
.dsh-cat__head .sp{flex:1}
|
|
4851
|
+
.dsh-cat__head .collapse{width:22px;height:22px;border:0;border-radius:4px;background:transparent;color:var(--dsw-alias-label-caption,#8b93a4);cursor:pointer;display:grid;place-items:center}
|
|
4852
|
+
.dsh-cat__head .collapse:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.06))}
|
|
4853
|
+
.dsh-cat__search{margin:2px 8px 8px;height:28px;display:flex;align-items:center;gap:6px;padding:0 8px;border-radius:6px;border:1px solid var(--dsw-alias-border-l2,#2c2f38);background:var(--dsw-alias-bg-layer-1,#1a1c21)}
|
|
4854
|
+
.dsh-cat__search input{flex:1;min-width:0;border:0;outline:0;background:transparent;color:var(--dsw-alias-label-primary,#e6e8ee);font-size:12px}
|
|
4855
|
+
.dsh-cat__search input::placeholder{color:var(--dsw-alias-label-caption,#8b93a4)}
|
|
4856
|
+
.dsh-cat__title{margin:8px 6px 3px;font-size:10px;letter-spacing:.04em;color:var(--dsw-alias-label-caption,#8b93a4)}
|
|
4857
|
+
.dsh-cat__item{display:flex;align-items:center;gap:6px;width:100%;height:28px;padding:0 8px;border:0;border-radius:4px;background:transparent;color:var(--dsw-alias-label-secondary,#aab2c2);font-size:12px;text-align:left;cursor:pointer}
|
|
4858
|
+
.dsh-cat__item:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.06))}
|
|
4859
|
+
.dsh-cat__item.is-active{background:var(--dsw-alias-interactive-bg-active,rgba(255,255,255,.10));color:var(--dsw-alias-label-primary,#fff)}
|
|
4860
|
+
.dsh-cat__item .n{margin-left:auto;font-size:10px;color:var(--dsw-alias-label-caption,#8b93a4);font-variant-numeric:tabular-nums}
|
|
4861
|
+
.dsh-cat__item .ico{width:14px;text-align:center;font-size:11px;flex:0 0 auto}
|
|
4862
|
+
`;
|
|
4863
|
+
function ResourceCatalogSidebar({ onFilter }) {
|
|
4864
|
+
const [catalogs, setCatalogs] = (0, react.useState)([]);
|
|
4865
|
+
const [total, setTotal] = (0, react.useState)(0);
|
|
4866
|
+
const [favorites, setFavorites] = (0, react.useState)([]);
|
|
4867
|
+
const [pinned, setPinned] = (0, react.useState)([]);
|
|
4868
|
+
const [favoriteTotal, setFavoriteTotal] = (0, react.useState)(0);
|
|
4869
|
+
const [pinnedTotal, setPinnedTotal] = (0, react.useState)(0);
|
|
4870
|
+
const [active, setActive] = (0, react.useState)("all");
|
|
4871
|
+
const [query, setQuery] = (0, react.useState)("");
|
|
4872
|
+
(0, react.useEffect)(() => {
|
|
4873
|
+
const style = document.createElement("style");
|
|
4874
|
+
style.dataset.dataopsCatalogTree = "true";
|
|
4875
|
+
style.textContent = CSS;
|
|
4876
|
+
document.head.appendChild(style);
|
|
4877
|
+
return () => style.remove();
|
|
4878
|
+
}, []);
|
|
4879
|
+
(0, react.useEffect)(() => {
|
|
4880
|
+
let live = true;
|
|
4881
|
+
let timer;
|
|
4882
|
+
const load = async () => {
|
|
4883
|
+
try {
|
|
4884
|
+
const [listResponse, favoriteResponse, pinnedResponse] = await Promise.all([
|
|
4885
|
+
fetch("/integrations/dataops/resources?page=1&pageSize=100", { headers: { accept: "application/json" } }),
|
|
4886
|
+
fetch("/integrations/dataops/resources/favorites?page=1&pageSize=100", { headers: { accept: "application/json" } }),
|
|
4887
|
+
fetch("/integrations/dataops/resources/pinned?page=1&pageSize=100", { headers: { accept: "application/json" } })
|
|
4888
|
+
]);
|
|
4889
|
+
if (!live) return false;
|
|
4890
|
+
if (!listResponse.ok) throw new Error("HTTP " + String(listResponse.status));
|
|
4891
|
+
const list = await listResponse.json();
|
|
4892
|
+
const counts = /* @__PURE__ */ new Map();
|
|
4893
|
+
for (const row of list.items ?? []) {
|
|
4894
|
+
if (typeof row.catalog !== "string" || row.catalog.trim() === "") continue;
|
|
4895
|
+
counts.set(row.catalog, (counts.get(row.catalog) ?? 0) + 1);
|
|
4896
|
+
}
|
|
4897
|
+
setCatalogs([...counts.entries()].sort((a, b) => a[0].localeCompare(b[0], "zh-CN")));
|
|
4898
|
+
const nextTotal = typeof list.total === "number" ? list.total : (list.items ?? []).length;
|
|
4899
|
+
setTotal(nextTotal);
|
|
4900
|
+
if (favoriteResponse.ok) {
|
|
4901
|
+
const page = await favoriteResponse.json();
|
|
4902
|
+
setFavorites((page.items ?? []).map((item) => item.resourceId ?? item.resource?.id).filter((id) => typeof id === "number"));
|
|
4903
|
+
setFavoriteTotal(typeof page.total === "number" ? page.total : (page.items ?? []).length);
|
|
4904
|
+
}
|
|
4905
|
+
if (pinnedResponse.ok) {
|
|
4906
|
+
const page = await pinnedResponse.json();
|
|
4907
|
+
setPinned((page.items ?? []).map((item) => item.resourceId ?? item.resource?.id).filter((id) => typeof id === "number"));
|
|
4908
|
+
setPinnedTotal(typeof page.total === "number" ? page.total : (page.items ?? []).length);
|
|
4909
|
+
}
|
|
4910
|
+
return true;
|
|
4911
|
+
} catch {
|
|
4912
|
+
return false;
|
|
4913
|
+
}
|
|
4914
|
+
};
|
|
4915
|
+
const run = async () => {
|
|
4916
|
+
const ok = await load();
|
|
4917
|
+
if (!live) return;
|
|
4918
|
+
if (!ok) timer = window.setTimeout(() => {
|
|
4919
|
+
run();
|
|
4920
|
+
}, 2500);
|
|
4921
|
+
};
|
|
4922
|
+
run();
|
|
4923
|
+
return () => {
|
|
4924
|
+
live = false;
|
|
4925
|
+
if (timer !== void 0) window.clearTimeout(timer);
|
|
4926
|
+
};
|
|
4927
|
+
}, []);
|
|
4928
|
+
const select = (0, react.useCallback)((key) => {
|
|
4929
|
+
setActive(key);
|
|
4930
|
+
if (key === "all") onFilter({ scope: "all" });
|
|
4931
|
+
else if (key === "favorites") onFilter({
|
|
4932
|
+
scope: "favorites",
|
|
4933
|
+
ids: favorites
|
|
4934
|
+
});
|
|
4935
|
+
else if (key === "pinned") onFilter({
|
|
4936
|
+
scope: "pinned",
|
|
4937
|
+
ids: pinned
|
|
4938
|
+
});
|
|
4939
|
+
else onFilter({
|
|
4940
|
+
scope: "catalog",
|
|
4941
|
+
catalog: key.slice(8)
|
|
4942
|
+
});
|
|
4943
|
+
}, [
|
|
4944
|
+
favorites,
|
|
4945
|
+
pinned,
|
|
4946
|
+
onFilter
|
|
4947
|
+
]);
|
|
4948
|
+
const item = (key, icon, label, count) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
4949
|
+
type: "button",
|
|
4950
|
+
className: "dsh-cat__item" + (active === key ? " is-active" : ""),
|
|
4951
|
+
onClick: () => select(key),
|
|
4952
|
+
"data-catalog-key": key,
|
|
4953
|
+
children: [
|
|
4954
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4955
|
+
className: "ico",
|
|
4956
|
+
"aria-hidden": "true",
|
|
4957
|
+
children: icon
|
|
4958
|
+
}),
|
|
4959
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4960
|
+
style: {
|
|
4961
|
+
overflow: "hidden",
|
|
4962
|
+
textOverflow: "ellipsis",
|
|
4963
|
+
whiteSpace: "nowrap"
|
|
4964
|
+
},
|
|
4965
|
+
children: label
|
|
4966
|
+
}),
|
|
4967
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4968
|
+
className: "n",
|
|
4969
|
+
children: count
|
|
4970
|
+
})
|
|
4971
|
+
]
|
|
4972
|
+
}, key);
|
|
4973
|
+
const visibleCatalogs = query.trim() === "" ? catalogs : catalogs.filter(([name]) => name.toLowerCase().includes(query.trim().toLowerCase()));
|
|
4974
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("aside", {
|
|
4975
|
+
className: "dsh-cat",
|
|
4976
|
+
"aria-label": "数据目录",
|
|
4977
|
+
children: [
|
|
4978
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4979
|
+
className: "dsh-cat__head",
|
|
4980
|
+
children: [
|
|
4981
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
4982
|
+
className: "ico",
|
|
4983
|
+
viewBox: "0 0 16 16",
|
|
4984
|
+
fill: "none",
|
|
4985
|
+
stroke: "currentColor",
|
|
4986
|
+
"stroke-width": "1.4",
|
|
4987
|
+
"aria-hidden": "true",
|
|
4988
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M1.8 4.2h4l1.2 1.6h7.2v7.2a1 1 0 0 1-1 1H2.8a1 1 0 0 1-1-1z" })
|
|
4989
|
+
}),
|
|
4990
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4991
|
+
className: "tt",
|
|
4992
|
+
children: "数据资源"
|
|
4993
|
+
}),
|
|
4994
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "sp" }),
|
|
4995
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4996
|
+
className: "collapse",
|
|
4997
|
+
type: "button",
|
|
4998
|
+
"aria-label": "收起目录",
|
|
4999
|
+
title: "收起目录",
|
|
5000
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
5001
|
+
viewBox: "0 0 16 16",
|
|
5002
|
+
width: "13",
|
|
5003
|
+
height: "13",
|
|
5004
|
+
fill: "none",
|
|
5005
|
+
stroke: "currentColor",
|
|
5006
|
+
"stroke-width": "1.4",
|
|
5007
|
+
"aria-hidden": "true",
|
|
5008
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
|
|
5009
|
+
x: "1.8",
|
|
5010
|
+
y: "2.8",
|
|
5011
|
+
width: "12.4",
|
|
5012
|
+
height: "10.4",
|
|
5013
|
+
rx: "1.6"
|
|
5014
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M6 2.8v10.4" })]
|
|
5015
|
+
})
|
|
5016
|
+
})
|
|
5017
|
+
]
|
|
5018
|
+
}),
|
|
5019
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
5020
|
+
className: "dsh-cat__search",
|
|
5021
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
5022
|
+
viewBox: "0 0 16 16",
|
|
5023
|
+
width: "12",
|
|
5024
|
+
height: "12",
|
|
5025
|
+
fill: "none",
|
|
5026
|
+
stroke: "currentColor",
|
|
5027
|
+
"stroke-width": "1.5",
|
|
5028
|
+
"aria-hidden": "true",
|
|
5029
|
+
style: { opacity: .7 },
|
|
5030
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
5031
|
+
cx: "7",
|
|
5032
|
+
cy: "7",
|
|
5033
|
+
r: "4.2"
|
|
5034
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M10.2 10.2 13.5 13.5" })]
|
|
5035
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
5036
|
+
value: query,
|
|
5037
|
+
onChange: (event) => setQuery(event.target.value),
|
|
5038
|
+
placeholder: "按目录名搜索…",
|
|
5039
|
+
"aria-label": "按目录名搜索"
|
|
5040
|
+
})]
|
|
5041
|
+
}),
|
|
5042
|
+
item("all", "▤", "全部", total),
|
|
5043
|
+
item("favorites", "★", "收藏", favoriteTotal),
|
|
5044
|
+
item("pinned", "📌", "置顶", pinnedTotal),
|
|
5045
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5046
|
+
className: "dsh-cat__title",
|
|
5047
|
+
children: "数据目录"
|
|
5048
|
+
}),
|
|
5049
|
+
catalogs.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5050
|
+
style: {
|
|
5051
|
+
padding: "4px 8px",
|
|
5052
|
+
fontSize: 10.5,
|
|
5053
|
+
opacity: .7
|
|
5054
|
+
},
|
|
5055
|
+
children: "暂无目录"
|
|
5056
|
+
}) : null,
|
|
5057
|
+
visibleCatalogs.map(([name, count]) => item("catalog:" + name, "▸", name, count))
|
|
5058
|
+
]
|
|
5059
|
+
});
|
|
5060
|
+
}
|
|
5061
|
+
//#endregion
|
|
4758
5062
|
//#region src/client/DataOpsResourcesTab.tsx
|
|
4759
5063
|
/**
|
|
4760
5064
|
* The custom `dataops-resources` sidebar tab.
|
|
@@ -4778,17 +5082,18 @@ window.__ModuleLoader__.load({
|
|
|
4778
5082
|
};
|
|
4779
5083
|
const buildEmbedUrl = (config, meta) => {
|
|
4780
5084
|
const base = config.embedBaseUrl.replace(/\/+$/u, "");
|
|
4781
|
-
const
|
|
4782
|
-
if (meta.resourceId !== void 0
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
5085
|
+
const hash = config.token === void 0 ? "" : "#accessToken=" + encodeURIComponent(config.token);
|
|
5086
|
+
if (meta.resourceId !== void 0 && (meta.mode === "detail" || meta.mode === "audit")) {
|
|
5087
|
+
const params = new URLSearchParams({
|
|
5088
|
+
assetTab: "resources",
|
|
5089
|
+
prototype: "resource-detail",
|
|
5090
|
+
resourceId: String(meta.resourceId),
|
|
5091
|
+
embed: "1"
|
|
5092
|
+
});
|
|
5093
|
+
if (meta.mode === "audit") params.set("tab", "audit");
|
|
5094
|
+
return `${base}/assets?${params.toString()}${hash}`;
|
|
4787
5095
|
}
|
|
4788
|
-
|
|
4789
|
-
if (meta.nonce) params.set("nonce", meta.nonce);
|
|
4790
|
-
const suffix = params.toString();
|
|
4791
|
-
return `${base}/embed/resources${suffix ? "?" + suffix : ""}`;
|
|
5096
|
+
return `${base}/assets?assetTab=resources&embed=1${hash}`;
|
|
4792
5097
|
};
|
|
4793
5098
|
const frameStyle = {
|
|
4794
5099
|
width: "100%",
|
|
@@ -4818,6 +5123,7 @@ window.__ModuleLoader__.load({
|
|
|
4818
5123
|
const [loading, setLoading] = (0, react.useState)(true);
|
|
4819
5124
|
const [notice, setNotice] = (0, react.useState)("");
|
|
4820
5125
|
const [reloadKey, setReloadKey] = (0, react.useState)(0);
|
|
5126
|
+
const [filter, setFilter] = (0, react.useState)({ scope: "all" });
|
|
4821
5127
|
const iframeRef = (0, react.useRef)(null);
|
|
4822
5128
|
const meta = readMeta(tab.meta);
|
|
4823
5129
|
const src = (0, react.useMemo)(() => config === null ? "" : buildEmbedUrl(config, meta), [
|
|
@@ -4835,11 +5141,16 @@ window.__ModuleLoader__.load({
|
|
|
4835
5141
|
if (!response.ok) throw new Error("HTTP " + response.status.toString());
|
|
4836
5142
|
const body = await response.json();
|
|
4837
5143
|
if (!live) return;
|
|
4838
|
-
|
|
5144
|
+
const next = {
|
|
4839
5145
|
embedBaseUrl: body.embedBaseUrl,
|
|
4840
5146
|
sameOrigin: body.sameOrigin === true,
|
|
4841
|
-
tabType: body.tabType
|
|
4842
|
-
|
|
5147
|
+
tabType: body.tabType,
|
|
5148
|
+
...typeof body.token === "string" && body.token !== "" ? { token: body.token } : {}
|
|
5149
|
+
};
|
|
5150
|
+
if (next.sameOrigin && next.token !== void 0) try {
|
|
5151
|
+
window.sessionStorage.setItem("dataops_auth_token", next.token);
|
|
5152
|
+
} catch {}
|
|
5153
|
+
setConfig(next);
|
|
4843
5154
|
} catch (loadError) {
|
|
4844
5155
|
if (!live) return;
|
|
4845
5156
|
setError("资源页配置加载失败:" + (loadError instanceof Error ? loadError.message : String(loadError)));
|
|
@@ -4862,22 +5173,26 @@ window.__ModuleLoader__.load({
|
|
|
4862
5173
|
expectedOrigin = "";
|
|
4863
5174
|
}
|
|
4864
5175
|
const onMessage = (event) => {
|
|
5176
|
+
if (event.source !== iframeRef.current?.contentWindow) return;
|
|
4865
5177
|
if (expectedOrigin && event.origin !== expectedOrigin) return;
|
|
4866
5178
|
const payload = event.data;
|
|
4867
|
-
|
|
4868
|
-
const
|
|
5179
|
+
const legacy = payload?.type === "dataops:add-to-conversation";
|
|
5180
|
+
const embed = payload?.source === "dataops-embed" && payload?.type === "add-to-conversation";
|
|
5181
|
+
if (!legacy && !embed) return;
|
|
5182
|
+
const resource = payload?.resource ?? {};
|
|
5183
|
+
const reference = payload?.reference ?? {
|
|
4869
5184
|
kind: "dataops-resource",
|
|
4870
|
-
resourceId:
|
|
4871
|
-
name:
|
|
4872
|
-
table:
|
|
5185
|
+
resourceId: resource.id,
|
|
5186
|
+
name: resource.name,
|
|
5187
|
+
table: resource.table ?? resource.sourceTable ?? null
|
|
4873
5188
|
};
|
|
4874
5189
|
if (insertResourceReference === void 0) {
|
|
4875
5190
|
setNotice("当前会话不可用,无法插入资源引用");
|
|
4876
5191
|
return;
|
|
4877
5192
|
}
|
|
4878
5193
|
try {
|
|
4879
|
-
insertResourceReference(
|
|
4880
|
-
setNotice("");
|
|
5194
|
+
insertResourceReference(resource, reference, scope?.sessionId);
|
|
5195
|
+
setNotice("已添加到对话");
|
|
4881
5196
|
} catch (insertError) {
|
|
4882
5197
|
setNotice("插入引用失败:" + (insertError instanceof Error ? insertError.message : String(insertError)));
|
|
4883
5198
|
}
|
|
@@ -4908,6 +5223,18 @@ window.__ModuleLoader__.load({
|
|
|
4908
5223
|
document.head.appendChild(style);
|
|
4909
5224
|
return () => style.remove();
|
|
4910
5225
|
}, []);
|
|
5226
|
+
const postFilter = (0, react.useCallback)(() => {
|
|
5227
|
+
const frame = iframeRef.current?.contentWindow;
|
|
5228
|
+
if (!frame) return;
|
|
5229
|
+
frame.postMessage({
|
|
5230
|
+
source: "dsh-host",
|
|
5231
|
+
type: "filter",
|
|
5232
|
+
...filter
|
|
5233
|
+
}, "*");
|
|
5234
|
+
}, [filter]);
|
|
5235
|
+
(0, react.useEffect)(() => {
|
|
5236
|
+
postFilter();
|
|
5237
|
+
}, [postFilter]);
|
|
4911
5238
|
(0, react.useEffect)(() => {
|
|
4912
5239
|
if (!notice) return void 0;
|
|
4913
5240
|
const timer = window.setTimeout(() => setNotice(""), 2400);
|
|
@@ -4933,38 +5260,49 @@ window.__ModuleLoader__.load({
|
|
|
4933
5260
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4934
5261
|
style: {
|
|
4935
5262
|
display: "flex",
|
|
4936
|
-
flexDirection: "column",
|
|
4937
5263
|
height: "100%",
|
|
4938
5264
|
minHeight: 0
|
|
4939
5265
|
},
|
|
4940
|
-
children: [
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
5266
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResourceCatalogSidebar, { onFilter: setFilter }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5267
|
+
style: {
|
|
5268
|
+
flex: 1,
|
|
5269
|
+
minWidth: 0,
|
|
5270
|
+
display: "flex",
|
|
5271
|
+
flexDirection: "column",
|
|
5272
|
+
minHeight: 0
|
|
5273
|
+
},
|
|
5274
|
+
children: [
|
|
5275
|
+
notice ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5276
|
+
style: noticeStyle,
|
|
5277
|
+
role: "status",
|
|
5278
|
+
children: notice
|
|
5279
|
+
}) : null,
|
|
5280
|
+
loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5281
|
+
style: stateStyle,
|
|
5282
|
+
role: "status",
|
|
5283
|
+
children: "正在加载数据资源页…"
|
|
5284
|
+
}) : null,
|
|
5285
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", {
|
|
5286
|
+
ref: iframeRef,
|
|
5287
|
+
src,
|
|
5288
|
+
title: meta.resourceName ? `${meta.resourceName} · 数据资源` : "数据资源",
|
|
5289
|
+
sandbox: "allow-same-origin allow-scripts allow-forms allow-popups allow-downloads",
|
|
5290
|
+
referrerPolicy: "no-referrer",
|
|
5291
|
+
style: {
|
|
5292
|
+
...frameStyle,
|
|
5293
|
+
display: loading ? "none" : "block"
|
|
5294
|
+
},
|
|
5295
|
+
onLoad: () => {
|
|
5296
|
+
setLoading(false);
|
|
5297
|
+
postFilter();
|
|
5298
|
+
},
|
|
5299
|
+
onError: () => {
|
|
5300
|
+
setLoading(false);
|
|
5301
|
+
setError("数据资源页加载失败");
|
|
5302
|
+
}
|
|
5303
|
+
}, `${src}:${reloadKey}`)
|
|
5304
|
+
]
|
|
5305
|
+
})]
|
|
4968
5306
|
});
|
|
4969
5307
|
}
|
|
4970
5308
|
//#endregion
|
|
@@ -5131,6 +5469,8 @@ window.__ModuleLoader__.load({
|
|
|
5131
5469
|
permWaiting: "The permission-centre API is waiting for the backend (task-37).",
|
|
5132
5470
|
permResourceSkill: "Skill",
|
|
5133
5471
|
permResourceWorkflow: "Workflow",
|
|
5472
|
+
permResourceBuiltin: "Built-in skill",
|
|
5473
|
+
permUnshared: "Not shared",
|
|
5134
5474
|
permResourceKb: "Knowledge base",
|
|
5135
5475
|
permType: "Type",
|
|
5136
5476
|
permName: "Name",
|
|
@@ -5278,6 +5618,8 @@ window.__ModuleLoader__.load({
|
|
|
5278
5618
|
permWaiting: "权限中心 API 待后端联调(task-37)。",
|
|
5279
5619
|
permResourceSkill: "技能",
|
|
5280
5620
|
permResourceWorkflow: "工作流",
|
|
5621
|
+
permResourceBuiltin: "内置技能",
|
|
5622
|
+
permUnshared: "未共享",
|
|
5281
5623
|
permResourceKb: "知识库",
|
|
5282
5624
|
permType: "类型",
|
|
5283
5625
|
permName: "名称",
|
|
@@ -5573,6 +5915,7 @@ window.__ModuleLoader__.load({
|
|
|
5573
5915
|
disposeTab = service.registerTab({
|
|
5574
5916
|
id: RESOURCE_TAB_TYPE,
|
|
5575
5917
|
title: "数据资源",
|
|
5918
|
+
icon: ResourceTabIcon,
|
|
5576
5919
|
description: "DataOps 全量资源、授权与操作记录",
|
|
5577
5920
|
order: 60,
|
|
5578
5921
|
single: true,
|