@flow-os/client 0.0.47-dev.1772043836 → 0.0.47-dev.1772043897
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli/dev.ts +10 -7
package/package.json
CHANGED
package/src/cli/dev.ts
CHANGED
|
@@ -151,7 +151,9 @@ export async function dev() {
|
|
|
151
151
|
httpServer.removeListener('error', onError);
|
|
152
152
|
const T = '\x1b[1;38;2;255;0;135m'; // bold #ff0087
|
|
153
153
|
const U = '\x1b[38;2;255;0;135m';
|
|
154
|
-
const
|
|
154
|
+
const W_COL = '\x1b[97m'; // bianco
|
|
155
|
+
const W = 46;
|
|
156
|
+
const innerW = W - 4;
|
|
155
157
|
const proto = useHttps ? 'https' : 'http';
|
|
156
158
|
const local = `${proto}://localhost:${port}`;
|
|
157
159
|
const network = host ? getNetworkUrl(port, useHttps) : null;
|
|
@@ -161,14 +163,15 @@ export async function dev() {
|
|
|
161
163
|
const pad = (s: string, len: number) => s + ' '.repeat(Math.max(0, len - strip(s).length));
|
|
162
164
|
const inner = ' ' + T + 'Flow OS' + R + ' ';
|
|
163
165
|
const innerLen = strip(inner).length;
|
|
164
|
-
const half = Math.max(0, Math.floor((
|
|
165
|
-
const
|
|
166
|
-
const
|
|
167
|
-
const
|
|
166
|
+
const half = Math.max(0, Math.floor((innerW - innerLen) / 2));
|
|
167
|
+
const rest = innerW - half - innerLen;
|
|
168
|
+
const top = '╭' + '─'.repeat(half) + inner + W_COL + '─'.repeat(rest) + '╮';
|
|
169
|
+
const bottom = '╰' + W_COL + '─'.repeat(innerW) + '╯';
|
|
170
|
+
const emptyLine = '│' + ' '.repeat(PAD_LEFT) + ' '.repeat(innerW - PAD_LEFT) + '│';
|
|
168
171
|
const localContent = iconLocal + ' Local: ' + U + local + R;
|
|
169
|
-
const localLine = '│' + ' '.repeat(PAD_LEFT) + pad(localContent,
|
|
172
|
+
const localLine = '│' + ' '.repeat(PAD_LEFT) + pad(localContent, innerW - PAD_LEFT) + '│';
|
|
170
173
|
const netContent = network ? iconNetwork + ' Network: ' + U + network + R : iconNetwork + ' Network: (not exposed)';
|
|
171
|
-
const networkLine = '│' + ' '.repeat(PAD_LEFT) + pad(netContent,
|
|
174
|
+
const networkLine = '│' + ' '.repeat(PAD_LEFT) + pad(netContent, innerW - PAD_LEFT) + '│';
|
|
172
175
|
const banner = '\x1b[2A\r\x1b[K\n' + top + '\n' + emptyLine + '\n' + localLine + '\n' + networkLine + '\n' + bottom + '\n\n';
|
|
173
176
|
process.stdout.write(banner);
|
|
174
177
|
resolve();
|