File size: 880 Bytes
82ea528
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
export enum EStatus {
  executing = 'Executing',
  executed = 'Executed',
  execution_error = 'Execution error',
}

export const ComfyKeyMenuDisplayOption = 'Comfy.UseNewMenu';
export enum MenuDisplayOptions {
  'Disabled' = 'Disabled',
  'Top' = 'Top',
  'Bottom' = 'Bottom',
}

export abstract class ProgressBarUIBase {
  protected htmlClassMonitor = 'crystools-monitors-container';

  protected constructor(
    public rootId: string,
    public rootElement: HTMLElement | null | undefined,
  ) {
    // IMPORTANT duplicate on crystools-save
    if (this.rootElement && this.rootElement.children.length === 0) {
      this.rootElement.setAttribute('id', this.rootId);
      this.rootElement.classList.add(this.htmlClassMonitor);
      this.rootElement.classList.add(this.constructor.name);
    } else {
      // it was created before
    }
  }

  abstract createDOM(): void;
}