index.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <div style="margin-top: 80px;">
  3. <template v-if="classic && !physical">
  4. <wire-topology
  5. v-for="(wire, idx) in wires"
  6. :key="idx"
  7. :idx="idx"
  8. :len="wires && wires.length"
  9. :vpc="vpc"
  10. :dataSource="wire"
  11. :wires="wires" />
  12. </template>
  13. <template v-if="classic && physical">
  14. <vpc-topology
  15. :physical="physical"
  16. :classic="classic"
  17. :dataSource="dataSource" />
  18. </template>
  19. <template v-if="!classic">
  20. <vpc-topology :dataSource="dataSource" />
  21. </template>
  22. </div>
  23. </template>
  24. <script>
  25. import VpcTopology from './Vpc'
  26. import WireTopology from './Wire'
  27. export default {
  28. name: 'ResTopology',
  29. components: {
  30. VpcTopology,
  31. WireTopology,
  32. },
  33. props: {
  34. classic: Boolean,
  35. physical: Boolean,
  36. dataSource: Object,
  37. },
  38. data () {
  39. return {}
  40. },
  41. computed: {
  42. vpc () {
  43. const { name, status } = this.dataSource
  44. return { name, status }
  45. },
  46. wires () {
  47. return this.dataSource?.wires || []
  48. },
  49. },
  50. }
  51. </script>
  52. <style lang="scss">
  53. @import "@Network/sections/Topology/index.scss";
  54. </style>