mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 23:36:16 -04:00
OperationConfig now loaded into App via value-loader so that operation code is only included in the worker
This commit is contained in:
parent
760ab688b2
commit
cc3aad17e1
6 changed files with 4000 additions and 1237 deletions
23
src/core/config/MetaConfig.js
Normal file
23
src/core/config/MetaConfig.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
/**
|
||||
* Re-exports OperationConfig in value-loader format without the run function
|
||||
* allowing the web app to access metadata about operations without having to
|
||||
* import all the dependencies.
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import "babel-regenerator-runtime";
|
||||
import Utils from "../Utils.js";
|
||||
import OperationConfig from "./OperationConfig.js";
|
||||
|
||||
|
||||
// Remove the run function from each operation config
|
||||
for (let opConf in OperationConfig) {
|
||||
delete OperationConfig[opConf].run;
|
||||
}
|
||||
|
||||
// Export a string version of the meta config so that it can be imported using
|
||||
// value-loader without any of the dependencies.
|
||||
export default "module.exports = " + JSON.stringify(OperationConfig) + ";";
|
|
@ -2291,7 +2291,7 @@ const OperationConfig = {
|
|||
}
|
||||
]
|
||||
},
|
||||
"Windows Filetime to UNIX Timestamp":{
|
||||
"Windows Filetime to UNIX Timestamp": {
|
||||
description: "Converts a Windows Filetime value to a UNIX timestamp.<br><br>A Windows Filetime is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 UTC.<br><br>A UNIX timestamp is a 32-bit value representing the number of seconds since January 1, 1970 UTC (the UNIX epoch).<br><br>This operation also supports UNIX timestamps in milliseconds, microseconds and nanoseconds.",
|
||||
run: DateTime.runFromFiletimeToUnix,
|
||||
inputType: "string",
|
||||
|
@ -2304,7 +2304,7 @@ const OperationConfig = {
|
|||
}
|
||||
]
|
||||
},
|
||||
"UNIX Timestamp to Windows Filetime":{
|
||||
"UNIX Timestamp to Windows Filetime": {
|
||||
description: "Converts a UNIX timestamp to a Windows Filetime value.<br><br>A Windows Filetime is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 UTC.<br><br>A UNIX timestamp is a 32-bit value representing the number of seconds since January 1, 1970 UTC (the UNIX epoch).<br><br>This operation also supports UNIX timestamps in milliseconds, microseconds and nanoseconds.",
|
||||
run: DateTime.runToFiletimeFromUnix,
|
||||
inputType: "string",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue