публикация конфигов

This commit is contained in:
IoT Manager
2023-10-15 02:28:10 +02:00
parent d10ffd679c
commit f55021345c
2 changed files with 4 additions and 3 deletions

View File

@@ -1377,7 +1377,7 @@
<DashboardPage show={pageReady.dash} layoutJson={layoutJson} pages={pages} wsPush={(ws, topic, status) => wsPush(ws, topic, status)} /> <DashboardPage show={pageReady.dash} layoutJson={layoutJson} pages={pages} wsPush={(ws, topic, status) => wsPush(ws, topic, status)} />
</Route> </Route>
<Route path="/config"> <Route path="/config">
<ConfigPage show={pageReady.config} bind:configJson={configJson} bind:scenarioTxt={scenarioTxt} widgetsJson={widgetsJson} itemsJson={itemsJson} saveConfig={() => saveConfig()} cleanLogs={() => cleanLogs()} rebootEsp={() => rebootEsp()} moduleOrder={(id, key, value) => moduleOrder(id, key, value)} /> <ConfigPage show={pageReady.config} bind:configJson={configJson} bind:scenarioTxt={scenarioTxt} widgetsJson={widgetsJson} itemsJson={itemsJson} saveConfig={() => saveConfig()} cleanLogs={() => cleanLogs()} rebootEsp={() => rebootEsp()} moduleOrder={(id, key, value) => moduleOrder(id, key, value)} userdata={userdata} />
</Route> </Route>
<Route path="/connection"> <Route path="/connection">
<ConnectionPage show={pageReady.connection} rebootEsp={() => rebootEsp()} ssidClick={() => ssidClick()} saveSett={() => saveSett()} saveMqtt={() => saveMqtt()} settingsJson={settingsJson} errorsJson={errorsJson} ssidJson={ssidJson} /> <ConnectionPage show={pageReady.connection} rebootEsp={() => rebootEsp()} ssidClick={() => ssidClick()} saveSett={() => saveSett()} saveMqtt={() => saveMqtt()} settingsJson={settingsJson} errorsJson={errorsJson} ssidJson={ssidJson} />

View File

@@ -10,6 +10,7 @@
export let widgetsJson; export let widgetsJson;
export let itemsJson; export let itemsJson;
export let scenarioTxt; export let scenarioTxt;
export let userdata;
export let show; export let show;
@@ -211,6 +212,7 @@
scenario: scenarioTxt, scenario: scenarioTxt,
gallery: [], gallery: [],
type: "iotmpost", type: "iotmpost",
username: userdata.username,
}; };
const JWT = Cookies.get("token_iotm2"); const JWT = Cookies.get("token_iotm2");
try { try {
@@ -227,8 +229,7 @@
if (res.ok) { if (res.ok) {
console.log(content.result); console.log(content.result);
if (content.result.acknowledged) { if (content.result.acknowledged) {
window.open("http://localhost:4000/configs", "_blank"); window.open("http://localhost:4000/configs?username=" + userdata.username + "&id=" + content.result.insertedId, "_blank");
//insertedId
} }
errors = [{ msg: "ok_success" }]; errors = [{ msg: "ok_success" }];
} else { } else {