{"version":3,"sources":["utils/forms/marshalling.ts","utils/sources.utils.ts","ui/pages/TaskLogs/utils.ts","utils/strings.ts","utils/validation/date.ts","utils/validation/validators.ts","utils/sources/sourcesUtils.ts","utils/polling.ts","webpack:///./src/ui/pages/TaskLogs/TaskLogsPage.module.less?44d9","utils/object.ts","ui/pages/TaskLogs/TaskLogViewer.tsx","ui/pages/TaskLogs/TasksTable.tsx","ui/pages/TaskLogs/TaskLogsPage.tsx"],"names":["mapFieldValueArray","array","map","value","isArray","isObject","makeObjectFromFieldsValues","fields","options","Object","keys","reduce","accumulator","current","omitEmptyValues","omitFieldsWithPrefix","startsWith","includes","isNullOrUndef","set","SourcesUtils","getDisplayName","src","displayName","sourceId","colorMap","SCHEDULED","undefined","RUNNING","FAILED","SUCCESS","TaskId","encode","str","replaceAll","decode","id","toTitleCaseDefaultOptions","rules","js","ts","db","api","url","ssl","ssh","tls","mysql","mongodb","googleads","jdbc","useDefaultRules","toTitleCaseDefaultOptionsWithoutRules","toTitleCase","split","separator","_word","word","toLowerCase","mappedByRule","toUpperCase","slice","join","snakeCaseToWords","naturalComparator","a","b","localeCompare","numeric","isValidFullIsoDate","date","DATE_REGEX","ISO_FULL","test","isValidFullWoMsIsoDate","ISO_FULL_WO_MS","isValidShortIsoDate","ISO_SHORT","IsValidIsoDate","isoDateValidator","errorMessage","validator","rule","Promise","reject","resolve","isAtLeastOneStreamSelected","source","length","config","selected_streams","Poll","callback","interval_ms","timeout_ms","interval","timeout","resultPromise","resultPromiseResolve","resultPromiseReject","requestsBlocked","result","endPolling","bind","failPolling","start","wait","cancel","clearInterval","clearTimeout","cleanup","error","Error","setInterval","then","setTimeout","assert","naturalComparatorBy","keyF","typedObjectEntries","object","entries","filterObject","decideIfNeedToKeep","fromEntries","filter","TaskLogViewerComponent","useParams","taskId","services","useServices","useState","setFilter","history","useHistory","viewerRef","useRef","logsReloading","setLogsReloading","fetchLogs","backendApiClient","get","encodeURIComponent","activeProject","proxy","useLoaderAsObject","taskLogsError","taskLogs","data","setTaskLogs","setData","sourcesStore","task","taskInfo","useEffect","connectorSource","allSources","find","candidate","snakeCase","sourceProtoType","currentPageHeaderStore","setBreadcrumbs","title","link","sourcesPageRoutes","root","pic","projectRoute","editExact","logs","scrollTo","scrollHeight","behavior","push","handleError","classNames","styles","logViewerWrapper","logViewer","message","l","level","logEntry","logTime","moment","utc","time","format","logLevel","padEnd","logMessage","replace","TaskLogViewer","observer","TasksTable","props","appServices","editSourceLink","generatePath","projectId","taskRuns","setTaskRuns","useLoader","urlParams","project_id","toISOString","end","collection","status","tasks","sort","comparator","t","Date","created_at","loadingError","tasksSorted","runTask","actionNotification","withProgressBar","estimatedMs","post","cancelTask","destinations","taskToRow","columns","c","toAntColumn","column","render","started","now","from","finished","diff","duration","minutes","seconds","hours","days","key","finished_at","dataIndex","text","record","TaskLogsPageComponent","params","location","useLocation","queryRaw","search","query","URLSearchParams","filterStatus","setFilterStatus","filterCollection","setFilterCollection","subtract","startOf","filterStart","setFilterStart","endOf","filterEnd","setFilterEnd","param","val","stateAction","toString","delete","queryStr","filterLabel","filterEdit","color","name","d","TaskLogsPage"],"mappings":";;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,GAAMA,mBAAkB,CAAG,QAArBA,mBAAqB,CAACC,KAAD,CAA2B,CACpD,MAAOA,MAAK,CAACC,GAAN,CAAU,SAAAC,KAAK,QACpBC,sDAAO,CAACD,KAAD,CAAP,CAAiBH,kBAAkB,CAACG,KAAD,CAAnC,CAA6CE,sDAAQ,CAACF,KAAD,CAAR,CAAkBG,0BAA0B,CAACH,KAAD,CAA5C,CAAsDA,KAD/E,EAAf,CAAP,CAGD,CAJD,CAMA,GAAMG,2BAA0B,CAAG,QAA7BA,2BAA6B,CACjCC,MADiC,CAEjCC,OAFiC,QAIjCC,OAAM,CAACC,IAAP,CAAYH,MAAZ,EAAoBI,MAApB,CAA2B,SAACC,WAAD,CAAmBC,OAAnB,CAAuC,CAChE,SA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kBAAAN,GAAG,CAAI,CACftI,SAAS,CAAC,OAAD,CAAUsI,GAAG,CAACP,OAAJ,CAAY,KAAZ,CAAV,CAA8BE,cAA9B,CAA8C,SAAAc,CAAC,QAAIA,EAAC,CAACrE,WAAF,EAAJ,EAA/C,CAAT,CACD,CALH,CAME,YAAY,CAAEsD,WANhB,EADF,EAFF,GAvCF,cAoDE,0DACE,mCAAM,SAAS,CAAEnF,6BAAM,CAAC8F,WAAxB,kBADF,cAEE,mCAAM,SAAS,CAAE9F,6BAAM,CAAC+F,UAAxB,uBACE,kDACE,SAAS,CAAC,QADZ,CAEE,UAAU,CAAE,KAFd,CAGE,QAAQ,CAAE,kBAAAN,GAAG,CAAI,CACftI,SAAS,CAAC,KAAD,CAAQsI,GAAG,CAACJ,KAAJ,CAAU,KAAV,CAAR,CAA0BE,YAA1B,CAAwC,SAAAW,CAAC,QAAIA,EAAC,CAACrE,WAAF,EAAJ,EAAzC,CAAT,CACD,CALH,CAME,YAAY,CAAEyD,SANhB,EADF,EAFF,GApDF,GADF,cAmEE,2BAAC,qBAAD,EACE,MAAM,CAAEhL,MADV,CAEE,UAAU,CAAEyK,gBAFd,CAGE,MAAM,CAAEF,YAHV,CAIE,SAAS,CAAE7H,QAAQ,CAACc,aAAT,CAAuB3G,EAJpC,CAKE,KAAK,CAAEgO,WALT,CAME,GAAG,CAAEG,SANP,EAnEF,GADF,CA8ED,CAlID,CAoIA,GAAMa,aAAY,CAAGlF,8BAAQ,CAACoD,kCAAD,CAA7B,CAEA8B,YAAY,CAAC7P,WAAb,CAA2B,cAA3B,C","file":"static/js/106.33ed97b2.chunk.js","sourcesContent":["import { isNullOrUndef } from \"lib/commons/utils\"\nimport isArray from \"lodash/isArray\"\nimport isObject from \"lodash/isObject\"\nimport set from \"lodash/set\"\n\nconst mapFieldValueArray = (array: Array) => {\n return array.map(value =>\n isArray(value) ? mapFieldValueArray(value) : isObject(value) ? makeObjectFromFieldsValues(value) : value\n )\n}\n\nconst makeObjectFromFieldsValues = (\n fields: any,\n options?: { omitEmptyValues?: boolean; omitFieldsWithPrefix?: string }\n): F =>\n Object.keys(fields).reduce((accumulator: any, current: string) => {\n const { omitEmptyValues, omitFieldsWithPrefix } = options ?? {}\n if (omitFieldsWithPrefix && current.startsWith(omitFieldsWithPrefix)) return accumulator\n\n const value = fields[current]\n if ([\"string\", \"number\", \"boolean\"].includes(typeof value)) {\n if (omitEmptyValues && (value === \"\" || isNullOrUndef(value))) return accumulator\n set(accumulator, current, value === \"null\" ? null : value)\n } else if (typeof value === \"object\") {\n if (isArray(value)) {\n set(accumulator, current, mapFieldValueArray(value))\n // set(\n // accumulator,\n // current,\n // value.map((f) =>\n // typeof f === 'object' ? makeObjectFromFieldsValues(f) : f\n // )\n // );\n } else if (value != null) {\n set(accumulator, current, makeObjectFromFieldsValues(value))\n }\n }\n\n return accumulator\n }, {} as F)\n\nexport { makeObjectFromFieldsValues }\n","export const SourcesUtils = {\n getDisplayName(src: SourceData) {\n return src.displayName || src.sourceId\n },\n}\n","export const colorMap: Record = {\n SCHEDULED: undefined,\n RUNNING: \"processing\",\n FAILED: \"error\",\n SUCCESS: \"success\",\n}\n\nexport type TaskStatus = \"SCHEDULED\" | \"RUNNING\" | \"FAILED\" | \"SUCCESS\"\n\nexport interface Task {\n id: string\n source: string\n collection: string\n priority: number\n created_at: string\n finished_at: string\n started_at: string\n status: TaskStatus\n}\n\nexport interface TaskLogEntry {\n time: string\n message: string\n level: \"info\" | \"warn\" | \"error\"\n}\n\n/**\n * Since task ID contains symbols that are not URL friendly (dot doesn't work well\n * with react-router), we need to encode/decode it before using in URL\n *\n * Note: encoding does not include URI encodling (encodeURIComponent/decodeURIComponent).\n * It should be done separately\n */\nexport const TaskId = {\n encode: (str: string) => {\n return str.replaceAll(\".\", \"-dot-\").replaceAll(\"#\", \"-sharp-\")\n },\n decode: (id: string) => {\n return id.replaceAll(\"-dot-\", \".\").replaceAll(\"-sharp-\", \"#\")\n },\n}\n","/**\n * Object of options for the `toTitleCase` function\n */\ntype ToTitleCaseOptions = {\n /**\n * Object with specific rules that override the default title case 'word' -> 'Word' mapping\n */\n rules?: Rules\n /**\n * Flag that controls whether to apply the default mapping rules\n */\n useDefaultRules?: boolean\n /**\n * Specify a separator such as '_' for the snake case. Default separator is whitespace.\n */\n separator?: string\n}\n\ntype Rules = { [key: string]: string }\n\nconst toTitleCaseDefaultOptions: ToTitleCaseOptions = {\n rules: {\n js: \"JS\",\n ts: \"TS\",\n id: \"ID\",\n db: \"DB\",\n api: \"API\",\n url: \"URL\",\n ssl: \"SSL\",\n ssh: \"SSH\",\n tls: \"TLS\",\n mysql: \"MySQL\",\n mongodb: \"MongoDB\",\n googleads: \"GoogleAds\",\n jdbc: \"JDBC\",\n },\n useDefaultRules: true,\n}\n\nconst { rules, ...toTitleCaseDefaultOptionsWithoutRules }: ToTitleCaseOptions = toTitleCaseDefaultOptions\n\n/**\n * Maps the string to the title case. Uses a default abbreviations dictionary\n * to uppercase them. You may override the default abbreviation dictionary by\n * passing your own, or you can disable abbreviations uppercasing at all by\n * setting the corresponding flag.\n * @param value a string to map to the title case\n * @param rulesDict\n * An object which keys are lovercased strings and which values are\n * the correctly uppercased strings. To omit this argument just\n * set it to any falsy value.\n *\n * The Function uses a default dictionary of rules. You can extend it\n * by passing your own dictionary or you can disable it completely by setting\n * `useDefaultRules: true` in the options argument.\n * @param options options object that configures the mapping.\n * @example\n * ```\n * const myOwnRules = {\n * js: 'JSX', // will override the default 'JS' rule\n * nhtca: 'NHTCA', // will extend the default rules\n * }\n *\n * toTitleCase('uSe of js is prohIbitEd by nhtca', {rules})\n * // 'Use Of JSX Is Prohibited By NHTCA'\n * ```\n */\nexport const toTitleCase = (value: string, options?: ToTitleCaseOptions): string => {\n if (!value) {\n return \"\"\n }\n\n const { rules } = options\n ? options.useDefaultRules === false\n ? { ...toTitleCaseDefaultOptionsWithoutRules, ...options }\n : { ...toTitleCaseDefaultOptions, ...options }\n : toTitleCaseDefaultOptions\n return value\n .split(options?.separator ?? \" \")\n .map(_word => {\n const word = _word.toLowerCase()\n const mappedByRule = rules[word]\n return mappedByRule || `${word[0].toUpperCase()}${word.slice(1)}`\n })\n .join(\" \")\n}\n\n/**\n * Maps a `snake_case` string to a `regular case` string\n * @param value string to convert\n */\nexport const snakeCaseToWords = (value: string): string => {\n return value.split(\"_\").join(\" \")\n}\n\n/**\n * Compares strings in a locale-specific manner.\n */\nexport function naturalComparator(a: string, b: string): number {\n return a.localeCompare(b, undefined, { numeric: true })\n}\n","import { DATE_REGEX } from \"constants/regex\"\n\nconst isValidFullIsoDate = (date: string) => DATE_REGEX.ISO_FULL.test(date)\nconst isValidFullWoMsIsoDate = (date: string) => DATE_REGEX.ISO_FULL_WO_MS.test(date)\nconst isValidShortIsoDate = (date: string) => DATE_REGEX.ISO_SHORT.test(date)\nconst IsValidIsoDate = (date: string) =>\n isValidFullIsoDate(date) || isValidFullWoMsIsoDate(date) || isValidShortIsoDate(date)\n\nexport { isValidFullIsoDate, isValidFullWoMsIsoDate, isValidShortIsoDate, IsValidIsoDate }\n","import { isValidFullIsoDate, isValidFullWoMsIsoDate } from \"utils/validation/date\"\n\nconst isoDateValidator = (errorMessage: string) => {\n return {\n validator: (rule, value) =>\n !value\n ? Promise.reject(errorMessage)\n : isValidFullIsoDate(value) || isValidFullWoMsIsoDate(value)\n ? Promise.resolve()\n : Promise.reject(\"Please, fill in correct ISO 8601 date, YYYY-MM-DDThh:mm:ss[.SSS]Z\"),\n }\n}\n\nexport { isoDateValidator }\n","export const isAtLeastOneStreamSelected = (source: SourceData): boolean => {\n return !!source?.[\"collections\"]?.length || !!source.config?.selected_streams\n}\n","import { assert } from \"./typeCheck\"\n\nexport interface IPoll {\n start(): void\n wait(): Promise\n cancel(): void\n}\n\ntype EndPollingFunction = (result: T) => void\ntype FailPollingFunction = (error?: Error) => void\n\nexport type PollingSetupCallback = (\n end: EndPollingFunction,\n fail: FailPollingFunction\n) => VoidFunction | AsyncVoidFunction\n\n/**\n * Class representing a polling instance that will run the passed callback periodically.\n */\nexport class Poll implements IPoll {\n private interval_ms: number = 1000\n private timeout_ms: number = 5 * 60 * 1000 // 5 min by default\n private callback: null | VoidFunction | AsyncVoidFunction = null\n private interval: null | ReturnType = null\n private timeout: null | ReturnType = null\n private resultPromise: null | Promise = null\n private resultPromiseResolve: null | ((value: T | PromiseLike) => void) = null\n private resultPromiseReject: null | ((reason: any) => void) = null\n private requestsBlocked: boolean = false\n private result: undefined | T\n\n /**\n * Creates a polling instane.\n * @param callback polling callback that provides the `end` function as the first argument. That function should be called like `end(result)` to stop the polling and return the result from the polling instance. The callback should return a function that will be polled.\n * @param interval_ms polling interval\n * @param timeout_ms polling timeout after which the poll will resolve with `null`\n */\n constructor(callback: PollingSetupCallback, interval_ms?: number, timeout_ms?: number) {\n this.endPolling = this.endPolling.bind(this)\n this.failPolling = this.failPolling.bind(this)\n this.start = this.start.bind(this)\n this.wait = this.wait.bind(this)\n this.cancel = this.cancel.bind(this)\n\n if (interval_ms) this.interval_ms = interval_ms\n if (timeout_ms) this.timeout_ms = timeout_ms\n this.callback = callback(this.endPolling, this.failPolling)\n }\n\n private cleanup() {\n if (this.interval) {\n clearInterval(this.interval)\n this.interval = null\n }\n if (this.timeout) {\n clearTimeout(this.timeout)\n this.timeout = null\n }\n }\n\n private endPolling(result: T | null = null): void {\n this.result = result\n this.cleanup()\n this.resultPromiseResolve?.(result)\n this.resultPromiseResolve = null\n }\n\n private failPolling(error?: Error) {\n this.cleanup()\n if (this.resultPromiseReject) {\n this.resultPromiseReject(error || new Error(\"Polling silently failed. Please, see the stack trace for details.\"))\n this.resultPromiseReject = null\n }\n }\n\n /**\n * Initializes the polling.\n */\n public start(): void {\n if (this.interval) return\n // set up the variable for resolving the polling promise\n this.resultPromise = new Promise((resolve, reject) => {\n this.resultPromiseResolve = resolve\n this.resultPromiseReject = reject\n })\n // set up the polling\n this.interval = setInterval(async () => {\n if (!this.requestsBlocked) {\n this.requestsBlocked = true\n ;(async () => this.callback())().then(() => {\n this.requestsBlocked = false\n })\n }\n }, this.interval_ms)\n this.timeout = setTimeout(this.endPolling, this.timeout_ms + 30) // 30ms safety margin for all calls to complete (to account for the minimum delay between the async calls)\n }\n\n /**\n * @returns The promise that will resolve to a result once the\n * polling is stopped; The result will be `null` if the polling\n * is force stopped with `.cancel()` or if the poll timed out.\n */\n public async wait(): Promise {\n assert(\n !!this.resultPromise || typeof this.result !== \"undefined\",\n \"`wait` function can not be called before calling the `start` function.\"\n )\n return this.resultPromise || this.result\n }\n\n /**\n * Force stops the polling and discards possible subsequent async updates,\n * yielding `wait` method to resolve with `null`\n */\n public cancel(): void {\n this.endPolling()\n }\n}\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"box-shadow-base\":\"TaskLogsPage_box-shadow-base__3hMJQ\",\"border-debug\":\"TaskLogsPage_border-debug__3ASOH\",\"font-heading\":\"TaskLogsPage_font-heading__3nxia\",\"font-monospace\":\"TaskLogsPage_font-monospace__3Hr1i\",\"ant-select-disabled\":\"TaskLogsPage_ant-select-disabled__1OsfB\",\"ant-select\":\"TaskLogsPage_ant-select__QYJbL\",\"ant-select-customize-input\":\"TaskLogsPage_ant-select-customize-input__3HDaX\",\"ant-select-selector\":\"TaskLogsPage_ant-select-selector__3tHjg\",\"ant-input-number-disabled\":\"TaskLogsPage_ant-input-number-disabled__2RsRa\",\"ant-select-item-option-selected\":\"TaskLogsPage_ant-select-item-option-selected__FBCbR\",\"ant-select-item-option-active\":\"TaskLogsPage_ant-select-item-option-active__Q8YZl\",\"ant-dropdown-menu-submenu-active\":\"TaskLogsPage_ant-dropdown-menu-submenu-active__1MVzh\",\"ant-dropdown-menu-submenu-title\":\"TaskLogsPage_ant-dropdown-menu-submenu-title__uf8MJ\",\"ant-collapse-content-box\":\"TaskLogsPage_ant-collapse-content-box__29Bsb\",\"ant-card\":\"TaskLogsPage_ant-card__1Vme6\",\"ant-modal-content\":\"TaskLogsPage_ant-modal-content__2YSTm\",\"ant-table-tbody\":\"TaskLogsPage_ant-table-tbody__3E1l3\",\"ant-table-thead\":\"TaskLogsPage_ant-table-thead__3gv5G\",\"ant-checkbox-inner\":\"TaskLogsPage_ant-checkbox-inner__3-A6d\",\"ant-modal-header\":\"TaskLogsPage_ant-modal-header__3plWO\",\"ant-table\":\"TaskLogsPage_ant-table__1XSEf\",\"ant-list-split\":\"TaskLogsPage_ant-list-split__1nv7u\",\"ant-list-header\":\"TaskLogsPage_ant-list-header__ebKBY\",\"ant-tag\":\"TaskLogsPage_ant-tag__30fkz\",\"ant-tooltip-inner\":\"TaskLogsPage_ant-tooltip-inner__3m-FP\",\"ant-badge-status-processing\":\"TaskLogsPage_ant-badge-status-processing__3Upp5\",\"ant-dropdown-menu-item-active\":\"TaskLogsPage_ant-dropdown-menu-item-active__22UCB\",\"ant-dropdown\":\"TaskLogsPage_ant-dropdown__7doc0\",\"ant-popover-inner\":\"TaskLogsPage_ant-popover-inner__1F94k\",\"ant-popover-arrow\":\"TaskLogsPage_ant-popover-arrow__1Ymjg\",\"ant-popover-placement-rightTop\":\"TaskLogsPage_ant-popover-placement-rightTop__2EMPL\",\"ant-popover-content\":\"TaskLogsPage_ant-popover-content__1rE2s\",\"ant-popover-placement-leftBottom\":\"TaskLogsPage_ant-popover-placement-leftBottom__t1hxr\",\"ant-popover-placement-bottomRight\":\"TaskLogsPage_ant-popover-placement-bottomRight__2cEno\",\"ant-popover-placement-top\":\"TaskLogsPage_ant-popover-placement-top__E1N0D\",\"icon-size-base\":\"TaskLogsPage_icon-size-base__xs3b6\",\"icon-size-lg\":\"TaskLogsPage_icon-size-lg__1c_gN\",\"ant-tabs-card\":\"TaskLogsPage_ant-tabs-card__3b1nq\",\"ant-tabs-tab-active\":\"TaskLogsPage_ant-tabs-tab-active__1fFQH\",\"ant-skeleton\":\"TaskLogsPage_ant-skeleton__2UKVL\",\"ant-skeleton-paragraph\":\"TaskLogsPage_ant-skeleton-paragraph__2_L18\",\"filterLabel\":\"TaskLogsPage_filterLabel__38_IO\",\"filterEdit\":\"TaskLogsPage_filterEdit__2jLNy\",\"logViewer\":\"TaskLogsPage_logViewer__4d0Fj\",\"logViewerWrapper\":\"TaskLogsPage_logViewerWrapper__386LJ\",\"logEntry_error\":\"TaskLogsPage_logEntry_error__sWrta\",\"logEntry_info\":\"TaskLogsPage_logEntry_info__32m-A\",\"logEntry_warn\":\"TaskLogsPage_logEntry_warn__21bt1\",\"logEntry_debug\":\"TaskLogsPage_logEntry_debug__1s4IF\"};","import { naturalComparator } from \"./strings\"\n\n/**\n * Compares objects by a specified field value. The value must be string.\n * @param keyF predicate that returns a field value from object\n **/\nexport function naturalComparatorBy(keyF: (obj: T) => string): (a: T, b: T) => number {\n return (a, b) => naturalComparator(keyF(a), keyF(b))\n}\n\n/**\n * Works exactly the same as `Object.entries` except that returns the union type of the object keys istead of a generic `string` type.\n * ```\n * WARNING``` - the function is only safe to use with objects that are not expected to be mutated in runtime.\n * @param object - object to extract entries from\n */\nexport const typedObjectEntries = (object: O): [keyof O, O[keyof O]][] => {\n return Object.entries(object) as [keyof O, O[keyof O]][]\n}\n\n/**\n * Filters object properties by the rule\n * As a second generic parameter pass a union of keys that will be definitely preserved\n * @param object object to process\n * @param decideIfNeedToKeep rule that accepts object entries and returns boolean that if true will keep the object field\n * @returns new object with some fields filtered away\n */\nexport const filterObject = (\n object: T,\n decideIfNeedToKeep: (entry: [key: string, value: unknown]) => boolean\n): Pick & Partial> => {\n return Object.fromEntries(Object.entries(object).filter(decideIfNeedToKeep)) as Pick &\n Partial>\n}\n\n// type NonNullableObject = {[key: keyof T]: T[keyof T]}\n\n// export const filterObjectNullishFields = (object: T): {[key: keyof T]: T[keyof T]} => {\n// return {}\n// }\n","// @Libs\nimport moment from \"moment\"\nimport { Button, Tag } from \"antd\"\nimport classNames from \"classnames\"\nimport snakeCase from \"lodash/snakeCase\"\nimport { observer } from \"mobx-react-lite\"\nimport React, { useEffect, useRef, useState } from \"react\"\nimport { useHistory, useParams } from \"react-router-dom\"\n// @Hooks\nimport { useServices } from \"hooks/useServices\"\nimport { useLoaderAsObject } from \"hooks/useLoader\"\n// @Components\nimport { PageHeader } from \"ui/components/PageHeader/PageHeader\"\nimport { CenteredError, CenteredSpin, handleError } from \"lib/components/components\"\n// @Icons\nimport ArrowLeftOutlined from \"@ant-design/icons/lib/icons/ArrowLeftOutlined\"\nimport ReloadOutlined from \"@ant-design/icons/lib/icons/ReloadOutlined\"\n// @Lib\nimport { allSources } from \"@jitsu/catalog\"\n// @Routes\nimport { sourcesPageRoutes } from \"ui/pages/SourcesPage/SourcesPage.routes\"\n// @Utils\nimport { Task, TaskId, TaskLogEntry } from \"./utils\"\n// @Types\nimport type { SourceConnector } from \"@jitsu/catalog\"\n// @Styles\nimport styles from \"./TaskLogsPage.module.less\"\nimport { sourcesStore } from \"stores/sources\"\nimport { projectRoute } from \"lib/components/ProjectLink/ProjectLink\"\nimport { currentPageHeaderStore } from \"stores/currentPageHeader\"\n\ntype TaskInfo = {\n task: Task\n source: SourceData\n}\n\nconst TaskLogViewerComponent: React.FC = () => {\n let { sourceId, taskId } = useParams<{ sourceId: string; taskId: string }>()\n taskId = TaskId.decode(taskId)\n const services = useServices()\n const [filter, setFilter] = useState(\"all\")\n const history = useHistory()\n const viewerRef = useRef(null)\n const [logsReloading, setLogsReloading] = useState(false)\n\n async function fetchLogs(): Promise {\n return (\n await services.backendApiClient.get(\n `/tasks/${encodeURIComponent(taskId)}/logs?project_id=${services.activeProject.id}`,\n { proxy: true }\n )\n )[\"logs\"]\n }\n\n const {\n error: taskLogsError,\n data: taskLogs,\n setData: setTaskLogs,\n } = useLoaderAsObject(async () => {\n return await fetchLogs()\n })\n\n const { error, data: taskInfo } = useLoaderAsObject(async () => {\n const source = sourcesStore.get(sourceId)\n if (!source) throw new Error(`Source with ID ${sourceId} not found.`)\n\n const task = await services.backendApiClient.get(\n `/tasks/${encodeURIComponent(taskId)}?project_id=${services.activeProject.id}`,\n { proxy: true }\n )\n return { task, source }\n })\n\n useEffect(() => {\n if (taskInfo) {\n const connectorSource = allSources.find(\n (candidate: SourceConnector) =>\n snakeCase(candidate.id) === taskInfo.source?.sourceProtoType ?? ({} as SourceConnector)\n )\n currentPageHeaderStore.setBreadcrumbs(\n { title: \"Sources\", link: sourcesPageRoutes.root },\n {\n title: ,\n link: projectRoute(sourcesPageRoutes.editExact, { sourceId }),\n },\n {\n title: \"Logs\",\n link: projectRoute(sourcesPageRoutes.logs, { sourceId }),\n },\n { title: \"Task Log\" }\n )\n }\n }, [sourceId, taskId, taskInfo])\n\n useEffect(() => {\n if (viewerRef.current) {\n viewerRef.current.scrollTo(0, viewerRef.current.scrollHeight, { behavior: \"smooth\" })\n }\n })\n\n if (error) {\n return \n } else if (!taskInfo) {\n return \n }\n\n return (\n
\n
\n
\n }\n onClick={() => history.push(projectRoute(sourcesPageRoutes.logs, { sourceId }))}\n >\n Back to task list\n \n
\n Show:{\" \"}\n \n setFilter(\"all\")}>\n {filter === \"all\" && \"✓\"}All\n \n setFilter(\"errors\")}\n >\n {filter !== \"all\" && \"✓\"}Errors\n \n \n
\n
\n }\n loading={logsReloading}\n onClick={async () => {\n setLogsReloading(true)\n try {\n setTaskLogs(await fetchLogs())\n } catch (e) {\n handleError(e, \"Failed to reload logs\")\n } finally {\n setLogsReloading(false)\n }\n }}\n >\n Reload\n \n
\n
\n
\n          {taskLogsError && \"Failed to load logs: \" + taskLogsError.message}\n          {!taskLogs && \"Loading logs...\"}\n          {taskLogs &&\n            taskLogs\n              .filter(l => filter === \"all\" || (filter === \"errors\" && l.level === \"error\"))\n              .map(l => (\n                \n                  {moment.utc(l.time).format(\"YYYY-MM-DD HH:mm:ss\")}\n                   [{l.level.toUpperCase().padEnd(5)}] -{\" \"}\n                  {l.message.replace(`[${taskId}] `, \"\")}\n                  {\"\\n\"}\n                \n              ))}\n        
\n
\n
\n )\n}\n\nconst TaskLogViewer = observer(TaskLogViewerComponent)\n\nTaskLogViewer.displayName = \"TaskLogViewer\"\n\nexport { TaskLogViewer }\n","import { generatePath, NavLink } from \"react-router-dom\"\nimport React, { ReactNode, useState } from \"react\"\nimport { CenteredError, CenteredSpin, withProgressBar } from \"lib/components/components\"\nimport { Button, Dropdown, Menu, Table, Tag } from \"antd\"\nimport RedoOutlined from \"@ant-design/icons/lib/icons/RedoOutlined\"\nimport CloseCircleOutlined from \"@ant-design/icons/lib/icons/CloseCircleOutlined\"\nimport moment, { Moment } from \"moment\"\nimport { colorMap, Task, TaskId, TaskStatus } from \"ui/pages/TaskLogs/utils\"\nimport useLoader from \"hooks/useLoader\"\nimport { useServices } from \"hooks/useServices\"\nimport { sourcesPageRoutes } from \"ui/pages/SourcesPage/SourcesPage.routes\"\nimport { comparator } from \"../../../lib/commons/utils\"\nimport { isAtLeastOneStreamSelected } from \"utils/sources/sourcesUtils\"\nimport { NoStreamsSelectedMessage } from \"ui/components/NoStreamsSelectedMessage/NoStreamsSelectedMessage\"\nimport { actionNotification } from \"ui/components/ActionNotification/ActionNotification\"\nimport { projectRoute } from \"../../../lib/components/ProjectLink/ProjectLink\"\n\nexport type TasksTableProps = {\n source: SourceData\n projectId: string\n start: Moment\n end: Moment\n status?: TaskStatus\n collection?: string\n}\nexport const TasksTable: React.FC = props => {\n const appServices = useServices()\n const editSourceLink = generatePath(sourcesPageRoutes.editExact, {\n projectId: appServices.activeProject.id,\n sourceId: props.source.sourceId,\n })\n\n const [taskRuns, setTaskRuns] = useState(0) //to trigger reload on manual task run\n const [loadingError, tasksSorted] = useLoader(async () => {\n const tasks = await appServices.backendApiClient.get(\"/tasks\", {\n proxy: true,\n urlParams: {\n project_id: props.projectId,\n source: `${props.projectId}.${props.source.sourceId}`,\n start: props.start.toISOString(),\n end: props.end.toISOString(),\n collection: props.collection || undefined,\n status: props.status || undefined,\n },\n })\n return tasks.tasks.sort(comparator(t => new Date(t.created_at)))\n }, [props.projectId, props.start, props.end, props.collection, props.status, taskRuns])\n\n const runTask = (source: string, collection: string) => {\n return async () => {\n if (!isAtLeastOneStreamSelected(props.source)) {\n actionNotification.error()\n return\n }\n return await withProgressBar({\n estimatedMs: 100,\n callback: async () => {\n await appServices.backendApiClient.post(\"/tasks\", undefined, {\n proxy: true,\n urlParams: {\n source,\n collection,\n project_id: props.projectId,\n },\n })\n setTaskRuns(taskRuns + 1)\n },\n })\n }\n }\n\n const cancelTask = (taskId: string) => {\n return async () => {\n return await withProgressBar({\n estimatedMs: 1000,\n callback: async () => {\n await appServices.backendApiClient.post(\n `/tasks/${taskId}/cancel`,\n {},\n { proxy: true, urlParams: { project_id: props.projectId } }\n )\n setTaskRuns(taskRuns + 1)\n },\n })\n }\n }\n if (!props.source?.destinations || props.source.destinations.length === 0) {\n return (\n
\n No destinations is configured for this source. Synchronization tasks will not run. Configure destinations on{\" \"}\n \n Linked Destinations tab\n \n
\n )\n }\n\n if (loadingError) {\n return \n } else if (!tasksSorted) {\n return \n }\n return (\n \n taskToRow(t, runTask(`${props.projectId}.${props.source.sourceId}`, t.collection), cancelTask(t.id))\n )}\n columns={columns.map(c => toAntColumn(c, props))}\n />\n )\n}\n\ntype TableRow = {\n runTask: () => Promise\n cancelTask: () => Promise\n key: string\n status: TaskStatus\n date: {\n started?: Date\n finished?: Date\n }\n collection: string\n logs: {\n taskId: string\n }\n}\n\ntype ColumnData = {\n column: string\n title: string\n render?: (row: TableRow, props: TasksTableProps) => ReactNode\n}\n\nconst columns: ColumnData[] = [\n {\n column: \"status\",\n title: \"Status\",\n render: t => {\n return (\n
\n
\n {t.status}\n
\n
\n )\n },\n },\n {\n column: \"date\",\n title: \"Started\",\n render: (t, props) => {\n const date = t.date ? moment.utc(t.date.started.toISOString()) : null\n const now = moment.utc(new Date().toISOString())\n return (\n
\n
\n {date ? date.from(now) : \"Not started\"}\n {\" • \"}\n \n View logs\n \n
\n
{date.format(\"YYYY-MM-DD HH:mm:ss\")} (UTC)
\n
\n )\n },\n },\n {\n column: \"duration\",\n title: \"Duration\",\n render: (t, props) => {\n if (t.date?.started && t.date?.finished) {\n const diff = moment(t.date?.finished).diff(moment(t.date?.started))\n const duration = moment.duration(diff);\n let format = `${duration.minutes()}m ${duration.seconds()}s`;\n if (duration.hours() > 0 || duration.days() > 0) {\n format = `${duration.hours()}h ` + format;\n }\n if (duration.days() > 0) {\n format = `${duration.days()}d ` + format;\n }\n return format;\n } else {\n return \" n/a \"\n }\n },\n },\n {\n column: \"collection\",\n title: \"Collection\",\n render: t => {\n return t.collection\n },\n },\n {\n column: \"action\",\n title: \"Action\",\n render: t => {\n return (\n \n } onClick={async () => await t.runTask()}>\n Run Once Again\n \n {(t.status === \"RUNNING\" || t.status === \"SCHEDULED\") && (\n }\n onClick={async () => {\n await t.cancelTask()\n }}\n >\n Cancel\n \n )}\n \n }\n >\n
\n
\n
\n \n )\n },\n },\n]\n\nfunction taskToRow(t: Task, runTask: () => Promise, cancelTask: () => Promise): TableRow {\n return {\n runTask,\n cancelTask,\n key: t.id,\n status: t.status,\n date: {\n started: t.created_at ? new Date(t.created_at) : undefined,\n finished: t.finished_at ? new Date(t.finished_at) : undefined,\n },\n collection: t.collection,\n logs: {\n taskId: t.id,\n },\n }\n}\n\nfunction toAntColumn(c: ColumnData, props: TasksTableProps) {\n return {\n dataIndex: c.column,\n key: c.column,\n title: c.title,\n render: c.render\n ? (text, record) => {\n return c.render(record, props)\n }\n : undefined,\n }\n}\n","import { useHistory, useLocation, useParams } from \"react-router-dom\"\nimport React, { useEffect, useState } from \"react\"\nimport { CenteredSpin } from \"lib/components/components\"\nimport { DatePicker, Select, Tag } from \"antd\"\nimport { TasksTable } from \"ui/pages/TaskLogs/TasksTable\"\nimport { useServices } from \"hooks/useServices\"\nimport { colorMap, TaskStatus } from \"./utils\"\nimport styles from \"./TaskLogsPage.module.less\"\nimport moment from \"moment\"\nimport { allSources } from \"@jitsu/catalog\"\nimport snakeCase from \"lodash/snakeCase\"\nimport { SourceConnector } from \"@jitsu/catalog\"\nimport { PageHeader } from \"ui/components/PageHeader/PageHeader\"\nimport { sourcesPageRoutes } from \"ui/pages/SourcesPage/SourcesPage.routes\"\nimport { currentPageHeaderStore } from \"../../../stores/currentPageHeader\"\nimport { projectRoute } from \"../../../lib/components/ProjectLink/ProjectLink\"\nimport { sourcesStore } from \"stores/sources\"\nimport { observer } from \"mobx-react-lite\"\n\nconst TaskLogsPageComponent: React.FC = () => {\n const params = useParams<{ sourceId: string; taskId: string }>()\n const services = useServices()\n const location = useLocation()\n const history = useHistory()\n const queryRaw = location.search\n const query = new URLSearchParams(queryRaw)\n const [filterStatus, setFilterStatus] = useState((query.get(\"status\") as TaskStatus) || undefined)\n const [filterCollection, setFilterCollection] = useState(query.get(\"collection\") || undefined)\n const [filterStart, setFilterStart] = useState(\n query.get(\"start\") ? moment.utc(query.get(\"start\")) : moment.utc().subtract(1, \"days\").startOf(\"day\")\n )\n const [filterEnd, setFilterEnd] = useState(\n query.get(\"end\") ? moment.utc(query.get(\"end\")) : moment.utc().endOf(\"day\")\n )\n const source = sourcesStore.get(params.sourceId)\n\n useEffect(() => {\n if (source) {\n const connectorSource = allSources.find(\n (candidate: SourceConnector) => snakeCase(candidate.id) === source?.sourceProtoType ?? ({} as SourceConnector)\n )\n\n currentPageHeaderStore.setBreadcrumbs(\n { title: \"Sources\", link: projectRoute(sourcesPageRoutes.root) },\n {\n title: ,\n link: \"/sources/edit/\" + source.sourceId,\n },\n { title: \"Logs\" }\n )\n }\n }, [source?.sourceId])\n\n const setFilter = (param, val, stateAction, toString?: (any) => string) => {\n toString = toString || (val => val + \"\")\n if (val !== undefined) {\n query.set(param, toString(val))\n } else {\n query.delete(param)\n }\n let queryStr = query.toString()\n if (queryStr.length > 0) {\n queryStr = \"?\" + queryStr\n }\n history.push(`/prj-${services.activeProject.id}/sources/logs/${source.sourceId}${queryStr}`)\n stateAction(val)\n }\n\n if (!source) {\n return \n }\n return (\n <>\n
\n
\n Status:\n \n {\n setFilter(\"status\", val === \"ALL\" ? undefined : (val as TaskStatus), setFilterStatus)\n }}\n >\n ALL\n {Object.entries(colorMap).map(([status, color]) => (\n \n {status}\n \n ))}\n \n \n
\n
\n Collection:\n \n {\n setFilter(\"collection\", val === \"ALL\" ? undefined : val, setFilterCollection)\n }}\n >\n ALL\n {(source[\"collections\"] ?? []).map(({ name }) => (\n \n {name}\n \n ))}\n \n \n
\n
\n From: \n \n {\n setFilter(\"start\", val.startOf(\"day\"), setFilterStart, d => d.toISOString())\n }}\n defaultValue={filterStart}\n />\n \n
\n
\n To: \n \n {\n setFilter(\"end\", val.endOf(\"day\"), setFilterEnd, d => d.toISOString())\n }}\n defaultValue={filterEnd}\n />\n \n
\n
\n \n \n )\n}\n\nconst TaskLogsPage = observer(TaskLogsPageComponent)\n\nTaskLogsPage.displayName = \"TaskLogsPage\"\n\nexport { TaskLogsPage }\n"],"sourceRoot":""}