github.com/tilt-dev/tilt@v0.33.15-0.20240515162809-0a22ed45d8a0/web/src/types.ts (about)

     1  export enum SocketState {
     2    Loading,
     3    Reconnecting,
     4    Closed,
     5    Active,
     6  }
     7  
     8  export enum ResourceView {
     9    Log,
    10    Alerts,
    11    Facets,
    12    Trace,
    13    Metrics,
    14  
    15    // The detail view in the Grid-based UI.
    16    OverviewDetail,
    17  
    18    // The grid UI
    19    Grid,
    20  }
    21  
    22  export enum TriggerMode {
    23    TriggerModeAuto,
    24    TriggerModeManualWithAutoInit,
    25    TriggerModeManual,
    26    TriggerModeAutoWithManualInit,
    27  }
    28  
    29  // what is the status of the resource in the cluster
    30  // Copied from pkg/model
    31  export enum RuntimeStatus {
    32    Ok = "ok",
    33    Pending = "pending",
    34    Error = "error",
    35    NotApplicable = "not_applicable",
    36    None = "none",
    37  }
    38  
    39  // what is the status of the update
    40  // Copied from pkg/model
    41  export enum UpdateStatus {
    42    Ok = "ok",
    43    Pending = "pending",
    44    InProgress = "in_progress",
    45    Error = "error",
    46    NotApplicable = "not_applicable",
    47    None = "none",
    48  }
    49  
    50  // What is the status of the resource with respect to Tilt
    51  export enum ResourceStatus {
    52    Building, // Tilt is actively doing something (e.g., docker build or kubectl apply)
    53    Pending, // not building, healthy, or unhealthy, but presumably on its way to one of those (e.g., queued to build, or ContainerCreating)
    54    Healthy, // e.g., build succeeded and pod is running and healthy
    55    Unhealthy, // e.g., last build failed, or CrashLoopBackOff
    56    Warning, // e.g., an undismissed restart
    57    Disabled, // e.g., a resource is disabled by the user through the API / UI
    58    None, // e.g., a manual build that has never executed
    59  }
    60  
    61  // These constants are duplicated from the Go constants.
    62  export enum ResourceDisableState {
    63    Disabled = "Disabled",
    64    Enabled = "Enabled",
    65    Error = "Error",
    66    Pending = "",
    67  }
    68  
    69  // These constants are duplicated from the Go constants.
    70  export enum TargetType {
    71    Unspecified = "unspecified",
    72    Image = "image",
    73    K8s = "k8s",
    74    DockerCompose = "docker-compose",
    75    Local = "local",
    76  }
    77  
    78  export type SnapshotHighlight = {
    79    beginningLogID: string
    80    endingLogID: string
    81    text: string
    82  }
    83  
    84  export enum ShowFatalErrorModal {
    85    Default,
    86    Show,
    87    Hide,
    88  }
    89  
    90  export enum ShowErrorModal {
    91    Default,
    92    Show,
    93  }
    94  
    95  export type Snapshot = Proto.webviewSnapshot
    96  
    97  export enum LogLevel {
    98    INFO = "INFO",
    99    WARN = "WARN",
   100    ERROR = "ERROR",
   101  }
   102  
   103  // A plaintext representation of a line of the log,
   104  // with metadata to render it in isolation.
   105  //
   106  // The metadata should be stored as primitive fields
   107  // so that React's default caching behavior will kick in.
   108  export type LogLine = {
   109    // We assume that 'text' does not contain a newline
   110    text: string
   111    manifestName: string
   112    level: string
   113    buildEvent?: string
   114    spanId: string
   115  
   116    // The index of this line in the LogStore StoredLine list.
   117    storedLineIndex: number
   118  }
   119  
   120  // Instructions on how to patch an existing log stream with new logs.
   121  // Includes:
   122  // - The lines to add. Some of these might patch existing lines.
   123  // - A client-side checkpoint, for determining the next patch
   124  //   Users of this API should not modify this. They should just pass it to
   125  //   the next invocation of the log getter. 0 indicates we will get all logs.
   126  export type LogPatchSet = {
   127    lines: LogLine[]
   128    checkpoint: number
   129  }
   130  
   131  // Display data about the current log trace.
   132  export type LogTrace = {
   133    url: string
   134    index: number
   135  }
   136  
   137  // Display data that lets us navigate between log traces.
   138  export type LogTraceNav = {
   139    count: number // The total number of traces
   140    current: LogTrace
   141    prev?: LogTrace
   142    next?: LogTrace
   143  }
   144  
   145  export enum ResourceName {
   146    tiltfile = "(Tiltfile)",
   147    all = "(all)",
   148    starred = "(starred)",
   149  }
   150  
   151  export type UISession = Proto.v1alpha1UISession
   152  export type UIResource = Proto.v1alpha1UIResource
   153  export type UIResourceStatus = Proto.v1alpha1UIResourceStatus
   154  export type UIBuild = Proto.v1alpha1UIBuildTerminated
   155  export type UILink = Proto.v1alpha1UIResourceLink
   156  export type UIButton = Proto.v1alpha1UIButton
   157  export type UIButtonStatus = Proto.v1alpha1UIButtonStatus
   158  export type UIInputSpec = Proto.v1alpha1UIInputSpec
   159  export type UIInputStatus = Proto.v1alpha1UIInputStatus
   160  export type Cluster = Proto.v1alpha1Cluster