├── lib.js
├── .gitignore
├── SCREENCAP.GIF
├── .gitattributes
├── .github
└── workflows
│ ├── DEVKING_TRACKER.yml
│ ├── DEVKING_CHECK.yml
│ ├── DEVKING_CLEANUP.yml
│ └── DEVKING_RELEASE.yml
├── package.json
├── CHANGELOG.md
├── README.md
├── app.js
└── LICENSE
/lib.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .env
2 | .env.*
3 | node_modules/
--------------------------------------------------------------------------------
/SCREENCAP.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cogsmith/dclone/HEAD/SCREENCAP.GIF
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.github/workflows/DEVKING_TRACKER.yml:
--------------------------------------------------------------------------------
1 | name: DEVKING_TRACKER
2 | on:
3 | workflow_dispatch:
4 | jobs:
5 | build:
6 | runs-on: ubuntu-latest
7 | steps:
8 | - uses: cogsmith/devking-tracker@main
--------------------------------------------------------------------------------
/.github/workflows/DEVKING_CHECK.yml:
--------------------------------------------------------------------------------
1 | name: DEVKING_CHECK
2 | on:
3 | workflow_dispatch:
4 | push:
5 | branches: [ main ]
6 | jobs:
7 | build:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - uses: actions/checkout@v2
11 | - run: npm -v
12 | - run: npm ci
13 | continue-on-error: true
14 | - run: find . -maxdepth 1 -name '*.js' -exec echo node --check {} \;
15 | - run: find . -maxdepth 1 -name '*.js' -exec node --check {} \;
16 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "npmpublish": true,
3 | "license": "GPLv3",
4 | "version": "0.0.3-dev",
5 | "nametag": "DCLONE",
6 | "namelong": "DCLONE",
7 | "description": "Disk Cloner",
8 | "dependencies": {
9 | "@cogsmith/xt": "^1.0.167",
10 | "ansi-term": "0.0.2",
11 | "blessed": "^0.1.81",
12 | "blessed-contrib": "^4.10.0",
13 | "blessed-xterm": "^1.4.1",
14 | "execa": "^5.1.1"
15 | },
16 | "versiontaglast": "0.0.2"
17 | }
18 |
--------------------------------------------------------------------------------
/.github/workflows/DEVKING_CLEANUP.yml:
--------------------------------------------------------------------------------
1 | name: DEVKING_CLEANUP
2 | on:
3 | workflow_dispatch:
4 | inputs:
5 | ACTIONDO:
6 | required: true
7 | default: 'CLEANUP'
8 | description: 'ACTIONDO'
9 | workflow_run:
10 | workflows: ['*']
11 | types: [completed]
12 | jobs:
13 | build:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - uses: actions/checkout@v2
17 | with:
18 | fetch-depth: 0
19 | - uses: cogsmith/devking-cleanup@main
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # [0.0.2](https://github.com/cogsmith/dclone/compare/0.0.2...main) @ [2021-07-23](https://github.com/cogsmith/dclone/releases/tag/0.0.2)
4 |
5 | ## DIFF
6 | - [2 COMMITS SINCE LAST TAG = 0.0.1](https://github.com/cogsmith/dclone/compare/0.0.1...0.0.2)
7 |
8 |
9 |
10 | ---
11 |
12 |
13 | # [0.0.1](https://github.com/cogsmith/dclone/compare/0.0.1...main) @ [2021-07-23](https://github.com/cogsmith/dclone/releases/tag/0.0.1)
14 |
15 | ## DIFF
16 | - [ LAST TAG = 0.0.0](https://github.com/cogsmith/dclone/compare/0.0.0...0.0.1)
17 |
18 |
19 |
20 | ---
21 |
--------------------------------------------------------------------------------
/.github/workflows/DEVKING_RELEASE.yml:
--------------------------------------------------------------------------------
1 | name: DEVKING_RELEASE
2 | on:
3 | push:
4 | branches: [ main ]
5 | workflow_dispatch:
6 | inputs:
7 | NEXTVERSION:
8 | required: true
9 | default: 'PATCH'
10 | description: 'NEXTVERSION'
11 | jobs:
12 | JOB:
13 | if: |
14 | github.event_name == 'workflow_dispatch'
15 | || ( github.event.head_commit.message == 'TAG'
16 | || github.event.head_commit.message == 'TAG PATCH'
17 | || github.event.head_commit.message == 'TAG MINOR'
18 | || github.event.head_commit.message == 'TAG MAJOR'
19 | || startsWith(github.event.head_commit.message, 'TAG ')
20 | )
21 | runs-on: ubuntu-latest
22 | steps:
23 | - uses: actions/checkout@v2
24 | with:
25 | fetch-depth: 0
26 | - uses: cogsmith/devking-release@main
27 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 💾 DCLONE: Terminal Menu Guided Disk Imaging 💾
2 | ## Simple frontend for common open-source tools: lsblk dd squashfs kpartx
3 |
4 | ---
5 |
6 |
7 |
8 | ####
9 |
10 | ####
[GITHUB REPO]🧾 [VIEW APP SOURCE CODE]
11 |
12 | #### 📅 [PROJECT TRACKER BOARD]
13 |
14 | ---
15 |
16 | [](http://github.com/cogsmith/dclone)
17 | [](https://github.com/cogsmith/dclone/commits/main)
18 | [](https://github.com/cogsmith/dclone/actions/workflows/DEVKING_CHECK.yml)
19 |
20 | [](https://github.com/cogsmith/dclone/releases)
21 | [](https://github.com/cogsmith/dclone/releases)
22 | [](https://github.com/cogsmith/dclone/commits/main)
23 |
24 |
25 | [](https://github.com/cogsmith/dclone/blob/main/LICENSE)
26 | [](http://github.com/cogsmith/dclone)
27 | [](http://github.com/cogsmith/dclone)
28 | [](https://github.com/cogsmith/dclone/issues)
29 |
30 | ---
31 |
32 | * lsblk
33 | * dd
34 | * squashfs
35 | * kpartx
36 |
37 | ---
38 |
39 | Single step streaming technique originally sourced from this StackOverflow post:
40 | https://unix.stackexchange.com/a/75590/23232
41 |
42 | ---
43 |
44 | 
45 |
46 | ---
47 |
48 |
Disk cloning app that uses open-source tools like dd mksquashfs and kpartx to backup and restore images easily.
49 |It gives a guided menu interface to picking out a disk and entering a filename, then lets you observe the streaming output from spawned tasks in an embedded tty buffer.
50 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | // npm install blessed blessed-contrib blessed-xterm execa ansi-term @cogsmith/xt 2 | 3 | const nodeos = require('os'); 4 | 5 | const JSONFANCY = function (x) { return require('util').inspect(x, { colors: true, depth: null, breakLength: 99 }); }; 6 | 7 | AppExit = function (exit) { 8 | try { screen.destroy(); } catch (ex) { } 9 | console.log({ EXIT: exit }); 10 | process.exit(1); 11 | } 12 | 13 | process.on('unhandledRejection', (reason, p) => { AppExit({ Msg: 'ERROR_UNEX_PromiseRejection' }); }); 14 | process.on('uncaughtException', (err) => { AppExit({ Msg: 'ERROR_UNEX_ThrowNoCatch', Err: err }); }); 15 | process.on('SIGINT', () => { AppExit({ Msg: 'EXIT_SIGINT' }); }); 16 | //process.on('exit', () => { AppExit({ Msg: 'EXIT_EXIT' }); }); 17 | 18 | const BXTERM = require("blessed-xterm"); 19 | 20 | const execa = require('execa'); 21 | const spawn = require('child_process').spawn; 22 | 23 | //const stripAnsi = require('strip-ansi'); 24 | const stripAnsi = function (string) { return string.replace(ansiRegex(), ''); } 25 | const ansiRegex = function ({ onlyFirst = false } = {}) { 26 | const pattern = ['[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'].join('|'); 27 | return new RegExp(pattern, onlyFirst ? undefined : 'g'); 28 | } 29 | 30 | 31 | const blessed = require('blessed'); 32 | const blessedc = require('blessed-contrib'); 33 | const Canvas = blessedc.canvas; 34 | const Node = blessed.Node; 35 | const Box = blessed.Box; 36 | 37 | const XT = require('@cogsmith/xt').Init(); 38 | const App = XT.App; const LOG = XT.LOG; 39 | 40 | // 41 | 42 | bp = false; 43 | screen = false; 44 | App.TUI = {}; 45 | App.TUI.FX = {}; 46 | App.TUI.Node = {}; 47 | 48 | // 49 | 50 | let MyGauge = function (options) { 51 | if (!(this instanceof Node)) { return new MyGauge(options); } 52 | 53 | var self = this; 54 | options = options || {}; 55 | options.left = options.left || 2; 56 | 57 | self.options = options; 58 | self.options.stroke = options.stroke || 'magenta'; 59 | self.options.fill = 'white'; 60 | self.options.data = options.data || []; 61 | self.options.showLabel = options.showLabel !== false; 62 | 63 | Canvas.call(this, options, require('ansi-term')); 64 | 65 | this.on('attach', function () { 66 | if (self.options.stack) { 67 | var stack = this.stack = self.options.stack; 68 | this.setStack(stack); 69 | } 70 | else { 71 | var percent = this.percent = self.options.percent || 0; 72 | this.setData(percent); 73 | } 74 | }); 75 | } 76 | 77 | MyGauge.prototype = Object.create(Canvas.prototype); 78 | MyGauge.prototype.getOptionsPrototype = function () { return { percent: 10 }; }; 79 | MyGauge.prototype.type = 'gauge'; 80 | 81 | MyGauge.prototype.calcSize = function () { 82 | this.width = this.width - 2; 83 | this.canvasSize = { width: this.width + 0, height: this.height }; 84 | }; 85 | 86 | MyGauge.prototype.setData = function (data) { 87 | if (typeof (data) == typeof ([]) && data.length > 0) { this.setStack(data); } 88 | else if (typeof (data) == typeof (1)) { this.setPercent(data); } 89 | }; 90 | 91 | MyGauge.prototype.setPercent = function (percent) { 92 | if (!this.ctx) { throw 'error: canvas context does not exist. setData() for gauges must be called after the gauge has been added to the screen via screen.append()'; } 93 | 94 | var c = this.ctx; 95 | c.strokeStyle = this.options.stroke;//'magenta' 96 | c.fillStyle = this.options.fill;//'white' 97 | 98 | c.clearRect(0, 0, this.canvasSize.width, this.canvasSize.height); 99 | if (percent < 1.001) { percent = percent * 100; } 100 | var width = percent / 100 * (this.canvasSize.width - 2); 101 | c.fillRect(1, 2, width, this.height); 102 | 103 | var textX = 7; 104 | if (width < textX) { c.strokeStyle = 'normal'; } 105 | 106 | // if (this.options.showLabel) c.fillText(Math.round(percent) + '%', textX, 3); 107 | if (this.options.showLabel) { c.fillText(currentStack.label || percent + '%', textX, this.height / 2); } 108 | }; 109 | 110 | MyGauge.prototype.setStack = function (stack) { 111 | var colors = ['green', 'magenta', 'cyan', 'red', 'blue']; 112 | if (!this.ctx) { throw 'error: canvas context does not exist. setData() for gauges must be called after the gauge has been added to the screen via screen.append()'; } 113 | 114 | var c = this.ctx; 115 | var leftStart = 0; 116 | var textLeft = 5; 117 | c.clearRect(0, 0, this.canvasSize.width, this.canvasSize.height); 118 | 119 | for (var i = 0; i < stack.length; i++) { 120 | var currentStack = stack[i]; 121 | 122 | let percent; 123 | if (typeof (currentStack) == typeof ({})) { percent = currentStack.percent; } else { percent = currentStack; } 124 | 125 | c.strokeStyle = currentStack.stroke || colors[(i % colors.length)]; // use specified or choose from the array of colors 126 | c.fillStyle = this.options.fill;//'white' 127 | 128 | textLeft = 5; 129 | if (percent < 1.001) { percent = percent * 100; } 130 | var width = percent / 100 * (this.canvasSize.width - 2); 131 | 132 | if (currentStack.stroke != 'black') { c.fillRect(leftStart, 0, width, this.height); } 133 | 134 | textLeft = (width / 2) - ((currentStack.label ? currentStack.label.length : 0) / 2) + 2; 135 | var textX = leftStart + textLeft; 136 | 137 | if ((leftStart + width) < textX) { c.strokeStyle = 'normal'; } 138 | 139 | // if (this.options.showLabel) c.fillText(percent + '%', textX, 3); 140 | if (this.options.showLabel) { c.fillText(currentStack.label || percent + '%', textX, this.height / 2); } 141 | 142 | leftStart += width; 143 | } 144 | }; 145 | 146 | App.TUI.Node.Gauge = MyGauge; 147 | 148 | // 149 | 150 | function MyTable(options) { 151 | var self = this; 152 | if (!(this instanceof Node)) { return new MyTable(options); } 153 | 154 | if (Array.isArray(options.columnSpacing)) { throw 'Error: columnSpacing cannot be an array.\r\n' + 'Note: From release 2.0.0 use property columnWidth instead of columnSpacing.\r\n' + 'Please refere to the README or to https://github.com/yaronn/blessed-contrib/issues/39'; } 155 | if (!options.columnWidth) { throw 'Error: A table must get columnWidth as a property. Please refer to the README.'; } 156 | 157 | options = options || {}; 158 | options.columnSpacing = options.columnSpacing == null ? 10 : options.columnSpacing; 159 | options.bold = true; 160 | options.selectedFg = options.selectedFg || 'white'; 161 | options.selectedBg = options.selectedBg || 'blue'; 162 | options.fg = options.fg || 'green'; 163 | options.bg = options.bg || ''; 164 | options.interactive = (typeof options.interactive === 'undefined') ? true : options.interactive; 165 | 166 | //options.left = options.left || 1; 167 | //options.right = options.right || 1; 168 | 169 | this.options = options; 170 | Box.call(this, options); 171 | 172 | this.rows = blessed.list({ 173 | //height: 0, 174 | top: 2, 175 | width: 0, 176 | left: 1, 177 | style: { 178 | selected: { fg: options.selectedFg, bg: options.selectedBg }, 179 | item: { fg: options.fg, bg: options.bg } 180 | }, 181 | keys: options.keys, 182 | vi: options.vi, 183 | mouse: options.mouse, 184 | tags: true, 185 | interactive: options.interactive, 186 | screen: this.screen 187 | }); 188 | 189 | this.append(this.rows); 190 | 191 | this.on('attach', function () { if (self.options.data) { self.setData(self.options.data); } }); 192 | } 193 | 194 | MyTable.prototype = Object.create(Box.prototype); 195 | MyTable.prototype.type = 'table'; 196 | MyTable.prototype.focus = function () { this.rows.focus(); }; 197 | 198 | MyTable.prototype.render = function () { 199 | if (this.screen.focused == this.rows) { this.rows.focus(); } 200 | 201 | this.rows.width = this.width - 3; 202 | this.rows.height = this.height - 3; 203 | Box.prototype.render.call(this); 204 | }; 205 | 206 | MyTable.prototype.setData = function (table) { 207 | var self = this; 208 | 209 | var dataToString = function (d) { 210 | var str = ''; 211 | d.forEach(function (r, i) { 212 | var colsize = self.options.columnWidth[i]; 213 | var strip = stripAnsi(r.toString()); 214 | var ansiLen = r.toString().length - strip.length; 215 | var spaceLength = colsize - strip.length + self.options.columnSpacing; 216 | r = r.toString().substring(0, colsize + ansiLen); //compensate for ansi len 217 | if (spaceLength < 0) { spaceLength = 0; } 218 | var spaces = new Array(spaceLength).join(' '); 219 | str += r + spaces; 220 | }); 221 | return str; 222 | }; 223 | 224 | var formatted = []; 225 | 226 | table.data.forEach(function (d) { var str = dataToString(d); formatted.push(str); }); 227 | this.setContent(dataToString(table.headers)); 228 | this.rows.setItems(formatted); 229 | }; 230 | 231 | MyTable.prototype.getOptionsPrototype = function () { 232 | return { 233 | keys: true, 234 | fg: 'white', 235 | interactive: false, 236 | label: 'Active Processes', 237 | width: '30%', 238 | height: '30%', 239 | border: { type: 'line', fg: 'blue' }, 240 | columnSpacing: 10, 241 | columnWidth: [16, 12], 242 | data: { 243 | headers: ['col1', 'col2'], 244 | data: [ 245 | ['a', 'b'], 246 | ['5', 'u'], 247 | ['x', '16.1'] 248 | ] 249 | } 250 | }; 251 | }; 252 | 253 | App.TUI.Node.Table = MyTable; 254 | 255 | // 256 | 257 | App.Disks = {}; 258 | 259 | App.Disks.BackupPath = '/backup'; 260 | 261 | App.Disks.GetInfo = function () { 262 | let exec = execa.commandSync('lsblk -pJ --output-all', { shell: true }); 263 | let info = JSON.parse(exec.stdout); 264 | return info; 265 | } 266 | 267 | App.Disks.GetTableData = function () { 268 | let info = App.Disks.GetInfo(); 269 | 270 | let disks = {}; 271 | let parts = {}; 272 | 273 | for (let dev of info.blockdevices) { 274 | if (dev.type == 'disk') { disks[dev.name] = dev; } 275 | if (dev.children) { 276 | for (let child of dev.children) { if (!parts[dev.name]) { parts[dev.name] = []; } parts[dev.name].push(child); } 277 | } 278 | } 279 | 280 | let sizetotal = 0; 281 | 282 | App.Disks.DiskDB = {}; 283 | App.Disks.Usages = {}; 284 | let rows = []; 285 | for (let diskid in disks) { 286 | let disk = disks[diskid]; 287 | App.Disks.DiskDB[diskid] = disk; 288 | //let row = [disk.name, disk.vendor, disk.model, disk.fstype, disk.label, disk.size, disk.fsused, disk.fsavail, disk.mountpoint]; 289 | let row = [disk.name, disk.vendor, disk.model, disk.size]; 290 | rows.push(row); 291 | 292 | disk.size = disk.size.toString() || ''; 293 | let sizeint = 0; let sizenum = disk.size.replace('M', '').replace('G', '').replace('T', ''); 294 | if (false) { } 295 | else if (disk.size.includes('M')) { sizeint = sizenum / 1024; } 296 | else if (disk.size.includes('G')) { sizeint = sizenum * 1; } 297 | else if (disk.size.includes('T')) { sizeint = sizenum * 1024; } 298 | sizetotal += sizeint; 299 | 300 | for (let part of disk.children) { 301 | partsizetext = part.size; 302 | part.size = part.size.toString() || ''; 303 | let partsizeint = 0; let partsizenum = part.size.replace('M', '').replace('G', '').replace('T', ''); 304 | if (false) { } 305 | else if (part.size.includes('M')) { partsizeint = partsizenum / 1024; } 306 | else if (part.size.includes('G')) { partsizeint = partsizenum * 1; } 307 | else if (part.size.includes('T')) { partsizeint = partsizenum * 1024; } 308 | 309 | console.log(part.name + ' = ' + part['fsuse%']); 310 | let partused = 0; try { partused = part['fsuse%'].replace('%', ''); } catch (ex) { } 311 | let usage = { ID: part.name, Label: part.label, Size: partsizeint, DiskSize: sizeint, SizeText: part.size, Used: partused * 1 }; 312 | //if (!App.Disks.Usages[diskid]) { App.Disks.Usages[diskid] = {}; } App.Disks.Usages[diskid][part.name] = usage; 313 | if (!App.Disks.Usages[diskid]) { App.Disks.Usages[diskid] = []; } App.Disks.Usages[diskid].push(usage); 314 | //console.log(disk); 315 | } 316 | 317 | } 318 | App.Disks.SizeTotal = sizetotal; 319 | 320 | for (let rowi = 0; rowi < rows.length; rowi++) { 321 | let r = rows[rowi]; 322 | for (let i = 0; i < r.length; i++) { if (!r[i]) { rows[rowi][i] = ''; } } 323 | } 324 | 325 | return rows; 326 | } 327 | 328 | App.Disks.DB = { Rows: App.Disks.GetTableData(), Info: App.Disks.GetInfo(), DiskDB: App.Disks.DiskDB, Usages: App.Disks.Usages }; 329 | 330 | // 331 | 332 | App.TUI.Append = function (el, to) { 333 | if (typeof (el) == 'object') { 334 | if (to.ViewHeight == undefined) { to.ViewHeight = 0; } 335 | if (to.ViewHeightFixed == undefined) { to.ViewHeightFixed = 0; } 336 | 337 | el.top = to.ViewHeight; 338 | if (el.position.bottom >= 0) { delete el.position.top; } 339 | 340 | to.ViewHeight = to.ViewHeight + el.height; 341 | if (el.flex) { el.height = to.ViewHeight - to.ViewHeightFixed; } else { to.ViewHeightFixed += el.height; } 342 | //if (el.flex) { } else { to.ViewHeightFixed += el.height; } 343 | 344 | if (!to.ViewHeights) { to.ViewHeights = []; } 345 | to.ViewHeights.push(el.height); 346 | 347 | to.append(el); 348 | 349 | screen.render(); 350 | } 351 | else { LOG.WARN('TUI.Append: !EL'); } 352 | } 353 | 354 | App.TUI.Init = function () { 355 | let bp = blessed.program(); 356 | //bp.cols = 144; bp.rows = 36; 357 | //bp.cols = 99; bp.rows = 24; 358 | //bp.cols = 80; bp.rows = 20; 359 | 360 | screen = blessed.screen({ debug: true, autoPadding: false, dockBorders: true, program: bp, cursor: { blink: true, color: 'red' } }); 361 | App.TUI.BP = bp; App.TUI.Screen = screen; 362 | 363 | screen.key(['q', 'C-c'], function (ch, key) { AppExit(); }); 364 | //screen.key(['escape'], function (ch, key) { AppExit(); }); 365 | 366 | App.TUI.NullBox = blessed.box({ height: 0, width: 0, hidden: false, style: { fg: 'white', bg: 'red' } }); 367 | 368 | for (let k in App.TUI.FX) { 369 | //LOG.TRACE('TUI.FX: ' + k); 370 | let el = App.TUI.FX[k].apply(null, []); 371 | if (!el) { el = App.TUI.NullBox; LOG.WARN('TUI.FX: ' + k + ' = NULLBOX'); } 372 | App.TUI[k] = el; 373 | } 374 | 375 | App.TUI.DiskView.append(App.TUI.ListBox); 376 | App.TUI.DiskView.append(App.TUI.UsageBox); 377 | 378 | App.TUI.Append(App.TUI.DiskView, App.TUI.ViewsBox); 379 | //App.TUI.Append(App.TUI.FilesystemView, App.TUI.ViewsBox); 380 | App.TUI.Append(App.TUI.OutputView, App.TUI.ViewsBox); 381 | //App.TUI.Append(App.TUI.AppView, App.TUI.ViewsBox); 382 | 383 | //App.TUI.AppView.append(App.TUI.NodeStatsBox); 384 | //App.TUI.AppView.append(App.TUI.AppInfoBox); 385 | 386 | for (let z of App.TUI.ViewsBox.children) { 387 | if (z.flex) { 388 | z.height = App.TUI.ViewsBox.height - App.TUI.ViewsBox.ViewHeightFixed; 389 | //z.height = screen.height - 2 - App.TUI.ViewsBox.ViewHeightFixed; 390 | for (let zz of z.children) { 391 | if (zz.flex) { zz.height = App.TUI.ViewsBox.height - App.TUI.ViewsBox.ViewHeightFixed; } 392 | //if (zz.flex) { zz.height = screen.height - 2 - App.TUI.ViewsBox.ViewHeightFixed; } 393 | } 394 | } 395 | } 396 | 397 | for (let i = 1; i < App.TUI.ViewsBox.children.length; i++) { 398 | let zlast = App.TUI.ViewsBox.children[i - 1]; 399 | let znow = App.TUI.ViewsBox.children[i]; 400 | if (zlast.flex) { znow.top = 10 + App.TUI.ViewsBox.height - App.TUI.ViewsBox.ViewHeightFixed; screen.render(); } 401 | } 402 | 403 | App.TUI.Screen.append(App.TUI.Header); 404 | App.TUI.Screen.append(App.TUI.Footer); 405 | App.TUI.Screen.append(App.TUI.ViewsBox); 406 | 407 | App.TUI.Screen.render(); 408 | } 409 | 410 | // 411 | 412 | App.TUI.FX.NodeStatsBox = function () { 413 | let box = blessed.box({ 414 | top: 0, height: 8, width: '20%', right: 0, 415 | style: { fg: 'white', bg: 'black' }, 416 | content: 'NODESTATBOX' 417 | }); 418 | 419 | return box; 420 | } 421 | 422 | App.TUI.FX.AppInfoBox = function () { 423 | let box = blessed.box({ 424 | top: 0, height: 8, width: '80%', 425 | style: { fg: 'white', bg: 'black' }, 426 | content: 'APPINFOBOX' 427 | }); 428 | 429 | return box; 430 | } 431 | 432 | App.TUI.FX.InputZone = function () { 433 | let box = blessed.box({ height: 1, width: '75%', top: 0, left: 0 }); 434 | return box; 435 | } 436 | 437 | App.TUI.FX.InputBox = function () { 438 | let box = blessed.textbox({ 439 | //top: 0, left: 0, height: 1, width: '50%', 440 | style: { fg: 'white', bg: 'blue', focus: { fg: 'black', bg: 'white' } }, 441 | tags: true, 442 | //content: '{green-fg}✔️ ▶ ✅ {/green-fg} ▶ ⭐ ⛔ ✅ HEADER_LEFT ⏸️ ⚡' 443 | // content: '▶ DCLONE ◀' 444 | //content: '▶ DCLONE: Disk Cloner [0.0.1-dev]' 445 | content: ' ▶ ' + App.Meta.Full + '' 446 | }); 447 | 448 | box.on('mouseout', () => { box.setContent(' ▶ ' + App.Meta.Full + ''); screen.render(); }); 449 | box.on('mouseover', () => { box.setContent(' ▶ COGSMITH IT Solutions Provider'); screen.render(); }); 450 | 451 | return box; 452 | } 453 | 454 | App.TUI.FX.InfoBox = function () { 455 | let box = blessed.box({ 456 | top: 0, right: 1, height: 1, width: '25%', align: 'right', 457 | style: { fg: 'white', bg: 'blue' }, 458 | content: nodeos.userInfo().username + ' @ ' + nodeos.hostname() + ' ' + App.Disks.BackupPath + ' ◀' 459 | }); 460 | 461 | return box; 462 | } 463 | 464 | App.TUI.FX.StatusBox = function () { 465 | let box = blessed.textbox({ 466 | bottom: 0, left: 0, height: 1, width: '50%', 467 | style: { fg: 'white', bg: 'blue', focus: { bg: 'red' }, hover: { bg: 'green' } }, 468 | content: '▶ FOOTER_LEFT', 469 | mouse: true, 470 | inputOnFocus: true, focus: { bg: 'red' }, 471 | tags: true 472 | }); 473 | 474 | //box.setContent(' ┋ ▾ ◂ ◆ ▸ ◀ ▲ ❯ ☒ > ▼ ◄ ⚠ ‼ ℹ i ✔ √ █ ■ ◉ ◉ ♦ ━ ◇ ▶ ✖ × ► ◊ ☰ ≡ ▶ ► ≡ ◆ ★ ♥ ✶ ★ ⬢ ⏏ ♦ ⏸ ⏺ ⏭ ▙ ▣ ■ ◼ ◉ STATUS') 475 | //box.setContent(' • ◆ ■ ◀ █ ▶ ▲ ▼ ♥ ≡ = - STATUS') 476 | box.setContent(' {bold}{#777-fg}◆{/#777-fg}{/bold} {bold}App.Init:{/bold} DCLONE'); screen.render(); 477 | 478 | loopfx = function () { 479 | box.setContent(' {bold}{yellow-fg}◆{/yellow-fg}{/bold} {bold}App.Init:{/bold} Loading...'); screen.render(); 480 | setTimeout(function () { box.setContent(' {bold}{#777-fg}◆{/#777-fg}{/bold} {bold}App.Init:{/bold} Loading...'); screen.render(); }, 500 + 250); 481 | setTimeout(function () { box.setContent(' {bold}{#777-fg} {/#777-fg}{/bold} {bold}App.Init:{/bold} Loading...'); screen.render(); }, 500 + 500); 482 | setTimeout(function () { box.setContent(' {bold}{#777-fg}◆{/#777-fg}{/bold} {bold}App.Init:{/bold} Loading...'); screen.render(); }, 500 + 750); 483 | }; setInterval(loopfx, 500 + 1000); 484 | 485 | return box; 486 | } 487 | 488 | App.TUI.FX.ClockBox = function () { 489 | let box = blessed.textbox({ 490 | bottom: 0, right: 0, height: 1, width: '50%', align: 'right', 491 | style: { fg: 'white', bg: 'blue', }, 492 | content: 'FOOTER_RIGHT ◀', 493 | mouse: true, 494 | inputOnFocus: false, 495 | }); 496 | 497 | setInterval(function () { box.setContent(new Date().toLocaleTimeString() + ' '); screen.render(); }, 500); 498 | 499 | return box; 500 | } 501 | 502 | // 503 | 504 | App.TUI.FX.ListBox = function () { 505 | var box = blessed.box({ height: 7, padding: { top: 0, left: 1, right: 1, bottom: 0 } }); 506 | 507 | var label = '[ ' + App.Disks.DB.Rows.length + ' disks = ' + Math.floor(App.Disks.SizeTotal / 10) + ' GB' + ' ]'; 508 | 509 | //App.TUI.LogAndExit(JSON.stringify(App.Disks.DB)); 510 | 511 | var boxlist = MyTable({ 512 | top: 0, 513 | keys: true, 514 | vi: true, 515 | interactive: true, 516 | fg: 'white', 517 | selectedFg: 'white', selectedBg: 'blue', 518 | label: label, 519 | width: 55, border: { type: "line", fg: "blue" }, columnSpacing: 3, columnWidth: [12, 12, 16, 8] 520 | }); 521 | 522 | boxlist.focus() 523 | 524 | box.append(boxlist); 525 | 526 | let rows = App.Disks.GetTableData(); 527 | boxlist.setData({ 528 | // headers: [('ID FS LABEL SIZE USED USED FREE FREE MOUNT'.split(' '))], 529 | headers: ['ID', 'VENDOR', 'MODEL', 'SIZE'], 530 | data: rows 531 | }) 532 | //App.Disks.DB.Rows = rows; 533 | 534 | screen.on('keypress', function (key, code) { 535 | if (code.name == 'up' || code.name == 'down') { 536 | setTimeout(() => { 537 | App.TUI.UsageBox.destroy(); 538 | App.TUI.UsageBox = App.TUI.FX.UsageBox(); 539 | App.TUI.DiskView.append(App.TUI.UsageBox); 540 | screen.render(); 541 | let rowdata = false; try { rowdata = App.Disks.DB.Rows[App.TUI.ListBox.children[0].rows.selected]; } catch (ex) { }; 542 | //App.TUI.UsageBox.setLabel('[ ' + rowdata[0] + ' = ' + rowdata[3] + ' ]'); 543 | screen.render(); 544 | }, 10); 545 | //console.log(rowdata); 546 | } 547 | }); 548 | 549 | boxlist.rows.on('select', (el, index) => { 550 | let inputpromptmsg = ' ▶ Enter Backup Filename: ' + App.Disks.BackupPath + '/'; 551 | let inputprompt = new blessed.box({ width: inputpromptmsg.length + 1, style: { bg: 'white', fg: 'black' }, content: inputpromptmsg }); 552 | App.TUI.InputBox.left = inputpromptmsg.length + 0; 553 | 554 | if (0) { 555 | const JSONFANCY = function (x) { return require('util').inspect(x, { colors: true, depth: null, breakLength: 99 }); }; 556 | screen.destroy(); 557 | console.log("\n\n\n\n========\n\n\n\n"); 558 | console.log(JSONFANCY(App.Disks.DB)); 559 | //LOG.WARN('Disks.DB', App.Disks.DB); 560 | process.exit(1); 561 | } 562 | 563 | let diskid = App.Disks.DB.Rows[index][0]; 564 | let partlabels = []; for (let zp of App.Disks.DB.Usages[diskid]) { partlabels.push(zp.Label); } 565 | 566 | //let backuplabel = rows[index][0]; 567 | let dnow = new Date().toISOString().replace(/(T|-|:|\.)/g, '').substring(0, 12); 568 | let disksizetext = Math.ceil(App.Disks.DB.Usages[diskid][0].DiskSize) + 'GB'; 569 | let backuplabel = 'DISK' + '_' + partlabels.join('+') + '_' + disksizetext + '.' + dnow; 570 | App.TUI.InputBox.setContent(backuplabel); screen.render(); 571 | App.TUI.InputBox.setValue(backuplabel); screen.render(); 572 | 573 | App.TUI.Header.remove(App.TUI.InputZone); 574 | App.TUI.InputZone.destroy(); 575 | App.TUI.InputZone = App.TUI.FX.InputZone(); 576 | App.TUI.InputZone.append(inputprompt); 577 | App.TUI.InputZone.append(App.TUI.InputBox); 578 | App.TUI.Header.append(App.TUI.InputZone); 579 | 580 | screen.render(); 581 | 582 | App.TUI.InputBox.readInput(function (z) { 583 | App.DoBackup(diskid, App.Disks.BackupPath, App.TUI.InputBox.value); 584 | 585 | App.TUI.Header.remove(App.TUI.InputZone); 586 | App.TUI.InputZone.destroy(); 587 | App.TUI.InputBox.left = 0; 588 | App.TUI.InputZone = App.TUI.FX.InputZone(); 589 | App.TUI.InputZone.append(App.TUI.InputBox); 590 | App.TUI.Header.append(App.TUI.InputZone); 591 | App.TUI.InputBox.setContent(' ▶ ' + App.Meta.Full + ''); screen.render(); 592 | }); 593 | }); 594 | 595 | App.TUI.BoxList = boxlist; 596 | 597 | return box; 598 | } 599 | 600 | App.DoBackup = function (diskid, outdir, backupfile) { 601 | App.BXTERM.write("\n\r\n"); 602 | App.BXTERM.write('▶ DCLONE Backup: ' + diskid + ' => ' + outdir + '/' + backupfile); 603 | App.BXTERM.write("\n\r\n"); 604 | //App.BXTERM.spawn('/bin/sh', ['-c', '/usr/bin/curl -o /dev/null https://speed.hetzner.de/100MB.bin']); 605 | App.BXTERM.spawn('/bin/bash', ['-c', 'echo 123 ; echo 999']); 606 | 607 | let sqfsdir = outdir + ''; 608 | let cmds = []; 609 | cmds.push('mkdir -p ' + sqfsdir); 610 | cmds.push('cd ' + sqfsdir); 611 | cmds.push('time mksquashfs /dev/null ./' + backupfile + '.sqfs -p "' + backupfile + '.img f 444 root root dd if=' + diskid + ' bs=8M"'); 612 | let cmd = '(' + cmds.join(' ; ') + ')'; 613 | App.BXTERM.write(cmd); 614 | App.BXTERM.write("\n\r\n"); 615 | App.BXTERM.spawn('/bin/bash', ['-c', cmd]); 616 | } 617 | 618 | App.TUI.LogAndExit = function (msg) { 619 | screen.destroy(); 620 | msg = JSONFANCY(msg); 621 | console.log(msg); 622 | process.exit(1); 623 | } 624 | 625 | App.TUI.FX.UsageBox = function () { 626 | let rowdata = false; try { rowdata = App.Disks.DB.Rows[App.TUI.ListBox.children[0].rows.selected]; } catch (ex) { }; 627 | let diskid = rowdata[0]; 628 | let disksize = rowdata[3]; 629 | 630 | //App.TUI.LogAndExit(App.Disks.DB.Usages); 631 | //App.TUI.LogAndExit(App.Disks.DB.Usages[diskid]); 632 | 633 | let g0stack = []; 634 | let g1stack = []; 635 | let g2stack = []; 636 | 637 | let sizes = []; 638 | let usedtotal = 0; 639 | let zi = 0; 640 | let gstrokes = ['cyan', 'blue', 'cyan', 'blue', 'cyan', 'blue', 'cyan', 'blue', 'cyan', 'blue']; 641 | let vpz = 100; 642 | for (let z of App.Disks.DB.Usages[diskid]) { 643 | let p = z.Size / z.DiskSize * 100; 644 | if (p < 10) { vpz = vpz - 10; } // else { vpz = vpz - p; } 645 | } 646 | for (let z of App.Disks.DB.Usages[diskid]) { 647 | sizes.push(z.Size); 648 | usedtotal += Math.floor((z.Used / 100) * (z.Size / z.DiskSize) * 100); 649 | let p = (z.Size / z.DiskSize) * 100; 650 | let vp = p; if (p > vpz) { vp = vpz; vpz = vpz - vp; } if (p < 10) { vp = 10; } 651 | let g1p1 = (z.Used / 100) * vp; 652 | let g1p2 = ((100 - z.Used) / 100) * vp; 653 | if (g1p1 == 1) { g1p1 = 1.01; } 654 | if (g1p2 == 1) { g1p2 = 1.01; } 655 | if (g1p1 < 0.01) { g1p1 = 0.01; } 656 | if ((g1p1 + g1p2) > vp) { g1p2 = (vp - g1p1) * 1; } 657 | //g1p2 = p - g1p1 - 0.5; 658 | g0stack.push({ label: Math.floor(p) + '%', percent: vp, stroke: gstrokes[zi] }); 659 | g2stack.push({ label: z.Label, percent: vp, stroke: 'black' }); 660 | g1stack.push({ u: z.Used, p: p, vp: vp, percent: g1p1, stroke: 'yellow' }); 661 | g1stack.push({ u: z.Used, p: p, vp: vp, percent: g1p2, stroke: 'green' }); 662 | zi++; 663 | } 664 | 665 | if (diskid == '0/dev/mmcblk0') { 666 | //console.log(g0stack); 667 | console.log(g1stack); 668 | //console.log(g2stack); 669 | } 670 | 671 | //App.TUI.LogAndExit({ G0: g0stack, G2: g2stack, G1: g1stack }); 672 | 673 | //console.log(usedtotal); 674 | 675 | let boxlabel = '[ ' + diskid + ' = ' + disksize + ' GB'; if (usedtotal > 0) { boxlabel += ' = ' + usedtotal + '% Used'; } else { boxlabel += ' = Not Mounted'; } boxlabel += ' ]'; 676 | var box = blessed.box({ 677 | interactive: true, 678 | right: 0, top: 0, 679 | //keys: true 680 | //, vi: true 681 | fg: 'white', 682 | //bg: '#ff0000', 683 | selectedFg: 'white', selectedBg: 'blue', 684 | label: boxlabel, 685 | width: screen.width - 55 + 1, 686 | height: 7, 687 | padding: 0, 688 | border: { type: "line", fg: "blue" } 689 | }) 690 | 691 | let gauge = MyGauge({ 692 | height: 3, top: 2, width: box.width - 1, zalign: 'right', zpadding: 0, 693 | style: { fg: 'white' }, //border: { type: "line", fg: "cyan" }, 694 | //label: '[ Partitions ]', 695 | showLabel: true, 696 | stack: g0stack 697 | }); 698 | box.append(gauge); 699 | 700 | 701 | let g1 = MyGauge({ 702 | height: 1, top: 5, width: box.width - 1, padding: 0, 703 | style: { fg: 'white' }, //border: { type: "line", fg: "cyan" }, 704 | showLabel: false, 705 | /* 706 | stack: [ 707 | { percent: 3, stroke: 'yellow' }, { percent: 2, stroke: 'green' }, 708 | { percent: 20, stroke: 'yellow' }, { percent: 10, stroke: 'green' }, 709 | { percent: 5, stroke: 'yellow' }, { percent: 60, stroke: 'green' } 710 | ], 711 | */ 712 | stack: g1stack 713 | }); 714 | box.append(g1); 715 | 716 | let g2 = MyGauge({ 717 | height: 1, top: 1, width: box.width - 1, padding: 0, 718 | style: { fg: 'white' }, //border: { type: "line", fg: "cyan" }, 719 | showLabel: true, 720 | stack: g2stack 721 | }); 722 | box.append(g2); 723 | 724 | setTimeout(() => { 725 | screen.append(blessed.box({ height: 1, top: 6, right: 1, width: 1, style: { fg: 'white', bg: 'black' } })); 726 | screen.render(); 727 | }, 10); 728 | 729 | return box; 730 | } 731 | 732 | //App.TUI.FX.FilesystemBox = function () {} 733 | 734 | //App.TUI.FX.OutputBox = function () {} 735 | 736 | //App.TUI.FX.LogBox = function () {} 737 | 738 | //App.TUI.FX.StatBox = function () {} 739 | 740 | // 741 | 742 | App.TUI.FX.Header = function () { 743 | let header = blessed.box({ 744 | top: 0, left: 0, height: 1, width: '100%', 745 | style: { fg: 'white', bg: 'blue' }, 746 | }); 747 | 748 | header.append(App.TUI.InfoBox); 749 | 750 | App.TUI.InputZone.append(App.TUI.InputBox); 751 | header.append(App.TUI.InputZone); 752 | 753 | setTimeout(() => { App.TUI.InputBox.setContent(' ▶ ' + App.Meta.Full + ''); screen.render(); }, 99); 754 | 755 | return header; 756 | } 757 | 758 | App.TUI.FX.Footer = function () { 759 | let footer = blessed.box({ 760 | bottom: 0, left: 0, height: 1, width: '100%', 761 | style: { fg: 'white', bg: 'blue' }, 762 | }); 763 | 764 | footer.append(App.TUI.StatusBox); 765 | footer.append(App.TUI.ClockBox); 766 | 767 | return footer; 768 | } 769 | 770 | App.TUI.FX.ViewsBox = function () { 771 | let box = blessed.box({ 772 | top: 1, left: 0, height: screen.height - 2, width: '100%', 773 | style: { fg: 'white', bg: 'black' }, 774 | }); 775 | return box; 776 | } 777 | 778 | // 779 | 780 | App.TUI.FX.DiskView = function () { 781 | let box = blessed.box({ height: 6 }); 782 | return box; 783 | } 784 | 785 | App.TUI.FX.FilesystemView = function () { 786 | let box = blessed.box({ height: 10, style: { fg: 'white', bg: 'red' } }); 787 | //box.flex = true; 788 | 789 | const opts = { 790 | padding: { top: 0, left: 1, right: 1, bottom: 0 }, 791 | shell: '/bin/sh', 792 | //args: ['-c', '/usr/bin/curl -o /dev/null https://speed.hetzner.de/100MB.bin'], 793 | args: ['-c', '(lspci;echo;lsusb)'], 794 | env: process.env, 795 | cwd: process.cwd(), 796 | cursorType: "block", 797 | border: "line", 798 | scrollback: 1000, 799 | style: { 800 | fg: "default", bg: "default", 801 | border: { type: "line", fg: "blue" }, 802 | focus: { border: { fg: "green" } }, 803 | scrolling: { border: { fg: "red" } } 804 | } 805 | } 806 | 807 | let bxterm = new BXTERM(Object.assign({}, opts, { 808 | //args: ['-c', '(lsblk -Tp --output NAME,MAJ:MIN,UUID,SERIAL,STATE,TRAN,PTTYPE,TYPE,FSTYPE,LABEL,MOUNTPOINT,SIZE,FSUSED,FSUSE%,FSAVAIL,RO,RM,HOTPLUG | cut -c -' + (screen.width - 4) + ')'], 809 | args: ['-c', '(lsblk -Tp --output NAME,MAJ:MIN,STATE,TRAN,PTTYPE,TYPE,FSTYPE,LABEL,MOUNTPOINT,SIZE,FSUSED,FSUSE%,FSAVAIL,RO,RM,HOTPLUG | cut -c -' + (screen.width - 4) + ')'], 810 | width: screen.width, height: box.height, 811 | label: "[ Filesystems ]", 812 | border: { type: "line", fg: "blue" }, 813 | })); 814 | bxterm.flex = true; 815 | 816 | box.append(bxterm); 817 | 818 | return box; 819 | } 820 | 821 | App.TUI.FX.OutputView = function () { 822 | let box = blessed.box({ label: 'Shell Output', height: 10, border: { type: "line", fg: "blue" }, style: { fg: 'white', bg: 'magenta' } }); 823 | box.flex = true; 824 | 825 | let lsblk = 'lsblk -Tp --output NAME,MAJ:MIN,STATE,TRAN,PTTYPE,TYPE,FSTYPE,LABEL,MOUNTPOINT,SIZE,FSUSED,FSUSE%,FSAVAIL,RO,RM,HOTPLUG | cut -c -' + (screen.width - 4) + ''; 826 | const opts = { 827 | padding: { top: 0, left: 1 }, 828 | shell: '/bin/sh', 829 | //args: ['-c', '/usr/bin/curl -o /dev/null https://speed.hetzner.de/100MB.bin'], 830 | //args: ['-c', '(sudo fdisk --list)'], 831 | //args: ['-c', '(uname -a;echo;' + lsblk + ';echo;sudo bash /zx/dclone/test_cmd_backup.sh)'], 832 | args: ['-c', '(uname -a;echo;' + lsblk + ')'], 833 | env: process.env, 834 | cwd: process.cwd(), 835 | cursorType: "block", 836 | border: "line", 837 | scrollback: 1000, 838 | mouse: true, 839 | style: { 840 | fg: "default", bg: "default", 841 | //border: { type: "line", fg: "blue" }, 842 | focus: { border: { fg: "green" } }, 843 | scrolling: { border: { fg: "red" } } 844 | } 845 | } 846 | 847 | let bxterm = new BXTERM(Object.assign({}, opts, { 848 | //args: ['-c', '(lsblk -Tp --output NAME,MAJ:MIN,UUID,SERIAL,STATE,TRAN,PTTYPE,TYPE,FSTYPE,LABEL,MOUNTPOINT,SIZE,FSUSED,FSUSE%,FSAVAIL,RO,RM,HOTPLUG | cut -c -' + (screen.width - 4) + ')'], 849 | //args: ['-c', '(lsblk -Tp --output NAME,MAJ:MIN,STATE,TRAN,PTTYPE,TYPE,FSTYPE,LABEL,MOUNTPOINT,SIZE,FSUSED,FSUSE%,FSAVAIL,RO,RM,HOTPLUG | cut -c -' + (screen.width - 4) + ')'], 850 | width: screen.width, height: 10, 851 | label: "[ Shell Output ]", 852 | border: { type: "line", fg: "blue" }, 853 | controlKey: 'C-w' 854 | })); 855 | bxterm.flex = true; 856 | 857 | box.append(bxterm); 858 | screen.render(); 859 | 860 | console.log(App.Disks.DB.Usages); 861 | 862 | App.BXTERM = bxterm; 863 | 864 | //bxterm.write("\n" + JSONFANCY(App.Disks.DB.Usages) + "\n"); 865 | //bxterm.write(App.Disks.DB.Usages); 866 | //bxterm.write(JSON.stringify(App.Disks.DB.Usages)); 867 | //bxterm.focus(); 868 | 869 | //bxterm.write(JSONFANCY(App.Disks.DB.Usages).replace(/\n/g, "\n\r")); 870 | //bxterm.write("\n\r\n"); 871 | 872 | return box; 873 | } 874 | 875 | App.TUI.FX.AppView = function () { 876 | //let box = blessed.box({ label: 'App Info', height: 8, bottom: 0, left: 0, border: { type: "line", fg: "blue" }, style: { fg: 'white', bg: 'green' } }); 877 | //return box; 878 | let box = blessed.box({ height: 0, bottom: 0, left: 0, style: { fg: 'white', bg: 'red' } }); 879 | return box; 880 | } 881 | 882 | // 883 | 884 | App.InitArgs = function () { 885 | //App.Argy = yargs(process.argv); 886 | } 887 | 888 | App.InitInfo = function () { 889 | //App.SetInfo('App', function () { return 'DCLONE' }); 890 | } 891 | 892 | App.InitData = function () { 893 | } 894 | 895 | App.Init = function () { 896 | } 897 | 898 | App.InitDone = function () { 899 | } 900 | 901 | App.Main = function () { 902 | let rows = App.Disks.GetTableData(); 903 | App.TUI.Init(); 904 | setInterval(() => { }, 100); 905 | } 906 | 907 | App.Run(); 908 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc.