diff --git a/packages/zowe-explorer/package.json b/packages/zowe-explorer/package.json index 9310a620f..b8a6aae58 100644 --- a/packages/zowe-explorer/package.json +++ b/packages/zowe-explorer/package.json @@ -1828,6 +1828,18 @@ "default": 5000, "description": "%zowe.pollInterval.info%", "scope": "window" + }, + "zowe.pagination.enabled": { + "type": "boolean", + "default": false, + "description": "%zowe.pagination.enabled%", + "scope": "window" + }, + "zowe.pagination.numRecords": { + "type": "integer", + "default": 250, + "description": "%zowe.pagination.numRecords%", + "scope": "window" } } }, diff --git a/packages/zowe-explorer/package.nls.json b/packages/zowe-explorer/package.nls.json index 3c5142cf0..46882d85f 100644 --- a/packages/zowe-explorer/package.nls.json +++ b/packages/zowe-explorer/package.nls.json @@ -109,6 +109,8 @@ "zowe.pollInterval.info": "Default interval (in milliseconds) when polling spool files.", "zowe.security.checkForCustomCredentialManagers": "Check for any installed VS Code extensions for handling credentials when activating Zowe Explorer", "zowe.security.secureCredentialsEnabled": "Allow credentials to be stored securely. If disabled and autoStore is set to true, z/OS credentials are stored as clear text in zowe.config.json.", + "zowe.pagination.enabled": "Enable pagination for tree items and resources. Instead of loading all items or resource contents, data is loaded in chunks.", + "zowe.pagination.numRecords": "Maximum number of records to load at once for a job spool. Set this value to 0 to disable pagination for spools.", "issueTsoCmd": "Issue TSO Command", "deleteProfile": "Delete a Profile Permanently...", "renameDataSet": "Rename Data Set", diff --git a/packages/zowe-explorer/src/trees/job/JobFSProvider.ts b/packages/zowe-explorer/src/trees/job/JobFSProvider.ts index d70f9ef0b..b8d6dd169 100644 --- a/packages/zowe-explorer/src/trees/job/JobFSProvider.ts +++ b/packages/zowe-explorer/src/trees/job/JobFSProvider.ts @@ -33,6 +33,7 @@ import { Profiles } from "../../configuration/Profiles"; import { ZoweExplorerApiRegister } from "../../extending/ZoweExplorerApiRegister"; import { SharedContext } from "../shared/SharedContext"; import { AuthUtils } from "../../utils/AuthUtils"; +import { SettingsConfig } from "../../configuration/SettingsConfig"; export class JobFSProvider extends BaseProvider implements vscode.FileSystemProvider { private static _instance: JobFSProvider; @@ -210,6 +211,12 @@ export class JobFSProvider extends BaseProvider implements vscode.FileSystemProv const queryParams = new URLSearchParams(uri.query); const startRecord = queryParams.has("startRecord") ? Number(queryParams.get("startRecord")) : undefined; + let numRecords: number; + if (queryParams.has("numRecords")) { + numRecords = Number(queryParams.get("numRecords")); + } else if (SettingsConfig.getDirectValue("zowe.pagination.enabled")) { + numRecords = SettingsConfig.getDirectValue("zowe.pagination.numRecords"); + } try { if (jesApi.downloadSingleSpool) { @@ -217,7 +224,7 @@ export class JobFSProvider extends BaseProvider implements vscode.FileSystemProv jobFile: spoolEntry.spool, stream: bufBuilder, startRecord, - numRecords: 250, + numRecords, }; // Handle encoding and binary options