feat(admin): compact UTM percentages and shared notes
deploy-preland / deploy zoomstage.online (push) Successful in 1m1s

This commit is contained in:
Panfilov Konstantin committed 2026-10-25 22:59:37 +03:00
1 parent 4fc4fd8162
commit f2097d4800
10 files changed
+240 -16

No files matched your search

+10 -1
View File
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
require dirname(__DIR__).'/bootstrap.php';
use PrelandAdmin\{Auth,Store,Config,Transport,Jobs,Sets,Problem,Catalog,LinkBuilder};
use PrelandAdmin\{Auth,Store,Config,Transport,Jobs,Sets,Problem,Catalog,LinkBuilder,Notes};
header('X-Content-Type-Options: nosniff');header('X-Frame-Options: DENY');header('Referrer-Policy: same-origin');header('Cache-Control: no-store');
$path=parse_url($_SERVER['REQUEST_URI']??'/',PHP_URL_PATH);
if(!str_starts_with((string)$path,'/api/')) {require dirname(__DIR__).'/views/dashboard.php';exit;}
@@ -30,6 +30,15 @@ try {
// не должны удерживать PHP session lock и блокировать соседние запросы.
session_write_close();
if($path==='/api/state'&&$method==='GET')reply(['csrf'=>$_SESSION['csrf'],'user'=>$user,'targets'=>$store->targets()]);
if($path==='/api/utm-notes'){
$notes=new Notes($store);
if($method==='GET'){
if($_GET)throw new Problem('Заметки UTM общие для всех доменов и не принимают параметры.');
reply(['notes'=>$notes->all()]);
}
if($method==='POST')reply(['note'=>$notes->save($data)]);
throw new Problem('Метод заметок UTM не поддерживается.',405);
}
if($path==='/api/link-builder'){
$builder=new LinkBuilder($store);
if($method==='GET'){