@@ -72,7 +72,6 @@ | |||||
| LastActiveTime| DateTime| 最后上线时间| | | LastActiveTime| DateTime| 最后上线时间| | ||||
| StartTime| DateTime| 上线时间| | | StartTime| DateTime| 上线时间| | ||||
| TerminalPhoneNo|string| 终端手机号| | | TerminalPhoneNo|string| 终端手机号| | ||||
| WebApiPort| string| WebApi端口号| | |||||
| RemoteAddressIP| string| 远程ip地址| | | RemoteAddressIP| string| 远程ip地址| | ||||
#### 1.获取会话集合 | #### 1.获取会话集合 | ||||
@@ -99,14 +98,12 @@ | |||||
"LastActiveTime":"2018-11-27 20:00:00", | "LastActiveTime":"2018-11-27 20:00:00", | ||||
"StartTime":"2018-11-25 20:00:00", | "StartTime":"2018-11-25 20:00:00", | ||||
"TerminalPhoneNo":"123456789012", | "TerminalPhoneNo":"123456789012", | ||||
"WebApiPort":828, | |||||
"RemoteAddressIP":"127.0.0.1:11808" | "RemoteAddressIP":"127.0.0.1:11808" | ||||
},{ | },{ | ||||
"ChannelId":"eadad23", | "ChannelId":"eadad23", | ||||
"LastActiveTime":"2018-11-27 20:00:00", | "LastActiveTime":"2018-11-27 20:00:00", | ||||
"StartTime":"2018-11-25 20:00:00", | "StartTime":"2018-11-25 20:00:00", | ||||
"TerminalPhoneNo":"123456789013", | "TerminalPhoneNo":"123456789013", | ||||
"WebApiPort":828, | |||||
"RemoteAddressIP":"127.0.0.1:11808" | "RemoteAddressIP":"127.0.0.1:11808" | ||||
} | } | ||||
] | ] | ||||
@@ -240,7 +237,6 @@ | |||||
|属性|数据类型|参数说明| | |属性|数据类型|参数说明| | ||||
|------|:------:|:------| | |------|:------:|:------| | ||||
| RemoteAddress| string | 远程ip地址| | | RemoteAddress| string | 远程ip地址| | ||||
| LocalAddress| string | 本地ip地址| | |||||
| Registered| bool | 通道是否注册| | | Registered| bool | 通道是否注册| | ||||
| Active| bool | 通道是否激活| | | Active| bool | 通道是否激活| | ||||
| Open| bool | 通道是否打开| | | Open| bool | 通道是否打开| | ||||
@@ -254,13 +250,11 @@ | |||||
"Data":[ | "Data":[ | ||||
{ | { | ||||
"RemoteAddress":"127.0.0.1:6665", | "RemoteAddress":"127.0.0.1:6665", | ||||
"LocalAddress":"127.0.0.1:6664", | |||||
"Registered":true, | "Registered":true, | ||||
"Active":true, | "Active":true, | ||||
"Open":true | "Open":true | ||||
},{ | },{ | ||||
"RemoteAddress":"127.0.0.1:6667", | "RemoteAddress":"127.0.0.1:6667", | ||||
"LocalAddress":"127.0.0.1:6666", | |||||
"Registered":true, | "Registered":true, | ||||
"Active":true, | "Active":true, | ||||
"Open":true | "Open":true | ||||
@@ -1,14 +1,20 @@ | |||||
# Install | # Install | ||||
```bush | ```bush | ||||
// install dependencies | // install dependencies | ||||
npm install | npm install | ||||
``` | ``` | ||||
## Run | ## Run | ||||
### Development | ### Development | ||||
```bush | ```bush | ||||
npm run dev | npm run dev | ||||
``` | ``` | ||||
### Production(Build) | ### Production(Build) | ||||
```bush | ```bush | ||||
npm run build | npm run build | ||||
``` | ``` |
@@ -2,11 +2,11 @@ import Vue from 'vue' | |||||
import VueI18n from 'vue-i18n' | import VueI18n from 'vue-i18n' | ||||
import { localRead } from '@/libs/util' | import { localRead } from '@/libs/util' | ||||
import customZhCn from './lang/zh-CN' | 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 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) | Vue.use(VueI18n) | ||||
@@ -20,9 +20,9 @@ Vue.config.lang = lang | |||||
// vue-i18n 6.x+写法 | // vue-i18n 6.x+写法 | ||||
Vue.locale = () => {} | Vue.locale = () => {} | ||||
const messages = { | 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({ | const i18n = new VueI18n({ | ||||
locale: lang, | locale: lang, | ||||
@@ -10,18 +10,8 @@ export default { | |||||
img_cropper_page: 'Image-editor', | img_cropper_page: 'Image-editor', | ||||
update: 'Update', | update: 'Update', | ||||
doc: 'Document', | doc: 'Document', | ||||
join_page: 'QQ Group', | |||||
update_table_page: 'Update .CSV', | update_table_page: 'Update .CSV', | ||||
update_paste_page: 'Paste Table Data', | 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', | excel: 'Excel', | ||||
'upload-excel': 'Upload Excel', | 'upload-excel': 'Upload Excel', | ||||
'export-excel': 'Export Excel', | 'export-excel': 'Export Excel', | ||||
@@ -9,19 +9,10 @@ export default { | |||||
icons_page: '自定义图标', | icons_page: '自定义图标', | ||||
img_cropper_page: '图片编辑器', | img_cropper_page: '图片编辑器', | ||||
update: '上传数据', | update: '上传数据', | ||||
join_page: 'QQ群', | |||||
doc: '文档', | |||||
update_table_page: '上传CSV文件', | update_table_page: '上传CSV文件', | ||||
update_paste_page: '粘贴表格数据', | update_paste_page: '粘贴表格数据', | ||||
multilevel: '多级菜单', | multilevel: '多级菜单', | ||||
directive_page: '指令', | 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', | excel: 'Excel', | ||||
'upload-excel': '上传excel', | 'upload-excel': '上传excel', | ||||
'export-excel': '导出excel', | 'export-excel': '导出excel', | ||||
@@ -38,5 +29,12 @@ export default { | |||||
params: '动态路由', | params: '动态路由', | ||||
cropper_page: '图片裁剪', | cropper_page: '图片裁剪', | ||||
message_page: '消息中心', | message_page: '消息中心', | ||||
tree_table_page: '树状表格' | |||||
tree_table_page: '树状表格', | |||||
_session: '会话管理', | |||||
_sourcepackage: '原包管理', | |||||
_transmit: '转发管理', | |||||
session: '会话管理', | |||||
sourcepackage: '原包管理', | |||||
transmit: '转发管理', | |||||
login: '登录' | |||||
} | } |
@@ -9,19 +9,10 @@ export default { | |||||
icons_page: '自定義圖標', | icons_page: '自定義圖標', | ||||
img_cropper_page: '圖片編輯器', | img_cropper_page: '圖片編輯器', | ||||
update: '上傳數據', | update: '上傳數據', | ||||
join_page: 'QQ群', | |||||
doc: '文檔', | |||||
update_table_page: '上傳CSV文件', | update_table_page: '上傳CSV文件', | ||||
update_paste_page: '粘貼表格數據', | update_paste_page: '粘貼表格數據', | ||||
multilevel: '多级菜单', | multilevel: '多级菜单', | ||||
directive_page: '指令', | 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', | excel: 'Excel', | ||||
'upload-excel': '上傳excel', | 'upload-excel': '上傳excel', | ||||
'export-excel': '導出excel', | 'export-excel': '導出excel', | ||||
@@ -14,7 +14,7 @@ export default { | |||||
}, | }, | ||||
GetAll () { | GetAll () { | ||||
return setData([{ | return setData([{ | ||||
'ChannelId': 'eadad23', | |||||
'ChannelId': 'eadad24', | |||||
'LastActiveTime': '2018-11-27 20:00:00', | 'LastActiveTime': '2018-11-27 20:00:00', | ||||
'StartTime': '2018-11-25 20:00:00', | 'StartTime': '2018-11-25 20:00:00', | ||||
'TerminalPhoneNo': '123456789012', | 'TerminalPhoneNo': '123456789012', | ||||
@@ -15,13 +15,11 @@ export default { | |||||
GetAll () { | GetAll () { | ||||
return setData([{ | return setData([{ | ||||
'RemoteAddress': '127.0.0.1:6665', | 'RemoteAddress': '127.0.0.1:6665', | ||||
'LocalAddress': '127.0.0.1:6664', | |||||
'Registered': true, | 'Registered': true, | ||||
'Active': true, | 'Active': true, | ||||
'Open': true | 'Open': true | ||||
}, { | }, { | ||||
'RemoteAddress': '127.0.0.1:6667', | 'RemoteAddress': '127.0.0.1:6667', | ||||
'LocalAddress': '127.0.0.1:6666', | |||||
'Registered': true, | 'Registered': true, | ||||
'Active': true, | 'Active': true, | ||||
'Open': true | 'Open': true | ||||
@@ -13,9 +13,22 @@ export default { | |||||
})) | })) | ||||
}, | }, | ||||
GetAll () { | 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 | |||||
} | |||||
]) | ]) | ||||
} | } | ||||
} | } |
@@ -1,5 +1,4 @@ | |||||
import Main from '@/components/main' | import Main from '@/components/main' | ||||
import parentView from '@/components/parent-view' | |||||
/** | /** | ||||
* iview-admin中meta除了原生参数外可配置的参数: | * iview-admin中meta除了原生参数外可配置的参数: | ||||
@@ -71,8 +70,8 @@ export default [ | |||||
] | ] | ||||
}, | }, | ||||
{ | { | ||||
path: '/session', | |||||
name: 'session', | |||||
path: '/_session', | |||||
name: '_session', | |||||
meta: { | meta: { | ||||
hideInBread: true | hideInBread: true | ||||
}, | }, | ||||
@@ -80,7 +79,7 @@ export default [ | |||||
children: [ | children: [ | ||||
{ | { | ||||
path: '/session', | path: '/session', | ||||
name: '会话管理', | |||||
name: 'session', | |||||
meta: { | meta: { | ||||
icon: 'ios-hammer', | icon: 'ios-hammer', | ||||
title: '会话管理' | title: '会话管理' | ||||
@@ -90,8 +89,8 @@ export default [ | |||||
] | ] | ||||
}, | }, | ||||
{ | { | ||||
path: '/sourcepackage', | |||||
name: 'sourcePackage', | |||||
path: '/_sourcePackage', | |||||
name: '_sourcePackage', | |||||
meta: { | meta: { | ||||
hideInBread: true | hideInBread: true | ||||
}, | }, | ||||
@@ -99,7 +98,7 @@ export default [ | |||||
children: [ | children: [ | ||||
{ | { | ||||
path: '/sourcepackage', | path: '/sourcepackage', | ||||
name: '原包管理', | |||||
name: 'sourcepackage', | |||||
meta: { | meta: { | ||||
icon: 'ios-hammer', | icon: 'ios-hammer', | ||||
title: '原包管理', | title: '原包管理', | ||||
@@ -110,8 +109,8 @@ export default [ | |||||
] | ] | ||||
}, | }, | ||||
{ | { | ||||
path: '/transmit', | |||||
name: 'transmit', | |||||
path: '/_transmit', | |||||
name: '_transmit', | |||||
meta: { | meta: { | ||||
hideInBread: true | hideInBread: true | ||||
}, | }, | ||||
@@ -119,7 +118,7 @@ export default [ | |||||
children: [ | children: [ | ||||
{ | { | ||||
path: '/transmit', | path: '/transmit', | ||||
name: '转发管理', | |||||
name: 'transmit', | |||||
meta: { | meta: { | ||||
icon: 'ios-hammer', | icon: 'ios-hammer', | ||||
title: '转发管理', | title: '转发管理', | ||||
@@ -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"> | |||||
<Modal v-draggable="options" v-model="visible">标题</Modal> | |||||
<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"> | |||||
<Input style="width: 60%" v-model="inputValue"> | |||||
<br/> | |||||
<Button slot="append" v-clipboard="clipOptions">copy</Button> | |||||
<br/> | |||||
</Input> | |||||
<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> |
@@ -1,34 +1,90 @@ | |||||
<template> | <template> | ||||
<div> | <div> | ||||
{{tmpResult}} | |||||
<Card> | |||||
{{tmpResult}} | |||||
<tables | |||||
ref='tables' | |||||
searchable | |||||
search-place='top' | |||||
v-model='tableData' | |||||
:columns='columns' | |||||
@on-delete='handleDelete' | |||||
/> | |||||
</Card> | |||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import { mapMutations } from 'vuex' | import { mapMutations } from 'vuex' | ||||
import { GetAll } from "@/api/session" | |||||
import Tables from '_c/tables' | |||||
import { GetAll } from '@/api/session' | |||||
export default { | export default { | ||||
name: 'session', | name: 'session', | ||||
components: { | |||||
Tables | |||||
}, | |||||
data () { | data () { | ||||
return { | 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: { | methods: { | ||||
...mapMutations([ | |||||
'closeTag' | |||||
]) | |||||
...mapMutations(['closeTag']), | |||||
handleDelete (params) { | |||||
console.log(params) | |||||
} | |||||
}, | }, | ||||
mounted () { | 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> | </script> | ||||
<style> | <style> | ||||
</style> | </style> |
@@ -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> |
@@ -1,7 +1,7 @@ | |||||
<template> | <template> | ||||
<div> | <div> | ||||
<Row :gutter="20"> | <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"> | <infor-card shadow :color="infor.color" :icon="infor.icon" :icon-size="36"> | ||||
<count-to :end="infor.count" count-class="count-style"/> | <count-to :end="infor.count" count-class="count-style"/> | ||||
<p>{{ infor.title }}</p> | <p>{{ infor.title }}</p> | ||||
@@ -9,55 +9,33 @@ | |||||
</i-col> | </i-col> | ||||
</Row> | </Row> | ||||
<Row :gutter="20" style="margin-top: 10px;"> | <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> | <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> | </Card> | ||||
</i-col> | </i-col> | ||||
</Row> | </Row> | ||||
<Row> | |||||
<Card shadow> | |||||
<example style="height: 310px;"/> | |||||
</Card> | |||||
</Row> | |||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import InforCard from '_c/info-card' | import InforCard from '_c/info-card' | ||||
import CountTo from '_c/count-to' | import CountTo from '_c/count-to' | ||||
import { ChartPie, ChartBar } from '_c/charts' | |||||
import Example from './example.vue' | |||||
import { ChartBar } from '_c/charts' | |||||
export default { | export default { | ||||
name: 'home', | name: 'home', | ||||
components: { | components: { | ||||
InforCard, | InforCard, | ||||
CountTo, | CountTo, | ||||
ChartPie, | |||||
ChartBar, | |||||
Example | |||||
ChartBar | |||||
}, | }, | ||||
data () { | data () { | ||||
return { | return { | ||||
inforCardData: [ | 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: { | barData: { | ||||
Mon: 13253, | Mon: 13253, | ||||
@@ -1,34 +1,97 @@ | |||||
<template> | <template> | ||||
<div> | <div> | ||||
{{tmpResult}} | |||||
<Card> | |||||
{{tmpResult}} | |||||
<tables | |||||
ref='tables' | |||||
searchable | |||||
search-place='top' | |||||
v-model='tableData' | |||||
:columns='columns' | |||||
@on-delete='handleDelete' | |||||
/> | |||||
</Card> | |||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import { mapMutations } from 'vuex' | 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 { | export default { | ||||
name: 'sourcepackage', | name: 'sourcepackage', | ||||
components: { | |||||
Tables | |||||
}, | |||||
data () { | data () { | ||||
return { | 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: { | methods: { | ||||
...mapMutations([ | |||||
'closeTag' | |||||
]) | |||||
...mapMutations(['closeTag']), | |||||
handleDelete (params) { | |||||
console.log(params) | |||||
} | |||||
}, | }, | ||||
mounted () { | 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> | </script> | ||||
<style> | <style> | ||||
</style> | </style> |
@@ -1,32 +1,85 @@ | |||||
<template> | <template> | ||||
<div> | <div> | ||||
{{tmpResult}} | |||||
<Card> | |||||
{{tmpResult}} | |||||
<tables | |||||
ref="tables" | |||||
searchable | |||||
search-place="top" | |||||
v-model="tableData" | |||||
:columns="columns" | |||||
@on-delete="handleDelete" | |||||
/> | |||||
</Card> | |||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <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 { | export default { | ||||
name: "transmit", | |||||
name: 'transmit', | |||||
components: { | |||||
Tables | |||||
}, | |||||
data () { | data () { | ||||
return { | 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: { | methods: { | ||||
...mapMutations([ | |||||
'closeTag' | |||||
]), | |||||
...mapMutations(['closeTag']), | |||||
handleDelete (params) { | |||||
console.log(params) | |||||
} | |||||
}, | }, | ||||
mounted () { | 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> | </script> | ||||
<style> | <style> | ||||
@@ -24,7 +24,7 @@ namespace JT808.DotNetty.Dashbord.Controllers | |||||
{ | { | ||||
return new JT808AtomicCounterDto { | return new JT808AtomicCounterDto { | ||||
MsgSuccessCount=100000, | MsgSuccessCount=100000, | ||||
MsgFailCount=0 | |||||
MsgFailCount=0 | |||||
}; | }; | ||||
} | } | ||||
} | } | ||||
@@ -53,16 +53,14 @@ namespace JT808.DotNetty.Dashbord.Controllers | |||||
LastActiveTime=DateTime.Now, | LastActiveTime=DateTime.Now, | ||||
RemoteAddressIP="127.0.0.1:559", | RemoteAddressIP="127.0.0.1:559", | ||||
TerminalPhoneNo="123456789012", | TerminalPhoneNo="123456789012", | ||||
StartTime=DateTime.Now, | |||||
WebApiPort=8091 | |||||
StartTime=DateTime.Now, | |||||
}, | }, | ||||
new JT808SessionInfoDto { | new JT808SessionInfoDto { | ||||
ChannelId="0x00x1", | ChannelId="0x00x1", | ||||
LastActiveTime=DateTime.Now, | LastActiveTime=DateTime.Now, | ||||
RemoteAddressIP="127.0.0.1:558", | RemoteAddressIP="127.0.0.1:558", | ||||
TerminalPhoneNo="123456789013", | TerminalPhoneNo="123456789013", | ||||
StartTime=DateTime.Now, | |||||
WebApiPort=8092 | |||||
StartTime=DateTime.Now, | |||||
} | } | ||||
}; | }; | ||||
} | } | ||||
@@ -23,10 +23,6 @@ namespace JT808.DotNetty.Dtos | |||||
/// </summary> | /// </summary> | ||||
public string TerminalPhoneNo { get; set; } | public string TerminalPhoneNo { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// WebApi端口号 | |||||
/// </summary> | |||||
public int WebApiPort { get; set; } | |||||
/// <summary> | |||||
/// 远程ip地址 | /// 远程ip地址 | ||||
/// </summary> | /// </summary> | ||||
public string RemoteAddressIP { get; set; } | public string RemoteAddressIP { get; set; } | ||||
@@ -1,8 +1,4 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.DotNetty.Dtos | |||||
namespace JT808.DotNetty.Dtos | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 原包通道信息 | /// 原包通道信息 | ||||
@@ -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 | |||||
} | |||||
} |
@@ -1,8 +1,6 @@ | |||||
using JT808.DotNetty.Dtos; | using JT808.DotNetty.Dtos; | ||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using WebApiClient; | using WebApiClient; | ||||
using WebApiClient.Attributes; | using WebApiClient.Attributes; | ||||
@@ -5,12 +5,17 @@ | |||||
</PropertyGroup> | </PropertyGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<Folder Include="wwwroot\" /> | |||||
<Compile Remove="wwwroot\**" /> | |||||
<Content Remove="wwwroot\**" /> | |||||
<EmbeddedResource Remove="wwwroot\**" /> | |||||
<None Remove="wwwroot\**" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="Microsoft.AspNetCore.App" /> | <PackageReference Include="Microsoft.AspNetCore.App" /> | ||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" /> | <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" /> | <PackageReference Include="WebApiClient.JIT" Version="0.2.9" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
@@ -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; } | |||||
} | |||||
} |
@@ -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; } | |||||
} | |||||
} |
@@ -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; } | |||||
} | |||||
} |
@@ -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; } | |||||
} | |||||
} |
@@ -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; } | |||||
} | |||||
} |
@@ -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; } | |||||
} | |||||
} |
@@ -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; } | |||||
} | |||||
} |
@@ -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; } | |||||
} | |||||
} |
@@ -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,6 +2,7 @@ | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | using System.Linq; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
using JT808.DotNetty.Dashbord.Providers; | |||||
using Microsoft.AspNetCore.Builder; | using Microsoft.AspNetCore.Builder; | ||||
using Microsoft.AspNetCore.Hosting; | using Microsoft.AspNetCore.Hosting; | ||||
using Microsoft.AspNetCore.Mvc; | 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. | // This method gets called by the runtime. Use this method to add services to the container. | ||||
public void ConfigureServices(IServiceCollection services) | public void ConfigureServices(IServiceCollection services) | ||||
{ | { | ||||
services.AddDbContext<JT808DbContext>(); | |||||
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); | ||||
} | } | ||||
@@ -34,7 +36,6 @@ namespace JT808.DotNetty.Dashbord | |||||
{ | { | ||||
app.UseDeveloperExceptionPage(); | app.UseDeveloperExceptionPage(); | ||||
} | } | ||||
app.UseMvc(); | app.UseMvc(); | ||||
} | } | ||||
} | } | ||||
@@ -4,10 +4,7 @@ using DotNetty.Transport.Channels; | |||||
using Microsoft.Extensions.Logging; | using Microsoft.Extensions.Logging; | ||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | |||||
using JT808.Protocol; | using JT808.Protocol; | ||||
using JT808.DotNetty.Internal; | |||||
using JT808.DotNetty.Interfaces; | |||||
using JT808.DotNetty.Metadata; | using JT808.DotNetty.Metadata; | ||||
namespace JT808.DotNetty.Codecs | namespace JT808.DotNetty.Codecs | ||||
@@ -23,10 +23,6 @@ namespace JT808.DotNetty.Dtos | |||||
/// </summary> | /// </summary> | ||||
public string TerminalPhoneNo { get; set; } | public string TerminalPhoneNo { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// WebApi端口号 | |||||
/// </summary> | |||||
public int WebApiPort { get; set; } | |||||
/// <summary> | |||||
/// 远程ip地址 | /// 远程ip地址 | ||||
/// </summary> | /// </summary> | ||||
public string RemoteAddressIP { get; set; } | public string RemoteAddressIP { get; set; } | ||||
@@ -14,14 +14,10 @@ namespace JT808.DotNetty.Internal | |||||
{ | { | ||||
private readonly JT808SessionManager jT808SessionManager; | private readonly JT808SessionManager jT808SessionManager; | ||||
private readonly JT808Configuration jT808Configuration; | |||||
public JT808SessionServiceDefaultImpl( | public JT808SessionServiceDefaultImpl( | ||||
IOptions<JT808Configuration> jT808ConfigurationAccssor, | |||||
JT808SessionManager jT808SessionManager) | JT808SessionManager jT808SessionManager) | ||||
{ | { | ||||
this.jT808SessionManager = jT808SessionManager; | this.jT808SessionManager = jT808SessionManager; | ||||
this.jT808Configuration = jT808ConfigurationAccssor.Value; | |||||
} | } | ||||
public JT808ResultDto<List<JT808SessionInfoDto>> GetAll() | public JT808ResultDto<List<JT808SessionInfoDto>> GetAll() | ||||
@@ -35,7 +31,6 @@ namespace JT808.DotNetty.Internal | |||||
LastActiveTime = s.LastActiveTime, | LastActiveTime = s.LastActiveTime, | ||||
StartTime = s.StartTime, | StartTime = s.StartTime, | ||||
TerminalPhoneNo = s.TerminalPhoneNo, | TerminalPhoneNo = s.TerminalPhoneNo, | ||||
WebApiPort = jT808Configuration.WebApiPort, | |||||
RemoteAddressIP = s.Channel.RemoteAddress.ToString(), | RemoteAddressIP = s.Channel.RemoteAddress.ToString(), | ||||
}).ToList(); | }).ToList(); | ||||
resultDto.Code = JT808ResultCode.Ok; | resultDto.Code = JT808ResultCode.Ok; | ||||