stack-site-builder 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +45 -0
- package/dev/local-samples-client.js +284 -0
- package/dev/local-samples.mjs +594 -0
- package/index.d.ts +12 -0
- package/index.mjs +124 -0
- package/markdown.mjs +394 -0
- package/package.json +52 -0
- package/src/components/ArrowUpRight.astro +24 -0
- package/src/components/ArticleCard.astro +56 -0
- package/src/components/ArticleDetail.astro +100 -0
- package/src/components/ArticleLink.astro +45 -0
- package/src/components/BackToTop.astro +47 -0
- package/src/components/BlogIndex.astro +137 -0
- package/src/components/Breadcrumb.astro +37 -0
- package/src/components/CategoryIndex.astro +115 -0
- package/src/components/ChevronDown.astro +23 -0
- package/src/components/CodeSamples.astro +141 -0
- package/src/components/CollapsibleGrid.astro +50 -0
- package/src/components/ConceptCard.astro +59 -0
- package/src/components/ConceptDetail.astro +102 -0
- package/src/components/ConceptIndex.astro +143 -0
- package/src/components/ConceptLink.astro +43 -0
- package/src/components/ConceptTools.astro +49 -0
- package/src/components/DeckView.astro +772 -0
- package/src/components/DetailTabs.astro +219 -0
- package/src/components/FilterControls.astro +407 -0
- package/src/components/Glossary.astro +264 -0
- package/src/components/Home.astro +90 -0
- package/src/components/LanguageSwitcher.astro +86 -0
- package/src/components/ListControls.astro +182 -0
- package/src/components/MermaidLoader.astro +96 -0
- package/src/components/PricingSection.astro +100 -0
- package/src/components/ProjectFileList.astro +68 -0
- package/src/components/ProjectFileTree.astro +95 -0
- package/src/components/ProjectRelatedTools.astro +70 -0
- package/src/components/ProjectViewer.astro +431 -0
- package/src/components/RelatedArticles.astro +52 -0
- package/src/components/RelatedConcepts.astro +60 -0
- package/src/components/RelatedTools.astro +55 -0
- package/src/components/SampleIndex.astro +464 -0
- package/src/components/SamplePage.astro +95 -0
- package/src/components/SampleProject.astro +56 -0
- package/src/components/Slide.astro +36 -0
- package/src/components/SlidesIndex.astro +60 -0
- package/src/components/StackCard.astro +183 -0
- package/src/components/StackDetail.astro +507 -0
- package/src/components/StarIcon.astro +21 -0
- package/src/components/TagIndex.astro +51 -0
- package/src/components/ThemeToggle.astro +106 -0
- package/src/components/Toc.astro +39 -0
- package/src/components/TocRail.astro +74 -0
- package/src/components/ToolAvatar.astro +133 -0
- package/src/components/ToolMeta.astro +95 -0
- package/src/components/VendorIndex.astro +51 -0
- package/src/content.ts +228 -0
- package/src/i18n/ui.ts +337 -0
- package/src/layouts/BaseLayout.astro +287 -0
- package/src/lib/articles.ts +27 -0
- package/src/lib/assets.ts +19 -0
- package/src/lib/category-tree.ts +64 -0
- package/src/lib/concepts.ts +35 -0
- package/src/lib/dates.ts +21 -0
- package/src/lib/facets.ts +57 -0
- package/src/lib/github.ts +186 -0
- package/src/lib/inline-md.ts +30 -0
- package/src/lib/pricing.ts +22 -0
- package/src/lib/project.ts +309 -0
- package/src/lib/samples.ts +88 -0
- package/src/lib/slides.ts +25 -0
- package/src/lib/stacks.ts +129 -0
- package/src/lib/toc-rail-client.ts +79 -0
- package/src/pages/article/[...id].astro +24 -0
- package/src/pages/article/category/[id].astro +17 -0
- package/src/pages/article/index.astro +12 -0
- package/src/pages/categories/[id].astro +25 -0
- package/src/pages/concept/[...id].astro +24 -0
- package/src/pages/concept/category/[id].astro +17 -0
- package/src/pages/concept/index.astro +12 -0
- package/src/pages/glossary.astro +12 -0
- package/src/pages/index.astro +9 -0
- package/src/pages/ko/article/[...id].astro +24 -0
- package/src/pages/ko/article/category/[id].astro +17 -0
- package/src/pages/ko/article/index.astro +12 -0
- package/src/pages/ko/categories/[id].astro +24 -0
- package/src/pages/ko/concept/[...id].astro +24 -0
- package/src/pages/ko/concept/category/[id].astro +17 -0
- package/src/pages/ko/concept/index.astro +12 -0
- package/src/pages/ko/glossary.astro +12 -0
- package/src/pages/ko/index.astro +9 -0
- package/src/pages/ko/sample/[folder].astro +16 -0
- package/src/pages/ko/sample/index.astro +12 -0
- package/src/pages/ko/slides/[deck].astro +14 -0
- package/src/pages/ko/slides/index.astro +12 -0
- package/src/pages/ko/stack/[...id].astro +51 -0
- package/src/pages/ko/tags/[tag].astro +18 -0
- package/src/pages/ko/vendors/[vendor].astro +18 -0
- package/src/pages/sample/[folder].astro +16 -0
- package/src/pages/sample/index.astro +12 -0
- package/src/pages/slides/[deck].astro +14 -0
- package/src/pages/slides/index.astro +12 -0
- package/src/pages/stack/[...id].astro +51 -0
- package/src/pages/tags/[tag].astro +18 -0
- package/src/pages/vendors/[vendor].astro +18 -0
- package/src/styles/global.css +2350 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CodeCompose7
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# stack-site-builder
|
|
2
|
+
|
|
3
|
+
An [Astro](https://astro.build) theme for curated "awesome stack" catalog
|
|
4
|
+
sites — a tool catalog with per-entry detail pages, concepts, articles,
|
|
5
|
+
presentation slides, runnable samples, a `[[wikilink]]` glossary, and full
|
|
6
|
+
en/ko i18n. The site that grew it: [awesome-ai-stack](https://github.com/codecompose7/awesome-ai-stack).
|
|
7
|
+
|
|
8
|
+
A consuming site provides only content and data; the theme provides every
|
|
9
|
+
route, component, style and the markdown pipeline.
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
// astro.config.mjs
|
|
13
|
+
import { defineConfig } from 'astro/config';
|
|
14
|
+
import aasTheme from 'stack-site-builder';
|
|
15
|
+
import { glossary } from './src/data/glossary.mjs';
|
|
16
|
+
|
|
17
|
+
export default defineConfig({
|
|
18
|
+
site: 'https://example.github.io',
|
|
19
|
+
base: '/my-stack',
|
|
20
|
+
i18n: { locales: ['en', 'ko'], defaultLocale: 'en', routing: { prefixDefaultLocale: false } },
|
|
21
|
+
integrations: [aasTheme({ glossary })],
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
// src/content.config.ts
|
|
27
|
+
import { defineAasCollections } from 'stack-site-builder/content';
|
|
28
|
+
import { categoryMap } from './data/categories';
|
|
29
|
+
|
|
30
|
+
export const collections = defineAasCollections({ categoryMap });
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## What a site supplies
|
|
34
|
+
|
|
35
|
+
| Where | What |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `src/data/site.ts` | Site identity: name, repo URL, per-locale UI string overrides |
|
|
38
|
+
| `src/data/categories.ts` | The tool-catalog category tree (validated against content) |
|
|
39
|
+
| `src/data/concept-categories.ts` · `article-categories.ts` | Taxonomies for concepts / articles |
|
|
40
|
+
| `src/data/glossary.mjs` | `[[Term]]` wikilink targets |
|
|
41
|
+
| `src/content/{stacks,concepts,articles,slides}/` | The content, one MDX file per locale |
|
|
42
|
+
| `public/` · `samples/` | Logos/favicons and runnable sample projects |
|
|
43
|
+
|
|
44
|
+
The theme reaches the site's data through the `@aas-data/*` alias (set up by
|
|
45
|
+
the integration), so everything above is swappable per site.
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
// Browser IIFE for the dev-only /local-samples run page (__run-ui). Read
|
|
2
|
+
// verbatim by dev/local-samples.mjs and injected into that page, so it must
|
|
3
|
+
// avoid template literals and ${...} (it lives inside a template literal there).
|
|
4
|
+
(function () {
|
|
5
|
+
var dataEl = document.getElementById('run-data');
|
|
6
|
+
if (!dataEl) return;
|
|
7
|
+
var data = JSON.parse(dataEl.textContent);
|
|
8
|
+
var fields = document.getElementById('env-fields');
|
|
9
|
+
var taskEl = document.getElementById('task');
|
|
10
|
+
var cmdEl = document.getElementById('cmd-preview');
|
|
11
|
+
var logEl = document.getElementById('run-log');
|
|
12
|
+
var statusEl = document.getElementById('run-status');
|
|
13
|
+
var recipeEl = document.getElementById('recipe');
|
|
14
|
+
var recipeDescEl = document.getElementById('recipe-desc');
|
|
15
|
+
var panels = document.querySelectorAll('[data-panel]');
|
|
16
|
+
var stepEls = document.querySelectorAll('[data-step]');
|
|
17
|
+
|
|
18
|
+
function recipeById(id) {
|
|
19
|
+
for (var i = 0; i < data.recipes.length; i++) if (data.recipes[i].id === id) return data.recipes[i];
|
|
20
|
+
return data.recipes[0];
|
|
21
|
+
}
|
|
22
|
+
var recipe = recipeEl.value; // server pre-selects from ?recipe
|
|
23
|
+
|
|
24
|
+
// Per-sample persistence so a refresh keeps the step, log, and the job id
|
|
25
|
+
// (for live reconnect). The URL recipe is authoritative: if the saved run was
|
|
26
|
+
// for a different recipe, start fresh.
|
|
27
|
+
var KEY = 'aas-run:' + data.folder;
|
|
28
|
+
var state;
|
|
29
|
+
try {
|
|
30
|
+
state = JSON.parse(sessionStorage.getItem(KEY) || 'null');
|
|
31
|
+
} catch (e) {}
|
|
32
|
+
if (!state || state.recipe !== recipe) state = { recipe: recipe, step: 1, task: '', log: '', status: '', job: '' };
|
|
33
|
+
var lastSave = 0;
|
|
34
|
+
function persist(force) {
|
|
35
|
+
var now = Date.now();
|
|
36
|
+
if (!force && now - lastSave < 400) return;
|
|
37
|
+
lastSave = now;
|
|
38
|
+
try {
|
|
39
|
+
sessionStorage.setItem(KEY, JSON.stringify(state));
|
|
40
|
+
} catch (e) {}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function syncRecipeDesc() {
|
|
44
|
+
recipeDescEl.textContent = recipeById(recipe).desc || '';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Step 1 — env form from the .env.sample schema, prefilled from the current
|
|
48
|
+
// .env values; secret fields render masked with a show/hide toggle.
|
|
49
|
+
data.env.forEach(function (f) {
|
|
50
|
+
var wrap = document.createElement('div');
|
|
51
|
+
wrap.className = 'field';
|
|
52
|
+
var lab = document.createElement('label');
|
|
53
|
+
lab.textContent = f.key;
|
|
54
|
+
wrap.appendChild(lab);
|
|
55
|
+
if (f.comment) {
|
|
56
|
+
var hint = document.createElement('p');
|
|
57
|
+
hint.className = 'hint';
|
|
58
|
+
hint.textContent = f.comment;
|
|
59
|
+
wrap.appendChild(hint);
|
|
60
|
+
}
|
|
61
|
+
var row = document.createElement('div');
|
|
62
|
+
row.className = 'inrow';
|
|
63
|
+
var inp = document.createElement('input');
|
|
64
|
+
inp.name = f.key;
|
|
65
|
+
inp.autocomplete = 'off';
|
|
66
|
+
inp.spellcheck = false;
|
|
67
|
+
var cur = data.values[f.key];
|
|
68
|
+
inp.value = (cur != null ? cur : f.value) || '';
|
|
69
|
+
inp.type = f.secret ? 'password' : 'text';
|
|
70
|
+
row.appendChild(inp);
|
|
71
|
+
if (f.secret) {
|
|
72
|
+
var btn = document.createElement('button');
|
|
73
|
+
btn.type = 'button';
|
|
74
|
+
btn.className = 'reveal';
|
|
75
|
+
btn.textContent = 'show';
|
|
76
|
+
btn.onclick = function () {
|
|
77
|
+
var masked = inp.type === 'password';
|
|
78
|
+
inp.type = masked ? 'text' : 'password';
|
|
79
|
+
btn.textContent = masked ? 'hide' : 'show';
|
|
80
|
+
};
|
|
81
|
+
row.appendChild(btn);
|
|
82
|
+
}
|
|
83
|
+
wrap.appendChild(row);
|
|
84
|
+
fields.appendChild(wrap);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// Step 2 — command preview, live as the task is edited, reflecting the recipe.
|
|
88
|
+
function buildCmd(task) {
|
|
89
|
+
// Escape inner quotes so the preview matches what actually runs (shellish).
|
|
90
|
+
var q = task ? ' "' + task.replace(/"/g, '\\"') + '"' : '';
|
|
91
|
+
if (recipe !== '__default') {
|
|
92
|
+
return 'bash run/' + recipe + '.sh' + q;
|
|
93
|
+
}
|
|
94
|
+
var build = 'docker build -t ' + data.image + ' .';
|
|
95
|
+
// Always detached + logs (a foreground run loses its output under this
|
|
96
|
+
// repo's nested Docker); DooD samples also mount the host socket.
|
|
97
|
+
var sock = data.dood ? ' -v /var/run/docker.sock:/var/run/docker.sock' : '';
|
|
98
|
+
return build + '\ndocker logs -f "$(docker run -d --env-file .env' + sock + ' ' + data.image + q + ')"';
|
|
99
|
+
}
|
|
100
|
+
function autoGrow() {
|
|
101
|
+
taskEl.style.height = 'auto';
|
|
102
|
+
taskEl.style.height = taskEl.scrollHeight + 'px';
|
|
103
|
+
}
|
|
104
|
+
function refreshCmd() {
|
|
105
|
+
cmdEl.textContent = buildCmd(taskEl.value.trim());
|
|
106
|
+
}
|
|
107
|
+
taskEl.addEventListener('input', function () {
|
|
108
|
+
autoGrow();
|
|
109
|
+
refreshCmd();
|
|
110
|
+
state.task = taskEl.value;
|
|
111
|
+
persist();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
function showStep(n) {
|
|
115
|
+
for (var i = 0; i < panels.length; i++) {
|
|
116
|
+
panels[i].hidden = panels[i].getAttribute('data-panel') !== String(n);
|
|
117
|
+
}
|
|
118
|
+
for (var j = 0; j < stepEls.length; j++) {
|
|
119
|
+
stepEls[j].className = Number(stepEls[j].getAttribute('data-step')) <= n ? 'active' : '';
|
|
120
|
+
}
|
|
121
|
+
// The recipe is a pre-flow choice: lock it once you leave step 1 (the
|
|
122
|
+
// command + run depend on it). Going back to step 1 re-enables it.
|
|
123
|
+
recipeEl.disabled = n !== 1;
|
|
124
|
+
if (n === 2) autoGrow(); // measurable only once the panel is visible
|
|
125
|
+
state.step = n;
|
|
126
|
+
persist(true);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async function saveEnv(btn) {
|
|
130
|
+
var values = {};
|
|
131
|
+
var inputs = fields.querySelectorAll('input');
|
|
132
|
+
for (var i = 0; i < inputs.length; i++) values[inputs[i].name] = inputs[i].value;
|
|
133
|
+
btn.disabled = true;
|
|
134
|
+
try {
|
|
135
|
+
var r = await fetch('__env', {
|
|
136
|
+
method: 'POST',
|
|
137
|
+
headers: { 'content-type': 'application/json' },
|
|
138
|
+
body: JSON.stringify(values),
|
|
139
|
+
});
|
|
140
|
+
if (r.ok) showStep(2);
|
|
141
|
+
else alert('저장에 실패했습니다.');
|
|
142
|
+
} finally {
|
|
143
|
+
btn.disabled = false;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
var running = false;
|
|
148
|
+
var sleep = function (ms) {
|
|
149
|
+
return new Promise(function (r) {
|
|
150
|
+
setTimeout(r, ms);
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
// Poll a job's output with an offset until it's done. Short requests survive a
|
|
154
|
+
// flaky proxy / port forward far better than one long-open stream, and this is
|
|
155
|
+
// the same path for a fresh run and a reconnect after refresh.
|
|
156
|
+
async function poll(jobId) {
|
|
157
|
+
var startedAt = state.startedAt || Date.now();
|
|
158
|
+
logEl.textContent = '';
|
|
159
|
+
statusEl.className = 'run-status busy';
|
|
160
|
+
statusEl.textContent = '● 실행 중… 0s';
|
|
161
|
+
var timer = setInterval(function () {
|
|
162
|
+
statusEl.textContent = '● 실행 중… ' + Math.round((Date.now() - startedAt) / 1000) + 's';
|
|
163
|
+
}, 1000);
|
|
164
|
+
var have = 0;
|
|
165
|
+
try {
|
|
166
|
+
for (;;) {
|
|
167
|
+
var resp = await fetch('__run-log?job=' + encodeURIComponent(jobId) + '&from=' + have);
|
|
168
|
+
if (resp.status === 404) {
|
|
169
|
+
clearInterval(timer);
|
|
170
|
+
logEl.textContent = state.log || '(실행 기록을 가져올 수 없습니다)';
|
|
171
|
+
statusEl.className = 'run-status';
|
|
172
|
+
statusEl.textContent = '만료됨 — [다시 실행]으로 재실행하세요';
|
|
173
|
+
state.status = 'done';
|
|
174
|
+
state.job = '';
|
|
175
|
+
persist(true);
|
|
176
|
+
running = false;
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
var d = await resp.json();
|
|
180
|
+
if (d.text) {
|
|
181
|
+
logEl.textContent += d.text;
|
|
182
|
+
logEl.scrollTop = logEl.scrollHeight;
|
|
183
|
+
state.log = logEl.textContent;
|
|
184
|
+
persist();
|
|
185
|
+
}
|
|
186
|
+
have = d.len;
|
|
187
|
+
if (d.done) break;
|
|
188
|
+
await sleep(600);
|
|
189
|
+
}
|
|
190
|
+
} catch (e) {
|
|
191
|
+
logEl.textContent += '\n[client error] ' + e.message;
|
|
192
|
+
}
|
|
193
|
+
clearInterval(timer);
|
|
194
|
+
var secs = Math.round((Date.now() - startedAt) / 1000);
|
|
195
|
+
statusEl.className = 'run-status';
|
|
196
|
+
statusEl.textContent = '완료 · ' + secs + 's';
|
|
197
|
+
state.status = 'done';
|
|
198
|
+
state.elapsed = secs;
|
|
199
|
+
state.log = logEl.textContent;
|
|
200
|
+
persist(true);
|
|
201
|
+
running = false;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
async function run() {
|
|
205
|
+
if (running) return;
|
|
206
|
+
running = true;
|
|
207
|
+
showStep(3);
|
|
208
|
+
state.status = 'running';
|
|
209
|
+
state.startedAt = Date.now();
|
|
210
|
+
state.log = '';
|
|
211
|
+
state.job = '';
|
|
212
|
+
persist(true);
|
|
213
|
+
try {
|
|
214
|
+
var resp = await fetch('__run', {
|
|
215
|
+
method: 'POST',
|
|
216
|
+
headers: { 'content-type': 'application/json' },
|
|
217
|
+
body: JSON.stringify({ task: taskEl.value.trim(), recipe: recipe }),
|
|
218
|
+
});
|
|
219
|
+
var d = await resp.json();
|
|
220
|
+
state.job = d.job;
|
|
221
|
+
persist(true);
|
|
222
|
+
await poll(d.job);
|
|
223
|
+
return;
|
|
224
|
+
} catch (e) {
|
|
225
|
+
logEl.textContent += '\n[client error] ' + e.message;
|
|
226
|
+
}
|
|
227
|
+
running = false;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Render the current step from state (restores after a refresh). A run that
|
|
231
|
+
// was still going resumes by polling its job (replays from offset 0).
|
|
232
|
+
function renderFromState() {
|
|
233
|
+
if (state.step === 3) {
|
|
234
|
+
if (state.status === 'running' && state.job) {
|
|
235
|
+
running = true;
|
|
236
|
+
showStep(3);
|
|
237
|
+
poll(state.job);
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
logEl.textContent = state.log || '';
|
|
241
|
+
statusEl.className = 'run-status';
|
|
242
|
+
statusEl.textContent =
|
|
243
|
+
state.status === 'done'
|
|
244
|
+
? '완료 (지난 실행 기록)' + (state.elapsed != null ? ' · ' + state.elapsed + 's' : '')
|
|
245
|
+
: '';
|
|
246
|
+
showStep(3);
|
|
247
|
+
logEl.scrollTop = logEl.scrollHeight;
|
|
248
|
+
} else {
|
|
249
|
+
showStep(state.step || 1);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Switching recipe (only possible on step 1): reflect it in the URL
|
|
254
|
+
// (refresh-safe), start that recipe fresh, and keep the typed task.
|
|
255
|
+
recipeEl.addEventListener('change', function () {
|
|
256
|
+
recipe = recipeEl.value;
|
|
257
|
+
var u = new URL(location.href);
|
|
258
|
+
u.searchParams.set('recipe', recipe);
|
|
259
|
+
history.replaceState(null, '', u);
|
|
260
|
+
state = { recipe: recipe, step: 1, task: taskEl.value, log: '', status: '', job: '' };
|
|
261
|
+
persist(true);
|
|
262
|
+
syncRecipeDesc();
|
|
263
|
+
refreshCmd();
|
|
264
|
+
showStep(1);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
var nexts = document.querySelectorAll('[data-next]');
|
|
268
|
+
for (var n1 = 0; n1 < nexts.length; n1++)
|
|
269
|
+
nexts[n1].onclick = function (ev) {
|
|
270
|
+
saveEnv(ev.currentTarget);
|
|
271
|
+
};
|
|
272
|
+
var backs1 = document.querySelectorAll('[data-back1]');
|
|
273
|
+
for (var b1 = 0; b1 < backs1.length; b1++) backs1[b1].onclick = function () { showStep(1); };
|
|
274
|
+
var backs2 = document.querySelectorAll('[data-back2]');
|
|
275
|
+
for (var b2 = 0; b2 < backs2.length; b2++) backs2[b2].onclick = function () { showStep(2); };
|
|
276
|
+
var runs = document.querySelectorAll('[data-run]');
|
|
277
|
+
for (var r2 = 0; r2 < runs.length; r2++) runs[r2].onclick = run;
|
|
278
|
+
|
|
279
|
+
// Init.
|
|
280
|
+
syncRecipeDesc();
|
|
281
|
+
taskEl.value = state.task || (data.defaultTask || '');
|
|
282
|
+
refreshCmd();
|
|
283
|
+
renderFromState();
|
|
284
|
+
})();
|