Quellcode durchsuchen

fix(full link): device online status

Casper Dai vor 3 Jahren
Ursprung
Commit
e9730882ce

+ 3 - 4
src/components/service/FullLink/index.vue

@@ -124,10 +124,6 @@ export default {
       type: Object,
       required: true
     },
-    online: {
-      type: [Boolean, String],
-      default: false
-    },
     theme: {
       type: String,
       default: 'dark'
@@ -146,6 +142,9 @@ export default {
     }
   },
   computed: {
+    online () {
+      return this.device.onlineStatus === 1
+    },
     targetId () {
       return this.device.id
     },

+ 0 - 6
src/views/dashboard/v0/LinkState.vue

@@ -13,7 +13,6 @@
         ref="link"
         class="l-flex__fill"
         :device="device"
-        :online="online"
         theme="light"
       />
     </div>
@@ -33,11 +32,6 @@ export default {
       type: Object,
       required: true
     }
-  },
-  computed: {
-    online () {
-      return this.device.activate === 2 && this.device.onlineStatus === 1
-    }
   }
 }
 </script>

+ 0 - 5
src/views/device/detail/components/DeviceExternal/index.vue

@@ -1,7 +1,6 @@
 <template>
   <full-link
     :device="device"
-    :online="online"
     @click="onClick"
   >
     <el-dialog
@@ -41,10 +40,6 @@ export default {
     device: {
       type: Object,
       required: true
-    },
-    online: {
-      type: [Boolean, String],
-      default: false
     }
   },
   data () {

+ 1 - 0
src/views/device/detail/index.vue

@@ -195,6 +195,7 @@ export default {
     onUpdate (online) {
       this.isActivated = true
       this.isOnline = online
+      this.device.onlineStatus = online ? 1 : 2
       if (!this.isOnline) {
         ScreenshotCache.remove(this.deviceId)
       }