Skip to content

Commit

Permalink
commit working lite version.
Browse files Browse the repository at this point in the history
  • Loading branch information
solderzzc committed Jan 29, 2021
1 parent 61016f2 commit 9ba314c
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.meteor/local
packages/*/.build*
packages/*/.npm*
node_modules/*
.git/*
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y curl python2.7 python-pip build-essential locales git \
&& rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

ENV LANG en_US.utf8
ENV LC_ALL en_US.UTF-8

RUN curl https://install.meteor.com/?release=1.4.1.2 | sh
ADD ./ /root/SharpAIMobileApp
WORKDIR /root
RUN git clone https://github.com/SharpAI/ApiServer.git
RUN git clone https://github.com/SharpAI/SharpAIPlugins.git
WORKDIR /root/SharpAIMobileApp

RUN meteor npm install --save jquery wolfy87-eventemitter eventie
#RUN meteor build --server http://165.232.62.29:3000 ../ && rm ../SharpAIMobileApp.tar.gz
CMD meteor run --production --mobile-server=165.232.62.29:3000
14 changes: 14 additions & 0 deletions client/4_router_client.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ if Meteor.isClient
Session.set 'focusOn',channel
,300
Router.route '/',()->
this.render 'home'
Session.set 'channel','home'
return
Router.route '/deviceHomePage/:_deviceUUID',()->
self=this
Meteor.loginWithPassword this.params._deviceUUID,'123456',(error)->
console.log('Login Error is ' + JSON.stringify(error))
if error and error.reason and error.reason is 'User not found'
console.log 'User Not Found, need create'
if !error
self.render 'timeline'
Session.set 'channel','timeline'
console.log this.params._deviceUUID

this.render 'home'
Session.set 'channel','home'
return
Expand Down
9 changes: 9 additions & 0 deletions client/chatGroups/groupDevices/groupDevices.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
<div class="content groupDevicesList">
<!-- <div class="line" style="height: 20px; text-align:left; padding-left:10px; color:#555;"></div> -->
<ul id="deviceList" class="set-up comFadeIn">
{{#if withLiteVersion}}
<li class="title"><b>{{_ "tapToChangeDisplayName"}}</b></li>
{{else}}
<li class="title"><b>{{_ "updateConfiguration"}}</b></li>
{{/if}}
{{#each lists}}
{{#if uuid}}
<li id="" class="deviceItem swiperElem">
Expand All @@ -30,18 +34,23 @@
<input class="edit" id="{{getId uuid}}" style="{{isShow uuid 2}}" value='{{_ "unknownDevice"}}'>
{{/if}}

{{#unless withLiteVersion}}
<div class="set-camera">
<span class="set-size">{{_ "cameraConfiguration"}}</span>
</div>
{{/unless}}
<!-- {{/if}} -->
<!-- </span> -->

<!-- <div id="{{uuid}}" class="value goTimelime" style="float:right; margin:10px;">{{in_out}}<i class="fa fa-angle-right"></i></div> -->
<div id="{{_id}}" class="delBtnContent" data-uuid="{{uuid}}">{{_ "delete"}}</div>
<!-- <button class="automatic_update">自动更新</button> -->

{{#unless withLiteVersion}}
<div class="value-fa">
<input id="switch_update" class="switch" type="checkbox" {{isChecked autoUpdate}}>
</div>
{{/unless}}
</div>
</li>
{{/if}}
Expand Down
3 changes: 3 additions & 0 deletions client/chatGroups/groupDevices/groupDevices.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Template.groupDevices.helpers({
return '未知'
}
},
withLiteVersion: function(){
return withLiteVersion
},
isChecked: function(autoUpdate){
if(autoUpdate){
return 'checked'
Expand Down
10 changes: 6 additions & 4 deletions client/chatGroups/groupsProfile/groupsProfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@
<label>{{_ "groupDeviceList"}}</label>
<div class="value"><i class="fa fa-angle-right"></i></div>
</li>
<li id="recognitionCounts">
<label>{{_ "recognitionCounts"}}</label>
<div class="value"><i class="fa fa-angle-right"></i></div>
</li>
{{#unless withLiteVersion}}
<li id="recognitionCounts">
<label>{{_ "recognitionCounts"}}</label>
<div class="value"><i class="fa fa-angle-right"></i></div>
</li>
{{/unless}}
{{#if hasTemplate}}
<li class="group_template">
<label style="top: 20px;">监控组模板</label>
Expand Down
3 changes: 2 additions & 1 deletion client/mqtt_mq_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,15 @@ if(Meteor.isClient && !withNativeMQTTLIB){
// Once a connection has been made, make a subscription and send a message.
console.log("mqtt onConnect");
// get MQTT_TIME_DIFF
var url = 'http://'+server_domain_name+'/restapi/date/';
/*var url = 'http://'+server_domain_name+'/restapi/date/';
$.get(url,function(data){
if(data){
MQTT_TIME_DIFF = Number(data) - Date.now();
console.log('MQTT_TIME_DIFF===',MQTT_TIME_DIFF)
}
});
console.log('Connected to mqtt server');
*/
noMessageTimer = Meteor.setTimeout(function(){
console.log('no message to receive');
Session.set('history_message',false);
Expand Down
23 changes: 18 additions & 5 deletions client/timeline/timeline.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
{{#if uuid}}
<li id="{{uuid}}" class="deviceItem" style="height:60px;padding:10px 0;border-bottom:1px solid #f5f5f5;">
{{#if name}}
<label style="width: 107px; margin-left:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">
<label style="width: 240px; margin-left:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">
{{name}}
</label>
{{else}}
<label style="margin-left:8px;">{{_ "unknownDevice"}}</label>
<iframe style="border: 0px;" src="/camera12.svg" width="30" height="30"></iframe>
{{/if}}
<!-- 显示状态图标 -->
<span style="display:inline-block; position: relative;left: 12rem;top:1.2rem;font-size: 12px;">
{{#if deviceSupportOnlineOffline online}}
<span style="display:inline-block; position: relative;left: 12rem;top:1.2rem;font-size: 12px;">
{{#if online}}
<span style="display: inline-block;margin-left: 1.5rem;color:#32c6b1;">
<iframe style="border: 0px;" src="/face_box_online.svg" width="16" height="12"></iframe><small class="equipment-fa">&nbsp;{{_ "box"}}</small>
Expand All @@ -62,14 +62,27 @@
<iframe style="border: 0px;" src="/camera_offline.svg" width="16" height="14"></iframe><small class="equipment-fa">&nbsp;{{_ "camera"}}</small>
</span>
{{/if}}

</span>
{{else}}
<!-- <span style="display: inline-block;margin-left: 1.2rem;">
<iframe style="border: 0px;" src="/what_offline.svg" width="25" height="25"></iframe>
</span> -->
<span style="display:inline-block; position: relative;right: 1rem;top:1.2rem;font-size: 12px;">
{{#if sawPersonRecently uuid}}
<span style="display: inline-block;margin-left: 1rem;color:#32c6b1;">
<i class="fa fa-user" aria-hidden="true"></i>
</span>
{{else}}
<span style="display: inline-block;margin-left: 1rem;color:#888888;">
<i class="fa fa-user" aria-hidden="true"></i>
</span>
{{/if}}
</span>
{{/if}}

</span>
<div class="value" style="float:right; margin:10px;"><i class="fa fa-angle-right"></i></div>
{{#unless withLiteVersion}}
<div class="value" style="float:right; margin:10px;"><i class="fa fa-angle-right"></i></div>
{{/unless}}
</li>
{{/if}}
{{/each}}
Expand Down
18 changes: 16 additions & 2 deletions client/timeline/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ Template.timeline.helpers({
deviceSupportOnlineOffline: function(online){
return typeof online ==='boolean'
},
sawPersonRecently: function(uuid){
var device = Devices.findOne({uuid:uuid});
if(device && device.last_person_ts){
if(new Date().getTime() - device.last_person_ts < 5*60*1000){
return true;
}
}
return false;
},
lists: function(){
var lists = [];
SimpleChat.GroupUsers.find({user_id:Meteor.userId()},{sort:{create_time:-1}}).forEach(function(item){
Expand All @@ -36,6 +45,9 @@ Template.timeline.helpers({
}
});
return lists;
},
withLiteVersion: function(){
return withLiteVersion;
}
});

Expand All @@ -44,7 +56,9 @@ Template.timeline.events({
return PUB.back();
},
'click .deviceItem': function(e){
Session.set("timelinehref",false)
return PUB.page('/timelineAlbum/'+e.currentTarget.id+'?from=timeline');
if(!withLiteVersion){
Session.set("timelinehref",false)
return PUB.page('/timelineAlbum/'+e.currentTarget.id+'?from=timeline');
}
}
})
4 changes: 3 additions & 1 deletion i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@
"scanPicture":"Scan picture to join group",
"scanToAddDevice":"Scan QR code to add device",
"scanNetworkToAddDevice":"Scan network to add device",
"setDisplayName":"Set Device Display Name",
// end

// footer.html
Expand Down Expand Up @@ -348,7 +349,7 @@

"groupInfo":"Group Informationn",
"groupQRCode":"Group QRCode",
"groupDeviceList":"Group Device List",
"groupDeviceList":"Change Group Device Name",
"recognitionCounts":"Recognition Status",
"checkInDuration":"Check-in Duration",
"notifyToFillSchedule":"Notify to Fill in Daily Schedule",
Expand All @@ -366,6 +367,7 @@
"unfamiliarFaces":"Unfamiliar Face",
"knownFaces":"Send Notification When See Following Faces",
"deviceList":"Device Lists",
"tapToChangeDisplayName":"Tap device name to change display name",
"updateConfiguration":"Auto Update Configuration",
"unknownDevice":"Unknown Device",
"cameraConfiguration":"Config Camera",
Expand Down
4 changes: 3 additions & 1 deletion i18n/zh.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
"scanPicture":"扫图片",
"scanToAddDevice":"扫码添加脸脸盒",
"scanNetworkToAddDevice":"网络扫描脸脸盒",
"setDisplayName":"设置设备名称",
// end

// footer.html
Expand Down Expand Up @@ -356,7 +357,7 @@

"groupInfo":"监控组信息",
"groupQRCode":"监控组二维码",
"groupDeviceList":"监控组设备列表",
"groupDeviceList":"设置监控组设备名称",
"recognitionCounts":"识别统计",
"checkInDuration":"监控时间设置",
"notifyToFillSchedule":"提醒填写工作安排",
Expand All @@ -375,6 +376,7 @@
"knownFaces":"以下熟人出现时,通知您",
"deviceList":"设备列表",
"updateConfiguration":"自动升级控制",
"tapToChangeDisplayName":"点击设备名之后修改",
"unknownDevice":"未知设备",
"cameraConfiguration":"摄像头配置",
"hitSetupCamera":"设置完成后,大约15秒后生效",
Expand Down
2 changes: 1 addition & 1 deletion public/i18n/tap-i18n.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/i18n/zh.json

Large diffs are not rendered by default.

0 comments on commit 9ba314c

Please sign in to comment.