home.blade.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="container">
  4. <div class="row justify-content-center">
  5. <div class="col-md-12">
  6. <div class="card">
  7. <div class="card-header d-flex flex-row">
  8. <div
  9. class="flex-grow-1 text-primary text-uppercase font-weight-bold">
  10. <i class="fas fa-music"></i>
  11. {{ __('ui.panel') }}
  12. </div>
  13. @auth
  14. <div class="btn-group">
  15. @if(Auth::user()->isAdmin)
  16. <div class="btn btn-sm btn-outline-primary text-left text-truncate" id="fScan" title="{{ __('ui.rescan') }}">
  17. <i class="fas fa-sync"></i>
  18. </div>
  19. <a href="{{route('ucontrol')}}" class="btn btn-sm btn-outline-primary text-right text-truncate" title="{{ __('ui.umanage') }}">
  20. <i class="fas fa-user-cog"></i>
  21. </a>
  22. <button data-toggle="modal" data-target="@if($srv_state['lockdown']=='yes')#exitLockdownModal @else#lockdownModal @endif"
  23. class="btn btn-sm btn-outline-primary text-right text-truncate" title="{{__('ui.lockreg')}}">
  24. <i class="fas @if($srv_state['lockdown']=='yes') fa-unlock-alt @else fa-lock @endif"></i>
  25. </button>
  26. @endif
  27. <div class="btn btn-sm btn-outline-primary text-left text-truncate"
  28. data-toggle="modal" data-target="#helpModal" title="{{ __('ui.help_btn') }}">
  29. <i class="fas fa-question"></i>
  30. </div>
  31. </div>
  32. @endauth
  33. </div>
  34. <div class="card-body">
  35. @if (session('status'))
  36. <div class="alert alert-success" role="alert">
  37. {{ session('status') }}
  38. </div>
  39. @endif
  40. @guest
  41. <div class="alert alert-danger">{{ __('ui.login_req') }}</div>
  42. @else
  43. <div class="container">
  44. <div class="row bg-dark text-light px-2 py-3 font-weight-bold">
  45. <div class="col-sm ">{{__('ui.tb_title')}}</div>
  46. <div class="col col-sm-3 controls text-truncate">
  47. {{__('ui.tb_play')}} и {{__('ui.tb_down')}}
  48. </div>
  49. </div>
  50. @foreach($song_list as $song)
  51. @if($song->type == 'dir')
  52. <div class="row bg-light p-2 align-items-center" >
  53. <div class="col-sm font-weight-bold">
  54. @if(Auth::user()->isAdmin)
  55. <div class="input-group">
  56. <input type="text" class="form-control bg-light" value="{{$song->title}}">
  57. <div class="input-group-append">
  58. <button class="btn btn-sm btn-outline-secondary btn_rename"
  59. route="{{route('mrename', $song->id)}}">
  60. <i class="fas fa-check"></i>
  61. </button>
  62. </div>
  63. </div>
  64. @else
  65. {{$song->title}}
  66. @endif
  67. </div>
  68. </div>
  69. @elseif($song->type == 'txt')
  70. <div class="row bg-light p-2 border-top border-bottom">
  71. <div class="col-sm font-italic">{!! nl2br(e($song->description)) !!}</div>
  72. </div>
  73. @else
  74. <div class="row p-2 border-bottom align-items-center">
  75. <div class="text-left align-middle col-sm">
  76. @if(Auth::user()->isAdmin)
  77. <div class="input-group">
  78. <input type="text" class="form-control" value="{{$song->title}}">
  79. <div class="input-group-append">
  80. <button class="btn btn-sm btn-outline-success btn_rename"
  81. route="{{route('mrename', $song->id)}}">
  82. <i class="fas fa-check"></i>
  83. </button>
  84. </div>
  85. </div>
  86. @else
  87. {{$song->title}}
  88. @endif
  89. <!-- real html5 audio object -->
  90. <audio id="audio_object_{{$song->id}}" audio_id="{{$song->id}}" class="audio" step="10">
  91. <source src="{{$song->file_name}}" type="audio/mpeg">
  92. {{ __('ui.err_play') }}
  93. </audio>
  94. </div>
  95. <div class="controls col-md-auto btn-group-vertical btn-toolbar">
  96. <div class="btn-group">
  97. <div class="btn btn-sm btn-primary disabled text-nowrap">
  98. <span id="curTime_{{$song->id}}">00:00:00</span> - <span id="trkTime_{{$song->id}}">00:00:00</span>
  99. </div>
  100. <div class="btn-group">
  101. <div class="btn btn-sm btn-outline-primary" title="{{__('ui.fwbk_stpep')}}"
  102. data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  103. <i class="fas fa-caret-square-down"></i>
  104. </div>
  105. <div class="dropdown-menu" aria-labelledby="btnGroupDrop1" audio_id="{{$song->id}}">
  106. <div class="dropdown-item disabled">{{__('ui.fwbk_stpep')}}</div>
  107. <div class="dropdown-item active" vsec="10">10 {{__('ui.sec')}}</div>
  108. <div class="dropdown-item" vsec="60">1 {{__('ui.min')}}</div>
  109. <div class="dropdown-item" vsec="600">10 {{__('ui.min')}}</div>
  110. </div>
  111. </div>
  112. <div class="btn btn-sm btn-outline-primary repeat_btn" audio_id="{{$song->id}}" title="{{__('ui.loop')}}">
  113. <i class="fas fa-retweet"></i>
  114. </div>
  115. <div class="btn btn-sm btn-outline-primary disabled" id="play_num_{{$song->id}}"
  116. title="{{__('ui.badge_play')}}">
  117. {{ $song->played }}
  118. </div>
  119. <div class="btn btn-sm btn-outline-success disabled" id="dw_num_{{$song->id}}" style="width: 30px; flex: initial"
  120. title="{{__('ui.badge_down')}}">
  121. {{ $song->downloads }}
  122. </div>
  123. </div>
  124. <div class="btn-group" audio_id="{{$song->id}}">
  125. <div class="btn btn-sm btn-outline-primary s_bkw" title="{{__('ui.s_bkw')}}" direction="1">
  126. <i class="fas fa-backward"></i>
  127. </div>
  128. <div class="btn btn-sm btn-outline-primary play_btn"
  129. route="{{route('mplay', $song->id)}}">
  130. <i class="fas fa-play" id="play_ctrl_{{$song->id}}"></i>
  131. </div>
  132. <div class="btn btn-sm btn-outline-primary s_fwd" title="{{__('ui.s_fwd')}}" direction="0">
  133. <i class="fas fa-forward"></i>
  134. </div>
  135. <a class="btn btn-sm btn-outline-success dw_btn" style="width: 30px; flex: initial"
  136. audio_id="{{$song->id}}" route="{{route('mdown', $song->id)}}"
  137. href="{{$song->file_name}}" target="_blank">
  138. <i class="fas fa-file-download"></i>
  139. </a>
  140. </div>
  141. </div>
  142. </div>
  143. @endif
  144. @endforeach
  145. </div>
  146. @endguest
  147. </div>
  148. </div>
  149. </div>
  150. </div>
  151. </div>
  152. @endsection
  153. @section('modals')
  154. <div class="modal fade" id="exitLockdownModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  155. <div class="modal-dialog" role="document">
  156. <div class="modal-content">
  157. <div class="modal-header">
  158. <h5 class="modal-title" id="exampleModalLabel">{{__('ui.lockreg')}}</h5>
  159. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  160. <span aria-hidden="true">&times;</span>
  161. </button>
  162. </div>
  163. <div class="modal-body">
  164. {{__('ui.lockdown_ask')}}
  165. </div>
  166. <div class="modal-footer">
  167. <button type="button" class="btn btn-secondary" data-dismiss="modal">
  168. {{__('ui.cancel')}}</button>
  169. <a href="{{route('lockregoff')}}" type="button" class="btn btn-primary">{{__('ui.ok')}}</a>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. <div class="modal fade" id="lockdownModal" tabindex="-1" role="dialog" aria-labelledby="lockdownModalLabel" aria-hidden="true">
  175. <div class="modal-dialog" role="document">
  176. <div class="modal-content">
  177. <div class="modal-header">
  178. <h5 class="modal-title" id="lockdownModalLabel">{{__('ui.lockreg')}}</h5>
  179. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  180. <span aria-hidden="true">&times;</span>
  181. </button>
  182. </div>
  183. <div class="modal-body">
  184. <form action="{{route('lockregon')}}" method="post" id="srvModeParam">
  185. @csrf
  186. <div class="form-group">
  187. <label for="message-text" class="col-form-label">{{__('ui.lock_msg')}}:</label>
  188. <textarea class="form-control" name="message_text">{{$srv_state['lockdown_msg']}}</textarea>
  189. </div>
  190. <div class="form-group">
  191. <label for="recipient-name" class="col-form-label">{{__('ui.srv_email')}}:</label>
  192. <input type="text" class="form-control" name="recipient_name"
  193. value="{{$srv_state['srv_email']}}">
  194. </div>
  195. </form>
  196. </div>
  197. <div class="modal-footer">
  198. <button type="button" class="btn btn-secondary" data-dismiss="modal">
  199. {{__('ui.cancel')}}</button>
  200. <button type="button" class="btn btn-primary"
  201. onclick="event.preventDefault();
  202. document.getElementById('srvModeParam').submit();">
  203. {{__('ui.ok')}}</button>
  204. </div>
  205. </div>
  206. </div>
  207. </div>
  208. <div class="modal fade" id="helpModal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel" aria-hidden="true">
  209. <div class="modal-dialog" role="document">
  210. <div class="modal-content">
  211. <div class="modal-header">
  212. <h5 class="modal-title" id="helpModalLabel">{{ __('ui.help_btn') }}</h5>
  213. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  214. <span aria-hidden="true">&times;</span>
  215. </button>
  216. </div>
  217. <div class="modal-body">
  218. <img src="{{ asset('img/player_help.png') }}" class="img-fluid">
  219. <ul class="list-group list-group-flush">
  220. <li class="list-group-item text-danger">1) {{ __('ui.help_1') }}</li>
  221. <li class="list-group-item text-danger">2) {{ __('ui.help_2') }}</li>
  222. <li class="list-group-item text-danger">3) {{ __('ui.help_3') }}</li>
  223. <li class="list-group-item text-danger">4) {{ __('ui.help_4') }}</li>
  224. <li class="list-group-item text-danger">5) {{ __('ui.help_5') }}</li>
  225. <li class="list-group-item text-danger">6) {{ __('ui.help_6') }}</li>
  226. <li class="list-group-item text-danger">7) {{ __('ui.help_7') }}</li>
  227. <li class="list-group-item text-danger">8) {{ __('ui.help_8') }}</li>
  228. <li class="list-group-item text-danger">9) {{ __('ui.help_9') }}</li>
  229. <li class="list-group-item text-danger">10) {{ __('ui.help_10') }}</li>
  230. <li class="list-group-item text-danger">11) {{ __('ui.help_11') }}</li>
  231. <li class="list-group-item text-danger">12) {{ __('ui.help_12') }}</li>
  232. </ul>
  233. </div>
  234. <div class="modal-footer">
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. @endsection