experimentStartupInfo.ts 1.24 KB
Newer Older
liuzhe-lz's avatar
liuzhe-lz committed
1
2
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Deshui Yu's avatar
Deshui Yu committed
3

4
import globals from 'common/globals';
5
6

export class ExperimentStartupInfo {
7
8
9
10
11
12
13
14
    public experimentId: string = globals.args.experimentId;
    public newExperiment: boolean = (globals.args.action === 'create');
    public basePort: number = globals.args.port;
    public logDir: string = globals.paths.experimentRoot;
    public logLevel: string = globals.args.logLevel;
    public readonly: boolean = (globals.args.action === 'view');
    public platform: string = globals.args.mode as string;
    public urlprefix: string = globals.args.urlPrefix;
15

16
    public static getInstance(): ExperimentStartupInfo {
17
        return new ExperimentStartupInfo();
18
    }
Deshui Yu's avatar
Deshui Yu committed
19
20
}

21
export function getExperimentStartupInfo(): ExperimentStartupInfo {
22
    return new ExperimentStartupInfo();
23
24
}

25
export function getExperimentId(): string {
26
    return globals.args.experimentId;
Deshui Yu's avatar
Deshui Yu committed
27
28
}

29
export function getBasePort(): number {
30
    return globals.args.port;
31
32
}

33
export function isNewExperiment(): boolean {
34
    return globals.args.action === 'create';
35
36
}

37
export function getPlatform(): string {
38
    return globals.args.mode as string;
SparkSnail's avatar
SparkSnail committed
39
40
}

41
export function isReadonly(): boolean {
42
    return globals.args.action === 'view';
Deshui Yu's avatar
Deshui Yu committed
43
}