Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/candidate-9.4.x' into candidate-…
Browse files Browse the repository at this point in the history
…9.6.x
  • Loading branch information
GordonSmith committed Nov 8, 2024
2 parents 77ce2e1 + f553c6a commit ac7dd63
Show file tree
Hide file tree
Showing 16 changed files with 1,341 additions and 1,233 deletions.
19 changes: 15 additions & 4 deletions esp/src/eclwatch/ClusterProcessesQueryWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ define([
"dojo/_base/declare",
"src/nlsHPCC",
"dojo/topic",
"dojo/dom-construct",

"dijit/registry",

Expand All @@ -20,7 +21,7 @@ define([
"hpcc/IFrameWidget",

"dijit/Dialog",
], function (declare, nlsHPCCMod, topic,
], function (declare, nlsHPCCMod, topic, domConstruct,
registry,
tree, selector,
GridDetailsWidget, ESPPreflight, ESPRequest, WsTopology, Utility, ESPUtil, DelayLoadWidget, PreflightDetailsWidget, MachineInformationWidget, IFrameWidget) {
Expand Down Expand Up @@ -50,6 +51,10 @@ define([
style: "border: 0; width: 100%; height: 100%"
});
this.legacyClustersProcessesIframeWidget.placeAt(this._tabContainer, "last");
if (dojoConfig.isContainer) {
const legacyTab = registry.byId(this.id + "_LegacyClustersProcessesIframeWidget");
legacyTab.set("disabled", true);
}
},

init: function (params) {
Expand Down Expand Up @@ -85,9 +90,15 @@ define([
if (currSel.id === this.id + "_Grid") {
this.refreshGrid();
} else if (currSel.id === this.legacyClustersProcessesIframeWidget.id && !this.legacyClustersProcessesIframeWidget.initalized) {
this.legacyClustersProcessesIframeWidget.init({
src: ESPRequest.getBaseURL("WsTopology") + "/TpClusterQuery?Type=ROOT"
});
if (!dojoConfig.isContainer) {
this.legacyClustersProcessesIframeWidget.init({
src: ESPRequest.getBaseURL("WsTopology") + "/TpClusterQuery?Type=ROOT"
});
} else {
const unavailMsg = domConstruct.create("div", { style: { margin: "5px" } });
unavailMsg.innerText = this.i18n.UnavailableInContainerized;
this.legacyClustersProcessesIframeWidget.contentPane.set("content", unavailMsg);
}
} else {
currSel.init(currSel.params);
}
Expand Down
19 changes: 15 additions & 4 deletions esp/src/eclwatch/SystemServersQueryWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ define([
"dojo/_base/array",
"dojo/dom-class",
"dojo/topic",
"dojo/dom-construct",

"dijit/registry",
"dijit/Dialog",
Expand All @@ -21,7 +22,7 @@ define([
"hpcc/PreflightDetailsWidget",
"hpcc/MachineInformationWidget",
"hpcc/IFrameWidget"
], function (declare, nlsHPCCMod, arrayUtil, domClass, topic,
], function (declare, nlsHPCCMod, arrayUtil, domClass, topic, domConstruct,
registry, Dialog,
tree, selector,
GridDetailsWidget, ESPPreflight, ESPRequest, WsTopology, Utility, ESPUtil, DelayLoadWidget, PreflightDetailsWidget, MachineInformationWidget, IFrameWidget) {
Expand Down Expand Up @@ -71,9 +72,15 @@ define([
if (currSel.id === this.id + "_Grid") {
this.refreshGrid();
} else if (currSel.id === this.systemServersQueryWidgetIframeWidget.id && !this.systemServersQueryWidgetIframeWidget.initalized) {
this.systemServersQueryWidgetIframeWidget.init({
src: ESPRequest.getBaseURL("WsTopology") + "/TpServiceQuery?Type=ALLSERVICES"
});
if (!dojoConfig.isContainer) {
this.systemServersQueryWidgetIframeWidget.init({
src: ESPRequest.getBaseURL("WsTopology") + "/TpServiceQuery?Type=ALLSERVICES"
});
} else {
const unavailMsg = domConstruct.create("div", { style: { margin: "5px" } });
unavailMsg.innerText = this.i18n.UnavailableInContainerized;
this.systemServersQueryWidgetIframeWidget.contentPane.set("content", unavailMsg);
}
} else {
currSel.init(currSel.params);
}
Expand Down Expand Up @@ -139,6 +146,10 @@ define([
style: "border: 0; width: 100%; height: 100%"
});
this.systemServersQueryWidgetIframeWidget.placeAt(this._tabContainer, "last");
if (dojoConfig.isContainer) {
const legacyTab = registry.byId(this.id + "_SystemServersQueryWidgetIframeWidget");
legacyTab.set("disabled", true);
}
},

createGrid: function (domID) {
Expand Down
19 changes: 15 additions & 4 deletions esp/src/eclwatch/TargetClustersQueryWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ define([
"dojo/_base/declare",
"src/nlsHPCC",
"dojo/topic",
"dojo/dom-construct",

"dijit/registry",

Expand All @@ -20,7 +21,7 @@ define([
"hpcc/IFrameWidget",

"dijit/Dialog",
], function (declare, nlsHPCCMod, topic,
], function (declare, nlsHPCCMod, topic, domConstruct,
registry,
tree, selector,
GridDetailsWidget, PreflightDetailsWidget, ESPPreflight, ESPRequest, WsTopology, Utility, DelayLoadWidget, ESPUtil, MachineInformationWidget, IFrameWidget) {
Expand Down Expand Up @@ -61,9 +62,15 @@ define([
if (currSel.id === this.id + "_Grid") {
this.refreshGrid();
} else if (currSel.id === this.legacyTargetClustersIframeWidget.id && !this.legacyTargetClustersIframeWidget.initalized) {
this.legacyTargetClustersIframeWidget.init({
src: ESPRequest.getBaseURL("WsTopology") + "/TpTargetClusterQuery?Type=ROOT"
});
if (!dojoConfig.isContainer) {
this.legacyTargetClustersIframeWidget.init({
src: ESPRequest.getBaseURL("WsTopology") + "/TpTargetClusterQuery?Type=ROOT"
});
} else {
const unavailMsg = domConstruct.create("div", { style: { margin: "5px" } });
unavailMsg.innerText = this.i18n.UnavailableInContainerized;
this.legacyTargetClustersIframeWidget.contentPane.set("content", unavailMsg);
}
} else if (currSel.params.newPreflight || currSel.params.Usergenerated) { //prevents loop of pfTab.init above
currSel.init(currSel.params);
}
Expand All @@ -88,6 +95,10 @@ define([
style: "border: 0; width: 100%; height: 100%"
});
this.legacyTargetClustersIframeWidget.placeAt(this._tabContainer, "last");
if (dojoConfig.isContainer) {
const legacyTab = registry.byId(this.id + "_LegacyTargetClustersIframeWidget");
legacyTab.set("disabled", true);
}
this.machineFilter.disable();
},

Expand Down
4 changes: 3 additions & 1 deletion esp/src/eclwatch/WUDetailsWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ define([
formatLogFilterDateTime: function (dateField, timeField, dateTimeField) {
if (dateField.value.toString() !== "Invalid Date") {
const d = new Date(dateField.value);
const date = `${d.getFullYear()}-${(d.getMonth() < 9 ? "0" : "") + parseInt(d.getMonth() + 1, 10)}-${d.getDate()}`;
const month = d.getMonth() + 1;
const day = d.getDate();
const date = `${d.getFullYear()}-${(month < 9 ? "0" : "") + month}-${(day < 9 ? "0" : "") + day}`;
const time = timeField.value.toString().replace(/.*1970\s(\S+).*/, "$1");
dateTimeField.value = `${date}T${time}.000Z`;
}
Expand Down
1 change: 1 addition & 0 deletions esp/src/eclwatch/img/opentelemetry-icon-color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion esp/src/eclwatch/templates/WUDetailsWidget.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ <h2>
<input id="${id}EndDateTime" name="LogFilter_AbsoluteTimeRange_EndDate" type="hidden" />
<input id="${id}EndDate" title="${i18n.ToDate}:" name="EndDate" data-dojo-props="trim: true" required="required" data-dojo-type="dijit.form.DateTextBox" />
<input id="${id}EndTime" title="" name="EndTime" data-dojo-props="trim: true" value="T19:30:00" data-dojo-type="dijit.form.TimeTextBox" />
<input id="${id}RelativeTimeRangeBuffer" title="${i18n.RelativeTimeRange}" name="LogFilter_RelativeTimeRangeBuffer" colspan="2" data-dojo-type="dijit.form.TextBox" />
<input id="${id}RelativeTimeRangeBuffer" title="${i18n.RelativeTimeRange}" name="LogFilter_RelativeTimeRangeBuffer" value="43200" colspan="2" data-dojo-type="dijit.form.TextBox" />
<input id="${id}LineLimit" title="${i18n.LogLineLimit}" name="LogFilter_LineLimit" colspan="2" value="10000" data-dojo-type="dijit.form.TextBox" />
<input id="${id}LineStartFrom" title="${i18n.LogLineStartFrom}" name="LogFilter_LineStartFrom" value="0" colspan="2" data-dojo-type="dijit.form.TextBox" />
<select id="${id}SelectColumnMode" title="${i18n.ColumnMode}" name="LogFilter_SelectColumnMode" colspan="2" data-dojo-type="dijit.form.Select">
Expand Down
13 changes: 8 additions & 5 deletions esp/src/src-react/components/LogViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ import { Checkbox, CommandBar, ICommandBarItemProps } from "@fluentui/react";
import { Level } from "@hpcc-js/util";
import { logColor } from "src/Utility";
import nlsHPCC from "src/nlsHPCC";
import { QuerySortItem } from "src/store/Store";
import { HolyGrail } from "../layouts/HolyGrail";
import { useECLWatchLogger } from "../hooks/logging";
import { FluentGrid, useCopyButtons, useFluentStoreState, FluentColumns } from "./controls/Grid";

interface LogViewerProps {
sort?: QuerySortItem;
}

export const defaultSort = { attribute: "dateTime", descending: true };

export const LogViewer: React.FunctionComponent<LogViewerProps> = ({
sort = defaultSort
}) => {

const [errorChecked, setErrorChecked] = React.useState(true);
Expand All @@ -36,19 +41,18 @@ export const LogViewer: React.FunctionComponent<LogViewerProps> = ({
// Grid ---
const columns = React.useMemo((): FluentColumns => {
return {
dateTime: { label: nlsHPCC.Time, width: 160, sortable: false },
dateTime: { label: nlsHPCC.Time, width: 160, },
level: {
label: nlsHPCC.Severity,
width: 112,
sortable: false,
formatter: level => {
const colors = logColor(level);
const styles = { backgroundColor: colors.background, padding: "2px 6px", color: colors.foreground };
return <span style={styles}>{Level[level].toUpperCase()}</span>;
},
csvFormatter: level => Level[level].toUpperCase()
},
id: { label: nlsHPCC.Source, width: 212, sortable: false },
id: { label: nlsHPCC.Source, width: 212 },
message: { label: nlsHPCC.Message, width: 720, sortable: false }
};
}, []);
Expand Down Expand Up @@ -92,8 +96,6 @@ export const LogViewer: React.FunctionComponent<LogViewerProps> = ({
return false;
}
return true;
}).sort((l, r) => {
return l.level - r.level;
});
setData(filteredExceptions);
setFilterCounts(filterCounts);
Expand All @@ -105,6 +107,7 @@ export const LogViewer: React.FunctionComponent<LogViewerProps> = ({
<FluentGrid
data={data}
primaryID={"dateTime"}
sort={sort}
columns={columns}
setSelection={setSelection}
setTotal={setTotal}
Expand Down
6 changes: 5 additions & 1 deletion esp/src/src-react/components/Logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ export const Logs: React.FunctionComponent<LogsProps> = ({
formatter: ts => {
if (ts) {
if (ts.indexOf(":") < 0) {
return timestampToDate(ts).toISOString();
const date = timestampToDate(ts);
if (!isNaN(date.getTime())) {
return date.toISOString();
}
return ts;
}
return formatDateString(ts);
}
Expand Down
2 changes: 1 addition & 1 deletion esp/src/src-react/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ export const SubNavigation: React.FunctionComponent<SubNavigationProps> = ({
</Link>;
})}
</Stack.Item>
{!subNav &&
{!!subNav &&
<Stack.Item grow={1} style={{ lineHeight: "24px" }}>
{hashPath.includes("/files/")
? <Breadcrumbs hashPath={hashPath} ignoreN={2} />
Expand Down
9 changes: 5 additions & 4 deletions esp/src/src-react/components/Variables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@ import * as React from "react";
import { CommandBar, ContextualMenuItemType, ICommandBarItemProps } from "@fluentui/react";
import nlsHPCC from "src/nlsHPCC";
import { QuerySortItem } from "src/store/Store";
import { useWorkunitVariables } from "../hooks/workunit";
import { Variable } from "../hooks/workunit";
import { HolyGrail } from "../layouts/HolyGrail";
import { FluentGrid, useCopyButtons, useFluentStoreState, FluentColumns } from "./controls/Grid";
import { ShortVerticalDivider } from "./Common";

interface VariablesProps {
wuid: string;
variables: Variable[];
refreshData: () => void;
sort?: QuerySortItem;
}

const defaultSort = { attribute: "Wuid", descending: true };

export const Variables: React.FunctionComponent<VariablesProps> = ({
wuid,
variables,
refreshData,
sort = defaultSort
}) => {

const [variables, , , refreshData] = useWorkunitVariables(wuid);
const [data, setData] = React.useState<any[]>([]);
const {
selection, setSelection,
Expand Down
13 changes: 10 additions & 3 deletions esp/src/src-react/components/WorkunitDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import nlsHPCC from "src/nlsHPCC";
import { hasLogAccess } from "src/ESPLog";
import { wuidToDate, wuidToTime } from "src/Utility";
import { emptyFilter, formatQuery } from "src/ESPWorkunit";
import { useWorkunit } from "../hooks/workunit";
import { Variable, useWorkunit, useWorkunitVariables } from "../hooks/workunit";
import { useDeepEffect } from "../hooks/deepHooks";
import { DojoAdapter } from "../layouts/DojoAdapter";
import { parseQuery, pushUrl } from "../util/history";
Expand Down Expand Up @@ -52,6 +52,8 @@ export const WorkunitDetails: React.FunctionComponent<WorkunitDetailsProps> = ({
}) => {

const [workunit] = useWorkunit(wuid, true);
const [variables, , , refreshVariables] = useWorkunitVariables(wuid);
const [otTraceParent, setOtTraceParent] = React.useState("");
const [logCount, setLogCount] = React.useState<number | string>("*");
const [logsDisabled, setLogsDisabled] = React.useState(true);
const [_nextPrev, setNextPrev] = useNextPrev();
Expand All @@ -64,6 +66,11 @@ export const WorkunitDetails: React.FunctionComponent<WorkunitDetailsProps> = ({
return parseQuery("?" + parentUrlParts[1]);
}, [parentUrl]);

React.useEffect(() => {
const traceInfo: Variable = variables.filter(v => v.Name === "ottraceparent")[0];
setOtTraceParent(traceInfo?.Value ?? "");
}, [variables]);

const nextWuid = React.useCallback((wuids: WsWorkunits.ECLWorkunit[]) => {
let found = false;
for (const wu of wuids) {
Expand Down Expand Up @@ -177,10 +184,10 @@ export const WorkunitDetails: React.FunctionComponent<WorkunitDetailsProps> = ({
<div style={{ height: "100%" }}>
<OverflowTabList tabs={tabs} selected={tab} onTabSelect={onTabSelect} size="medium" />
<DelayLoadedPanel visible={tab === "summary"} size={size}>
<WorkunitSummary wuid={wuid} fullscreen={queryParams.summary?.fullscreen !== undefined} />
<WorkunitSummary wuid={wuid} otTraceParent={otTraceParent} fullscreen={queryParams.summary?.fullscreen !== undefined} />
</DelayLoadedPanel>
<DelayLoadedPanel visible={tab === "variables"} size={size}>
<Variables wuid={wuid} />
<Variables variables={variables} refreshData={refreshVariables} />
</DelayLoadedPanel>
<DelayLoadedPanel visible={tab === "outputs"} size={size}>
{state?.outputs ?
Expand Down
Loading

0 comments on commit ac7dd63

Please sign in to comment.