settings.html.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <!--
  2. Wifi Hotspot app for YunoHost
  3. Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
  4. Contribute at https://github.com/jvaubourg/hotspot_ynh
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU Affero General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU Affero General Public License for more details.
  13. You should have received a copy of the GNU Affero General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. -->
  16. <div id="wifiparty_screen">
  17. <div id="wifiparty_ssid_part">
  18. <div class="btn-group" role="group">
  19. <button type="button" class="btn btn-default" id="wifiparty_close"><span class="glyphicon glyphicon-eye-close"></span></button>
  20. <button type="button" class="btn btn-default" id="wifiparty_zoomin_ssid"><span class="glyphicon glyphicon-zoom-in"></span></button>
  21. <button type="button" class="btn btn-default" id="wifiparty_zoomout_ssid"><span class="glyphicon glyphicon-zoom-out"></span></button>
  22. </div>
  23. <span id="wifiparty_ssid"><span class="glyphicon glyphicon-signal"></span> <?= $wifi_ssid ?></span>
  24. </div>
  25. <div class="btn-group" role="group">
  26. <button type="button" class="btn btn-default" id="wifiparty_zoomin_passphrase"><span class="glyphicon glyphicon-zoom-in"></span></button>
  27. <button type="button" class="btn btn-default" id="wifiparty_zoomout_passphrase"><span class="glyphicon glyphicon-zoom-out"></span></button>
  28. </div>
  29. <div id="wifiparty_passphrase"><?php
  30. $pw = preg_replace('/[^0-9a-z ]/i', '<span-class="passother">$0</span>', $wifi_passphrase);
  31. $pw = preg_replace('/\d/', '<span-class="passdigit">$0</span>', $pw);
  32. $pw = preg_replace('/ /', '<span class="passspace">&#x25AE;</span>', $pw);
  33. $pw = preg_replace('/span-class/', 'span class', $pw);
  34. echo $pw;
  35. ?></div>
  36. </div>
  37. <h2><?= T_("Wifi Hotspot Configuration") ?></h2>
  38. <?php if($faststatus): ?>
  39. <span class="label label-success" data-toggle="tooltip" data-title="<?= T_('This is a fast status. Click on More details to show the complete status.') ?>"><?= T_('Running') ?></span>
  40. <?php else: ?>
  41. <span class="label label-danger" data-toggle="tooltip" data-title="<?= T_('This is a fast status. Click on More details to show the complete status.') ?>"><?= T_('Not Running') ?></span>
  42. <?php endif; ?>
  43. &nbsp; <img src="public/img/loading.gif" id="status-loading" alt="Loading..." /><a href="#" id="statusbtn" data-toggle="tooltip" data-title="<?= T_('Loading complete status may take a few minutes. Be patient.') ?>"><?= T_('More details') ?></a>
  44. <div id="status" class="alert alert-dismissible alert-info fade in" style="margin-top: 10px" role="alert">
  45. <button type="button" class="close"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  46. <div id="status-text"></div>
  47. </div>
  48. <hr />
  49. <div class="row">
  50. <div class="col-sm-offset-2 col-sm-8">
  51. <form method="post" enctype="multipart/form-data" action="?/settings" class="form-horizontal" role="form" id="form">
  52. <input type="hidden" name="_method" value="put" />
  53. <div class="panel panel-default">
  54. <div class="panel-heading">
  55. <h3 class="panel-title"><?= T_("Service") ?></h3>
  56. </div>
  57. <div style="padding: 14px 14px 0 10px">
  58. <div class="form-group">
  59. <label for="service_enabled" class="col-sm-3 control-label"><?= T_('Hotspot Enabled') ?></label>
  60. <div class="col-sm-9 input-group-btn">
  61. <div class="input-group">
  62. <input type="checkbox" class="form-control switch" name="service_enabled" id="service_enabled" value="1" <?= $service_enabled == 1 ? 'checked="checked"' : '' ?> />
  63. </div>
  64. </div>
  65. </div>
  66. <div class="form-group">
  67. <label for="wifi_device" class="col-sm-3 control-label"><?= T_('Device') ?></label>
  68. <div class="col-sm-9 input-group-btn">
  69. <div class="input-group">
  70. <input type="text" name="wifi_device" id="wifi_device" value="<?= $wifi_device ?>" style="display: none" />
  71. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><?= $wifi_device ?> <span class="caret"></span></button>
  72. <ul class="dropdown-menu dropdown-menu-left" role="menu">
  73. <?= $wifi_device_list ?>
  74. </ul>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="form-group">
  79. <label class="col-sm-3 control-label"><?= T_('Channel') ?></label>
  80. <div class="col-sm-9 input-group-btn">
  81. <div class="input-group dropdownmenu">
  82. <input type="text" name="wifi_channel" value="<?= $wifi_channel ?>" style="display: none" />
  83. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><?= $wifi_channel ?> <span class="caret"></span></button>
  84. <ul class="dropdown-menu dropdown-menu-left" role="menu">
  85. <li <?= $wifi_channel == 1 ? 'class="active"' : '' ?>><a href="javascript:;">1</a></li>
  86. <li <?= $wifi_channel == 2 ? 'class="active"' : '' ?>><a href="javascript:;">2</a></li>
  87. <li <?= $wifi_channel == 3 ? 'class="active"' : '' ?>><a href="javascript:;">3</a></li>
  88. <li <?= $wifi_channel == 4 ? 'class="active"' : '' ?>><a href="javascript:;">4</a></li>
  89. <li <?= $wifi_channel == 5 ? 'class="active"' : '' ?>><a href="javascript:;">5</a></li>
  90. <li <?= $wifi_channel == 6 ? 'class="active"' : '' ?>><a href="javascript:;">6</a></li>
  91. <li <?= $wifi_channel == 7 ? 'class="active"' : '' ?>><a href="javascript:;">7</a></li>
  92. <li <?= $wifi_channel == 8 ? 'class="active"' : '' ?>><a href="javascript:;">8</a></li>
  93. <li <?= $wifi_channel == 9 ? 'class="active"' : '' ?>><a href="javascript:;">9</a></li>
  94. <li <?= $wifi_channel == 10 ? 'class="active"' : '' ?>><a href="javascript:;">10</a></li>
  95. <li <?= $wifi_channel == 11 ? 'class="active"' : '' ?>><a href="javascript:;">11</a></li>
  96. </ul>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. <div id="ssids">
  103. <?php foreach($ssids as $ssid): ?>
  104. <?php set('ssid', $ssid) ?>
  105. <?= partial('_ssid.html.php') ?>
  106. <?php endforeach; ?>
  107. </div>
  108. <button id="newssid" type="button" class="btn btn-default">Add</button>
  109. <div class="form-group">
  110. <div style="text-align: center">
  111. <?php if($is_connected_through_hotspot): ?>
  112. <div class="alert alert-dismissible alert-warning fade in" role="alert" id="saveconfirmation">
  113. <strong><?= T_('Notice') ?>:</strong> <?= T_("You are currently connected through the wifi hotspot. Please, confirm the reloading, wait for the wifi disconnect/reconnect and go back here to check that everything is okay.") ?>
  114. <div id="confirm">
  115. <button type="submit" class="btn btn-default" data-toggle="tooltip" id="save" data-title="<?= T_('Reloading may take a few minutes. Be patient.') ?>"><?= T_('Confirm') ?></button> <img src="public/img/loading.gif" id="save-loading" alt="Loading..." />
  116. </div>
  117. </div>
  118. <button type="button" class="btn btn-default" id="saveconfirm"><?= T_('Save and reload') ?></button>
  119. <?php else: ?>
  120. <button type="submit" class="btn btn-default" data-toggle="tooltip" id="save" data-title="<?= T_('Reloading may take a few minutes. Be patient.') ?>"><?= T_('Save and reload') ?></button> <img src="public/img/loading.gif" id="save-loading" alt="Loading..." />
  121. <?php endif; ?>
  122. </div>
  123. </div>
  124. </form>
  125. </div>
  126. </div>