-
Tiedostot
+
+ Tiedostot
+
+
Generoi projekti:
kpn project "..."
diff --git a/network-poc/frontend/src/pages/index.astro b/network-poc/frontend/src/pages/index.astro
index 6780698..14f59cf 100644
--- a/network-poc/frontend/src/pages/index.astro
+++ b/network-poc/frontend/src/pages/index.astro
@@ -1430,7 +1430,9 @@ Blog → Author: name,email,bio(Text|None) / Post: title, content(Text), author_
// Oppimispolku
renderLearnView(promptLog);
- renderProjectCard(files, task);
+ termLog(`\n
Siirretään tiedostot Editoriin...`);
+ window._currentProjectName = task;
+ setTimeout(() => window.openInEditor(files), 1000);
}
async function kpnPipelineSimple(task) {
@@ -1456,41 +1458,7 @@ Blog → Author: name,email,bio(Text|None) / Post: title, content(Text), author_
termLog(`\n
━━━ Done ━━━`);
}
- // === Project card ===
- window._projectFiles = {}; // id → files
-
- function renderProjectCard(files, name) {
- const entries = Object.entries(files);
- if (!entries.length) return;
- const id = 'proj-' + Date.now();
- window._projectFiles[id] = files;
-
- const tabs = entries.map(([n],i) =>
- `
${esc(n)}
`
- ).join('');
-
- const panels = entries.map(([n,c],i) =>
- `
` +
- `
` +
- `
` +
- `
${highlightCode(c)}`
- ).join('');
-
- const html = `
` +
- `` +
- `
${tabs}
${panels}
`;
-
- const div = document.createElement('div');
- div.innerHTML = html;
- termPanel.appendChild(div.firstElementChild);
- termPanel.scrollTop = termPanel.scrollHeight;
- }
+ // === Poistettiin renderProjectCard ja siirryttiin suoraan Editorin käyttöön ===
window.copyProjectFile = function(id, name) {
const files = window._projectFiles[id];
if (files && files[name]) navigator.clipboard.writeText(files[name]);
@@ -1501,8 +1469,9 @@ Blog → Author: name,email,bio(Text|None) / Post: title, content(Text), author_
const text = Object.entries(files).map(([n,c]) => '# --- ' + n + ' ---\n' + c).join('\n\n');
navigator.clipboard.writeText(text);
};
- window.downloadProjectZip = function(id, name) {
- const files = window._projectFiles[id];
+ window.downloadProjectZip = function() {
+ const files = window._currentEditorFiles;
+ const name = window._currentProjectName || 'projekti';
if (!files) return;
const enc = new TextEncoder();
const entries = Object.entries(files);
@@ -1618,6 +1587,7 @@ Blog → Author: name,email,bio(Text|None) / Post: title, content(Text), author_
const langMap = {py:'python',rs:'rust',js:'javascript',ts:'typescript',toml:'toml',json:'json',html:'html',css:'css',md:'markdown',txt:'plaintext'};
window.openInEditor = async function(files) {
+ window._currentEditorFiles = files;
switchTab('editor');
try { await initMonaco(); } catch(e) { console.error('Monaco-virhe:', e); return; }
const m = window.monaco;