Усилить безопасность веб-интерфейса
CI / Rust Checks (push) Successful in 5m14s
CI / UI Checks (push) Successful in 4s
CI / Deployment Manifests (push) Successful in 2s
CI / Frontend E2E (push) Successful in 2m58s
CI / Deploy (push) Successful in 1m44s

This commit is contained in:
2026-07-11 17:12:50 +03:00
parent 8318e4b560
commit 46892ee61c
26 changed files with 250 additions and 60 deletions
-8
View File
@@ -124,14 +124,6 @@
return encoded ? ('?' + encoded) : '';
}
function postBytes(path, bytes, fileName) {
return request(API_BASE + path, {
method: 'POST',
headers: headers(fileName ? { 'X-File-Name': fileName } : {}),
body: bytes,
});
}
window.CrankApi = {
login: function(payload) {
return request(AUTH_BASE + '/login', {
+3
View File
@@ -330,6 +330,9 @@ async function loadWorkspaceSettings() {
}
async function initSettingsPage() {
document.querySelectorAll('.lang-btn[data-lang]').forEach(function(button) {
button.addEventListener('click', function() { setLang(button.dataset.lang); });
});
bindSectionNavigation();
await loadProfile();
await loadCapabilities();
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+31
View File
@@ -83,6 +83,7 @@ async function initWizardPage() {
await loadProtocolCapabilities();
await loadWizardPanels([1, 2, 3, 4, 5]);
bindWizardPanelActions();
if (window.CrankOverlay && typeof window.CrankOverlay.render === 'function') {
await window.CrankOverlay.render(document, {
workspace: workspace,
@@ -248,6 +249,36 @@ function selectMethod(btn) {
}
}
function bindWizardPanelActions() {
var upstreamSearch = document.getElementById('upstream-search');
var authMode = document.getElementById('new-upstream-auth-mode');
var authKind = document.getElementById('new-auth-profile-kind');
if (upstreamSearch) {
upstreamSearch.addEventListener('input', function(event) {
filterUpstreams(event.target.value);
});
}
if (authMode) authMode.addEventListener('change', updateUpstreamAuthUi);
if (authKind) authKind.addEventListener('change', updateAuthProfileCreateUi);
document.querySelectorAll('.method-card[data-method]').forEach(function(button) {
button.addEventListener('click', function() { selectMethod(button); });
});
document.querySelectorAll('[data-wizard-action]').forEach(function(element) {
element.addEventListener('click', function(event) {
var action = element.dataset.wizardAction;
if (action === 'toggle-upstream') toggleUpstreamDropdown(event);
if (action === 'edit-upstream') beginEditSelectedUpstream(event);
if (action === 'new-upstream') startNewUpstream();
if (action === 'quick-secret') openQuickSecretModal(event);
if (action === 'save-upstream') void saveNewUpstream(event);
if (action === 'cancel-upstream') cancelNewUpstream(event);
});
});
}
function escapeHtml(str) {
return String(str).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;');
}
+11
View File
@@ -207,6 +207,17 @@ async function exportWorkspaceSnapshot() {
async function initPage() {
updatePageMode();
document.querySelectorAll('.ws-color-swatch').forEach(function(swatch) {
swatch.addEventListener('click', function() { pickColor(swatch); });
});
document.querySelectorAll('[data-history-back]').forEach(function(button) {
button.addEventListener('click', function() { window.history.back(); });
});
var elements = formElements();
elements.name.addEventListener('input', function(event) { onWsNameInput(event.target.value); });
elements.slug.addEventListener('input', function(event) { onWsSlugInput(event.target.value); });
elements.submit.addEventListener('click', submitForm);
var exportButton = document.getElementById('export-workspace-btn');
if (exportButton) {
exportButton.addEventListener('click', exportWorkspaceSnapshot);