开发者选项

This commit is contained in:
2023-05-24 16:28:51 +08:00
parent 8813fc118c
commit 1aa08d5db9
3 changed files with 95 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
import {post} from '@config/http.js'
// import store from '../vuex/store'
// 开发者选项
export const getIP = () => post('api/developer/getIP', {})
export const getLogList = () => post('api/developer/getLogList', {})
export const getROSNodeList = () => post('api/developer/getROSNodeList', {})

View File

@@ -14,7 +14,7 @@ export default {
name: 'PreLoad',
mounted () {
setTimeout(() => {
this.$router.replace('/setup')
this.$router.replace('/login')
}, 1000)
}
}

View File

@@ -11,28 +11,113 @@
</div>
</div>
<div class="tabs_content">
<div v-show="tab === '1'" class="tab_pane">首页首页首页首页首页首页首页</div>
<div v-show="tab === '2'" class="tab_pane">动态</div>
<div v-show="tab === '3'" class="tab_pane">项目</div>
<div v-show="tab === '4'" class="tab_pane">项目</div>
<div v-show="tab === '5'" class="tab_pane">项目</div>
<div v-show="tab === '6'" class="tab_pane">其他</div>
<div v-show="tab === '1'" class="tab_pane">{{ result1 }}</div>
<div v-show="tab === '2'" class="tab_pane">{{ result2 }}</div>
<div v-show="tab === '3'" class="tab_pane">{{ result3 }}</div>
<div v-show="tab === '4'" class="tab_pane">{{ result4 }}</div>
<div v-show="tab === '5'" class="tab_pane">{{ result5 }}</div>
<div v-show="tab === '6'" class="tab_pane">{{ result6 }}</div>
</div>
</div>
</div>
</template>
<script>
import { getIP, getLogList, getROSNodeList, temperature, debugInfo, softwareVersion } from '@/config/getData2.js'
export default {
data () {
return {
tabs: [{id: '1', label: '首页'}, {id: '2', label: '动态'}, {id: '3', label: '项目'}, {id: '4', label: '项目'}, {id: '5', label: '项目'}, {id: '6', label: '其他'}],
tab: '1'
tabs: [{id: '1', label: 'ifconfig'}, {id: '2', label: '日志列表'}, {id: '3', label: 'ROS运行列表'}, {id: '4', label: '芯片温度/主频'}, {id: '5', label: '调试信息'}, {id: '6', label: '软/硬件版本'}],
tab: '1',
interTime: this.$store.getters.setTime,
timer: null,
result1: '',
result2: '',
result3: '',
result4: '',
result5: '',
result6: ''
}
},
created () {
this._getIP()
},
methods: {
refresh () {
this.timer = setInterval(() => {
this._getIP()
}, this.interTime)
},
async _getIP () {
let res = await getIP()
if (res.code === '1') {
this.result1 = res.result.result_info
} else {
this.toast(res.desc)
}
},
async _getLogList () {
let res = await getLogList()
if (res.code === '1') {
this.result2 = res.result.result_info
} else {
this.toast(res.desc)
}
},
async _getROSNodeList () {
let res = await getROSNodeList()
if (res.code === '1') {
this.result3 = res.result.result_info
} else {
this.toast(res.desc)
}
},
async _temperature () {
let res = await temperature()
if (res.code === '1') {
this.result4 = res.result.result_info
} else {
this.toast(res.desc)
}
},
async _debugInfo () {
let res = await debugInfo()
if (res.code === '1') {
this.result5 = res.result.result_info
} else {
this.toast(res.desc)
}
},
async _softwareVersion () {
let res = await softwareVersion()
if (res.code === '1') {
this.result6 = res.result.result_info
} else {
this.toast(res.desc)
}
},
changeTab (id) {
this.tab = id
switch (id) {
case '1':
this._getIP()
break
case '2':
this._getLogList()
break
case '3':
this._getROSNodeList()
break
case '4':
this._temperature()
break
case '5':
this._debugInfo()
break
case '6':
this._softwareVersion()
break
}
}
}
}