tunnel.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * Copyright (c) 2018-2025, lengleng All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the pig4cloud.com developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: lengleng (wangiegie@gmail.com)
  16. */
  17. import request from '@/router/axios'
  18. export function fetchList(query) {
  19. return request({
  20. url: '/da/tunnel/page',
  21. method: 'get',
  22. params: query
  23. })
  24. }
  25. export function addObj(obj) {
  26. return request({
  27. url: '/da/tunnel',
  28. method: 'post',
  29. data: obj
  30. })
  31. }
  32. export function getObj(id) {
  33. return request({
  34. url: '/da/tunnel/' + id,
  35. method: 'get'
  36. })
  37. }
  38. export function delObj(id) {
  39. return request({
  40. url: '/da/tunnel/' + id,
  41. method: 'delete'
  42. })
  43. }
  44. export function putObj(obj) {
  45. return request({
  46. url: '/da/tunnel',
  47. method: 'put',
  48. data: obj
  49. })
  50. }
  51. export function tunnelById(stationCode,tunnelId) {
  52. return request({
  53. url: '/da/tunnel/tunnelId/'+stationCode+'/'+tunnelId,
  54. method: 'get'
  55. })
  56. }
  57. export function tunnelStation(stationCode) {
  58. return request({
  59. url: '/da/tunnel/station/'+stationCode,
  60. method: 'get'
  61. })
  62. }
  63. export function tunnelTyps() {
  64. return request({
  65. url: '/da/tunnel/tunnelType',
  66. method: 'get'
  67. })
  68. }
  69. export function tunnelState(obj) {
  70. return request({
  71. url: '/da/tunnel/link/status',
  72. method: 'post',
  73. data: obj
  74. })
  75. }
  76. export function tunnelFindInstation(stations) {
  77. return request({
  78. url: '/da/tunnel/findInStation',
  79. method: 'post',
  80. data: stations
  81. })
  82. }
  83. export function tunnelConnect(tunnel) {
  84. return request({
  85. url: '/da/tunnel/connect',
  86. method: 'post',
  87. data: tunnel
  88. })
  89. }
  90. export function tunnelDisconnect(tunnel) {
  91. return request({
  92. url: '/da/tunnel/disConnect',
  93. method: 'post',
  94. data: tunnel
  95. })
  96. }
  97. export function tunnelReconnect(tunnel) {
  98. return request({
  99. url: '/da/tunnel/reConnect',
  100. method: 'post',
  101. data: tunnel
  102. })
  103. }
  104. export function getThreadCount() {
  105. return request({
  106. url: '/da/tunnel/getThreadCount',
  107. method: 'get'
  108. })
  109. }