UNPKG

@hpcc-js/comms

Version:
155 lines 6.05 kB
import * as tslib_1 from "tslib"; import { debounce, StateObject } from "@hpcc-js/util"; import { SMCService } from "../services/wsSMC"; import { Workunit } from "./workunit"; var _activity; var Activity = /** @class */ (function (_super) { tslib_1.__extends(Activity, _super); function Activity(optsConnection) { var _this = _super.call(this) || this; _this.lazyRefresh = debounce(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () { var response; return tslib_1.__generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this.connection.Activity({})]; case 1: response = _a.sent(); this.set(response); return [2 /*return*/, this]; } }); }); }); if (optsConnection instanceof SMCService) { _this.connection = optsConnection; } else { _this.connection = new SMCService(optsConnection); } _this.clear({}); return _this; } Object.defineProperty(Activity.prototype, "properties", { get: function () { return this.get(); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "Exceptions", { get: function () { return this.get("Exceptions"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "Build", { get: function () { return this.get("Build"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "ThorClusterList", { get: function () { return this.get("ThorClusterList"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "RoxieClusterList", { get: function () { return this.get("RoxieClusterList"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "HThorClusterList", { get: function () { return this.get("HThorClusterList"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "DFUJobs", { get: function () { return this.get("DFUJobs"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "Running", { get: function () { return this.get("Running", { ActiveWorkunit: [] }); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "BannerContent", { get: function () { return this.get("BannerContent"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "BannerColor", { get: function () { return this.get("BannerColor"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "BannerSize", { get: function () { return this.get("BannerSize"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "BannerScroll", { get: function () { return this.get("BannerScroll"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "ChatURL", { get: function () { return this.get("ChatURL"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "ShowBanner", { get: function () { return this.get("ShowBanner"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "ShowChatURL", { get: function () { return this.get("ShowChatURL"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "SortBy", { get: function () { return this.get("SortBy"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "Descending", { get: function () { return this.get("Descending"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "SuperUser", { get: function () { return this.get("SuperUser"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "AccessRight", { get: function () { return this.get("AccessRight"); }, enumerable: true, configurable: true }); Object.defineProperty(Activity.prototype, "ServerJobQueues", { get: function () { return this.get("ServerJobQueues"); }, enumerable: true, configurable: true }); Activity.attach = function (optsConnection, state) { if (!_activity) { _activity = new Activity(optsConnection); } if (state) { _activity.set(tslib_1.__assign({}, state)); } return _activity; }; Activity.prototype.runningWorkunits = function (clusterName) { var _this = this; if (clusterName === void 0) { clusterName = ""; } return this.Running.ActiveWorkunit.filter(function (awu) { return clusterName === "" || awu.ClusterName === clusterName; }).map(function (awu) { return Workunit.attach(_this.connection.connectionOptions(), awu.Wuid, awu); }); }; Activity.prototype.refresh = function () { return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { return [2 /*return*/, this.lazyRefresh()]; }); }); }; return Activity; }(StateObject)); export { Activity }; //# sourceMappingURL=activity.js.map