Commit 009fd140 authored by Mathias Chouet's avatar Mathias Chouet :spaghetti:
Browse files

Rapport de bug : compression des données de session

mise à jour des dépendances
Showing with 528 additions and 368 deletions
+528 -368
This diff is collapsed.
#!/usr/bin/env node
'use strict';
const pako = require("pako");
global.atob = require("atob");
const stdin = process.openStdin();
// let session = 'eJztXdtu4kgQ/Reeo5Vp48wkb2EAAxs3A+vgy2oefBM32xgDwXaUf1+SrOhiFEeWsjMr4LyFpOkkh+qqU6eq2k+1dbBez5Zx7fbvp9p25tdua1xNVi6rXdWSdJmsa7dPNc8JPT1PgtqtclWLl37w9kJ63q9xUicKNkG6ft1hnUfuMtxv8j3dbxDtl+6//qvH1fv2/vWjE25f3veHJEn15yuy/F6s/nZ3/+3hvnb0Y6N8s+N9rI9+q3K0dFy+lD3/eFn6Bodt7Bqe/D4cX3+GY71Jt95mmwZrAqimjnZO9/0dvtAdFLLB23fqV7VwOWsF7mzz+q+W4m23Pvh/6pJUFc6fUbr/CCW68Jv/0abXFFGnCHeuATwOFjZvzgYq8Dicl6geOiUO6BLx8FS/CFrA4+A/on4eRMDjELCLTubhvBzw8HU71hBfhD/tTvIAePz4z9jq8GO2atc/guL4z7bZR2vrezQoUYiUVCs56NWoKI9uGl588aYgEJX5tY/QSkJruPKRqgjqJS/lAVynwGP+UOclyfAl4mHFncgvgMchvpiTgiOVFVQ0vmuAmhM8us0VUrczoKID42tdKyEKv0Ek1npcuzNfXs/iV9OInKx223gxmiB5eXNdKfuY34PpF8jGvGhuy2Tj3wDQfY//uX+1cdJJsOFbl35kb9/8/vI7X9/0aan9PUir4uQa9aLMQ/7/1YZjO9vbwr+WxoSlSV+UX21LgfGQ2yVes2LeF9soQVDepg8VBzxW5MHmdMlhHyK8qTexA54ieJtpya4OPA7+lE1yG+dF4BFbOxe6Ii1RxdCNKINZSD7wOP28j8ejlVMimFejorY6ndqQiEQCVDQlDolI4BH7cYDQSkKJlvugoqQkM54htJJUxWwqAagX8R/9BPZB8NB5rEHqEP6jm2x8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oBpE6hngEwlHqNn7EWOwZUFE7TtJPXnFvhgWHKRBE/RSqKHEVZq9AFk/sQ9UauNyK4FFouQ/7EKms7CccqrnwH4UfYxaBpCr6WC57PuIl4uEVPcxmnAMVteZWo2yopOIV96oS4wpzUjBoTTdwFQIPrvYZCmwCDz9u4h684+e9JTaol/AfRsjgP6g/HTVwjyZVzccZR7wVeLQ0GTdOnAEVdbs95pZoEtWoqGYMd5iAJUdD9vIB2sqFqsGUCG32VOXhc0wE04LjKMLYAcGDjaZoeCJiid7MMcZFU5Upg2pOGMz8geHphqdLRX88/wMHt56Z';
let session = '';
stdin.on('data', function(chunk) {
session += chunk;
});
stdin.on('end', function() {
session = atob(session); // base64
session = pako.inflate(session, { to: 'string' }); // gzip (zlib)
console.log(session);
});
...@@ -20,6 +20,7 @@ import { DialogLoadSessionComponent } from "./components/dialog-load-session/dia ...@@ -20,6 +20,7 @@ import { DialogLoadSessionComponent } from "./components/dialog-load-session/dia
import { DialogSaveSessionComponent } from "./components/dialog-save-session/dialog-save-session.component"; import { DialogSaveSessionComponent } from "./components/dialog-save-session/dialog-save-session.component";
import { NotificationsService } from "./services/notifications/notifications.service"; import { NotificationsService } from "./services/notifications/notifications.service";
import * as pako from "pako";
@Component({ @Component({
selector: "nghyd-app", selector: "nghyd-app",
...@@ -420,11 +421,16 @@ export class AppComponent implements OnInit, OnDestroy, Observer { ...@@ -420,11 +421,16 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
* avec un texte standard, et le contenu de la session au format JSON * avec un texte standard, et le contenu de la session au format JSON
*/ */
public reportBug() { public reportBug() {
const recipient = "cassiopee@g-eau.fr"; const recipient = "bug@cassiopee.g-eau.fr";
const subject = "[ISSUE] " + this.intlService.localizeText("INFO_REPORT_BUG_SUBJECT"); const subject = "[ISSUE] " + this.intlService.localizeText("INFO_REPORT_BUG_SUBJECT");
let body = this.intlService.localizeText("INFO_REPORT_BUG_BODY"); let body = this.intlService.localizeText("INFO_REPORT_BUG_BODY");
// add session description // add session description
body += Session.getInstance().serialise(); let session = Session.getInstance().serialise();
session = pako.deflate(session, { to: "string" }); // gzip (zlib)
session = btoa(session); // base64
body += session + "\n";
body = encodeURIComponent(body); body = encodeURIComponent(body);
const mailtoURL = `mailto:${recipient}?subject=${subject}&body=${body}`; const mailtoURL = `mailto:${recipient}?subject=${subject}&body=${body}`;
......
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
"INFO_REMOUS_RESSAUT_DEHORS": "Hydraulic jump detected %sens% abscissa %x% m", "INFO_REMOUS_RESSAUT_DEHORS": "Hydraulic jump detected %sens% abscissa %x% m",
"INFO_REMOUS_RESSAUT_HYDRO": "Hydraulic jump detected between abscissa %xmin% and %xmax% m", "INFO_REMOUS_RESSAUT_HYDRO": "Hydraulic jump detected between abscissa %xmin% and %xmax% m",
"INFO_REPORT_BUG_SUBJECT": "Issue report", "INFO_REPORT_BUG_SUBJECT": "Issue report",
"INFO_REPORT_BUG_BODY": "This is an issue report.\n\nPlease describe quickly the issue you encoutered, and the steps you followed.\n\n1. ...\n2. ...\n\n\nDO NOT MODIFY TEXT BELOW THIS LINE\n--------------------------------------------\n\n", "INFO_REPORT_BUG_BODY": "This is an issue report.\n\nPlease describe quickly the issue you encoutered, and the steps you followed.\n\n1. ...\n2. ...\n\n\n--- Current session state - do not modify text below ---\n------------------------------------------------------------------------\n\n",
"INFO_REQUIRES": "requires", "INFO_REQUIRES": "requires",
"INFO_SECTIONPARAMETREE_TITRE": "Parametric section", "INFO_SECTIONPARAMETREE_TITRE": "Parametric section",
"INFO_SECTIONPARAMETREE_TITRE_COURT": "Param. section", "INFO_SECTIONPARAMETREE_TITRE_COURT": "Param. section",
......
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
"INFO_REMOUS_RESSAUT_DEHORS": "Ressaut hydraulique détecté à l'%sens% de l'abscisse %x% m", "INFO_REMOUS_RESSAUT_DEHORS": "Ressaut hydraulique détecté à l'%sens% de l'abscisse %x% m",
"INFO_REMOUS_RESSAUT_HYDRO": "Ressaut hydraulique détecté entre les abscisses %xmin% et %xmax% m", "INFO_REMOUS_RESSAUT_HYDRO": "Ressaut hydraulique détecté entre les abscisses %xmin% et %xmax% m",
"INFO_REPORT_BUG_SUBJECT": "Rapport d'erreur", "INFO_REPORT_BUG_SUBJECT": "Rapport d'erreur",
"INFO_REPORT_BUG_BODY": "Ceci est un rapport d'erreur.\n\nMerci de décrire rapidement ci-dessous le problème rencontré, et les étapes qui vous y ont mené.\n\n1. ...\n2. ...\n\n\nNE PAS MODIFIER LE TEXTE SOUS CETTE LIGNE\n--------------------------------------------\n\n", "INFO_REPORT_BUG_BODY": "Ceci est un rapport d'erreur.\n\nMerci de décrire rapidement ci-dessous le problème rencontré, et les étapes qui vous y ont mené.\n\n1. ...\n2. ...\n\n\n--- État de la session en cours - ne pas modifier le texte ci-dessous ---\n--------------------------------------------------------------------------------------------\n\n",
"INFO_REQUIRES": "dépend de", "INFO_REQUIRES": "dépend de",
"INFO_SECTIONPARAMETREE_TITRE": "Section paramétrée", "INFO_SECTIONPARAMETREE_TITRE": "Section paramétrée",
"INFO_SECTIONPARAMETREE_TITRE_COURT": "Sec. param.", "INFO_SECTIONPARAMETREE_TITRE_COURT": "Sec. param.",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment