From 1bc6313e98fc7d151c80e518e2d3081d26ea2981 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Thu, 31 Oct 2024 15:02:28 +0200 Subject: [PATCH] Fixes sidebar menu --- app/pages/config.php | 49 ++++++++++++++++++---------------- app/templates/page-sidebar.php | 16 +++++------ 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/app/pages/config.php b/app/pages/config.php index fb7a60a..5b9e727 100644 --- a/app/pages/config.php +++ b/app/pages/config.php @@ -102,7 +102,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { ]; $result = $hostObject->editHost($platform_id, $updatedHost); if ($result === true) { - $_SESSION['notice'] = "Host id \"{$_REQUEST['host']}\" edited."; + $_SESSION['notice'] = "Host \"{$_REQUEST['address']}:{$_REQUEST['port']}\" edited."; } else { $_SESSION['error'] = "Editing the host failed. Error: $result"; } @@ -220,29 +220,32 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { } break; - // if there is no $item, we work on the local config DB default: - switch ($action) { - case 'add-agent': - $jilo_agent_types = $agentObject->getAgentTypes(); - $jilo_agents_in_platform = $agentObject->getPlatformAgentTypes($platform_id); - $jilo_agent_types_in_platform = array_column($jilo_agents_in_platform, 'agent_type_id'); - include '../app/templates/config-add-agent.php'; - break; - case 'edit': - if (isset($_GET['agent'])) { - $agentDetails = $agentObject->getAgentDetails($platform_id, $agent); - $jilo_agent_types = $agentObject->getAgentTypes(); - include '../app/templates/config-edit-agent.php'; - } - break; - case 'delete': - if (isset($_GET['agent'])) { - $agentDetails = $agentObject->getAgentDetails($platform_id, $agent); - include '../app/templates/config-delete-agent.php'; - } - break; - } + // the default config page is the platforms page + header("Location: $app_root?page=config&item=platform"); + exit(); + +// switch ($action) { +// case 'add-agent': +// $jilo_agent_types = $agentObject->getAgentTypes(); +// $jilo_agents_in_platform = $agentObject->getPlatformAgentTypes($platform_id); +// $jilo_agent_types_in_platform = array_column($jilo_agents_in_platform, 'agent_type_id'); +// include '../app/templates/config-add-agent.php'; +// break; +// case 'edit': +// if (isset($_GET['agent'])) { +// $agentDetails = $agentObject->getAgentDetails($platform_id, $agent); +// $jilo_agent_types = $agentObject->getAgentTypes(); +// include '../app/templates/config-edit-agent.php'; +// } +// break; +// case 'delete': +// if (isset($_GET['agent'])) { +// $agentDetails = $agentObject->getAgentDetails($platform_id, $agent); +// include '../app/templates/config-delete-agent.php'; +// } +// break; +// } } } diff --git a/app/templates/page-sidebar.php b/app/templates/page-sidebar.php index 3adcbec..794fc4f 100644 --- a/app/templates/page-sidebar.php +++ b/app/templates/page-sidebar.php @@ -41,22 +41,22 @@ $timeNow = new DateTime('now', new DateTimeZone($userTimezone));
  • live data

  • -
  • +
  • combined graphs
  • -
  • +
  • latest data
  • -
  • +
  • config.js
  • -
  • +
  • interface_config.js
  • @@ -69,17 +69,17 @@ $timeNow = new DateTime('now', new DateTimeZone($userTimezone));
  • jitsi platforms config

  • -
  • +
  • platforms
  • -
  • +
  • hosts
  • -
  • +
  • endpoints
  • @@ -88,7 +88,7 @@ $timeNow = new DateTime('now', new DateTimeZone($userTimezone)); hasRight($user_id, 'view config file')) {?> -
  • +
  • config file