METODO LAYOT


SUBMITTED BY: terrorxdroid

DATE: Oct. 2, 2024, 9:52 p.m.

UPDATED: Oct. 4, 2024, 9:54 a.m.

FORMAT: Text only

SIZE: 33.2 kB

HITS: 353

  1. <!DOCTYPE html>
  2. <html lang="pt-BR">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title>DTunnel</title>
  8. <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css">
  9. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet"
  10. integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
  11. <script type="text/javascript"
  12. src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"
  13. integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe"
  14. crossorigin="anonymous"></script>
  15. <style>
  16. @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
  17. :root {
  18. --background-img: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 35%, rgba(255,0,0,1) 100%);
  19. --logo-img-url: url(https://plenonet.com.br/assets/images/plenonet-512512px-2-512x512.webp);
  20. --input-border-radius: 5px;
  21. --input-background-color: #0a091a55;
  22. --card-border-radius: 5px;
  23. --card-background-color: #0b092868;
  24. --btn-background-color: #0a091a55;
  25. --btn-border-radius: 5px;
  26. --modal-background-color: #0b092868;
  27. --text-color: #ffffff;
  28. --icon-color: #FFFFFF;
  29. }
  30. * {
  31. margin: 0;
  32. padding: 0;
  33. box-sizing: border-box;
  34. font-family: 'Roboto', sans-serif;
  35. }
  36. body {
  37. height: 100vh;
  38. display: flex;
  39. flex-direction: column;
  40. align-items: center;
  41. justify-content: center;
  42. background-repeat: no-repeat;
  43. background-size: cover;
  44. }
  45. .container {
  46. height: 100%;
  47. display: flex;
  48. flex-direction: column;
  49. justify-content: center;
  50. align-items: center;
  51. max-width: 465px;
  52. background: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 35%, rgba(255,0,0,1) 100%);
  53. }
  54. .logo {
  55. width: 100%;
  56. margin-bottom: 10px;
  57. }
  58. .card {
  59. background: #080808;
  60. border-radius: 20px;
  61. border: 1px solid #1e1e1e !important;
  62. box-shadow: -8px 12px 20px 0 rgb(13 15 18 / 63%) !important;
  63. padding: 15px !important;
  64. max-width: 450px;
  65. height: auto;
  66. position: relative;
  67. }
  68. .btn-dark {
  69. border: none;
  70. background: linear-gradient( to top right, #ff0000, #121212 );
  71. border-radius: 15px;
  72. }
  73. .modal-content {
  74. background-color: transparent;
  75. backdrop-filter: blur(25px);
  76. }
  77. .tool {
  78. align-items: center;
  79. justify-content: center;
  80. text-align: center;
  81. }
  82. .tool-bt {
  83. background: linear-gradient( to top right, #ff0000, #121212 );
  84. border-radius: 20px;
  85. color: #ffffff !important;
  86. height: 35px;
  87. width: 100%;
  88. border: var(--btn-border);
  89. }
  90. .input-group, .form-control, .input-group-text {
  91. background: #080808;
  92. color: var(--icon-color);
  93. border: none;
  94. border-radius: 15px;
  95. outline: none;
  96. }
  97. .form-control::placeholder {
  98. color: var(--text-color);
  99. }
  100. .form-control:focus {
  101. color: var(--text-color);
  102. outline: none;
  103. box-shadow: none;
  104. }
  105. .input-group-text {
  106. padding-right: 0;
  107. }
  108. .fs-5 {
  109. font-size: 1rem!important;
  110. }
  111. nav {
  112. background: linear-gradient( to top right, #ff0000, #121212 );
  113. border-radius: 20px;
  114. font-size: 0;
  115. width: 100%;
  116. max-width: 450px;
  117. height: auto;
  118. position: relative;
  119. margin-top: 20px;
  120. margin-bottom: 10px;
  121. }
  122. nav a {
  123. line-height: 35px;
  124. height: 100%;
  125. font-size: 15px;
  126. display: inline-block;
  127. position: relative;
  128. z-index: 1;
  129. text-decoration: none;
  130. text-align: center;
  131. color: white !important;
  132. cursor: pointer;
  133. }
  134. nav .animation {
  135. position: absolute;
  136. height: 100%;
  137. top: 0;
  138. z-index: 0;
  139. transition: all .5s ease 0s;
  140. border-radius: 8px;
  141. }
  142. a:nth-child(1) {
  143. width: 30%;
  144. }
  145. a:nth-child(2) {
  146. width: 30%;
  147. }
  148. a:nth-child(3) {
  149. width: 40%;
  150. }
  151. nav .start-home, a:nth-child(1):hover~.animation {
  152. width: 30%;
  153. left: 0;
  154. background-color: #121212;
  155. border-radius: 20px;
  156. }
  157. nav .start-about, a:nth-child(2):hover~.animation {
  158. width: 30%;;
  159. left: 30%;
  160. background-color: #121212;
  161. border-radius: 20px;
  162. }
  163. nav .start-blog, a:nth-child(3):hover~.animation {
  164. width: 40%;
  165. left: 60%;
  166. background-color: #121212;
  167. border-radius: 20px;
  168. }
  169. body {
  170. font-size: 12px;
  171. font-family: sans-serif;
  172. background: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 35%, rgba(255,0,0,1) 100%);
  173. }
  174. @media (min-width: 768px) {
  175. .container, .container-md, .container-sm {
  176. max-width: 100%;
  177. }
  178. }
  179. .rede {
  180. color: #ff0000;
  181. }
  182. .iplocal {
  183. color: #ffffff;
  184. }
  185. .containerlocal {
  186. background: #080808;
  187. border-radius: 20px;
  188. border: 1px solid #1e1e1e !important;
  189. padding: 15px !important;
  190. width: 95%;
  191. max-width: 450px;
  192. height: auto;
  193. position: relative;
  194. margin-top: 50px;
  195. margin-bottom: -70px;
  196. }
  197. .hidden {
  198. display: none;
  199. }
  200. </style>
  201. </head>
  202. <body>
  203. <div class="containerlocal">
  204. <span class="font-semibold text-xs mr-2" style="color: #ffffff;"">📢 IP Local da sua operadora:</span><span class="rede font-semibold text-xs mr-2" id="name">REDE</span> <span class="iplocal font-semibold text-xs" id="ip">127.0.0.1</span>
  205. </div>
  206. <div class="container">
  207. <div class="card border-0 p-2 shadow mb-3 w-100">
  208. <span style="color:#ffffff;font-size: 18px;border-radius: 15px;padding: 0px 0px 0px 5px;margin-bottom: 10px;display: block !important;text-align: start;">Plenonet - Versão: 1.6.7</span>
  209. <img class="logo" src="https://i.ibb.co/z2nx6bF/DT01hvn4ps.png">
  210. <div class="input-group mb-2 shadow" id="config-area">
  211. <input class="form-control" type="text" placeholder="CONFIGURAÇÃO" readonly title="configurações"
  212. id="config" style="background-color: #080808;" />
  213. <span class="input-group-text me-2">
  214. <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor"
  215. class="bi bi:bar-chart" viewBox="0 0 16 16">
  216. <path
  217. d="M4 11H2v3h2v-3zm5-4H7v7h2V7zm5-5v12h-2V2h2zm-2-1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1h-2zM6 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7zm-5 4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1v-3z"/></svg>
  218. </span>
  219. </div>
  220. <div class="input-group input mb-2 shadow">
  221. <span class="input-group-text">
  222. <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor"
  223. class="bi bi:file-person" viewBox="0 0 16 16">
  224. <path
  225. d="M12 1a1 1 0 0 1 1 1v10.755S12 11 8 11s-5 1.755-5 1.755V2a1 1 0 0 1 1-1h8zM4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H4z"/><path d="M8 10a3 3 0 1 0 0-6a3 3 0 0 0 0 6z"/></g></svg>
  226. </span>
  227. <input class="form-control" type="text" placeholder="usuario" id="username" style="background-color: #080808;" />
  228. </div>
  229. <div class="input-group input mb-2 shadow">
  230. <span class="input-group-text">
  231. <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="bi bi:file-earmark-lock"
  232. viewBox="0 0 16 16">
  233. <path
  234. d="M10 7v1.076c.54.166 1 .597 1 1.224v2.4c0 .816-.781 1.3-1.5 1.3h-3c-.719 0-1.5-.484-1.5-1.3V9.3c0-.627.46-1.058 1-1.224V7a2 2 0 1 1 4 0zM7 7v1h2V7a1 1 0 0 0-2 0zM6 9.3v2.4c0 .042.02.107.105.175A.637.637 0 0 0 6.5 12h3a.64.64 0 0 0 .395-.125c.085-.068.105-.133.105-.175V9.3c0-.042-.02-.107-.105-.175A.637.637 0 0 0 9.5 9h-3a.637.637 0 0 0-.395.125C6.02 9.193 6 9.258 6 9.3z"/><path d="M14 14V4.5L9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2zM9.5 3A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5v2z"/></g></svg>
  235. </span>
  236. <input class="form-control" type="password" placeholder="senha" id="password" style="background-color: #080808;" />
  237. <span class="input-group-text me-2"
  238. onclick="password.type==`text`?password.type = `password`:password.type = `text`">
  239. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye"
  240. viewBox="0 0 16 16">
  241. <path
  242. d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z" />
  243. <path
  244. d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z" />
  245. </svg>
  246. </span>
  247. </div>
  248. <div class="input-group input mb-2 shadow">
  249. <span class="input-group-text">
  250. <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="bi bi-key"
  251. viewBox="0 0 16 16">
  252. <path
  253. d="M0 8a4 4 0 0 1 7.465-2H14a.5.5 0 0 1 .354.146l1.5 1.5a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0L13 9.207l-.646.647a.5.5 0 0 1-.708 0L11 9.207l-.646.647a.5.5 0 0 1-.708 0L9 9.207l-.646.647A.5.5 0 0 1 8 10h-.535A4 4 0 0 1 0 8zm4-3a3 3 0 1 0 2.712 4.285A.5.5 0 0 1 7.163 9h.63l.853-.854a.5.5 0 0 1 .708 0l.646.647.646-.647a.5.5 0 0 1 .708 0l.646.647.646-.647a.5.5 0 0 1 .708 0l.646.647.793-.793-1-1h-6.63a.5.5 0 0 1-.451-.285A3 3 0 0 0 4 5z" />
  254. <path d="M4 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0z" />
  255. </svg>
  256. </span>
  257. <input class="form-control" type="text" placeholder="V2ray UUID" id="uuid" style="background: #080808;" />
  258. <span class="input-group-text me-2"
  259. onclick="uuid.type==`text`?uuid.type = `password`:uuid.type = `text`">
  260. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye"
  261. viewBox="0 0 16 16">
  262. <path
  263. d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z" />
  264. <path
  265. d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z" />
  266. </svg>
  267. </span>
  268. </div>
  269. <button class="btn btn-dark w-100 shadow" id="start-stop">INICIAR</button>
  270. <nav>
  271. <a id="sync" onclick="DtStartAppUpdate.execute()">Atualizar</a>
  272. <a id="logger">Registro</a>
  273. <a onclick="ToolsModal.show()">Ajustes</a>
  274. <div class="animation start-home"></div>
  275. </nav>
  276. </div>
  277. <div class="card my-3 w-100 text-center border-0 p-2 shadow text-light fs-5 text-uppercase fw-bold" id="state" style="padding: 5px !important; font-size: 15px !important;">
  278. </div>
  279. <p style="color: #5e9ca0;"><span style="color: #ffffff; font-size: 17px;">Plenonet - Conex&otilde;es @2020-2024</span></p>
  280. </div>
  281. </div>
  282. <div class="modal fade" id="checkUserModal">
  283. <div class="modal-dialog modal-dialog-centered" role="document">
  284. <div class="modal-content rounded-3 shadow">
  285. <div class="modal-header border-bottom-0 pb-0">
  286. <h1 class="modal-title fs-5 chk-title text-light"></h1>
  287. <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
  288. aria-label="Close"></button>
  289. </div>
  290. <div class="modal-body text-center">
  291. <p class="fs-5 mb-0 chk-message text-light"></p>
  292. </div>
  293. </div>
  294. </div>
  295. </div>
  296. <div class="modal fade" id="errorModal">
  297. <div class="modal-dialog modal-dialog-centered" role="document">
  298. <div class="modal-content rounded-3 shadow">
  299. <div class="modal-header border-bottom-0 pb-0">
  300. <h1 class="modal-title fs-5 err-title text-light"></h1>
  301. <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
  302. aria-label="Close"></button>
  303. </div>
  304. <div class="modal-body text-center">
  305. <p class="fs-5 mb-0 err-message text-light"></p>
  306. </div>
  307. </div>
  308. </div>
  309. </div>
  310. <div class="modal fade" id="loggerModal">
  311. <div class="modal-dialog modal-dialog-centered" role="document">
  312. <div class="modal-content rounded-3 shadow">
  313. <div class="modal-body p-1 text-center">
  314. <ul class="list-group bg-transparent overflow-y-auto logger-content" style="max-height: 600px;">
  315. </ul>
  316. </div>
  317. <div class="modal-footer flex-nowrap p-0">
  318. <button type="button" class="btn btn-lg btn-dark text-light w-100 clear-logger">LIMPAR</button>
  319. <button type="button" class="btn btn-lg btn-dark text-light w-100"
  320. data-bs-dismiss="modal">FECHAR</button>
  321. </div>
  322. </div>
  323. </div>
  324. </div>
  325. <div class="tool webm modal fade" index="-1" id="ToolsModal">
  326. <div class="modal-dialog modal-dialog-centered" role="document">
  327. <div class="modal-content">
  328. <div class="tool modal-header">
  329. <h5 class="modal-title" style="color:#ffffff;">Configurações do aplicativo</h5>
  330. </div>
  331. <div class="modal-body">
  332. <button class="tool-bt rounded-2xl text-white" onclick="DtStartWebViewActivity.execute('https://painel.plenonet.com.br/renovar.php')"><i class="info2 bi bi-globe mr-2"></i>Renovar meu Plano</button>
  333. </div>
  334. <div class="modal-body">
  335. <button class="tool-bt rounded-2xl text-white" onclick="DtStartWebViewActivity.execute('https://docs.plenonet.com.br/instalacao-e-conexao/tutoriais-plenonet')"><i class="info2 bi bi-globe mr-2"></i>Acessar turoriais</button>
  336. </div>
  337. <div class="modal-body">
  338. <button class="tool-bt rounded-2xl text-white" onclick="DtStartApnActivity.execute()"><i class="info2 bi bi-wifi mr-2"></i>Alterar protocolo de APN</button>
  339. </div>
  340. <div class="modal-body">
  341. <button class="tool-bt rounded-2xl text-white" onclick="DtIgnoreBatteryOptimizations.execute()"><i class="info2 bi bi-battery-full mr-2"></i>Otimizar Bateria</button>
  342. </div>
  343. <div class="modal-body">
  344. <button class="tool-bt rounded-2xl text-white" onclick="DtCleanApp.execute()"><i class="info2 bi bi-trash3 mr-2"></i>Limpar cachê e dados</button>
  345. </div>
  346. <div class="modal-body">
  347. <button class="tool-bt rounded-2xl text-white" onclick="DtStartWebViewActivity.execute('https://docs.plenonet.com.br/termos-de-uso/termos-de-uso-do-aplicativo')"><i class="info2 bi bi-globe mr-2"></i>Termos de uso do aplicativo</button>
  348. </div>
  349. <div class="tool modal-footer">
  350. <button type="button" class="btn btn-primary" data-bs-dismiss="modal" style="background-color: var(--btn-modal);">FECHAR</button>
  351. </div>
  352. </div>
  353. </div>
  354. </div>
  355. <div class="modal fade" id="configModal">
  356. <div class="modal-dialog modal-dialog-centered" role="document">
  357. <div class="modal-content rounded-3 shadow">
  358. <div class="modal-header border-bottom-0 pb-0">
  359. <h1 class="modal-title fs-5 text-white">CONFIGURAÇÕES</h1>
  360. <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
  361. aria-label="Close"></button>
  362. </div>
  363. <div class="modal-body p-1 text-center">
  364. <ul class="list-group bg-transparent overflow-y-auto config-body" style="max-height: 600px;">
  365. <li class="list-group-item bg-transparent text-white border-0">
  366. <p>CATEGORIA</p>
  367. <ul class="list-group bg-transparent overflow-y-auto text-start">
  368. <li
  369. class="list-group-item d-flex bg-transparent text-white border-0 border-bottom rounded-0">
  370. <img src="https://cdn-icons-png.flaticon.com/512/3686/3686811.png" width="40"
  371. height="40">
  372. <div class="d-flex flex-column ms-2 w-100">
  373. <span>CONFIG 01</span>
  374. <span>DESC 01</span>
  375. </div>
  376. <div class="d-flex flex-column ms-2 w-100">
  377. <span class="text-end">CONFIG_MODE</span>
  378. </div>
  379. </li>
  380. </ul>
  381. </li>
  382. </ul>
  383. </div>
  384. </div>
  385. </div>
  386. </div>
  387. <div class="modal fade" id="RenovarModal">
  388. <div class="modal-dialog modal-dialog-centered" role="document">
  389. <div class="modal-content rounded-3 shadow">
  390. <div class="modal-header border-bottom-0 py-3">
  391. <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
  392. aria-label="Close"></button>
  393. </div>
  394. <div class="modal-body ratio rounded-bottom-3" style="height: 600px;">
  395. <div class="spinner d-flex w-100 h-100 align-items-center justify-content-center">
  396. <div class="spinner-border text-light p-5" role="status">
  397. <span class="visually-hidden">Loading...</span>
  398. </div>
  399. </div>
  400. <iframe class="rounded-bottom-3" id="RenovarFrame"></iframe>
  401. </div>
  402. </div>
  403. </div>
  404. </div>
  405. <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/toastify-js"></script>
  406. <script>
  407. class AndroidMock {
  408. static getLocalIP() {
  409. return '192.168.0.1';
  410. }
  411. static getConfig() {
  412. return JSON.stringify({
  413. urlCheckUser: 'URLAQUI'
  414. });
  415. }
  416. static getNetworkName() {
  417. return 'REDE';
  418. }
  419. static openRadioInfo() {
  420. console.log('openRadioInfo');
  421. }
  422. }
  423. </script>
  424. <script>
  425. function showLocalIP(android) {
  426. console.log(android.getNetworkName());
  427. document.getElementById('name').innerHTML = ' ' + android.getNetworkName() + ':';
  428. document.getElementById('ip').innerHTML = android.getLocalIP();
  429. setInterval(() => {
  430. document.getElementById('name').innerHTML =
  431. ' ' + android.getNetworkName() + ':';
  432. document.getElementById('ip').innerHTML = android.getLocalIP();
  433. }, 2000)
  434. }
  435. window.onload = function () {
  436. const android = window.Android || AndroidMock;
  437. showLocalIP(android);
  438. }
  439. function mostrar(id) {
  440. if (document.getElementById(id).style.display !== "none") {
  441. document.getElementById(id).style.display = "none";
  442. return;
  443. }
  444. Array.from(document.getElementsByClassName("hidden")).forEach(
  445. div => (div.style.display = "none")
  446. );
  447. document.getElementById(id).style.display = "block";
  448. }
  449. </script>
  450. <script>
  451. const configArea = document.querySelector('#config-area')
  452. const config = document.querySelector('#config')
  453. const username = document.querySelector('#username')
  454. const password = document.querySelector('#password')
  455. const uuid = document.querySelector('#uuid')
  456. const logger = document.querySelector('#logger')
  457. const networkStatus = document.querySelector('#section.local-ip')
  458. const startStopVpn = document.querySelector('#start-stop')
  459. const stateStatus = document.querySelector('#state')
  460. const loggerModal = new bootstrap.Modal(document.querySelector('#loggerModal'))
  461. const checkUserModal = new bootstrap.Modal(document.querySelector('#checkUserModal'))
  462. const errorModal = new bootstrap.Modal(document.querySelector('#errorModal'))
  463. const configModal = new bootstrap.Modal(document.querySelector('#configModal'))
  464. const ToolsModal = new bootstrap.Modal(document.querySelector('#ToolsModal'))
  465. const clearLogger = document.querySelector('.clear-logger')
  466. const RenovarModal = new bootstrap.Modal(document.querySelector('#RenovarModal'))
  467. configArea.addEventListener('click', e => showConfigsModal())
  468. username.addEventListener('input', e => DtUsername.set(e.target.value))
  469. password.addEventListener('input', e => DtPassword.set(e.target.value))
  470. uuid.addEventListener('input', e => DtUuid.set(e.target.value))
  471. logger.addEventListener('click', e => loggerModal.show())
  472. startStopVpn.addEventListener('click', (e) => {
  473. if (DtGetVpnState.execute() != 'DISCONNECTED') {
  474. DtExecuteVpnStop.execute()
  475. } else {
  476. DtExecuteVpnStart.execute()
  477. }
  478. })
  479. clearLogger.addEventListener('click', () => DtClearLogs.execute())
  480. RenovarModal._element.addEventListener('shown.bs.modal', () => {
  481. const iframe = document.querySelector('#RenovarFrame');
  482. if (!iframe.src) {
  483. iframe.src = 'https://painel.plenonet.com.br/renovar.php'
  484. iframe.addEventListener('load', () => {
  485. mp3Modal._element.querySelector('.spinner').classList.add('d-none')
  486. })
  487. }
  488. })
  489. RenovarModal._element.addEventListener('hide.bs.modal', () => {
  490. const iframe = document.querySelector('#RenovarFrame');
  491. iframe.src = '';
  492. })
  493. Object.defineProperty(String.prototype, 't', {
  494. value: function t() {
  495. return window?.DtTranslateText?.execute('' + this) ?? '' + this
  496. },
  497. writable: true,
  498. configurable: true,
  499. })
  500. const dtConfigClickListener = () => {
  501. const data = JSON.parse(window?.DtGetDefaultConfig?.execute() || `{ "auth": {}, "mode": "v2ray" }`)
  502. const isV2ray = data?.mode?.toLowerCase()?.startsWith('v2ray');
  503. config.placeholder = data.name ?? 'LBL_CHOOSE_CONFIG'.t()
  504. username.parentElement.style.display = !data?.auth?.username && !isV2ray ? 'flex' : 'none';
  505. password.parentElement.style.display = !data?.auth?.password && !isV2ray ? 'flex' : 'none';
  506. uuid.parentElement.style.display = !data?.auth?.v2ray_uuid && isV2ray ? 'flex' : 'none';
  507. }
  508. const dtVpnStateListener = state => {
  509. const isRunning = state != 'DISCONNECTED';
  510. stateStatus.innerHTML = ('LBL_STATE_' + state).t()
  511. startStopVpn.innerHTML = isRunning ? 'LBL_BTN_STOP'.t() : 'LBL_BTN_START'.t()
  512. if (isRunning) {
  513. username.setAttribute('readonly', 'true')
  514. password.setAttribute('readonly', 'true')
  515. } else {
  516. username.removeAttribute('readonly')
  517. password.removeAttribute('readonly')
  518. }
  519. if (state == 'CONNECTING') dtShowSuccessToastListener('Conectando...')
  520. }
  521. const dtCheckUserStartedListener = () => {
  522. const data = JSON.parse(window?.DtGetDefaultConfig?.execute() || `{}`)
  523. const isV2ray = data?.mode?.toLowerCase()?.startsWith('v2ray');
  524. if (isV2ray) return;
  525. const html = `
  526. <div class="d-flex justify-content-center">
  527. <div class="spinner-border p-5" role="status">
  528. <span class="visually-hidden">Loading...</span>
  529. </div>
  530. </div>
  531. `
  532. checkUserModal._element.querySelector('.chk-title').textContent = 'CHECK USER'
  533. checkUserModal._element.querySelector('.chk-message').innerHTML = html;
  534. checkUserModal.show()
  535. }
  536. const dtCheckUserModelListener = model => {
  537. const data = JSON.parse(model ?? `{"username": "test"}`)
  538. const html = `
  539. <div class="d-flex flex-column text-white">
  540. <span>👤Nome de usuario: ${data.username}</span>
  541. <span>📆Expira em: ${data.expiration_date}</span>
  542. <span>📆Dias restantes: ${data.expiration_days}</span>
  543. <span>🚫Conexoes: ${data.count_connections}|${data.limit_connections}</span>
  544. </div>
  545. `
  546. checkUserModal._element.querySelector('.chk-title').textContent = '📆 Olá, ' + data.username.toUpperCase() + '👤'
  547. checkUserModal._element.querySelector('.chk-message').innerHTML = html;
  548. checkUserModal.show()
  549. }
  550. const dtMessageErrorListener = message => {
  551. const data = JSON.parse(message)
  552. errorModal._element.querySelector('.err-title').textContent = data.title;
  553. errorModal._element.querySelector('.err-message').innerHTML = data.content;
  554. errorModal.show()
  555. }
  556. const dtOnNewLogListener = () => {
  557. const mock = [];
  558. for (let i = 0; i < 30; i++) {
  559. mock.push({ 'TIME': 'MESSAGE ' + i })
  560. }
  561. const log = window?.DtGetLogs?.execute() || JSON.stringify(mock)
  562. const data = JSON.parse(log)
  563. let content = '';
  564. data.forEach(item => {
  565. content += '<li class="list-group-item fs-6 bg-transparent text-white p-0 border-0 text-start ms-2 text-wrap">';
  566. content += Object.keys(item)[0] + " " + item[Object.keys(item)]
  567. content += '</li>';
  568. })
  569. loggerModal._element.querySelector('.logger-content').innerHTML = content;
  570. const listGroup = loggerModal._element.querySelector('.list-group')
  571. listGroup.scrollTo(0, listGroup.scrollHeight)
  572. }
  573. const dtVpnStartedSuccessListener = () => dtShowSuccessToastListener('Conectado com sucesso')
  574. const dtVpnStoppedSuccessListener = () => dtShowSuccessToastListener('Desconectado com sucesso')
  575. const dtShowSuccessToastListener = text => {
  576. Toastify({
  577. text: text,
  578. close: true,
  579. style: {
  580. background: 'linear-gradient(to right, #00b09b, #96c93d)',
  581. marginTop: '35px',
  582. }
  583. }).showToast()
  584. }
  585. const dtShowErrorToastListener = text => {
  586. Toastify({
  587. text: text,
  588. close: true,
  589. style: {
  590. background: 'linear-gradient(to right, #ff5c33, #e69900)',
  591. marginTop: '35px',
  592. }
  593. }).showToast()
  594. }
  595. const showConfigsModal = () => {
  596. const mock = '[{"sorter":6,"color":"#6D08041C","name":"CONFIG","id":1393,"items":[{"mode":"V2RAY - VLESS","sorter":4,"tlsVersion":"TLSv1.2","name":"CONFIG 01","icon":"https://cdn-icons-png.flaticon.com/512/8187/8187143.png","id":11803,"status":"ACTIVE"},{"mode":"SSH_DIRECT","sorter":2,"tlsVersion":"TLSv1.2","name":"CONFIG 02","icon":"https://cdn-icons-png.flaticon.com/512/8187/8187143.png","id":28627,"status":"ACTIVE"},{"mode":"OVPN_PROXY","sorter":23,"tlsVersion":"TLSv1.2","name":"CONFIG 03","icon":"https://cdn-icons-png.flaticon.com/512/8187/8187143.png","id":30001,"status":"ACTIVE"}]},{"sorter":2,"color":"#6D08041C","name":"CONFIG 2","id":1846,"items":[{"mode":"SSH_PROXY","sorter":1,"tlsVersion":"TLSv1.2","name":"CONFIG 01","icon":"https://cdn-icons-png.flaticon.com/512/8187/8187143.png","id":26295,"status":"ACTIVE"}]},{"sorter":4,"color":"#80000000","name":"CONFIG 3","id":3310,"items":[{"mode":"SSH_PROXY","sorter":1,"tlsVersion":"TLSv1.2","name":"CONFIG. TEST","icon":"https://cdn-icons-png.flaticon.com/512/8187/8187143.png","id":29997,"status":"ACTIVE"},{"mode":"OVPN_PROXY","sorter":1,"tlsVersion":"TLSv1.2","name":"CONFIG. TEST 2","icon":"https://cdn-icons-png.flaticon.com/512/8187/8187143.png","id":29998,"status":"ACTIVE"}]}]'
  597. const data = JSON.parse(window?.DtGetConfigs?.execute() || mock)
  598. data.sort((a, b) => a.sorter - b.sorter)
  599. data.forEach(item => item.items.sort((a, b) => a.sorter - b.sorter))
  600. const body = configModal._element.querySelector('.config-body')
  601. body.innerHTML = ''
  602. data.forEach(category => {
  603. const categoryElement = document.createElement('li')
  604. categoryElement.classList.add('list-group-item', 'bg-transparent', 'text-white', 'border-0', 'mb-1', 'rounded-1', 'px-1')
  605. categoryElement.innerHTML = `<span class="fw-bold btn-dark w-100 d-block p-1 rounded-1 mb-1">${category.name}</span>`
  606. const configUlElement = document.createElement('ul')
  607. configUlElement.classList.add('list-group', 'bg-transparent', 'overflow-y-auto')
  608. category.items.forEach(item => {
  609. const configElement = document.createElement('li')
  610. configElement.classList.add('list-group-item', 'd-flex', 'btn-dark', 'text-white', 'border-0', 'rounded-2', 'px-1', 'py-2', 'mb-1')
  611. configElement.innerHTML = `
  612. <img src="${item.icon}" width="40" height="40">
  613. <div class="text-start d-flex flex-column ms-2 w-100 text-truncate">
  614. <span class="fw-bold text-uppercase" style="font-size: 0.8rem;">${item.name}</span>
  615. <span class="fst-italic fw-bold" style="font-size: 0.7rem;">${item.description || ''}</span>
  616. </div>
  617. <div class="d-flex flex-column ms-2">
  618. <span class="fst-italic fw-bold text-end text-uppercase text-nowrap" style="font-size: 0.8rem;">${item.mode}</span>
  619. </div>
  620. </li>
  621. `
  622. configElement.addEventListener('click', e => {
  623. window?.DtSetConfig?.execute(item.id)
  624. configModal.hide()
  625. })
  626. configUlElement.appendChild(configElement)
  627. })
  628. categoryElement.appendChild(configUlElement)
  629. body.appendChild(categoryElement)
  630. })
  631. configModal.show()
  632. }
  633. username.value = window?.DtUsername?.get() ?? ''
  634. password.value = window?.DtPassword?.get() ?? ''
  635. uuid.value = window?.DtUuid?.get() ?? ''
  636. username.placeholder = 'LBL_USERNAME'.t()
  637. password.placeholder = 'LBL_PASSWORD'.t()
  638. uuid.placeholder = 'LBL_UUID'.t()
  639. dtOnNewLogListener()
  640. dtVpnStateListener(window?.DtGetVpnState?.execute() ?? 'DISCONNECTED')
  641. dtConfigClickListener()
  642. console.log('Pleno Layouts!🚀')
  643. </script>
  644. </body>
  645. </html>

comments powered by Disqus