Fixes agent config pages

main
Yasen Pramatarov 2024-09-21 12:21:46 +03:00
parent 88e77f71ef
commit 72b1442b77
4 changed files with 11 additions and 8 deletions

View File

@ -107,7 +107,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
include '../app/templates/config-list-interfaceconfigjs.php';
break;
// if there is no $item, we work on the local config file
// if there is no $item, we work on the local config DB
default:
switch ($action) {
case 'add-agent':
@ -125,12 +125,15 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
}
break;
case 'delete':
if (isset($_GET['agent'])) {
$agentDetails = $agentObject->getAgentDetails($platform_id, $agent);
include '../app/templates/config-delete-agent.php';
} else {
include '../app/templates/config-delete-platform.php';
}
break;
default:
if ($userObject->hasRight($user_id, 'view config file')) {
// require '../app/classes/agent.php';
// $agentObject = new Agent($dbWeb);
include '../app/templates/config-list.php';
} else {
include '../app/templates/unauthorized.php';

View File

@ -42,7 +42,7 @@
<input type="hidden" name="new" value="true" />
<br />
<a class="btn btn-secondary" href="<?= $app_root ?>?platform=<?= htmlspecialchars($platform_id) ?>&page=agents" />Cancel</a>
<a class="btn btn-secondary" href="<?= $app_root ?>?page=config" />Cancel</a>
<input type="submit" class="btn btn-primary" value="Save" />
</form>
</div>

View File

@ -24,7 +24,7 @@ foreach ($agentDetails[0] as $key => $value) {
<input type="hidden" name="delete" value="true" />
<p class="h5 text-danger">Are you sure you want to delete this agent?</p>
<br />
<a class="btn btn-secondary" href="<?= $app_root ?>?platform=<?= htmlspecialchars($platform_id) ?>&page=agents" />Cancel</a>
<a class="btn btn-secondary" href="<?= $app_root ?>?page=config" />Cancel</a>
<input type="submit" class="btn btn-danger" value="Delete" />
</form>
</div>

View File

@ -12,7 +12,7 @@
<span class="text-danger" style="margin-right: -12px;">*</span>
</div>
<div class="col-md-8">
<input class="form-control" type="text" name="type_id" value="<?= htmlspecialchars($agentDetails[0]['type_id'])?>" required autofocus />
<input class="form-control" type="text" name="type_id" value="<?= htmlspecialchars($agentDetails[0]['agent_type_id'])?>" required autofocus />
<p class="text-start"><small>type of agent (meet, jvb, jibri, all)</small></p>
</div>
</div>
@ -42,7 +42,7 @@
<br />
<input type="hidden" name="agent" value="<?= htmlspecialchars($agentDetails[0]['id']) ?>" />
<a class="btn btn-secondary" href="<?= $app_root ?>?platform=<?= htmlspecialchars($platform_id) ?>&page=agents" />Cancel</a>
<a class="btn btn-secondary" href="<?= $app_root ?>?page=config" />Cancel</a>
<input type="submit" class="btn btn-primary" value="Save" />
</form>
</div>