1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
18 | return new (P || (P = Promise))(function (resolve, reject) {
|
19 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
20 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
21 | function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
22 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
23 | });
|
24 | };
|
25 | Object.defineProperty(exports, "__esModule", { value: true });
|
26 | const RolarProgressLog_1 = require("./RolarProgressLog");
|
27 |
|
28 |
|
29 |
|
30 | class DashboardDisplayProgressLog {
|
31 | constructor(rolarBaseUrl, bufferSize, flushInterval, context, sdmGoal) {
|
32 | this.context = context;
|
33 | this.sdmGoal = sdmGoal;
|
34 | this.rolarProgressLog =
|
35 | new RolarProgressLog_1.RolarProgressLog(rolarBaseUrl, constructLogPath(context, sdmGoal), bufferSize, flushInterval);
|
36 | }
|
37 | get name() {
|
38 | return this.rolarProgressLog.name;
|
39 | }
|
40 | get url() {
|
41 | const path = constructLogPath(this.context, this.sdmGoal);
|
42 | return `https://app.atomist.com/workspace/${path[0]}/logs/${path.slice(1).join("/")}`;
|
43 | }
|
44 | isAvailable() {
|
45 | return __awaiter(this, void 0, void 0, function* () {
|
46 | return this.rolarProgressLog.isAvailable();
|
47 | });
|
48 | }
|
49 | write(what) {
|
50 | this.rolarProgressLog.write(what);
|
51 | }
|
52 | flush() {
|
53 | return this.rolarProgressLog.flush();
|
54 | }
|
55 | close() {
|
56 | return this.rolarProgressLog.close();
|
57 | }
|
58 | }
|
59 | exports.DashboardDisplayProgressLog = DashboardDisplayProgressLog;
|
60 | function constructLogPath(context, sdmGoal) {
|
61 | return [
|
62 | context.workspaceId,
|
63 | sdmGoal.repo.owner,
|
64 | sdmGoal.repo.name,
|
65 | sdmGoal.sha,
|
66 | sdmGoal.environment,
|
67 | sdmGoal.name,
|
68 | sdmGoal.goalSetId,
|
69 | context.correlationId,
|
70 | ];
|
71 | }
|
72 | exports.constructLogPath = constructLogPath;
|
73 |
|
\ | No newline at end of file |