Compare commits
5 Commits
feat/add-n
...
feature/re
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ed97d2873 | ||
|
|
f49d69e75d | ||
|
|
da4b2e68ab | ||
|
|
5557b1bcba | ||
|
|
f4b5f98a44 |
@@ -84,11 +84,6 @@ export const SetHookDialog: React.FC<{ account: IAccount }> = ({ account }) => {
|
|||||||
snap.files?.[snap.active]?.name?.split(".")?.[0] || ""
|
snap.files?.[snap.active]?.name?.split(".")?.[0] || ""
|
||||||
);
|
);
|
||||||
const calculateHashedValue = useCallback(async () => {
|
const calculateHashedValue = useCallback(async () => {
|
||||||
console.log(
|
|
||||||
"-->",
|
|
||||||
namespace,
|
|
||||||
snap.files?.[snap.active]?.name?.split(".")?.[0]
|
|
||||||
);
|
|
||||||
const hashedVal = await sha256(namespace);
|
const hashedVal = await sha256(namespace);
|
||||||
setHashedNamespace(hashedVal.toUpperCase());
|
setHashedNamespace(hashedVal.toUpperCase());
|
||||||
}, [namespace]);
|
}, [namespace]);
|
||||||
@@ -189,7 +184,7 @@ export const SetHookDialog: React.FC<{ account: IAccount }> = ({ account }) => {
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<Input
|
<Input
|
||||||
placeholder="Parameter value"
|
placeholder="Value (hex-quoted)"
|
||||||
{...register(
|
{...register(
|
||||||
`HookParameters.${index}.HookParameter.HookParameterValue`
|
`HookParameters.${index}.HookParameter.HookParameterValue`
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export const deployHook = async (account: IAccount & { name?: string }, data: Se
|
|||||||
const HookNamespace = (await sha256(data.HookNamespace)).toUpperCase();
|
const HookNamespace = (await sha256(data.HookNamespace)).toUpperCase();
|
||||||
const hookOnValues: (keyof TTS)[] = data.Invoke.map(tt => tt.value);
|
const hookOnValues: (keyof TTS)[] = data.Invoke.map(tt => tt.value);
|
||||||
const { HookParameters } = data;
|
const { HookParameters } = data;
|
||||||
const filteredHookParameters = HookParameters.filter(hp => hp.HookParameter.HookParameterName && hp.HookParameter.HookParameterValue)?.map(aa => ({ HookParameter: { HookParameterName: toHex(aa.HookParameter.HookParameterName || ''), HookParameterValue: toHex(aa.HookParameter.HookParameterValue || '') } }));
|
const filteredHookParameters = HookParameters.filter(hp => hp.HookParameter.HookParameterName && hp.HookParameter.HookParameterValue)?.map(aa => ({ HookParameter: { HookParameterName: toHex(aa.HookParameter.HookParameterName || ''), HookParameterValue: aa.HookParameter.HookParameterValue || '' } }));
|
||||||
// const filteredHookGrants = HookGrants.filter(hg => hg.HookGrant.Authorize || hg.HookGrant.HookHash).map(hg => {
|
// const filteredHookGrants = HookGrants.filter(hg => hg.HookGrant.Authorize || hg.HookGrant.HookHash).map(hg => {
|
||||||
// return {
|
// return {
|
||||||
// HookGrant: {
|
// HookGrant: {
|
||||||
|
|||||||
@@ -28,18 +28,19 @@ export const fetchFiles = (gistId: string) => {
|
|||||||
const resHeader = await fetch(`${process.env.NEXT_PUBLIC_COMPILE_API_BASE_URL}/api/header-files`);
|
const resHeader = await fetch(`${process.env.NEXT_PUBLIC_COMPILE_API_BASE_URL}/api/header-files`);
|
||||||
if (resHeader.ok) {
|
if (resHeader.ok) {
|
||||||
resHeaderJson = await resHeader.json();
|
resHeaderJson = await resHeader.json();
|
||||||
|
const files = {
|
||||||
|
...res.data.files,
|
||||||
|
'hookapi.h': res.data.files?.['hookapi.h'] || { filename: 'hookapi.h', content: resHeaderJson.hookapi, language: 'C' },
|
||||||
|
'hookmacro.h': res.data.files?.['hookmacro.h'] || { filename: 'hookmacro.h', content: resHeaderJson.hookmacro, language: 'C' },
|
||||||
|
'sfcodes.h': res.data.files?.['sfcodes.h'] || { filename: 'sfcodes.h', content: resHeaderJson.sfcodes, language: 'C' },
|
||||||
|
};
|
||||||
|
res.data.files = files;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
const files = {
|
|
||||||
...res.data.files,
|
|
||||||
'hookapi.h': res.data.files?.['hookapi.h'] || { filename: 'hookapi.h', content: resHeaderJson.hookapi, language: 'C' },
|
|
||||||
'hookmacro.h': res.data.files?.['hookmacro.h'] || { filename: 'hookmacro.h', content: resHeaderJson.hookmacro, language: 'C' },
|
|
||||||
'sfcodes.h': res.data.files?.['sfcodes.h'] || { filename: 'sfcodes.h', content: resHeaderJson.sfcodes, language: 'C' },
|
|
||||||
};
|
|
||||||
res.data.files = files;
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
// If you want to load templates from GIST instad, uncomment the code below and comment the code above.
|
// If you want to load templates from GIST instad, uncomment the code below and comment the code above.
|
||||||
|
|||||||
Reference in New Issue
Block a user