Adj. to 103

This commit is contained in:
Kilian Hofmann 2025-11-07 11:26:39 +01:00
parent 3d2e439674
commit 5ad5f16bdb
7 changed files with 89 additions and 28 deletions

2
.gitignore vendored
View File

@ -18,5 +18,7 @@ PackageSources/SimObjects/Airplanes/**/panel/*.wasm
EFB/efb.css
EFB/efb.js
EFB/efb.html
EFB/efb.index.js
EFB/patched/
*.su

View File

@ -1,13 +1,16 @@
diff --git a/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.html b/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.html
index a2e14f7..515e0d9 100644
--- a/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.html
+++ b/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.html
@@ -7,4 +7,6 @@
Index: EFB.html
===================================================================
--- EFB.html
+++ EFB.html
@@ -4,7 +4,9 @@
</div>
</script>
-<script type="text/html" import-async="false" import-script="/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.index.js"></script>
+<script type="text/html" import-script="/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.js" import-async="false"></script>
+<script type="text/html" import-script="/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/App.js" import-async="false"></script>
-<link rel="stylesheet" href="/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.css" />
+<link rel="stylesheet" href="/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.css" />
+<link rel="stylesheet" href="/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/App.css" />
-<script type="text/html" import-script="/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.js" import-async="false"></script>
+<script type="text/html" import-script="/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.js" import-async="false"></script>
+<script type="text/html" import-script="/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/App.js" import-async="false"></script>

View File

@ -1,9 +1,10 @@
diff --git a/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.js b/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.js
index 0904cc9..d2bcd02 100644
--- a/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.js
+++ b/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.js
@@ -42333,9 +42333,16 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
Index: EFB.js
===================================================================
--- EFB.js
+++ EFB.js
@@ -40035,11 +40035,18 @@
),
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
"button",
{
- onClick: loadPayload,
@ -20,8 +21,10 @@ index 0904cc9..d2bcd02 100644
+ children: "Manage payload & fuel"
}
),
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
@@ -42842,6 +42849,11 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
"button",
@@ -40537,8 +40544,13 @@
] })
] }) }) });
}
@ -32,13 +35,16 @@ index 0904cc9..d2bcd02 100644
+
// src/components/Router.tsx
init_common();
var import_jsx_runtime14 = __toESM(require_jsx_runtime());
@@ -42858,7 +42870,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
var import_jsx_runtime15 = __toESM(require_jsx_runtime());
var routes = {
@@ -40553,9 +40565,9 @@
button: {
title: "Payload",
icon: faWeightHanging
icon: Weight
},
- page: PayloadPage
+ page: App
},
"/perf": {
button: {
title: "Perf",

21
EFB/generatePatches.js Normal file
View File

@ -0,0 +1,21 @@
const { createTwoFilesPatch } = require("diff");
const fs = require("fs");
// HTML
let file1Contents = fs.readFileSync("EFB.html").toString();
let file2Contents = fs.readFileSync("patched/EFB.html").toString();
let patch = createTwoFilesPatch(
"EFB.html",
"EFB.html",
file1Contents,
file2Contents
);
fs.writeFileSync("efb-html.patch", patch);
// JS
file1Contents = fs.readFileSync("EFB.js").toString();
file2Contents = fs.readFileSync("patched/EFB.js").toString();
patch = createTwoFilesPatch("EFB.js", "EFB.js", file1Contents, file2Contents);
fs.writeFileSync("efb-js.patch", patch);

View File

@ -1,3 +1,4 @@
const { applyPatch } = require("diff");
const fs = require("fs");
const util = require("node:util");
const exec = util.promisify(require("node:child_process").exec);
@ -6,17 +7,17 @@ const readline = require("readline");
const outPath =
"./PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb";
fs.copyFileSync("./EFB/efb.js", `${outPath}/efb.js`);
fs.copyFileSync("./EFB/efb.html", `${outPath}/efb.html`);
fs.copyFileSync("./EFB/efb.css", `${outPath}/efb.css`);
console.log("Files transferred.");
exec("git apply ./EFB/efb-js.patch").then(({ stdout, stderr }) => {
console.log("Patches efb.js applied.");
});
exec("git apply ./EFB/efb-html.patch").then(({ stdout, stderr }) => {
console.log("Patches efb.html applied.");
});
let file1Contents = fs.readFileSync("./EFB/efb.js").toString();
let patch = fs.readFileSync("./EFB/efb-js.patch").toString();
let patchedFile = applyPatch(file1Contents, patch);
fs.writeFileSync(`${outPath}/efb.js`, patchedFile);
file1Contents = fs.readFileSync("./EFB/efb.html").toString();
patch = fs.readFileSync("./EFB/efb-html.patch").toString();
patchedFile = applyPatch(file1Contents, patch);
fs.writeFileSync(`${outPath}/efb.html`, patchedFile);
var output = "";
var lineReader = readline.createInterface({

5
package.json Normal file
View File

@ -0,0 +1,5 @@
{
"devDependencies": {
"diff": "^8.0.2"
}
}

23
pnpm-lock.yaml generated Normal file
View File

@ -0,0 +1,23 @@
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
devDependencies:
diff:
specifier: ^8.0.2
version: 8.0.2
packages:
diff@8.0.2:
resolution: {integrity: sha512-sSuxWU5j5SR9QQji/o2qMvqRNYRDOcBTgsJ/DeCf4iSN4gW+gNMXM7wFIP+fdXZxoNiAnHUTGjCr+TSWXdRDKg==}
engines: {node: '>=0.3.1'}
snapshots:
diff@8.0.2: {}