Skip to content

Commit c3edc6d

Browse files
authored
Merge pull request #20354 from GordonSmith/HPCC-34921-REVERT-ACTIVITY_TECHPREVIEW
HPCC-25201 Revert "Add React Activities"
2 parents 5e387bd + 5897094 commit c3edc6d

20 files changed

Lines changed: 132 additions & 1961 deletions

esp/src/src-dojo/nls/hpcc.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export = {
2121
ActivePackageMap: "Active Package Map",
2222
ActiveWorkunit: "Active Workunit",
2323
Activities: "Activities",
24-
ActivitiesLegacy: "Activities (L)",
2524
Activity: "Activity",
2625
ActivityLabel: "Activity Label",
2726
ActivityMap: "Activity Map",
@@ -380,7 +379,6 @@ export = {
380379
FirstNRows: "First N Rows",
381380
Fixed: "Fixed",
382381
Folder: "Folder",
383-
Folders: "Folders",
384382
Form: "Form",
385383
Format: "Format",
386384
Forums: "Forums",
@@ -424,7 +422,6 @@ export = {
424422
HideSpills: "Hide Spills",
425423
High: "High",
426424
History: "History",
427-
Home: "Home",
428425
Homepage: "Homepage",
429426
Hotspots: "Hot spots",
430427
Hour: "Hour",
@@ -574,7 +571,6 @@ export = {
574571
MatchCase: "Match Case",
575572
MatchWholeWord: "Match Whole Word",
576573
Max: "Max",
577-
Maximize: "Maximize",
578574
MaxConnections: "Max Connections",
579575
MaxNode: "Max Node",
580576
MaxSize: "Max Size",
@@ -596,7 +592,6 @@ export = {
596592
MetricsGraph: "Metrics/Graph",
597593
MetricsSQL: "Metrics (SQL)",
598594
Min: "Min",
599-
Minimize: "Minimize",
600595
MinimumCompileCost: "Minimum Compile Cost",
601596
MinimumExecuteCost: "Minimum Execute Cost",
602597
MinimumFileAccessCost: "Minimum File Access Cost",
@@ -622,11 +617,6 @@ export = {
622617
Month: "Month",
623618
More: "more",
624619
Move: "Move",
625-
MoveBottomHint: "Move Bottom (ctrl+click-down)",
626-
MoveDown: "Move Down",
627-
MoveDownHint: "Move Down (ctrl+click move to bottom)",
628-
MoveUp: "Move Up",
629-
MoveUpHint: "Move Up (ctrl+click move to top)",
630620
MustContainUppercaseAndSymbol: "Must contain uppercase and symbol",
631621
NA: "N/A",
632622
Name: "Name",

esp/src/src-dojo/nls/zh/hpcc.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
AutoRefreshIncrement: "自动刷新增量",
7373
Back: "返回",
7474
BackupDFUWorkunit: "备份DFU工作单元",
75-
BackupECLWorkunit: "备份ECL工作单元",
75+
BackupECLWorkunit: "备份ECL工作单元",
7676
BannerColor: "标语的颜色",
7777
BannerColorTooltip: "修改上方显示框的背景颜色",
7878
BannerMessage: "标语的文字",
@@ -575,11 +575,6 @@
575575
Month: "月",
576576
More: "更多",
577577
Move: "移动",
578-
MoveBottomHint: "移至底部(Ctrl+单击向下)",
579-
MoveDown: "下移",
580-
MoveDownHint: "下移(Ctrl+单击向下)",
581-
MoveUp: "上移",
582-
MoveUpHint: "上移(Ctrl+单击向上)",
583578
MustContainUppercaseAndSymbol: "需含大写字符和符号",
584579
NA: "不适用",
585580
Name: "名称",

esp/src/src-react/components/Activities.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ const defaultUIState = {
4747
wuCanDown: false
4848
};
4949

50-
interface ActivitiesLegacyProps {
50+
interface ActivitiesProps {
5151
}
5252

53-
export const ActivitiesLegacy: React.FunctionComponent<ActivitiesLegacyProps> = ({
53+
export const Activities: React.FunctionComponent<ActivitiesProps> = ({
5454
}) => {
5555

5656
const [uiState, setUIState] = React.useState({ ...defaultUIState });
@@ -62,7 +62,7 @@ export const ActivitiesLegacy: React.FunctionComponent<ActivitiesLegacyProps> =
6262
const { Grid, selection, refreshTable, copyButtons } = useGrid({
6363
store: activity.getStore({}),
6464
sort: { attribute: "idx", descending: false },
65-
filename: "activities-legacy",
65+
filename: "activities",
6666
columns: {
6767
col1: selector({
6868
width: 27,
@@ -402,7 +402,7 @@ export const ActivitiesLegacy: React.FunctionComponent<ActivitiesLegacyProps> =
402402
}, [activity, selection]);
403403

404404
if (isContainer) {
405-
return <HolyGrail key="activities-legacy"
405+
return <HolyGrail key="activities"
406406
header={<CommandBar items={buttons} farItems={copyButtons} />}
407407
main={
408408
<Grid />
@@ -417,7 +417,7 @@ export const ActivitiesLegacy: React.FunctionComponent<ActivitiesLegacyProps> =
417417
<div className={classNames.reflexSplitterDiv}></div>
418418
</ReflexSplitter>
419419
<ReflexElement>
420-
<HolyGrail key="activities-legacy"
420+
<HolyGrail key="activities"
421421
header={<CommandBar items={buttons} farItems={copyButtons} />}
422422
main={
423423
<Grid />

esp/src/src-react/components/ActivitiesReact.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 71 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
import * as React from "react";
22
import { Link } from "@fluentui/react";
3-
import { Divider, Toolbar, ToolbarButton } from "@fluentui/react-components";
4-
import { ArrowClockwise20Regular } from "@fluentui/react-icons";
3+
import { MachineService } from "@hpcc-js/comms";
4+
import { scopedLogger } from "@hpcc-js/util";
55
import { ComponentDetails as ComponentDetailsWidget, Summary as SummaryWidget } from "src/DiskUsage";
66
import nlsHPCC from "src/nlsHPCC";
77
import * as Utility from "src/Utility";
88
import { AutosizeHpccJSComponent } from "../layouts/HpccJSAdapter";
9-
import { HolyGrail } from "../layouts/HolyGrail";
10-
import { SizeMe } from "../layouts/SizeMe";
9+
import { ReflexContainer, ReflexElement, ReflexSplitter, classNames, styles } from "../layouts/react-reflex";
1110
import { pushUrl } from "../util/history";
1211
import { FluentGrid, useFluentStoreState } from "./controls/Grid";
13-
import { FolderUsageCards } from "./cards/DiskUsageCard";
14-
import { useTargetClusterUsageEx } from "../hooks/diskUsage";
1512

16-
//
17-
// Disk Usage Components
18-
//
13+
const logger = scopedLogger("src-react/components/DiskUsage.tsx");
14+
15+
const machineService = new MachineService({ baseUrl: "" });
1916

2017
interface SummaryProps {
2118
cluster?: string;
@@ -37,17 +34,15 @@ export const Summary: React.FunctionComponent<SummaryProps> = ({
3734
return <AutosizeHpccJSComponent widget={summary}></AutosizeHpccJSComponent >;
3835
};
3936

40-
interface ClusterUsageProps {
37+
interface DetailsProps {
4138
cluster: string;
4239
}
4340

44-
export const ClusterUsage: React.FunctionComponent<ClusterUsageProps> = ({
41+
export const Details: React.FunctionComponent<DetailsProps> = ({
4542
cluster
4643
}) => {
4744

4845
const { refreshTable } = useFluentStoreState({});
49-
const [refreshToken, setRefreshToken] = React.useState(0);
50-
const { data: usage, refresh } = useTargetClusterUsageEx(cluster);
5146

5247
// Grid ---
5348
const columns = React.useMemo(() => {
@@ -77,48 +72,51 @@ export const ClusterUsage: React.FunctionComponent<ClusterUsageProps> = ({
7772

7873
type Columns = typeof columns;
7974
type Row = { __hpcc_id: string } & { [K in keyof Columns]: string | number };
80-
const data = React.useMemo<Row[]>(() => {
81-
const rows: Row[] = [];
82-
(usage ?? []).forEach(component => {
83-
component.ComponentUsages.forEach(cu => {
84-
cu.MachineUsages.forEach(mu => {
85-
mu.DiskUsages.forEach((du, i) => {
86-
rows.push({
87-
__hpcc_id: `__usage_${i}`,
88-
PercentUsed: Math.round((du.InUse / du.Total) * 100),
89-
Component: cu.Name,
90-
IPAddress: mu.Name,
91-
Type: du.Name,
92-
Path: du.Path,
93-
InUse: Utility.convertedSize(du.InUse),
94-
Total: Utility.convertedSize(du.Total)
75+
const [data, setData] = React.useState<Row[]>([]);
76+
77+
const refreshData = React.useCallback(() => {
78+
machineService.GetTargetClusterUsageEx([cluster])
79+
.then(response => {
80+
const _data: Row[] = [];
81+
if (response) {
82+
response.forEach(component => {
83+
component.ComponentUsages.forEach(cu => {
84+
cu.MachineUsages.forEach(mu => {
85+
mu.DiskUsages.forEach((du, i) => {
86+
_data.push({
87+
__hpcc_id: `__usage_${i}`,
88+
PercentUsed: Math.round((du.InUse / du.Total) * 100),
89+
Component: cu.Name,
90+
IPAddress: mu.Name,
91+
Type: du.Name,
92+
Path: du.Path,
93+
InUse: Utility.convertedSize(du.InUse),
94+
Total: Utility.convertedSize(du.Total)
95+
});
96+
});
97+
});
9598
});
9699
});
97-
});
98-
});
99-
});
100-
return rows;
101-
}, [usage]);
102-
103-
return <HolyGrail
104-
header={
105-
<Toolbar>
106-
<ToolbarButton appearance="subtle" icon={<ArrowClockwise20Regular />} aria-label={nlsHPCC.Refresh} onClick={() => { refresh(); setRefreshToken(t => t + 1); }}>
107-
{nlsHPCC.Refresh}
108-
</ToolbarButton>
109-
</Toolbar>
110-
}
111-
main={<SizeMe>{({ size }) => {
112-
return <div style={{ position: "relative", width: "100%", height: "100%" }}>
113-
<div style={{ position: "absolute", width: "100%", height: `${size.height}px`, overflowY: "auto" }}>
114-
<Divider>{nlsHPCC.Category}</Divider>
115-
<FolderUsageCards cluster={cluster} refreshToken={refreshToken} />
116-
<Divider>{nlsHPCC.Folders}</Divider>
117-
<FluentGrid data={data} primaryID="__hpcc_id" sort={{ attribute: "__hpcc_id", descending: false }} columns={columns} setSelection={() => null} setTotal={() => null} refresh={refreshTable} />
118-
</div>
119-
</div>;
120-
}}</SizeMe>}
121-
/>;
100+
}
101+
setData(_data);
102+
})
103+
.catch(err => logger.error(err))
104+
;
105+
}, [cluster]);
106+
107+
React.useEffect(() => {
108+
refreshData();
109+
}, [refreshData]);
110+
111+
return <FluentGrid
112+
data={data}
113+
primaryID={"__hpcc_id"}
114+
sort={{ attribute: "__hpcc_id", descending: false }}
115+
columns={columns}
116+
setSelection={() => null}
117+
setTotal={() => null}
118+
refresh={refreshTable}
119+
></FluentGrid>;
122120
};
123121

124122
interface MachineUsageProps {
@@ -137,3 +135,23 @@ export const MachineUsage: React.FunctionComponent<MachineUsageProps> = ({
137135

138136
return <AutosizeHpccJSComponent widget={summary}></AutosizeHpccJSComponent >;
139137
};
138+
139+
interface ClusterUsageProps {
140+
cluster: string;
141+
}
142+
143+
export const ClusterUsage: React.FunctionComponent<ClusterUsageProps> = ({
144+
cluster
145+
}) => {
146+
return <ReflexContainer orientation="horizontal">
147+
<ReflexElement minSize={100} size={100} style={{ overflow: "hidden" }}>
148+
<Summary cluster={cluster} />
149+
</ReflexElement>
150+
<ReflexSplitter style={styles.reflexSplitter}>
151+
<div className={classNames.reflexSplitterDiv}></div>
152+
</ReflexSplitter>
153+
<ReflexElement style={{ overflow: "hidden" }}>
154+
<Details cluster={cluster} />
155+
</ReflexElement>
156+
</ReflexContainer >;
157+
};

esp/src/src-react/components/Menu.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ type SubMenuItems = { [nav: string]: SubMenu[] };
179179
const subMenuItems: SubMenuItems = {
180180
"activities": [
181181
{ headerText: nlsHPCC.Activities, itemKey: "/activities" },
182-
{ headerText: nlsHPCC.ActivitiesLegacy, itemKey: "/activities-legacy" },
183182
{ headerText: nlsHPCC.EventScheduler, itemKey: "/events" }
184183
],
185184
"workunits": [

esp/src/src-react/components/cards/CardGroup.tsx

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)