WYB
2021-03-22 91b8cdad021ab052e4991f3d41834a6f0ddc36b8
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<template>
    <div style="margin-top: 30px;">
          <div style="margin: 20px;"> 欢迎来到 捷配仓库后台管理系统!</div>
 
<!-- <el-card class="welcome-card note" style="width: calc(49% - 10px);margin-right: 10px;">
   <div slot="header" class="clearfix">
    <span>操作指南</span>
  </div>
  <div class="text item"><i class="el-icon-edit"></i>、在vue.config.js中配置项目端口号,以及代理后端API项目域名。  </div>
  <div class="text item"><i class="el-icon-edit"></i>、在global.js中配置授权方案global.IS_IDS4。  </div>
  <div class="text item"><i class="el-icon-edit"></i>、动态添加页面以及权限配置,看右侧两个动图。  </div>
  <div class="text item"><i class="el-icon-edit"></i>、更多内容,查看官方文档:<a href="http://vueadmin.neters.club/.doc/" target="_blank">http://vueadmin.neters.club/.doc/</a>。  </div>
</el-card> -->
<el-card class="welcome-card note" style="width: calc(49% - 10px);margin-right: 10px;">
   <div slot="header" class="clearfix">
    <span style="font-size: 16px;">服务器</span>
   </div>
  <div class="text item">环境变量:{{serverInfo.EnvironmentName}}</div>
  <div class="text item">系统架构:{{serverInfo.OSArchitecture}}</div>
  <div class="text item">ContentRootPath:{{serverInfo.ContentRootPath}}</div>
  <div class="text item">WebRootPath:{{serverInfo.WebRootPath}}</div>
  <div class="text item">.NET Core版本:{{serverInfo.FrameworkDescription}}</div>
  <div class="text item">内存占用:{{serverInfo.MemoryFootprint}}</div>
  <div class="text item">启动时间:{{serverInfo.WorkingTime}}</div>
  <div><br ></div>
 
    
</el-card>
 
<el-card class="welcome-card" style="margin-top:20px;width: 98%;">
    <div slot="header" class="clearfix">
        <span>访问日志 <span style="font-size:12px;">(Top 50 desc)</span> </span>
    </div>
<el-table :data="logs" highlight-current-row border
        v-loading="listLoading" 
                  style="width: 100%;font-size: 12px;">
            <el-table-column prop="User" label="访问者" width="150px" sortable>
            </el-table-column>
            <el-table-column prop="IP" label="请求地址" width="150px" >
            </el-table-column>
            <el-table-column prop="BeginTime" label="请求时间" width="150px" >
            </el-table-column>
            <el-table-column prop="API" label="访问接口" width="" >
            </el-table-column>
            <el-table-column prop="RequestMethod" label="Method" width="100px" >
            </el-table-column>
            <el-table-column prop="OPTime" label="响应时长" width="100px" >
            </el-table-column>
            <el-table-column prop="RequestData" label="参数" width="" >
            </el-table-column>
            <el-table-column prop="Agent" label="Agent" width="80" show-overflow-tooltip>
                <template scope="scope">
                    <div style="text-decoration:underline;cursor:pointer;">
                        {{ scope.row.Agent}}
                    </div>
                </template>
            </el-table-column>
          
        </el-table>
 
 
    <br>
</el-card>
 
    </div>
</template>
 
<script>
    import applicationUserManager from "../Auth/applicationusermanager";
    import {getServerInfo,getAccessLogs} from '../api/api';
  
  export default {
        name: "Welcome",
         data() {
            return {
                listLoading: false,
                logs: [],
                serverInfo:{}
            }
        },
        mounted() {
            var curTime = new Date()
            if(window.localStorage.TokenExpire){
                var expiretime = new Date(Date.parse(window.localStorage.TokenExpire))
                if(curTime>=expiretime){
                    if (global.IS_IDS4) {
                        applicationUserManager.login();
                    } else {
                        this.$router.push('/login');
                    }
                }
            }else {
                if (global.IS_IDS4) {
                    applicationUserManager.login();
                } else {
                    this.$router.push('/login');
                }
            }
 
            getServerInfo({}).then((res) => {
                this.serverInfo = res.data.response;
            });
 
               getAccessLogs({}).then((res) => {
                    this.logs = res.data.response;
                    this.listLoading = false;
                    //NProgress.done();
                });
 
        },
    }
</script>
 
<style scoped>
.note .text {
    font-size: 14px;
  }
 
 .note .item {
    margin-bottom: 18px;
  }
</style>