settings.html.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <!--
  2. PirateBox app for YunoHost
  3. Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
  4. Contribute at https://github.com/jvaubourg/piratebox_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. <h2><?= T_("PirateBox Configuration") ?></h2>
  17. <?php if($faststatus): ?>
  18. <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>
  19. <?php else: ?>
  20. <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>
  21. <?php endif; ?>
  22. &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> &middot; <a href="http://<?= $opt_domain ?>:4280">PirateBox</a>
  23. <div id="status" class="alert alert-dismissible alert-info fade in" style="margin-top: 10px" role="alert">
  24. <button type="button" class="close"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  25. <div id="status-text"></div>
  26. </div>
  27. <hr />
  28. <div class="row">
  29. <div class="col-sm-offset-2 col-sm-8">
  30. <form method="post" enctype="multipart/form-data" action="?/settings" class="form-horizontal" role="form" id="form">
  31. <input type="hidden" name="_method" value="put" />
  32. <div class="panel panel-default">
  33. <div class="panel-heading">
  34. <h3 class="panel-title"><?= T_("Service") ?></h3>
  35. </div>
  36. <div style="padding: 14px 14px 0 10px">
  37. <div class="form-group">
  38. <label for="service_enabled" class="col-sm-3 control-label"><?= T_('PirateBox Enabled') ?></label>
  39. <div class="col-sm-9 input-group-btn">
  40. <div class="input-group">
  41. <input type="checkbox" class="form-control switch" name="service_enabled" id="service_enabled" value="1" <?= $service_enabled == 1 ? 'checked="checked"' : '' ?> />
  42. </div>
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <?php if($wifi_device_id == -1): ?>
  47. <div class="alert alert-dismissible alert-warning fade in" style="margin: 2px 16px 17px" role="alert">
  48. <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  49. <strong><?= T_('Notice') ?>:</strong> <?= T_("You need to select an associated hotspot.") ?>
  50. </div>
  51. <?php endif; ?>
  52. <label for="wifi_device_id" class="col-sm-3 control-label"><?= T_('Associated Hotspot') ?></label>
  53. <div class="col-sm-9 input-group-btn">
  54. <div class="input-group">
  55. <input type="text" name="wifi_device_id" id="wifi_device_id" value="<?= $wifi_device_id ?>" style="display: none" />
  56. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><?= empty($wifi_ssid) ? '<em>'.T_("None").'</em>' : $wifi_ssid ?> <span class="caret"></span></button>
  57. <ul class="dropdown-menu dropdown-menu-left" id="deviceidlist" role="menu">
  58. <?= $wifi_ssid_list ?>
  59. </ul>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="panel panel-default enabled" <?= $service_enabled == 0 ? 'style="display: none"' : '' ?>>
  66. <div class="panel-heading">
  67. <h3 class="panel-title"><?= T_("PirateBox") ?></h3>
  68. </div>
  69. <div style="padding: 14px 14px 0 10px">
  70. <div class="form-group">
  71. <label for="opt_name" class="col-sm-3 control-label"><?= T_('Name') ?></label>
  72. <div class="col-sm-9">
  73. <input type="text" class="form-control" name="opt_name" id="opt_name" placeholder="PirateBox" value="<?= htmlentities($opt_name) ?>" />
  74. </div>
  75. </div>
  76. <div class="form-group">
  77. <label for="opt_renaming" class="col-sm-3 control-label"><?= T_('Renaming Allowed') ?></label>
  78. <div class="col-sm-9 input-group-btn">
  79. <div class="input-group">
  80. <input type="checkbox" class="form-control switch" name="opt_renaming" id="opt_renaming" value="1" <?= $opt_renaming == 1 ? 'checked="checked"' : '' ?> />
  81. </div>
  82. </div>
  83. </div>
  84. <div class="form-group">
  85. <label for="opt_deleting" class="col-sm-3 control-label"><?= T_('Deleting Allowed') ?></label>
  86. <div class="col-sm-9 input-group-btn">
  87. <div class="input-group">
  88. <input type="checkbox" class="form-control switch" name="opt_deleting" id="opt_deleting" value="1" <?= $opt_deleting == 1 ? 'checked="checked"' : '' ?> />
  89. </div>
  90. </div>
  91. </div>
  92. <div class="form-group">
  93. <label for="opt_chat" class="col-sm-3 control-label"><?= T_('Chat Enabled') ?></label>
  94. <div class="col-sm-9 input-group-btn">
  95. <div class="input-group">
  96. <input type="checkbox" class="form-control switch" name="opt_chat" id="opt_chat" value="1" <?= $opt_chat == 1 ? 'checked="checked"' : '' ?> />
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. <div class="form-group">
  103. <div style="text-align: center">
  104. <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..." />
  105. </div>
  106. </div>
  107. </form>
  108. </div>
  109. </div>