@olenbetong/appframe-vite 5.1.16 → 5.1.17
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/lib/proxy.js +17 -5
- package/package.json +3 -3
package/lib/proxy.js
CHANGED
|
@@ -20,6 +20,7 @@ export async function login(hostname, username, password) {
|
|
|
20
20
|
await currentLogin;
|
|
21
21
|
}
|
|
22
22
|
let loginPromise = new Promise((resolve, reject) => {
|
|
23
|
+
let hostPrefix = `[${hostname.split(".")[0]}]`;
|
|
23
24
|
if (lastLogin.has(hostname)) {
|
|
24
25
|
let { timestamp, authCookies } = lastLogin.get(hostname);
|
|
25
26
|
if (Date.now() - timestamp < 1000 * 60 * 15) {
|
|
@@ -27,7 +28,7 @@ export async function login(hostname, username, password) {
|
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
30
|
else {
|
|
30
|
-
write(`${chalk.bgBlueBright(
|
|
31
|
+
write(`${chalk.bgBlueBright(hostPrefix)} Renewing authentication cookies...`);
|
|
31
32
|
lastLogin.delete(hostname);
|
|
32
33
|
}
|
|
33
34
|
}
|
|
@@ -46,13 +47,24 @@ export async function login(hostname, username, password) {
|
|
|
46
47
|
};
|
|
47
48
|
process.stdout.clearLine?.(0);
|
|
48
49
|
process.stdout.cursorTo?.(0);
|
|
49
|
-
write(`\r${chalk.bgBlueBright(
|
|
50
|
+
write(`\r${chalk.bgBlueBright(hostPrefix)} Authenticating.`);
|
|
51
|
+
let initialCursorPos = `${hostPrefix} Authenticating.`.length;
|
|
50
52
|
let start = performance.now();
|
|
53
|
+
let counter = 0;
|
|
51
54
|
let interval = setInterval(() => {
|
|
52
55
|
if (isInteractive) {
|
|
53
|
-
|
|
56
|
+
if (counter >= 2) {
|
|
57
|
+
process.stdout.cursorTo?.(initialCursorPos);
|
|
58
|
+
write(" ");
|
|
59
|
+
process.stdout.cursorTo?.(initialCursorPos);
|
|
60
|
+
counter = 0;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
write(`.`);
|
|
64
|
+
counter++;
|
|
65
|
+
}
|
|
54
66
|
}
|
|
55
|
-
},
|
|
67
|
+
}, 400);
|
|
56
68
|
let request = https.request(options, (response) => {
|
|
57
69
|
clearInterval(interval);
|
|
58
70
|
let status = response.statusCode ?? 600;
|
|
@@ -68,7 +80,7 @@ export async function login(hostname, username, password) {
|
|
|
68
80
|
}
|
|
69
81
|
process.stdout.clearLine?.(0);
|
|
70
82
|
process.stdout.cursorTo?.(0);
|
|
71
|
-
write(`${chalk.bgBlueBright(
|
|
83
|
+
write(`${chalk.bgBlueBright(hostPrefix)} Authenticated (${Math.floor(performance.now() - start)}ms)\n`);
|
|
72
84
|
lastLogin.set(hostname, {
|
|
73
85
|
timestamp: Date.now(),
|
|
74
86
|
authCookies: cookieObj,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olenbetong/appframe-vite",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.17",
|
|
4
4
|
"description": "Tools to use and deploy Vite applications to Appframe",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"author": "Bjørnar Vister Hansen <bvh@olenbetong.no>",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@olenbetong/appframe-data": "1.0.
|
|
22
|
+
"@olenbetong/appframe-data": "1.0.3",
|
|
23
23
|
"body-parser": "^1.20.2",
|
|
24
24
|
"chalk": "^5.3.0",
|
|
25
25
|
"chokidar": "^3.6.0",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"open": "^10.0.3",
|
|
41
41
|
"tcp-port-used": "^1.0.2"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "14a3bb472e2ad0a25554eed531a4da53a76b428b"
|
|
44
44
|
}
|