From 3fb9cc0e4ee2c11f5f8d29d7304af5298d29e1c8 Mon Sep 17 00:00:00 2001 From: dlaxcess Date: Sat, 3 Feb 2024 02:17:55 +0100 Subject: [PATCH] get default kredeum storage config --- svelte/components/Input/Config/Config.ts | 41 +++++++++--------- .../Input/Config/InputConfigFields.svelte | 42 +++++++++++-------- svelte/components/Input/Config/configTypes.ts | 3 +- 3 files changed, 46 insertions(+), 40 deletions(-) diff --git a/svelte/components/Input/Config/Config.ts b/svelte/components/Input/Config/Config.ts index 346ce7e2a..fc06bf60e 100644 --- a/svelte/components/Input/Config/Config.ts +++ b/svelte/components/Input/Config/Config.ts @@ -29,7 +29,7 @@ export default class Config { display: "IPFS", editable: false, fields: [ - { key: "apiEndPoint", value: "", display: "API end Point", fixed: true, undeletable: true }, + { key: "apiEndpoint", value: "", display: "API end Point", fixed: true, undeletable: true }, { key: "apiKey", value: "", fixed: true, undeletable: true } ] }, @@ -37,7 +37,7 @@ export default class Config { display: "Swarm", editable: false, fields: [ - { key: "apiEndPoint", value: "", fixed: true, undeletable: true }, + { key: "apiEndpoint", value: "", fixed: true, undeletable: true }, { key: "apiKey", value: "", fixed: true, undeletable: true } ] } @@ -58,15 +58,15 @@ export default class Config { loadConfigFromFile = () => { - } + }; localConfigSet = () => { - } + }; localConfigInit = () => { - } + }; getConfig = () => { return this.attributes; @@ -74,38 +74,37 @@ export default class Config { deleteAttribute = () => { - } + }; addAttribute = () => { - } + }; addField(namespace: string): void { const fields = this.attributes[namespace].fieldsGroups[this.attributes[namespace].default.value].fields; this.attributes[namespace].fieldsGroups[this.attributes[namespace].default.value].fields = [...fields, { key: "", value: "" }]; - console.log("addField ~ this.attributes[namespace].fields:", this.attributes[namespace].fields); document.dispatchEvent(this.propertyChangedEvent); } removeField(namespace: string, i: number): void { const fields = this.attributes[namespace].fieldsGroups[this.attributes[namespace].default.value].fields; - if (fields.length > 1) { - this.attributes[namespace].fieldsGroups[this.attributes[namespace].default.value].fields = fields.filter((_, index) => i !== index); - } else { - this.attributes[namespace].fieldsGroups[this.attributes[namespace].default.value].fields[i] = { key: "", value: "" }; - } + // if (fields.length > 1) { + this.attributes[namespace].fieldsGroups[this.attributes[namespace].default.value].fields = fields.filter((_, index) => i !== index); + // } else { + // this.attributes[namespace].fieldsGroups[this.attributes[namespace].default.value].fields[i] = { key: "", value: "" }; + // } document.dispatchEvent(this.propertyChangedEvent); } -////////////////////////////////////////////// -// actual localStorage storage structure -let storage = { - default: "swarm", - swarm: { - apiEndpoint: "http://localhost:1633", - apiKey: "f2b69cfcb5666586d028e965f75fc19bd3eba48313591cf61418856f6904d5d4" - } + ////////////////////////////////////////////// + // actual localStorage storage structure + // let storage = { + // default: "swarm", + // swarm: { + // apiEndpoint: "http://localhost:1633", + // apiKey: "f2b69cfcb5666586d028e965f75fc19bd3eba48313591cf61418856f6904d5d4" + // } } \ No newline at end of file diff --git a/svelte/components/Input/Config/InputConfigFields.svelte b/svelte/components/Input/Config/InputConfigFields.svelte index bc2caa135..b314c58c6 100644 --- a/svelte/components/Input/Config/InputConfigFields.svelte +++ b/svelte/components/Input/Config/InputConfigFields.svelte @@ -1,4 +1,5 @@