My SMM panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

71 line
2.0 KiB

  1. <template>
  2. <div>
  3. <section class="pending-pane">
  4. <div class="actions"><a class="new-order" href="#new-order">New</a><a class="new-order" href="#credits">Add Credits</a></div>
  5. <h4>Pending Orders</h4>
  6. <ul>
  7. <template v-bind:key='order.id' v-for="order in orders">
  8. <div class="pending-item" v-if="order.status == 'pending'">
  9. <div class="pending-heading">
  10. <li @click="togglePending($event)">{{order.service.name}} ({{order.updated_at}})</li>
  11. <img class="chevron" src="../../images/chevron-down.svg" alt="">
  12. </div>
  13. <div class="pending-content">
  14. <p>ID: {{order.id}}<br>URL: {{order.url}}<br>Quantity: {{order.quantity}}<br>Note: {{order.note}}</p>
  15. </div>
  16. </div>
  17. </template>
  18. </ul>
  19. </section>
  20. <section class="history-pane">
  21. <h4>Order History</h4>
  22. <table>
  23. <thead><th>Date</th><th>ID</th><th>Name</th><th>Status</th> <th>Quantity</th></thead>
  24. <tbody>
  25. <tr v-bind:key='order.id' v-for='order in orders.slice(historyPage*10-10, historyPage*10)'>
  26. <td>{{order.updated_at}}</td>
  27. <td>{{order.id}}</td>
  28. <td>{{order.service.name}}</td>
  29. <td :class="order.status"
  30. class="status"><span>{{order.status.charAt(0).toUpperCase() +
  31. order.status.slice(1)}}</span></td>
  32. <td>{{order.quantity}}</td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. <img @click="moveHistory(false)" class="nav-btn left" src="../../images/arrow-left-circle-fill.svg" alt=""/>
  37. <p class="nav-legend">{{historyPage}}/{{Math.ceil(orders.length/10)}}</p>
  38. <img @click="moveHistory(true)" class="nav-btn right" src="../../images/arrow-right-circle-fill.svg" alt=""/>
  39. </section>
  40. </div>
  41. </template>
  42. <script>
  43. function togglePending(event) {
  44. event.target.parentNode.parentNode.classList.toggle('selected')
  45. }
  46. function moveHistory(forward) {
  47. if (forward) {
  48. this.historyPage += 1
  49. } else {
  50. this.historyPage -= 1
  51. }
  52. if (this.historyPage < 1) {
  53. this.historyPage = 1
  54. return
  55. } else if (this.historyPage > this.orders.length/10+1) {
  56. this.historyPage -= 1
  57. return
  58. }
  59. }
  60. export default {
  61. data() {return {historyPage: 1}},
  62. methods: {
  63. togglePending, moveHistory
  64. },
  65. props: ['orders']
  66. }
  67. </script>