MCPcopy Create free account
hub / github.com/error311/FileRise / renderManagedRuntimeHelp

Function renderManagedRuntimeHelp

public/js/adminPanel.js:4029–4159  ·  view source on GitHub ↗
(selectedGateway = null)

Source from the content-addressed store, hash-verified

4027 };
4028
4029 const renderManagedRuntimeHelp = (selectedGateway = null) => {
4030 if (!managedRuntimeHelpEl) return;
4031 const runtime = state.managedRuntime && typeof state.managedRuntime === 'object' ? state.managedRuntime : null;
4032 const gw = selectedGateway && typeof selectedGateway === 'object' ? selectedGateway : null;
4033 const port = String(gw?.port || '2022');
4034 const publishHint = `- "${port}:${port}"`;
4035
4036 if (dockerPortLineEl) {
4037 dockerPortLineEl.value = publishHint;
4038 }
4039
4040 if (!runtime) {
4041 managedRuntimeHelpEl.textContent =
4042 `Docker/container note: publish the gateway port on the host (${publishHint}).`;
4043 if (rcloneVersionInfoEl) {
4044 rcloneVersionInfoEl.textContent = '';
4045 }
4046 if (rcloneAutoInstallBtn) {
4047 rcloneAutoInstallBtn.hidden = false;
4048 }
4049 if (rcloneManageToggleBtn) {
4050 rcloneManageToggleBtn.hidden = false;
4051 rcloneManageToggleBtn.textContent = state.showRcloneInstallControls
4052 ? tf('gateway_hide_optional_rclone_options', 'Hide optional rclone options')
4053 : tf('gateway_show_optional_rclone_options', 'Show optional rclone options');
4054 }
4055 if (rcloneInstallControlsEl) {
4056 rcloneInstallControlsEl.hidden = !state.showRcloneInstallControls;
4057 }
4058 if (rcloneInstallHintEl) {
4059 rcloneInstallHintEl.hidden = !state.showRcloneInstallControls;
4060 }
4061 if (rcloneDownloadLinkEl) {
4062 rcloneDownloadLinkEl.hidden = true;
4063 rcloneDownloadLinkEl.removeAttribute('href');
4064 }
4065 return;
4066 }
4067
4068 const arch = String(runtime.arch || 'linux-amd64');
4069 const source = String(runtime.source || 'missing');
4070 const path = String(runtime.path || '').trim();
4071 const managedBinPath = String(runtime.managedBinPath || '').trim();
4072 const available = runtime.available === true;
4073 const runtimeError = String(runtime.error || '').trim();
4074 const recommendedDownloadUrl = String(runtime.recommendedDownloadUrl || '').trim();
4075 const currentVersion = String(runtime.currentVersion || '').trim();
4076 const latestVersion = String(runtime.latestVersion || '').trim();
4077 const updateAvailable = runtime.updateAvailable === true;
4078 const updateCheckError = String(runtime.updateCheckError || '').trim();
4079 const updateCheckedAt = String(runtime.updateCheckedAt || '').trim();
4080 const statusLabel = (() => {
4081 if (!available) return tf('gateway_rclone_status_not_installed', 'Status: Not installed in FileRise Pro');
4082 if (source === 'managed_bin') return tf('gateway_rclone_status_installed', 'Status: Installed in FileRise Pro');
4083 if (source === 'bundle_binary') return tf('gateway_rclone_status_bundled', 'Status: Using bundled rclone in FileRise Pro');
4084 if (source === 'env_override') return tf('gateway_rclone_status_env_override', 'Status: Using FR_PRO_RCLONE_BINARY (external path)');
4085 if (source === 'system_path') return tf('gateway_rclone_status_system_path', 'Status: Using system rclone on PATH');
4086 return tf('gateway_rclone_status_unknown', 'Status: Runtime state unknown');

Callers 2

renderManagedStatusFunction · 0.85
loadManagedStatusesFunction · 0.85

Calls 1

tfFunction · 0.70

Tested by

no test coverage detected