Create api general + status tabs

This commit is contained in:
billz 2024-02-19 19:34:59 +01:00
parent 7dc2fd6538
commit 8ecd542eae
3 changed files with 37 additions and 3 deletions

View file

@ -17,16 +17,22 @@
<div class="col"> <div class="col">
<i class="fas fa-puzzle-piece mr-2"></i><?php echo _("RestAPI"); ?> <i class="fas fa-puzzle-piece mr-2"></i><?php echo _("RestAPI"); ?>
</div> </div>
<div class="col">
<button class="btn btn-light btn-icon-split btn-sm service-status float-right">
<span class="icon text-gray-600"><i class="fas fa-circle service-status-<?php echo $serviceStatus ?>"></i></span>
<span class="text service-status">raspap-api <?php echo _($serviceStatus) ?></span>
</button>
</div>
</div><!-- /.row --> </div><!-- /.row -->
</div><!-- /.card-header --> </div><!-- /.card-header -->
<div class="card-body"> <div class="card-body">
<?php $status->showMessages(); ?> <?php $status->showMessages(); ?>
<form role="form" action="restapi_conf" enctype="multipart/form-data" method="POST"> <form role="form" action="restapi_conf" method="POST" class="needs-validation" novalidate>
<?php echo CSRFTokenFieldTag() ?> <?php echo CSRFTokenFieldTag() ?>
<!-- Nav tabs --> <!-- Nav tabs -->
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="nav-item"><a class="nav-link active" id="settingstab" href="#restapisettings" data-toggle="tab"><?php echo _("Settings"); ?></a></li> <li class="nav-item"><a class="nav-link active" id="restapisettingstab" href="#restapisettings" data-toggle="tab"><?php echo _("Settings"); ?></a></li>
<li class="nav-item"><a class="nav-link" id="loggingtab" href="#restapistatus" data-toggle="tab"><?php echo _("Status"); ?></a></li> <li class="nav-item"><a class="nav-link" id="restapistatustab" href="#restapistatus" data-toggle="tab"><?php echo _("Status"); ?></a></li>
</ul> </ul>
<!-- Tab panes --> <!-- Tab panes -->

View file

@ -0,0 +1,17 @@
<div class="tab-pane active" id="restapisettings">
<h4 class="mt-3"><?php echo ("RestAPI settings") ;?></h4>
<div class="row">
<div class="form-group col-lg-12 mt-3">
<div class="row">
<div class="form-group col-md-6" required>
<label for="txtapikey"><?php echo _("API Key"); ?></label>
<input type="text" id="txtapikey" class="form-control" name="txtapikey" value="<?php echo htmlspecialchars($apiKey, ENT_QUOTES); ?>" required />
<div class="invalid-feedback">
<?php echo _("Please provide a valid API key."); ?>
</div>
</div>
</div>
</div>
</div>
</div><!-- /.tab-pane | general tab -->

View file

@ -0,0 +1,11 @@
<!-- status tab -->
<div class="tab-pane fade" id="restapistatus">
<h4 class="mt-3 mb-3"><?php echo _("RestAPI status") ;?></h4>
<p><?php echo _("Current <code>raspap-restapi.service</code> status is displayed below."); ?></p>
<div class="row">
<div class="form-group col-md-8 mt-2">
<textarea class="logoutput"><?php echo htmlspecialchars($serviceLog, ENT_QUOTES); ?></textarea>
</div>
</div>
</div><!-- /.tab-pane -->