fix: var _wsInitData globale + anti-cache headers HTML
- x-data="_wsInitData" référence la variable globale JS (pas window.) - var _wsInitData = IIFE — propriété window automatique pour compatibilité window._wsData - Headers Cache-Control: no-cache, no-store, must-revalidate sur la page HTML - 73 tests OK
This commit is contained in:
@@ -542,7 +542,14 @@ async def local_workspace_page(request: Request, folder: int = None):
|
||||
"breadcrumb": breadcrumb,
|
||||
}
|
||||
template = env.get_template("local_workspace.html")
|
||||
return template.render(**ctx)
|
||||
return HTMLResponse(
|
||||
content=template.render(**ctx),
|
||||
headers={
|
||||
"Cache-Control": "no-cache, no-store, must-revalidate",
|
||||
"Pragma": "no-cache",
|
||||
"Expires": "0",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@router.get("/api/local-workspace/tree")
|
||||
|
||||
@@ -336,7 +336,7 @@
|
||||
.preview-leave-end{transform:translateX(100%);opacity:0;}
|
||||
</style>
|
||||
|
||||
<div class="ws-split" x-data="window._wsInitData"
|
||||
<div class="ws-split" x-data="_wsInitData"
|
||||
@dragover.prevent="onDragOver($event)"
|
||||
@dragleave="onDragLeave($event)"
|
||||
@drop.prevent="onDrop($event)"
|
||||
@@ -867,7 +867,7 @@
|
||||
</div><!-- /ws-split -->
|
||||
|
||||
<script>
|
||||
window._wsInitData = (function() {
|
||||
var _wsInitData = (function() {
|
||||
return {
|
||||
tree:[],
|
||||
displayTree:[],
|
||||
|
||||
Reference in New Issue
Block a user