1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Implement hostapd modal dialog

This commit is contained in:
billz 2020-12-24 20:52:18 +00:00
parent 31e3afa4a4
commit 8e8ce320d4
6 changed files with 67 additions and 9 deletions

View File

@ -52,19 +52,23 @@ body {
font-weight: 500; font-weight: 500;
} }
.card .card-header { .card .card-header, .modal-header {
border-color: <?php echo $color; ?>; border-color: <?php echo $color; ?>;
color: #fff; color: #fff;
background-color: <?php echo $color; ?>; background-color: <?php echo $color; ?>;
} }
.modal-header {
border-radius: 0px;
}
.btn-primary { .btn-primary {
color: <?php echo $color; ?>; color: <?php echo $color; ?>;
border-color: <?php echo $color; ?>; border-color: <?php echo $color; ?>;
background-color: #fff; background-color: #fff;
} }
.card-footer { .card-footer, .modal-footer {
background-color: #f2f1f0; background-color: #f2f1f0;
} }

View File

@ -34,12 +34,12 @@ h5.card-title {
color: #212529; color: #212529;
} }
.card { .card, .modal-dialog {
border-radius: 1px; border-radius: 1px;
border-color: #ff6600; border-color: #ff6600;
} }
.card>.card-header { .card>.card-header, .modal-header {
border-color: #ff6600; border-color: #ff6600;
background-color: #ff6600; background-color: #ff6600;
color: #000; color: #000;
@ -53,11 +53,20 @@ h5.card-title {
font-size: 1.0rem; font-size: 1.0rem;
} }
.card-header [class^="fa"] { .card-header [class^="fa"], .modal-header [class^="fa"] {
color: #fff; color: #fff;
font-size: 1.0rem; font-size: 1.0rem;
} }
.modal-title {
color: #000;
font-size: 1.0rem;
}
.modal-content {
border-radius: 0px;
}
.sidebar-brand-text { .sidebar-brand-text {
text-transform: none; text-transform: none;
color: #212529; color: #212529;

View File

@ -119,7 +119,7 @@ a:focus, a:hover {
color: #d2d2d2; color: #d2d2d2;
} }
.card>.card-header { .card>.card-header, .modal-content, .modal-header {
border-color: #404040; border-color: #404040;
background-color: #202020; background-color: #202020;
color: #afafaf; color: #afafaf;
@ -129,6 +129,10 @@ a:focus, a:hover {
font-weight: 400; font-weight: 400;
} }
.modal-body {
background-color: #141414;
}
.card>.card-header .fa { .card>.card-header .fa {
color: #202020; color: #202020;
} }
@ -197,11 +201,15 @@ hr {
width: 6.5rem; width: 6.5rem;
} }
.card-footer { .card-footer, .modal-footer {
background-color: #202020; background-color: #202020;
border-top: 0px; border-top: 0px;
} }
.modal-footer {
border-radius: 0.3rem;
}
.card>.card-header::before, .navbar-default::before { .card>.card-header::before, .navbar-default::before {
content: " "; content: " ";
display: block; display: block;

View File

@ -232,6 +232,18 @@ function loadChannel() {
}); });
} }
$('#hostapdModal').on('shown.bs.modal', function (e) {
var seconds = 9;
var countDown = setInterval(function(){
if(seconds <= 0){
clearInterval(countDown);
}
var pcg = Math.floor(100-(seconds*100/9));
document.getElementsByClassName('progress-bar').item(0).setAttribute('style','width:'+Number(pcg)+'%');
seconds --;
}, 1000);
});
/* /*
Sets the wirelss channel select options based on hw_mode and country_code. Sets the wirelss channel select options based on hw_mode and country_code.

View File

@ -462,6 +462,12 @@ msgstr "Disable <code>disassoc_low_ack</code>"
msgid "Do not disassociate stations based on excessive transmission failures." msgid "Do not disassociate stations based on excessive transmission failures."
msgstr "Do not disassociate stations based on excessive transmission failures." msgstr "Do not disassociate stations based on excessive transmission failures."
msgid "RaspAP service start executing"
msgstr "RaspAP service start executing"
msgid "Close"
msgstr "Close"
#: includes/networking.php #: includes/networking.php
msgid "Summary" msgid "Summary"
msgstr "Summary" msgstr "Summary"

View File

@ -2,11 +2,30 @@
<?php if (!RASPI_MONITOR_ENABLED) : ?> <?php if (!RASPI_MONITOR_ENABLED) : ?>
<input type="submit" class="btn btn-outline btn-primary" name="SaveHostAPDSettings" value="<?php echo _("Save settings"); ?>" /> <input type="submit" class="btn btn-outline btn-primary" name="SaveHostAPDSettings" value="<?php echo _("Save settings"); ?>" />
<?php if ($hostapdstatus[0] == 0) : ?> <?php if ($hostapdstatus[0] == 0) : ?>
<input type="submit" class="btn btn-success" name="StartHotspot" value="<?php echo _("Start hotspot") ?>"/> <input type="submit" class="btn btn-success" name="StartHotspot" value="<?php echo _("Start hotspot"); $msg=_("Starting hotspot"); ?>" data-toggle="modal" data-target="#hostapdModal"/>
<?php else : ?> <?php else : ?>
<input type="submit" class="btn btn-warning" name="StopHotspot" value="<?php echo _("Stop hotspot") ?>"/> <input type="submit" class="btn btn-warning" name="StopHotspot" value="<?php echo _("Stop hotspot") ?>"/>
<input type ="submit" class="btn btn-warning" name="RestartHotspot" value="<?php echo _("Restart hotspot") ?>"/> <input type ="submit" class="btn btn-warning" name="RestartHotspot" value="<?php echo _("Restart hotspot"); $msg=_("Restarting hotspot"); ?>" data-toggle="modal" data-target="#hostapdModal"/>
<?php endif ?> <?php endif ?>
<!-- Modal -->
<div class="modal fade" id="hostapdModal" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title" id="ModalLabel"><i class="fas fa-sync-alt mr-2"></i><?php echo $msg ?></div>
</div>
<div class="modal-body">
<div class="col-md-12 mb-3 mt-1"><?php echo _("RaspAP service start executing") ?>...</div>
<div class="progress" style="height: 20px;">
<div class="progress-bar bg-info" role="progressbar" id="progressBar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="9"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline btn-primary" data-dismiss="modal"><?php echo _("Close"); ?></button>
</div>
</div>
</div>
</div>
<?php endif ?> <?php endif ?>
<?php $buttons = ob_get_clean(); ob_end_clean() ?> <?php $buttons = ob_get_clean(); ob_end_clean() ?>