My SMM panel
 
 
 
 
 
 

101 satır
3.1 KiB

  1. <template>
  2. <sidebar :active="active"></sidebar>
  3. <transition name="fade" mode="out-in">
  4. <div v-if="active === ''" id="main">
  5. <section class="welcome-pane"><h3>Welcome, {{user.name}}!</h3></section>
  6. <section class="credits-pane"><img src="../../images/wallet2.svg" alt="wallet" class="icon"/><p>Credits: ${{user.credits}}</p></section>
  7. <section class="alerts-pane"><h4>News and Announcements</h4>
  8. <p>We've just launched. Thanks for joining us.</p>
  9. </section>
  10. <section class="recent-pane"><h4>Recent Activity</h4>
  11. <table>
  12. <thead><th>Date</th><th>Name</th><th>Status</th> <th>Quantity</th></thead>
  13. <tbody>
  14. <tr v-bind:key='order.id' v-for='order in orders.slice(0, 10)'>
  15. <template v-if="order.status != 'pending'">
  16. <td>{{order.updated_at}}</td>
  17. <td>{{order.service.name}}</td>
  18. <td :class="order.status"
  19. class="status"><span>{{order.status.charAt(0).toUpperCase() +
  20. order.status.slice(1)}}</span></td>
  21. <td>{{order.quantity}}</td>
  22. </template>
  23. </tr>
  24. </tbody>
  25. </table>
  26. </section>
  27. </div>
  28. <div v-else-if="active === '#orders'" id="main">
  29. <div class="actions"><a class="new-order" href="#orders/new">New</a></div>
  30. <section class="pending-pane">
  31. <h4>Pending Orders</h4>
  32. <ul>
  33. <template v-bind:key='order.id' v-for="order in orders">
  34. <div class="pending-item" v-if="order.status == 'pending'">
  35. <div class="pending-heading">
  36. <li @click="togglePending($event)">{{order.service.name}} ({{order.updated_at}})</li>
  37. <img class="chevron" src="../../images/chevron-down.svg" alt="">
  38. </div>
  39. <div class="pending-content">
  40. <p>ID: {{order.id}}<br>URL: {{order.url}}<br>Quantity: {{order.quantity}}<br>Note: {{order.note}}</p>
  41. </div>
  42. </div>
  43. </template>
  44. </ul>
  45. </section>
  46. <section class="history-pane">
  47. <h4>Order History</h4>
  48. <table>
  49. <thead><th>Date</th><th>ID</th><th>Name</th><th>Status</th> <th>Quantity</th></thead>
  50. <tbody>
  51. <tr @click="toggleOrderItem($event)" v-bind:key='order.id' v-for='order in orders.slice(0, 10)'>
  52. <td>{{order.updated_at}}</td>
  53. <td>{{order.id}}</td>
  54. <td>{{order.service.name}}</td>
  55. <td :class="order.status"
  56. class="status"><span>{{order.status.charAt(0).toUpperCase() +
  57. order.status.slice(1)}}</span></td>
  58. <td>{{order.quantity}}</td>
  59. </tr>
  60. </tbody>
  61. </table>
  62. <img class="nav-btn" src="../../images/arrow-left-circle-fill.svg" alt="">
  63. <img class="nav-btn" src="../../images/arrow-right-circle-fill.svg" alt="">
  64. </section>
  65. </div>
  66. <div id="main" v-else-if="active === '#exit'">
  67. <section class="logout-pane">
  68. <h3>Are you sure you want to logout?</h3>
  69. <a href="/logout">Logout</a>
  70. </section>
  71. </div>
  72. </transition>
  73. </template>
  74. <script>
  75. import Sidebar from './sidebar.vue'
  76. function togglePending(event) {
  77. event.target.parentNode.parentNode.classList.toggle('selected')
  78. }
  79. function toggleOrderItem(event) {
  80. event.target.parentNode.parentNode.classList.toggle('selected')
  81. }
  82. function logout(event) {
  83. event.target.parentNode.parentNode.classList.toggle('selected')
  84. }
  85. export default {
  86. components: {
  87. Sidebar,
  88. },
  89. data() {
  90. return {active: window.location.hash, user: '',
  91. token: '', orders: ''}
  92. },
  93. methods: {togglePending, toggleOrderItem}
  94. }
  95. </script>