1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | const RolarProgressLog_1 = require("./RolarProgressLog");
|
19 |
|
20 |
|
21 |
|
22 | class DashboardDisplayProgressLog {
|
23 | constructor(rolarBaseUrl, bufferSize, flushInterval, context, sdmGoal) {
|
24 | this.context = context;
|
25 | this.sdmGoal = sdmGoal;
|
26 | this.rolarProgressLog =
|
27 | new RolarProgressLog_1.RolarProgressLog(rolarBaseUrl, constructLogPath(context, sdmGoal), bufferSize, flushInterval);
|
28 | }
|
29 | get name() {
|
30 | return this.rolarProgressLog.name;
|
31 | }
|
32 | get url() {
|
33 | const path = constructLogPath(this.context, this.sdmGoal);
|
34 | return `https://app.atomist.com/workspace/${path[0]}/logs/${path.slice(1).join("/")}`;
|
35 | }
|
36 | async isAvailable() {
|
37 | return this.rolarProgressLog.isAvailable();
|
38 | }
|
39 | write(what) {
|
40 | this.rolarProgressLog.write(what);
|
41 | }
|
42 | flush() {
|
43 | return this.rolarProgressLog.flush();
|
44 | }
|
45 | close() {
|
46 | return this.rolarProgressLog.close();
|
47 | }
|
48 | }
|
49 | exports.DashboardDisplayProgressLog = DashboardDisplayProgressLog;
|
50 | function constructLogPath(context, sdmGoal) {
|
51 | return [
|
52 | context.teamId,
|
53 | sdmGoal.repo.owner,
|
54 | sdmGoal.repo.name,
|
55 | sdmGoal.sha,
|
56 | sdmGoal.environment,
|
57 | sdmGoal.name,
|
58 | sdmGoal.goalSetId,
|
59 | context.correlationId,
|
60 | ];
|
61 | }
|
62 | exports.constructLogPath = constructLogPath;
|
63 |
|
\ | No newline at end of file |