error-log.vue 1.7 KB
Newer Older
M
MicroMilo 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
<template>
    <view class="uni-table">
        <uni-table border stripe>
            <uni-tr>
                <uni-th align="center">错误信息</uni-th>
                <uni-th width="100" align="center">路由</uni-th>
                <uni-th width="100" align="center">时间</uni-th>
                <uni-th width="100" align="center">搜索</uni-th>
            </uni-tr>
            <uni-tr v-for="(log,index) in logs" :key="index">
                <uni-td>
                    <text class="err-msg">Error in {{log.info}}: `{{log.err}}`</text>
                </uni-td>
                <uni-td>
                    <navigator class="err-route" :url="log.route">{{log.route}}</navigator>
                </uni-td>
                <uni-td>
                    <text>{{log.time}}</text>
                </uni-td>
                <uni-td>
                    <!-- #ifdef H5 -->
                    <a v-for="engine in engines" :href="engine.url.replace('ERR_MSG',encodeURIComponent(log.err))"
                        target="_blank" class="err-search">{{engine.name}}</a>
                    <!-- #endif -->
                </uni-td>
            </uni-tr>
        </uni-table>
    </view>
</template>

<script>
    import {
        mapState
    } from 'vuex'
    import config from '@/admin.config.js'
    const debugOptions = config.navBar.debug || {}
    export default {
        data() {
            return {
                engines: debugOptions.engine || []
            };
        },
        computed: {
            ...mapState('error', ['logs'])
        },
        methods: {
            search(engine, log) {

            }
        }
    }
</script>

<style>
    .err-msg {
        color: #FF0000;
    }

    .err-search {
        margin-right: 10px;
    }
</style>