Browse Source

update request receiving, tmp dispable custom timing requests

yggdrasil-0.4.7
ghost 1 year ago
parent
commit
50e2ce3f39
  1. 12
      src/public/index.php
  2. 12
      src/public/peer.php

12
src/public/index.php

@ -30,12 +30,12 @@ try {
} }
// Prepare request // Prepare request
$requestTheme = isset($_GET['theme']) && in_array(['default'], $_GET['theme']) ? $_GET['theme'] : 'default'; $requestTheme = isset($_GET['theme']) && in_array(['default'], $_GET['theme']) ? $_GET['theme'] : 'default';
$requestTime = !empty($_GET['time']) ? (int) $_GET['time'] : time(); $requestTime = time(); // @TODO !empty($_GET['time']) ? (int) $_GET['time'] : time();
$requestSort = !empty($_GET['sort']) && in_array($_GET['sort'], ['timeOnline', 'uptimeAvg', 'sentSum', 'receivedSum', 'address']) ? $_GET['sort'] : 'timeOnline'; $requestSort = isset($_GET['sort']) && in_array($_GET['sort'], ['timeOnline', 'uptimeAvg', 'sentSum', 'receivedSum', 'address']) ? $_GET['sort'] : 'timeOnline';
$requestOrder = !empty($_GET['order']) && in_array($_GET['order'], ['ASC', 'DESC']) ? $_GET['order'] : 'DESC'; $requestOrder = isset($_GET['order']) && in_array($_GET['order'], ['ASC', 'DESC']) ? $_GET['order'] : 'DESC';
$requestPage = !empty($_GET['page']) && $_GET['page'] > 1 ? (int) $_GET['page'] : 1; $requestPage = isset($_GET['page']) && $_GET['page'] > 1 ? (int) $_GET['page'] : 1;
$requestCalendar = !empty($_GET['calendar']) && in_array($_GET['calendar'], ['peers', 'traffic']) ? $_GET['calendar'] : 'peers'; $requestCalendar = isset($_GET['calendar']) && in_array($_GET['calendar'], ['peers', 'traffic']) ? $_GET['calendar'] : 'peers';
// app begin // app begin
$calendar = new Yggverse\Graph\Calendar\Month($requestTime); $calendar = new Yggverse\Graph\Calendar\Month($requestTime);

12
src/public/peer.php

@ -32,12 +32,12 @@ try {
// Prepare request // Prepare request
$requestPeerId = isset($_GET['peerId']) ? (int) $_GET['peerId'] : 0; $requestPeerId = isset($_GET['peerId']) ? (int) $_GET['peerId'] : 0;
$requestTheme = !empty($_GET['theme']) && in_array(['default'], $_GET['theme']) ? $_GET['theme'] : 'default'; $requestTheme = isset($_GET['theme']) && in_array(['default'], $_GET['theme']) ? $_GET['theme'] : 'default';
$requestTime = !empty($_GET['time']) ? (int) $_GET['time'] : time(); $requestTime = time(); // @TODO !empty($_GET['time']) ? (int) $_GET['time'] : time();
$requestSort = !empty($_GET['sort']) && in_array($_GET['sort'], ['peerConnection.timeAdded']) ? $_GET['sort'] : 'peerConnection.timeAdded'; $requestSort = isset($_GET['sort']) && in_array($_GET['sort'], ['peerConnection.timeAdded']) ? $_GET['sort'] : 'peerConnection.timeAdded';
$requestOrder = !empty($_GET['order']) && in_array($_GET['order'], ['ASC', 'DESC']) ? $_GET['order'] : 'DESC'; $requestOrder = isset($_GET['order']) && in_array($_GET['order'], ['ASC', 'DESC']) ? $_GET['order'] : 'DESC';
$requestPage = !empty($_GET['page']) && $_GET['page'] > 1 ? (int) $_GET['page'] : 1; $requestPage = isset($_GET['page']) && $_GET['page'] > 1 ? (int) $_GET['page'] : 1;
$requestCalendar = !empty($_GET['calendar']) && in_array($_GET['calendar'], ['traffic']) ? $_GET['calendar'] : 'traffic'; $requestCalendar = isset($_GET['calendar']) && in_array($_GET['calendar'], ['traffic']) ? $_GET['calendar'] : 'traffic';
// App controller begin // App controller begin
$calendar = new Yggverse\Graph\Calendar\Month($requestTime); $calendar = new Yggverse\Graph\Calendar\Month($requestTime);

Loading…
Cancel
Save