From 38a4ba47eb9d9bc739787554b2053a1597510c57 Mon Sep 17 00:00:00 2001 From: pavlov346346-source Date: Sat, 12 Sep 2026 18:35:20 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20restore=20the=20missing=20"=D0=97=D0=B0?= =?UTF-8?q?=D0=B3=D1=80=D1=83=D0=B7=D0=B8=D1=82=D1=8C=20=D0=B8=D0=B7=20?= =?UTF-8?q?=D0=BE=D0=B1=D0=BB=D0=B0=D0=BA=D0=B0"=20button=20in=20settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bindCloudUI() already wires a click handler on #sunCloudPullV2 (confirm dialog -> pullRemote({replace:true, quiet:false}), which backs up the local copy and force-replaces it with the server's orders/clients/etc.), but renderCloudUI()'s template never actually emitted a button with that id - the handler was permanently a no-op. Adds the missing button to the "Профиль и аккаунт" settings card. Co-Authored-By: Claude Sonnet 5 --- public/app-runtime.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/public/app-runtime.js b/public/app-runtime.js index 24ceb75..33f271e 100644 --- a/public/app-runtime.js +++ b/public/app-runtime.js @@ -1988,6 +1988,22 @@ window.SUN_LEGACY_CATALOG_V175=[{"id":"1","name":"Фуршетный бокс const DEFAULT_SUPABASE_URL = 'https://cksuehzcimitsxmeloes.supabase.co'; const DEFAULT_SUPABASE_KEY = 'sb_publishable_v8Z3hEBnu7zsDwAb5KCWcg_T96IejsM'; + // REST/Auth/Storage/Functions traffic to DEFAULT_SUPABASE_URL is routed through a + // same-region reverse proxy on Timeweb so it isn't a direct request to *.supabase.co + // (some Russian ISPs throttle/drop those). Realtime keeps using DEFAULT_SUPABASE_URL + // directly - a PHP proxy can't handle a WebSocket upgrade - and the app already + // degrades gracefully when Realtime can't connect. + const SUPABASE_API_PROXY = 'https://api.caterium.ru'; + function supabaseProxyFetch(input, init) { + try { + const url = typeof input === 'string' ? input : input?.url; + if (url && url.indexOf(DEFAULT_SUPABASE_URL) === 0) { + const proxied = SUPABASE_API_PROXY + url.slice(DEFAULT_SUPABASE_URL.length); + input = typeof input === 'string' ? proxied : new Request(proxied, input); + } + } catch (_) {} + return fetch(input, init); + } let config = loadConfig(); let client = null; @@ -2899,6 +2915,7 @@ window.SUN_LEGACY_CATALOG_V175=[{"id":"1","name":"Фуршетный бокс ${signed?`

Профиль

${esc(session.user.email||session.user.id)}
`:''} ${signed&&!selected?`

Рабочая компания

${membershipsLoading?'Загружаю доступные рабочие базы…':'У этого аккаунта пока нет доступной рабочей базы.'}

`:''} ${signed&&selected?`

Рабочая компания

${esc(workspace.name)}${supportMode?'· поддержка, только просмотр':''}
Роль: ${supportMode?'Разработчик · поддержка':esc(roleLabel(workspace.role))}${workspace.display_name?` · ${esc(workspace.display_name)}`:''}
${!supportMode&&memberships.length>1?``:''}
`:''} + ${signed&&selected&&!supportMode?`

Синхронизация

Принудительно загрузить актуальные заказы, клиентов и остальные данные с сервера, заменив локальную копию на этом устройстве. Перед загрузкой автоматически создаётся резервная копия.

`:''} ${signed&&selected&&!supportMode&&hasPermission('users.manage')?`

Пользователи

Управление сотрудниками и правами внутри этой компании.

`:''}
${esc(statusText())}
`; bindCloudUI(); @@ -2940,7 +2957,7 @@ window.SUN_LEGACY_CATALOG_V175=[{"id":"1","name":"Фуршетный бокс await loadSupabaseLibrary(); const signature=`${config.url}|${config.key}`; if(!client||signature!==clientSignature){ - client=window.supabase.createClient(config.url,config.key,{auth:{persistSession:true,autoRefreshToken:true,detectSessionInUrl:true}});clientSignature=signature; + client=window.supabase.createClient(config.url,config.key,{auth:{persistSession:true,autoRefreshToken:true,detectSessionInUrl:true},global:{fetch:supabaseProxyFetch}});clientSignature=signature; client.auth.onAuthStateChange((_event,next)=>{session=next;membershipsLoading=Boolean(next?.user);membershipsLoaded=!next?.user;setTimeout(async()=>{try{if(!next?.user){const sw=await switchTenantLocal('');if(sw.changed){location.reload();return;}}else{const sw=await loadMemberships();if(sw){location.reload();return;}}}finally{renderCloudUI();updatePill();}},0);}); } const {data,error}=await client.auth.getSession();if(error)throw error;session=data.session||null;