File size: 1,801 Bytes
70546b5
 
e38f741
3c87bd8
70546b5
 
8974a20
 
70546b5
8974a20
 
 
 
70546b5
8974a20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70546b5
 
8974a20
 
 
 
70546b5
 
 
 
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
module.exports = {
  title: "sdxl turbo",
  description: "A Real-Time Text-to-Image Generation Model",
  icon: "icon.png",
  menu: async (kernel) => {
    let installed = await kernel.exists(__dirname, "env")
    let installing = await kernel.require(__dirname, "install.json")
    if (installing) {
      return [{
        icon: "fa-solid fa-plug",
        text: "Installing",
        href: "install.json",
        params: { fullscreen: true }
      }]
    } else if (installed) {
      let session = await kernel.require(__dirname, "session.json")
      console.log("session", session)
      let running = await kernel.running(__dirname, "start.json")
      if (running) {
        if (session && session.url) {
          return [{
            icon: "fa-solid fa-spin fa-circle-notch",
            text: "Running",
            type: "label",
          }, {
            icon: "fa-solid fa-terminal", text: "Terminal", href: "start.json", params: { fullscreen: true }
          }, {
            icon: "fa-solid fa-rocket",
            text: "Open Web UI",
            href: session.url,
            target: "_blank"
          }]
        } else {
          return [{
            icon: "fa-solid fa-spin fa-circle-notch",
            text: "Running",
            type: "label",
          }, {
            icon: "fa-solid fa-rocket",
            text: "Open Web UI",
            href: session.url,
            target: "_blank"
          }]
        }
      } else {
        return [{
          icon: "fa-solid fa-power-off", text: "Start", href: "start.json", params: { run: true, fullscreen: true }
        }]
      }
    } else {
      return [{
        icon: "fa-solid fa-plug",
        text: "Install",
        href: "install.json",
        params: { run: true, fullscreen: true }
      }]
    }
  }
}