{"id":6,"date":"2026-11-25T15:42:46","date_gmt":"2026-11-25T15:42:46","guid":{"rendered":"https:\/\/depot.dwsapp.io\/?page_id=6"},"modified":"2026-11-25T15:42:46","modified_gmt":"2026-11-25T15:42:46","slug":"depots","status":"publish","type":"page","link":"https:\/\/depot.dwsapp.io\/?page_id=6","title":{"rendered":"D\u00e9p\u00f4ts"},"content":{"rendered":"    <div id=\"depot-file-list\">\n        <table>\n            <thead>\n                <tr><th>Fichier<\/th><th>Taille<\/th><th>Depose le<\/th><\/tr>\n            <\/thead>\n            <tbody id=\"depot-file-list-body\">\n                <tr><td colspan=\"3\">Chargement...<\/td><\/tr>\n            <\/tbody>\n        <\/table>\n    <\/div>\n    <script>\n    (function () {\n        var POLL_MS = 4000;\n        var body = document.getElementById('depot-file-list-body');\n        var timer = null;\n\n        function formatSize(bytes) {\n            if (bytes < 1024) return bytes + ' o';\n            if (bytes < 1024 * 1024) return (bytes \/ 1024).toFixed(1) + ' Ko';\n            return (bytes \/ (1024 * 1024)).toFixed(1) + ' Mo';\n        }\n\n        function formatDate(unixSeconds) {\n            return new Intl.DateTimeFormat(undefined, {\n                dateStyle: 'short',\n                timeStyle: 'medium',\n            }).format(new Date(unixSeconds * 1000));\n        }\n\n        function render(files) {\n            if (!files.length) {\n                body.innerHTML = '<tr><td colspan=\"3\">Aucun depot.<\/td><\/tr>';\n                return;\n            }\n            body.innerHTML = files.map(function (f) {\n                return '<tr><td>' + f.name.replace(\/<\/g, '&lt;') + '<\/td><td>' +\n                    formatSize(f.size) + '<\/td><td>' + formatDate(f.mtime) + '<\/td><\/tr>';\n            }).join('');\n        }\n\n        function refresh() {\n            \/\/ Site runs plain permalinks (no \/wp-json\/ rewrite rule) \u2014 use the rest_route fallback.\n            fetch('\/?rest_route=\/depot\/v1\/list')\n                .then(function (r) { return r.json(); })\n                .then(render)\n                .catch(function () { \/* transient fetch error: keep last render, retry next tick *\/ });\n        }\n\n        function start() {\n            if (timer) return;\n            refresh();\n            timer = setInterval(refresh, POLL_MS);\n        }\n\n        function stop() {\n            if (!timer) return;\n            clearInterval(timer);\n            timer = null;\n        }\n\n        document.addEventListener('visibilitychange', function () {\n            if (document.visibilityState === 'hidden') {\n                stop();\n            } else {\n                start();\n            }\n        });\n\n        start();\n    })();\n    <\/script>\n    \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":0,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-6","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/depot.dwsapp.io\/index.php?rest_route=\/wp\/v2\/pages\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/depot.dwsapp.io\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/depot.dwsapp.io\/index.php?rest_route=\/wp\/v2\/types\/page"}],"replies":[{"embeddable":true,"href":"https:\/\/depot.dwsapp.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6"}],"version-history":[{"count":0,"href":"https:\/\/depot.dwsapp.io\/index.php?rest_route=\/wp\/v2\/pages\/6\/revisions"}],"wp:attachment":[{"href":"https:\/\/depot.dwsapp.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}