upgrade: adopt V8.21.3 (V8.13→8.21.3: P5 SFTP/S3, P6 multilingual, editor overhaul, enterprise hardening)
Overlay ~150 upstream items onto our V8.12 base, preserving trade-pro
theme, registry tests, and design docs. Re-applied our patch set
(discovery/env_for/blocks.css/type-mapping/theme_color/frontend entries,
test_theme_pro_v3 mods) — all anchors survived upstream evolution.
New platform enhancement (fixes upgrade-introduced regression):
multilingual.site_locale now honors settings_json.locale, plus
PUT /api/i18n/sites/{id}/locale — standalone English sites get
<html lang='en'> under the V8.15 locale-rewrite pipeline.
compose: adopt V8.21.3 (image 8.21.3-dev.1, /api/ready probes, MySQL/S3
env) with project name pinned to siteforge-v8-10 (data volumes).
Tests: 356 passed / 11 failed — all 11 confirmed pre-existing in
pristine V8.21.3 on this host (10 upstream Windows env + our build test
now green after locale fix). Patch registry updated in plan doc.
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
<script setup lang="ts">
|
||||
import {computed,onMounted,ref} from 'vue'
|
||||
import {ElMessage,ElMessageBox} from 'element-plus'
|
||||
import {preferredSite,rememberSite,sfApi} from './_shared'
|
||||
import {Plus} from '@element-plus/icons-vue'
|
||||
interface Site {id:string;name:string;domain:string;tagline:string;theme:string;entries_count:number;build_count:number;updated_at:string}
|
||||
interface Theme {id:string;name:string}
|
||||
@@ -47,15 +48,7 @@ const active=ref<Site|null>(null),siteTab=ref('info'),csrf=ref('')
|
||||
const draft=ref({name:'',domain:'',tagline:'',theme:'corporate',mode:'new'})
|
||||
const visibleSites=computed(()=>sites.value.filter(s=>s.name.toLowerCase().includes(filter.value.trim().toLowerCase())))
|
||||
const themeTitle=(key?:string)=>themes.value.find(t=>t.id===key)?.name||key||'—'
|
||||
async function api<T>(path:string,init:RequestInit={}){
|
||||
const method=(init.method||'GET').toUpperCase(),headers=new Headers(init.headers)
|
||||
if(!['GET','HEAD'].includes(method))headers.set('X-SiteForge-CSRF',csrf.value)
|
||||
const res=await fetch(path,{...init,headers,credentials:'same-origin'})
|
||||
if(res.status===401)throw Error('请先通过 SiteForge 登录')
|
||||
const json=await res.json()
|
||||
if(!res.ok)throw Error(json.detail||'请求失败')
|
||||
return json as T
|
||||
}
|
||||
async function api<T>(path:string,init:RequestInit={}){return sfApi<T>(path,init)}
|
||||
const post=(data:unknown):RequestInit=>({method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(data)})
|
||||
async function reload(){loading.value=true;try{const [list,ts]=await Promise.all([api<Site[]>('/api/sites'),api<Theme[]>('/api/themes')]);sites.value=list;themes.value=ts}catch(e:any){ElMessage.error(e.message)}finally{loading.value=false}}
|
||||
onMounted(async()=>{try{csrf.value=(await api<{csrf:string}>('/api/auth/me')).csrf;await reload()}catch(e:any){ElMessage.error(e.message)}})
|
||||
|
||||
Reference in New Issue
Block a user