ui: trim community streaming surface

This commit is contained in:
a.tolmachev
2026-05-03 18:03:23 +00:00
parent 82b7b7278e
commit 20598ff5dc
11 changed files with 104 additions and 40 deletions
+24
View File
@@ -149,6 +149,9 @@ async function initWizardPage() {
function renderEditionCapabilityHints(capabilities) {
var securityNote = document.getElementById('wizard-security-level-note');
var securityText = securityNote ? securityNote.querySelector('.info-callout-text') : null;
var streamingNote = document.getElementById('wizard-streaming-capability-note');
var streamingText = streamingNote ? streamingNote.querySelector('.info-callout-text') : null;
var streamingCard = document.getElementById('wizard-streaming-config-card');
if (!securityText) return;
var levels = capabilities && Array.isArray(capabilities.supported_security_levels)
? capabilities.supported_security_levels
@@ -157,8 +160,29 @@ function renderEditionCapabilityHints(capabilities) {
if (!securityNote.hidden) {
securityText.textContent = tKey('wizard.step5.community_security_note');
}
var protocolCapabilities = currentProtocolCapabilities();
var modes = protocolCapabilities && Array.isArray(protocolCapabilities.supports_execution_modes)
? protocolCapabilities.supports_execution_modes
: ['unary'];
var hasStreamingModes = modes.some(function(mode) { return mode !== 'unary'; });
if (streamingCard) {
streamingCard.hidden = !hasStreamingModes;
}
if (streamingNote && streamingText) {
var edition = capabilities && capabilities.edition ? capabilities.edition : 'community';
var shouldExplainCommunityLimit = edition === 'community'
&& !hasStreamingModes
&& ['rest', 'grpc'].indexOf(wizardProtocol) >= 0;
streamingNote.hidden = !shouldExplainCommunityLimit;
if (shouldExplainCommunityLimit) {
streamingText.textContent = tKey('wizard.step5.community_streaming_note');
}
}
}
window.renderEditionCapabilityHints = renderEditionCapabilityHints;
if (window.CrankDiagnostics && typeof window.CrankDiagnostics.bootstrap === 'function') {
window.CrankDiagnostics.bootstrap('wizard', initWizardPage);
} else {