Quellcode durchsuchen

1.增加表实体定义

2.前端表格展示
tags/v1.0.0
SmallChi vor 6 Jahren
Ursprung
Commit
2c094dabc6
36 geänderte Dateien mit 588 neuen und 392 gelöschten Zeilen
  1. +0
    -6
      api/README.md
  2. +6
    -0
      src/JT808.DotNetty.Dashbord.UI/README.md
  3. +7
    -7
      src/JT808.DotNetty.Dashbord.UI/src/locale/index.js
  4. +0
    -10
      src/JT808.DotNetty.Dashbord.UI/src/locale/lang/en-US.js
  5. +8
    -10
      src/JT808.DotNetty.Dashbord.UI/src/locale/lang/zh-CN.js
  6. +0
    -9
      src/JT808.DotNetty.Dashbord.UI/src/locale/lang/zh-TW.js
  7. +1
    -1
      src/JT808.DotNetty.Dashbord.UI/src/mock/session.js
  8. +0
    -2
      src/JT808.DotNetty.Dashbord.UI/src/mock/sourcePackage.js
  9. +16
    -3
      src/JT808.DotNetty.Dashbord.UI/src/mock/transmit.js
  10. +9
    -10
      src/JT808.DotNetty.Dashbord.UI/src/router/routers.js
  11. +0
    -121
      src/JT808.DotNetty.Dashbord.UI/src/view/directive/directive.vue
  12. +68
    -12
      src/JT808.DotNetty.Dashbord.UI/src/view/session/session.vue
  13. +0
    -114
      src/JT808.DotNetty.Dashbord.UI/src/view/single-page/home/example.vue
  14. +9
    -31
      src/JT808.DotNetty.Dashbord.UI/src/view/single-page/home/home.vue
  15. +75
    -12
      src/JT808.DotNetty.Dashbord.UI/src/view/sourcepackage/sourcepackage.vue
  16. +67
    -14
      src/JT808.DotNetty.Dashbord.UI/src/view/transmit/transmit.vue
  17. +1
    -1
      src/JT808.DotNetty.Dashbord/Controllers/JT808AtomicCounterController.cs
  18. +2
    -4
      src/JT808.DotNetty.Dashbord/Controllers/JT808SessionController.cs
  19. +0
    -4
      src/JT808.DotNetty.Dashbord/Dtos/JT808SessionInfoDto.cs
  20. +1
    -5
      src/JT808.DotNetty.Dashbord/Dtos/JT808SourcePackageChannelInfoDto.cs
  21. +15
    -0
      src/JT808.DotNetty.Dashbord/Enums/JT808UnificationSendType.cs
  22. +0
    -2
      src/JT808.DotNetty.Dashbord/Internal/IJT808DotNettyWebApi.cs
  23. +6
    -1
      src/JT808.DotNetty.Dashbord/JT808.DotNetty.Dashbord.csproj
  24. +26
    -0
      src/JT808.DotNetty.Dashbord/Models/JT808_AtomicCounter.cs
  25. +35
    -0
      src/JT808.DotNetty.Dashbord/Models/JT808_Session.cs
  26. +30
    -0
      src/JT808.DotNetty.Dashbord/Models/JT808_SessionLog.cs
  27. +31
    -0
      src/JT808.DotNetty.Dashbord/Models/JT808_SourcePackage.cs
  28. +29
    -0
      src/JT808.DotNetty.Dashbord/Models/JT808_SourcePackageLog.cs
  29. +31
    -0
      src/JT808.DotNetty.Dashbord/Models/JT808_Transmit.cs
  30. +29
    -0
      src/JT808.DotNetty.Dashbord/Models/JT808_TransmitLog.cs
  31. +36
    -0
      src/JT808.DotNetty.Dashbord/Models/JT808_UnificationSend.cs
  32. +48
    -0
      src/JT808.DotNetty.Dashbord/Providers/JT808DbContext.cs
  33. +2
    -1
      src/JT808.DotNetty.Dashbord/Startup.cs
  34. +0
    -3
      src/JT808.DotNetty/Codecs/JT808ClientDecoder.cs
  35. +0
    -4
      src/JT808.DotNetty/Dtos/JT808SessionInfoDto.cs
  36. +0
    -5
      src/JT808.DotNetty/Internal/JT808SessionServiceDefaultImpl.cs

+ 0
- 6
api/README.md Datei anzeigen

@@ -72,7 +72,6 @@
| LastActiveTime| DateTime| 最后上线时间|
| StartTime| DateTime| 上线时间|
| TerminalPhoneNo|string| 终端手机号|
| WebApiPort| string| WebApi端口号|
| RemoteAddressIP| string| 远程ip地址|

#### 1.获取会话集合
@@ -99,14 +98,12 @@
"LastActiveTime":"2018-11-27 20:00:00",
"StartTime":"2018-11-25 20:00:00",
"TerminalPhoneNo":"123456789012",
"WebApiPort":828,
"RemoteAddressIP":"127.0.0.1:11808"
},{
"ChannelId":"eadad23",
"LastActiveTime":"2018-11-27 20:00:00",
"StartTime":"2018-11-25 20:00:00",
"TerminalPhoneNo":"123456789013",
"WebApiPort":828,
"RemoteAddressIP":"127.0.0.1:11808"
}
]
@@ -240,7 +237,6 @@
|属性|数据类型|参数说明|
|------|:------:|:------|
| RemoteAddress| string | 远程ip地址|
| LocalAddress| string | 本地ip地址|
| Registered| bool | 通道是否注册|
| Active| bool | 通道是否激活|
| Open| bool | 通道是否打开|
@@ -254,13 +250,11 @@
"Data":[
{
"RemoteAddress":"127.0.0.1:6665",
"LocalAddress":"127.0.0.1:6664",
"Registered":true,
"Active":true,
"Open":true
},{
"RemoteAddress":"127.0.0.1:6667",
"LocalAddress":"127.0.0.1:6666",
"Registered":true,
"Active":true,
"Open":true


+ 6
- 0
src/JT808.DotNetty.Dashbord.UI/README.md Datei anzeigen

@@ -1,14 +1,20 @@
# Install

```bush
// install dependencies
npm install
```

## Run

### Development

```bush
npm run dev
```

### Production(Build)

```bush
npm run build
```

+ 7
- 7
src/JT808.DotNetty.Dashbord.UI/src/locale/index.js Datei anzeigen

@@ -2,11 +2,11 @@ import Vue from 'vue'
import VueI18n from 'vue-i18n'
import { localRead } from '@/libs/util'
import customZhCn from './lang/zh-CN'
import customZhTw from './lang/zh-TW'
import customEnUs from './lang/en-US'
// import customZhTw from './lang/zh-TW'
// import customEnUs from './lang/en-US'
import zhCnLocale from 'iview/src/locale/lang/zh-CN'
import enUsLocale from 'iview/src/locale/lang/en-US'
import zhTwLocale from 'iview/src/locale/lang/zh-TW'
// import enUsLocale from 'iview/src/locale/lang/en-US'
// import zhTwLocale from 'iview/src/locale/lang/zh-TW'

Vue.use(VueI18n)

@@ -20,9 +20,9 @@ Vue.config.lang = lang
// vue-i18n 6.x+写法
Vue.locale = () => {}
const messages = {
'zh-CN': Object.assign(zhCnLocale, customZhCn),
'zh-TW': Object.assign(zhTwLocale, customZhTw),
'en-US': Object.assign(enUsLocale, customEnUs)
'zh-CN': Object.assign(zhCnLocale, customZhCn)
// 'zh-TW': Object.assign(zhTwLocale, customZhTw),
// 'en-US': Object.assign(enUsLocale, customEnUs)
}
const i18n = new VueI18n({
locale: lang,


+ 0
- 10
src/JT808.DotNetty.Dashbord.UI/src/locale/lang/en-US.js Datei anzeigen

@@ -10,18 +10,8 @@ export default {
img_cropper_page: 'Image-editor',
update: 'Update',
doc: 'Document',
join_page: 'QQ Group',
update_table_page: 'Update .CSV',
update_paste_page: 'Paste Table Data',
multilevel: 'multilevel',
directive_page: 'Directive',
level_1: 'Level-1',
level_2: 'Level-2',
level_2_1: 'Level-2-1',
level_2_3: 'Level-2-3',
level_2_2: 'Level-2-2',
level_2_2_1: 'Level-2-2-1',
level_2_2_2: 'Level-2-2-2',
excel: 'Excel',
'upload-excel': 'Upload Excel',
'export-excel': 'Export Excel',


+ 8
- 10
src/JT808.DotNetty.Dashbord.UI/src/locale/lang/zh-CN.js Datei anzeigen

@@ -9,19 +9,10 @@ export default {
icons_page: '自定义图标',
img_cropper_page: '图片编辑器',
update: '上传数据',
join_page: 'QQ群',
doc: '文档',
update_table_page: '上传CSV文件',
update_paste_page: '粘贴表格数据',
multilevel: '多级菜单',
directive_page: '指令',
level_1: 'Level-1',
level_2: 'Level-2',
level_2_1: 'Level-2-1',
level_2_3: 'Level-2-3',
level_2_2: 'Level-2-2',
level_2_2_1: 'Level-2-2-1',
level_2_2_2: 'Level-2-2-2',
excel: 'Excel',
'upload-excel': '上传excel',
'export-excel': '导出excel',
@@ -38,5 +29,12 @@ export default {
params: '动态路由',
cropper_page: '图片裁剪',
message_page: '消息中心',
tree_table_page: '树状表格'
tree_table_page: '树状表格',
_session: '会话管理',
_sourcepackage: '原包管理',
_transmit: '转发管理',
session: '会话管理',
sourcepackage: '原包管理',
transmit: '转发管理',
login: '登录'
}

+ 0
- 9
src/JT808.DotNetty.Dashbord.UI/src/locale/lang/zh-TW.js Datei anzeigen

@@ -9,19 +9,10 @@ export default {
icons_page: '自定義圖標',
img_cropper_page: '圖片編輯器',
update: '上傳數據',
join_page: 'QQ群',
doc: '文檔',
update_table_page: '上傳CSV文件',
update_paste_page: '粘貼表格數據',
multilevel: '多级菜单',
directive_page: '指令',
level_1: 'Level-1',
level_2: 'Level-2',
level_2_1: 'Level-2-1',
level_2_3: 'Level-2-3',
level_2_2: 'Level-2-2',
level_2_2_1: 'Level-2-2-1',
level_2_2_2: 'Level-2-2-2',
excel: 'Excel',
'upload-excel': '上傳excel',
'export-excel': '導出excel',


+ 1
- 1
src/JT808.DotNetty.Dashbord.UI/src/mock/session.js Datei anzeigen

@@ -14,7 +14,7 @@ export default {
},
GetAll () {
return setData([{
'ChannelId': 'eadad23',
'ChannelId': 'eadad24',
'LastActiveTime': '2018-11-27 20:00:00',
'StartTime': '2018-11-25 20:00:00',
'TerminalPhoneNo': '123456789012',


+ 0
- 2
src/JT808.DotNetty.Dashbord.UI/src/mock/sourcePackage.js Datei anzeigen

@@ -15,13 +15,11 @@ export default {
GetAll () {
return setData([{
'RemoteAddress': '127.0.0.1:6665',
'LocalAddress': '127.0.0.1:6664',
'Registered': true,
'Active': true,
'Open': true
}, {
'RemoteAddress': '127.0.0.1:6667',
'LocalAddress': '127.0.0.1:6666',
'Registered': true,
'Active': true,
'Open': true


+ 16
- 3
src/JT808.DotNetty.Dashbord.UI/src/mock/transmit.js Datei anzeigen

@@ -13,9 +13,22 @@ export default {
}))
},
GetAll () {
return setData([
'127.0.0.1:6665',
'127.0.0.1:6667'
return setData([{
IP: '127.0.0.1',
Port: 6667
},
{
IP: '127.0.0.1',
Port: 6668
},
{
IP: '127.0.0.1',
Port: 6669
},
{
IP: '127.0.0.1',
Port: 6670
}
])
}
}

+ 9
- 10
src/JT808.DotNetty.Dashbord.UI/src/router/routers.js Datei anzeigen

@@ -1,5 +1,4 @@
import Main from '@/components/main'
import parentView from '@/components/parent-view'

/**
* iview-admin中meta除了原生参数外可配置的参数:
@@ -71,8 +70,8 @@ export default [
]
},
{
path: '/session',
name: 'session',
path: '/_session',
name: '_session',
meta: {
hideInBread: true
},
@@ -80,7 +79,7 @@ export default [
children: [
{
path: '/session',
name: '会话管理',
name: 'session',
meta: {
icon: 'ios-hammer',
title: '会话管理'
@@ -90,8 +89,8 @@ export default [
]
},
{
path: '/sourcepackage',
name: 'sourcePackage',
path: '/_sourcePackage',
name: '_sourcePackage',
meta: {
hideInBread: true
},
@@ -99,7 +98,7 @@ export default [
children: [
{
path: '/sourcepackage',
name: '原包管理',
name: 'sourcepackage',
meta: {
icon: 'ios-hammer',
title: '原包管理',
@@ -110,8 +109,8 @@ export default [
]
},
{
path: '/transmit',
name: 'transmit',
path: '/_transmit',
name: '_transmit',
meta: {
hideInBread: true
},
@@ -119,7 +118,7 @@ export default [
children: [
{
path: '/transmit',
name: '转发管理',
name: 'transmit',
meta: {
icon: 'ios-hammer',
title: '转发管理',


+ 0
- 121
src/JT808.DotNetty.Dashbord.UI/src/view/directive/directive.vue Datei anzeigen

@@ -1,121 +0,0 @@
<template>
<div>
<Row>
<i-col>
<Card>
<Row>
<i-col span="8">
<Button type="primary" @click="showModal">显示可拖动弹窗</Button>
<br/>
<Button v-draggable="buttonOptions" class="draggable-btn">这个按钮也是可以拖动的</Button>
</i-col>
<i-col span="16">
<div class="intro-con">
&lt;Modal v-draggable="options" v-model="visible"&gt;标题&lt;/Modal&gt;
<pre class="code-con">
options = {
trigger: '.ivu-modal-body',
body: '.ivu-modal'
}
</pre>
</div>
</i-col>
</Row>
</Card>
</i-col>
<Modal v-draggable="options" v-model="modalVisible">
拖动这里即可拖动整个弹窗
</Modal>
</Row>
<Row style="margin-top: 10px;">
<i-col>
<Card>
<Row>
<i-col span="8">
<Input style="width: 60%" v-model="inputValue">
<Button slot="append" v-clipboard="clipOptions">copy</Button>
</Input>
</i-col>
<i-col span="16">
<div class="intro-con">
&lt;Input style="width: 60%" v-model="inputValue"&gt;
<br/>
&nbsp;&nbsp;&nbsp;&lt;Button slot="append" v-clipboard="clipOptions"&gt;copy&lt;/Button&gt;
<br/>
&lt;/Input&gt;
<pre class="code-con">
clipOptions: {
value: this.inputValue,
success: (e) => {
this.$Message.success('复制成功')
},
error: () => {
this.$Message.error('复制失败')
}
}
</pre>
</div>
</i-col>
</Row>
</Card>
</i-col>
<Modal v-draggable="options" v-model="modalVisible">
拖动这里即可拖动整个弹窗
</Modal>
</Row>
</div>
</template>

<script>
export default {
name: 'directive_page',
data () {
return {
modalVisible: false,
options: {
trigger: '.ivu-modal-body',
body: '.ivu-modal',
recover: true
},
buttonOptions: {
trigger: '.draggable-btn',
body: '.draggable-btn'
},
statu: 1,
inputValue: '这是输入的内容'
}
},
computed: {
clipOptions () {
return {
value: this.inputValue,
success: (e) => {
this.$Message.success('复制成功')
},
error: () => {
this.$Message.error('复制失败')
}
}
}
},
methods: {
showModal () {
this.modalVisible = true
}
}
}
</script>

<style>
.intro-con{
min-height: 140px;
}
.draggable-btn{
margin-top: 20px;
}
.code-con{
width: 400px;
background: #F9F9F9;
padding-top: 10px;
}
</style>

+ 68
- 12
src/JT808.DotNetty.Dashbord.UI/src/view/session/session.vue Datei anzeigen

@@ -1,34 +1,90 @@
<template>
<div>
{{tmpResult}}
<Card>
{{tmpResult}}
<tables
ref='tables'
searchable
search-place='top'
v-model='tableData'
:columns='columns'
@on-delete='handleDelete'
/>
</Card>
</div>
</template>

<script>
import { mapMutations } from 'vuex'
import { GetAll } from "@/api/session"
import Tables from '_c/tables'
import { GetAll } from '@/api/session'
export default {
name: 'session',
components: {
Tables
},
data () {
return {
tmpResult: null
tmpResult: null,
columns: [
{ title: '通道Id', key: 'ChannelId' },
{ title: '终端设备号', key: 'TerminalPhoneNo' },
{ title: '上线时间', key: 'StartTime' },
{ title: '最后登录时间', key: 'LastActiveTime' },
{ title: 'WebApi端口号', key: 'WebApiPort' },
{ title: '设备远程地址', key: 'RemoteAddressIP' },
{
title: '操作',
key: 'handle',
options: ['delete'],
button: [
(h, params, vm) => {
return h(
'Poptip',
{
props: {
confirm: true,
title: '你确定要删除吗?'
},
on: {
'on-ok': () => {
vm.$emit('on-delete', params)
vm.$emit(
'input',
params.tableData.filter(
(item, index) => index !== params.row.initRowIndex
)
)
}
}
},
[h('Button', '自定义删除')]
)
}
]
}
],
tableData: []
}
},
methods: {
...mapMutations([
'closeTag'
])
...mapMutations(['closeTag']),
handleDelete (params) {
console.log(params)
}
},
mounted () {
GetAll().then(res => {
this.tmpResult = res
}).catch(err => {
console.log(err)
})
GetAll()
.then(res => {
this.tmpResult = res
this.tableData = res.data.Data
})
.catch(err => {
console.log(err)
})
}
}
</script>

<style>

</style>

+ 0
- 114
src/JT808.DotNetty.Dashbord.UI/src/view/single-page/home/example.vue Datei anzeigen

@@ -1,114 +0,0 @@
<template>
<div ref="dom"></div>
</template>

<script>
import echarts from 'echarts'
import { on, off } from '@/libs/tools'
export default {
name: 'serviceRequests',
data () {
return {
dom: null
}
},
methods: {
resize () {
this.dom.resize()
}
},
mounted () {
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
grid: {
top: '3%',
left: '1.2%',
right: '1%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '运营商/网络服务',
type: 'line',
stack: '总量',
areaStyle: {normal: {
color: '#2d8cf0'
}},
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: '银行/证券',
type: 'line',
stack: '总量',
areaStyle: {normal: {
color: '#10A6FF'
}},
data: [257, 358, 278, 234, 290, 330, 310]
},
{
name: '游戏/视频',
type: 'line',
stack: '总量',
areaStyle: {normal: {
color: '#0C17A6'
}},
data: [379, 268, 354, 269, 310, 478, 358]
},
{
name: '餐饮/外卖',
type: 'line',
stack: '总量',
areaStyle: {normal: {
color: '#4608A6'
}},
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: '快递/电商',
type: 'line',
stack: '总量',
label: {
normal: {
show: true,
position: 'top'
}
},
areaStyle: {normal: {
color: '#398DBF'
}},
data: [820, 645, 546, 745, 872, 624, 258]
}
]
}
this.$nextTick(() => {
this.dom = echarts.init(this.$refs.dom)
this.dom.setOption(option)
on(window, 'resize', this.resize)
})
},
beforeDestroy () {
off(window, 'resize', this.resize)
}
}
</script>

+ 9
- 31
src/JT808.DotNetty.Dashbord.UI/src/view/single-page/home/home.vue Datei anzeigen

@@ -1,7 +1,7 @@
<template>
<div>
<Row :gutter="20">
<i-col :xs="12" :md="8" :lg="4" v-for="(infor, i) in inforCardData" :key="`infor-${i}`" style="height: 120px;padding-bottom: 10px;">
<i-col :xs="12" :md="6" :lg="6" v-for="(infor, i) in inforCardData" :key="`infor-${i}`" style="height: 120px;padding-bottom: 10px;">
<infor-card shadow :color="infor.color" :icon="infor.icon" :icon-size="36">
<count-to :end="infor.count" count-class="count-style"/>
<p>{{ infor.title }}</p>
@@ -9,55 +9,33 @@
</i-col>
</Row>
<Row :gutter="20" style="margin-top: 10px;">
<i-col :md="24" :lg="8" style="margin-bottom: 20px;">
<i-col :md="24" :lg="24" style="margin-bottom: 20px;">
<Card shadow>
<chart-pie style="height: 300px;" :value="pieData" text="用户访问来源"></chart-pie>
</Card>
</i-col>
<i-col :md="24" :lg="16" style="margin-bottom: 20px;">
<Card shadow>
<chart-bar style="height: 300px;" :value="barData" text="每周用户活跃量"/>
<chart-bar style="height: 300px;" :value="barData" text="每周车辆在线情况"/>
</Card>
</i-col>
</Row>
<Row>
<Card shadow>
<example style="height: 310px;"/>
</Card>
</Row>
</div>
</template>

<script>
import InforCard from '_c/info-card'
import CountTo from '_c/count-to'
import { ChartPie, ChartBar } from '_c/charts'
import Example from './example.vue'
import { ChartBar } from '_c/charts'
export default {
name: 'home',
components: {
InforCard,
CountTo,
ChartPie,
ChartBar,
Example
ChartBar
},
data () {
return {
inforCardData: [
{ title: '新增用户', icon: 'md-person-add', count: 803, color: '#2d8cf0' },
{ title: '累计点击', icon: 'md-locate', count: 232, color: '#19be6b' },
{ title: '新增问答', icon: 'md-help-circle', count: 142, color: '#ff9900' },
{ title: '分享统计', icon: 'md-share', count: 657, color: '#ed3f14' },
{ title: '新增互动', icon: 'md-chatbubbles', count: 12, color: '#E46CBB' },
{ title: '新增页面', icon: 'md-map', count: 14, color: '#9A66E4' }
],
pieData: [
{value: 335, name: '直接访问'},
{value: 310, name: '邮件营销'},
{value: 234, name: '联盟广告'},
{value: 135, name: '视频广告'},
{value: 1548, name: '搜索引擎'}
{ title: '车辆总数', icon: 'md-locate', count: 800, color: '#19be6b' },
{ title: '车辆在线数', icon: 'md-person-add', count: 793, color: '#2d8cf0' },
{ title: '接收包成功数', icon: 'md-help-circle', count: 14200, color: '#ff9900' },
{ title: '接收包失败数', icon: 'md-share', count: 657, color: '#ed3f14' }
],
barData: {
Mon: 13253,


+ 75
- 12
src/JT808.DotNetty.Dashbord.UI/src/view/sourcepackage/sourcepackage.vue Datei anzeigen

@@ -1,34 +1,97 @@
<template>
<div>
{{tmpResult}}
<Card>
{{tmpResult}}
<tables
ref='tables'
searchable
search-place='top'
v-model='tableData'
:columns='columns'
@on-delete='handleDelete'
/>
</Card>
</div>
</template>

<script>
import { mapMutations } from 'vuex'
import { Add, Remove, GetAll } from "@/api/sourcePackage"
import Tables from '_c/tables'
import { Add, Remove, GetAll } from '@/api/sourcePackage'
export default {
name: 'sourcepackage',
components: {
Tables
},
data () {
return {
tmpResult: null
tmpResult: null,
columns: [
{ title: '远程IP地址', key: 'RemoteAddress' },
{ title: '通道是否注册', key: 'Registered', render: function (h,params){
return h('span', params.row.Registered? '是' : '否')
}
},
{ title: '通道是否活动', key: 'Active', render: function (h,params){
return h('span', params.row.Active? '是' : '否')
}
},
{ title: '通道是否打开', key: 'Open', render: function (h,params){
return h('span', params.row.Open? '是' : '否')
}
},
{
title: '操作',
key: 'handle',
options: ['delete'],
button: [
(h, params, vm) => {
return h(
'Poptip',
{
props: {
confirm: true,
title: '你确定要删除吗?'
},
on: {
'on-ok': () => {
vm.$emit('on-delete', params)
vm.$emit(
'input',
params.tableData.filter(
(item, index) => index !== params.row.initRowIndex
)
)
}
}
},
[h('Button', '自定义删除')]
)
}
]
}
],
tableData: []
}
},
methods: {
...mapMutations([
'closeTag'
])
...mapMutations(['closeTag']),
handleDelete (params) {
console.log(params)
}
},
mounted () {
GetAll().then(res => {
this.tmpResult = res
}).catch(err => {
console.log(err)
})
GetAll()
.then(res => {
this.tmpResult = res
this.tableData = res.data.Data
})
.catch(err => {
console.log(err)
})
}
}
</script>

<style>

</style>

+ 67
- 14
src/JT808.DotNetty.Dashbord.UI/src/view/transmit/transmit.vue Datei anzeigen

@@ -1,32 +1,85 @@
<template>
<div>
{{tmpResult}}
<Card>
{{tmpResult}}
<tables
ref="tables"
searchable
search-place="top"
v-model="tableData"
:columns="columns"
@on-delete="handleDelete"
/>
</Card>
</div>
</template>

<script>
import { mapMutations } from "vuex"
import { Add, Remove, GetAll } from "@/api/transmit"
import { mapMutations } from 'vuex'
import Tables from '_c/tables'
import { Add, Remove, GetAll } from '@/api/transmit'
export default {
name: "transmit",
name: 'transmit',
components: {
Tables
},
data () {
return {
tmpResult: null
tmpResult: null,
columns: [
{ title: 'IP', key: 'IP' },
{ title: '端口', key: 'Port' },
{
title: '操作',
key: 'handle',
options: ['delete'],
button: [
(h, params, vm) => {
return h(
'Poptip',
{
props: {
confirm: true,
title: '你确定要删除吗?'
},
on: {
'on-ok': () => {
vm.$emit('on-delete', params)
vm.$emit(
'input',
params.tableData.filter(
(item, index) => index !== params.row.initRowIndex
)
)
}
}
},
[h('Button', '自定义删除')]
)
}
]
}
],
tableData: []
}
},
methods: {
...mapMutations([
'closeTag'
]),
...mapMutations(['closeTag']),
handleDelete (params) {
console.log(params)
}
},
mounted () {
GetAll().then(res => {
this.tmpResult = res
}).catch(err => {
console.log(err)
})
GetAll()
.then(res => {
this.tmpResult = res
this.tableData = res.data.Data
})
.catch(err => {
console.log(err)
})
}
};
}
</script>

<style>


+ 1
- 1
src/JT808.DotNetty.Dashbord/Controllers/JT808AtomicCounterController.cs Datei anzeigen

@@ -24,7 +24,7 @@ namespace JT808.DotNetty.Dashbord.Controllers
{
return new JT808AtomicCounterDto {
MsgSuccessCount=100000,
MsgFailCount=0
MsgFailCount=0
};
}
}


+ 2
- 4
src/JT808.DotNetty.Dashbord/Controllers/JT808SessionController.cs Datei anzeigen

@@ -53,16 +53,14 @@ namespace JT808.DotNetty.Dashbord.Controllers
LastActiveTime=DateTime.Now,
RemoteAddressIP="127.0.0.1:559",
TerminalPhoneNo="123456789012",
StartTime=DateTime.Now,
WebApiPort=8091
StartTime=DateTime.Now,
},
new JT808SessionInfoDto {
ChannelId="0x00x1",
LastActiveTime=DateTime.Now,
RemoteAddressIP="127.0.0.1:558",
TerminalPhoneNo="123456789013",
StartTime=DateTime.Now,
WebApiPort=8092
StartTime=DateTime.Now,
}
};
}


+ 0
- 4
src/JT808.DotNetty.Dashbord/Dtos/JT808SessionInfoDto.cs Datei anzeigen

@@ -23,10 +23,6 @@ namespace JT808.DotNetty.Dtos
/// </summary>
public string TerminalPhoneNo { get; set; }
/// <summary>
/// WebApi端口号
/// </summary>
public int WebApiPort { get; set; }
/// <summary>
/// 远程ip地址
/// </summary>
public string RemoteAddressIP { get; set; }


+ 1
- 5
src/JT808.DotNetty.Dashbord/Dtos/JT808SourcePackageChannelInfoDto.cs Datei anzeigen

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace JT808.DotNetty.Dtos
namespace JT808.DotNetty.Dtos
{
/// <summary>
/// 原包通道信息


+ 15
- 0
src/JT808.DotNetty.Dashbord/Enums/JT808UnificationSendType.cs Datei anzeigen

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace JT808.DotNetty.Dashbord.Enums
{
public enum JT808UnificationSendType
{
/// <summary>
/// 文本下发
/// </summary>
TXT=1
}
}

+ 0
- 2
src/JT808.DotNetty.Dashbord/Internal/IJT808DotNettyWebApi.cs Datei anzeigen

@@ -1,8 +1,6 @@
using JT808.DotNetty.Dtos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WebApiClient;
using WebApiClient.Attributes;



+ 6
- 1
src/JT808.DotNetty.Dashbord/JT808.DotNetty.Dashbord.csproj Datei anzeigen

@@ -5,12 +5,17 @@
</PropertyGroup>

<ItemGroup>
<Folder Include="wwwroot\" />
<Compile Remove="wwwroot\**" />
<Content Remove="wwwroot\**" />
<EmbeddedResource Remove="wwwroot\**" />
<None Remove="wwwroot\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.0" />
<PackageReference Include="WebApiClient.JIT" Version="0.2.9" />
</ItemGroup>



+ 26
- 0
src/JT808.DotNetty.Dashbord/Models/JT808_AtomicCounter.cs Datei anzeigen

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace JT808.DotNetty.Dashbord.Models
{
[Table("jt808_atomic_counter")]
public class JT808_AtomicCounter
{
[Key]
[Column("id")]
public long Id { get; set; }

[Column("create_time")]
public long CreateTime { get; set; }

[Column("success_count")]
public long SuccessCount { get; set; }

[Column("fail_count")]
public long FailCount { get; set; }
}
}

+ 35
- 0
src/JT808.DotNetty.Dashbord/Models/JT808_Session.cs Datei anzeigen

@@ -0,0 +1,35 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace JT808.DotNetty.Dashbord.Models
{
[Table("jt808_session")]
public class JT808_Session
{
[Key]
[Column("id")]
public long Id { get; set; }
[Column("create_time")]
public long CreateTime { get; set; }
[MaxLength(32)]
[Column("channel_id")]
public string ChannelId { get; set; }
[MaxLength(16)]
[Column("terminal_phone_no")]
public string TerminalPhoneNo { get; set; }
[Column("last_active_time")]
public long LastActiveTime { get; set; }
[Column("start_time")]
public long StartTime { get; set; }
[MaxLength(32)]
[Column("remote_address_ip")]
public string RemoteAddressIP { get; set; }
/// <summary>
/// 通道Id对应多个终端号
/// true:第三方平台转发
/// false:设备上报
/// </summary>
[Column("is_transmit")]
public bool IsTransmit { get; set; }
}
}

+ 30
- 0
src/JT808.DotNetty.Dashbord/Models/JT808_SessionLog.cs Datei anzeigen

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace JT808.DotNetty.Dashbord.Models
{
[Table("jt808_session_log")]
public class JT808_SessionLog
{
[Key]
[Column("id")]
public long Id { get; set; }
[Column("create_time")]
public long CreateTime { get; set; }
[MaxLength(32)]
[Column("channel_id")]
public string ChannelId { get; set; }
[MaxLength(16)]
[Column("terminal_phone_no")]
public string TerminalPhoneNo { get; set; }
[MaxLength(128)]
[Column("reason")]
public string Reason { get; set; }
[Column("is_success")]
public bool IsSuccess { get; set; }
}
}

+ 31
- 0
src/JT808.DotNetty.Dashbord/Models/JT808_SourcePackage.cs Datei anzeigen

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace JT808.DotNetty.Dashbord.Models
{
[Table("jt808_source_package")]
public class JT808_SourcePackage
{
[Key]
[Column("id")]
public long Id { get; set; }
[Column("create_time")]
public long CreateTime { get; set; }
[MaxLength(32)]
[Column("ip")]
public string IP { get; set; }
[Column("port")]
public int Port { get; set; }
/// <summary>
/// 是否系统配置
/// true:网关配置文件
/// false:平台配置
/// </summary>
[Column("is_system_config")]
public bool IsSystemConfig { get; set; }
}
}

+ 29
- 0
src/JT808.DotNetty.Dashbord/Models/JT808_SourcePackageLog.cs Datei anzeigen

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace JT808.DotNetty.Dashbord.Models
{
[Table("jt808_source_package_log")]
public class JT808_SourcePackageLog
{
[Key]
[Column("id")]
public long Id { get; set; }
[Column("create_time")]
public long CreateTime { get; set; }
[MaxLength(32)]
[Column("ip")]
public string IP { get; set; }
[Column("port")]
public int Port { get; set; }
[Column("is_success")]
public bool IsSuccess { get; set; }
[MaxLength(128)]
[Column("reason")]
public string Reason { get; set; }
}
}

+ 31
- 0
src/JT808.DotNetty.Dashbord/Models/JT808_Transmit.cs Datei anzeigen

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace JT808.DotNetty.Dashbord.Models
{
[Table("jt808_transmit")]
public class JT808_Transmit
{
[Key]
[Column("id")]
public long Id { get; set; }
[Column("create_time")]
public long CreateTime { get; set; }
[MaxLength(32)]
[Column("ip")]
public string IP { get; set; }
[Column("port")]
public int Port { get; set; }
/// <summary>
/// 是否系统配置
/// true:网关配置文件
/// false:平台配置
/// </summary>
[Column("is_system_config")]
public bool IsSystemConfig { get; set; }
}
}

+ 29
- 0
src/JT808.DotNetty.Dashbord/Models/JT808_TransmitLog.cs Datei anzeigen

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace JT808.DotNetty.Dashbord.Models
{
[Table("jt808_transmit_log")]
public class JT808_TransmitLog
{
[Key]
[Column("id")]
public long Id { get; set; }
[Column("create_time")]
public long CreateTime { get; set; }
[MaxLength(32)]
[Column("ip")]
public string IP { get; set; }
[Column("port")]
public int Port { get; set; }
[Column("is_success")]
public bool IsSuccess { get; set; }
[MaxLength(128)]
[Column("reason")]
public string Reason { get; set; }
}
}

+ 36
- 0
src/JT808.DotNetty.Dashbord/Models/JT808_UnificationSend.cs Datei anzeigen

@@ -0,0 +1,36 @@
using JT808.DotNetty.Dashbord.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace JT808.DotNetty.Dashbord.Models
{
[Table("jt808_unification_send")]
public class JT808_UnificationSend
{
[Key]
[Column("id")]
public long Id { get; set; }
[Column("create_time")]
public long CreateTime { get; set; }
[Column("unification_send_type")]
public JT808UnificationSendType UnificationSendType { get; set; }
[MaxLength(16)]
[Column("terminal_phone_no")]
public string TerminalPhoneNo { get; set; }
[MaxLength(2048)]
[Column("hex_data")]
public string HexData { get; set; }
[MaxLength(32)]
[Column("remote_address_ip")]
public string RemoteAddressIP { get; set; }
[Column("is_success")]
public bool IsSuccess { get; set; }
[MaxLength(128)]
[Column("reason")]
public string Reason { get; set; }
}
}

+ 48
- 0
src/JT808.DotNetty.Dashbord/Providers/JT808DbContext.cs Datei anzeigen

@@ -0,0 +1,48 @@
using JT808.DotNetty.Dashbord.Enums;
using JT808.DotNetty.Dashbord.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace JT808.DotNetty.Dashbord.Providers
{
/// <summary>
///
/// Add-Migration Init
/// 首次更新:创建对应文件夹
/// Update-Database
/// System.NotSupportedException: SQLite does not support this migration operation ('DropColumnOperation').
/// SQLite: 不支持删除列
/// 解决方式:
/// https://elanderson.net/2017/04/entity-framework-core-with-sqlite-migration-limitations/
/// https://sqlite.org/lang_altertable.html#otheralter
/// </summary>
public class JT808DbContext : DbContext
{
public DbSet<JT808_AtomicCounter> JT808_AtomicCounters { get; set; }
public DbSet<JT808_UnificationSend> JT808_UnificationSends { get; set; }
public DbSet<JT808_TransmitLog> JT808_TransmitLogs { get; set; }
public DbSet<JT808_Transmit> JT808_Transmits { get; set; }
public DbSet<JT808_SourcePackageLog> JT808_SourcePackageLogs { get; set; }
public DbSet<JT808_SourcePackage> JT808_SourcePackages { get; set; }
public DbSet<JT808_SessionLog> JT808_SessionLogs { get; set; }
public DbSet<JT808_Session> JT808_Sessions { get; set; }

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlite("Data Source=../JT808.DotNetty.Dashbord/data/jt808.db");
}

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder
.Entity<JT808_UnificationSend>()
.Property(e => e.UnificationSendType)
.HasConversion(
v => v.ToString(),
v => (JT808UnificationSendType)Enum.Parse(typeof(JT808UnificationSendType), v));
}
}
}

+ 2
- 1
src/JT808.DotNetty.Dashbord/Startup.cs Datei anzeigen

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using JT808.DotNetty.Dashbord.Providers;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
@@ -24,6 +25,7 @@ namespace JT808.DotNetty.Dashbord
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<JT808DbContext>();
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
}

@@ -34,7 +36,6 @@ namespace JT808.DotNetty.Dashbord
{
app.UseDeveloperExceptionPage();
}

app.UseMvc();
}
}


+ 0
- 3
src/JT808.DotNetty/Codecs/JT808ClientDecoder.cs Datei anzeigen

@@ -4,10 +4,7 @@ using DotNetty.Transport.Channels;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Text;
using JT808.Protocol;
using JT808.DotNetty.Internal;
using JT808.DotNetty.Interfaces;
using JT808.DotNetty.Metadata;

namespace JT808.DotNetty.Codecs


+ 0
- 4
src/JT808.DotNetty/Dtos/JT808SessionInfoDto.cs Datei anzeigen

@@ -23,10 +23,6 @@ namespace JT808.DotNetty.Dtos
/// </summary>
public string TerminalPhoneNo { get; set; }
/// <summary>
/// WebApi端口号
/// </summary>
public int WebApiPort { get; set; }
/// <summary>
/// 远程ip地址
/// </summary>
public string RemoteAddressIP { get; set; }


+ 0
- 5
src/JT808.DotNetty/Internal/JT808SessionServiceDefaultImpl.cs Datei anzeigen

@@ -14,14 +14,10 @@ namespace JT808.DotNetty.Internal
{
private readonly JT808SessionManager jT808SessionManager;

private readonly JT808Configuration jT808Configuration;

public JT808SessionServiceDefaultImpl(
IOptions<JT808Configuration> jT808ConfigurationAccssor,
JT808SessionManager jT808SessionManager)
{
this.jT808SessionManager = jT808SessionManager;
this.jT808Configuration = jT808ConfigurationAccssor.Value;
}

public JT808ResultDto<List<JT808SessionInfoDto>> GetAll()
@@ -35,7 +31,6 @@ namespace JT808.DotNetty.Internal
LastActiveTime = s.LastActiveTime,
StartTime = s.StartTime,
TerminalPhoneNo = s.TerminalPhoneNo,
WebApiPort = jT808Configuration.WebApiPort,
RemoteAddressIP = s.Channel.RemoteAddress.ToString(),
}).ToList();
resultDto.Code = JT808ResultCode.Ok;


Laden…
Abbrechen
Speichern