working poc
This commit is contained in:
@@ -25,6 +25,7 @@ const app = createApp({
|
|||||||
fileStream: null,
|
fileStream: null,
|
||||||
fileName: null,
|
fileName: null,
|
||||||
fileSize: null,
|
fileSize: null,
|
||||||
|
t0: new Date(),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
@@ -76,6 +77,7 @@ const app = createApp({
|
|||||||
initConnection(conn) {
|
initConnection(conn) {
|
||||||
conn.on("open", () => {
|
conn.on("open", () => {
|
||||||
console.log("connOpen");
|
console.log("connOpen");
|
||||||
|
console.log(conn);
|
||||||
this.connection = conn;
|
this.connection = conn;
|
||||||
this.connection.on("close", this.connClose);
|
this.connection.on("close", this.connClose);
|
||||||
this.connection.on("error", this.connError);
|
this.connection.on("error", this.connError);
|
||||||
@@ -109,6 +111,7 @@ const app = createApp({
|
|||||||
console.log(data.type);
|
console.log(data.type);
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case "start":
|
case "start":
|
||||||
|
this.t0 = new Date();
|
||||||
this.fileName = data.fileName;
|
this.fileName = data.fileName;
|
||||||
this.fileSize = data.fileSize;
|
this.fileSize = data.fileSize;
|
||||||
this.fileStream = streamSaver
|
this.fileStream = streamSaver
|
||||||
@@ -126,6 +129,8 @@ const app = createApp({
|
|||||||
if (this.fileStream) {
|
if (this.fileStream) {
|
||||||
this.fileStream.close();
|
this.fileStream.close();
|
||||||
}
|
}
|
||||||
|
console.log(new Date() - this.t0);
|
||||||
|
console.log(this.fileSize / (new Date() - this.t0));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user