diff --git a/src/api/monitor/online.js b/src/api/monitor/online.js index bd22137..a6d20ec 100644 --- a/src/api/monitor/online.js +++ b/src/api/monitor/online.js @@ -1,7 +1,7 @@ import request from '@/utils/request' // 查询在线用户列表 -export function list(query) { +export function listOnline(query) { return request({ url: '/monitor/online/list', method: 'get', diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index b21927e..998e9d0 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -15,9 +15,11 @@ const useSocketStore = defineStore('socket', { this.noticeList = data this.noticeDot = data.length > 0 }, - setOnlineUsers(data) { - this.onlineUsers = data - }, + // setOnlineUsers(data) { + // const { onlineNum, users } = data + // this.onlineUsers = users + // this.onlineNum = onlineNum + // }, sendChat(data) { const { proxy } = getCurrentInstance() console.log(data) diff --git a/src/utils/request.js b/src/utils/request.js index 361296c..db6f329 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -75,7 +75,7 @@ service.interceptors.response.use( } }, (error) => { - console.log('err' + error) + console.log('axios err', error) let { message } = error if (message == 'Network Error') { message = '后端接口连接异常' diff --git a/src/utils/signalR.js b/src/utils/signalR.js index db04792..e4cbe60 100644 --- a/src/utils/signalR.js +++ b/src/utils/signalR.js @@ -99,9 +99,9 @@ export default { }) // 接收在线用户 - connection.on('onlineUser', (data) => { - useSocketStore().setOnlineUsers(data) - }) + // connection.on('onlineUser', (data) => { + // useSocketStore().setOnlineUsers(data) + // }) // 接收聊天数据 connection.on('receiveChat', (data) => { diff --git a/src/views/index_v1.vue b/src/views/index_v1.vue index efd7d77..fd040bf 100644 --- a/src/views/index_v1.vue +++ b/src/views/index_v1.vue @@ -27,36 +27,12 @@ - + -
- -
-
-
{{ v.userIP }}({{ v.location }})
-
- 通知 -
-
-
-
-
- - -
@@ -111,10 +87,7 @@ import BarChart from './dashboard/BarChart' // import WordCloudChat from './dashboard/WordCloud.vue' import CommonMenu from './components/CommonMenu' -import dayjs from 'dayjs' - import useUserStore from '@/store/modules/user' -import useSocketStore from '@/store/modules/socket' const showEdit = ref(false) const data = { newVisitis: { @@ -132,57 +105,7 @@ const data = { shoppings: { expectedData: [130, 140, 141, 142, 145, 150, 160], actualData: [120, 82, 91, 154, 162, 140, 130] - }, - wordCloud: [ - { - name: 'Vue3', - value: 144 - }, - { - name: '.net6', - value: 928 - }, - { - name: 'Sqlsugar', - value: 906 - }, - { - name: 'Redis', - value: 825 - }, - { - name: '代码生成', - value: 514 - }, - { - name: '开源免费', - value: 486 - }, - { - name: '代码简单', - value: 53 - }, - { - name: '打赏', - value: 163 - }, - { - name: '国际化', - value: 163 - }, - { - name: 'Composition api', - value: 1163 - }, - { - name: 'Quartz.Net', - value: 190 - }, - { - name: 'Element UI', - value: 190 - } - ] + } } const { proxy } = getCurrentInstance() const userInfo = computed(() => { @@ -191,9 +114,6 @@ const userInfo = computed(() => { const currentTime = computed(() => { return proxy.parseTime(new Date()) }) -const onlineUsers = computed(() => { - return useSocketStore().onlineUsers -}) let lineChartData = reactive([]) const dataType = ref(null) @@ -202,22 +122,7 @@ function handleSetLineChartData(type) { lineChartData = data[type] } handleSetLineChartData('newVisitis') -function onOpenGitee() {} -function onChat(item) { - proxy - .$prompt('请输入通知内容', '', { - confirmButtonText: '发送', - cancelButtonText: '取消', - inputPattern: /\S/, - inputErrorMessage: '消息内容不能为空' - }) - .then(({ value }) => { - proxy.signalr.SR.invoke('SendMessage', item.connnectionId, item.name, value).catch(function (err) { - console.error(err.toString()) - }) - }) - .catch(() => {}) -} + function handleAdd() { proxy.$modal.msg('请通过搜索添加') } @@ -256,32 +161,6 @@ function handleAdd() { .info { height: 200px; // overflow-y: scroll; - - .info-item { - display: flex; - font-size: 13px; - color: gray; - height: 28px; - line-height: 28px; - - &:hover { - color: var(--color-primary); - cursor: pointer; - } - .info-item-left { - flex: 1; - flex-shrink: 0; - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; - margin-right: 10px; - } - .info-item-right { - width: 140px; - text-align: right; - padding-right: 10px; - } - } } } .chart-wrapper { diff --git a/src/views/monitor/onlineuser/index.vue b/src/views/monitor/onlineuser/index.vue new file mode 100644 index 0000000..9465ef4 --- /dev/null +++ b/src/views/monitor/onlineuser/index.vue @@ -0,0 +1,95 @@ + + +