Skip to content

Commit d93efc8

Browse files
committed
更新UI,增加数据管理界面
1 parent d0c2365 commit d93efc8

25 files changed

+339
-463
lines changed

conf/nbs-conf.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ nbs.client.merkle.root=.merkleroot
44
nbs.client.merkle.add.log.name=.merkle
55
nbs.client.profile.root=profile
66
nbs.client.files.root=nbs
7-
nbs.client.im.topic.subworld=disabled
7+
nbs.client.im.topic.subworld=enabled
88
nbs.client.heart.monitor.seconds=300
9+
nbs.client.im.replay-open=false
910
nbs.client.i18n.home=zh_cn
1011
#nbs server config
1112
nbs.server.address=/ip4/127.0.0.1/tcp/5001

conf/nbs.db

24 KB
Binary file not shown.

conf/zh-cn.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ nbs.ui.panel.status.default-nickname= NBSChain_9527
2929

3030

3131
#### about
32+
nbs.ui.panel.about.label.version-title=The Next Block chain System
3233
nbs.ui.panel.about.label.ver-name=\u5F53\u524D\u7248\u672C
33-
nbs.ui.panel.about.label.ver-value=v0.2.1
34+
nbs.ui.panel.about.label.ver-value=v0.2.2
3435
nbs.ui.panel.about.html.ver-log=http://nbs.lanbery.cn/nbs/client4j/update.log.html
3536

3637
#### File

src/main/java/io/nbs/client/adapter/ReceiverMessageAdapter.java

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import io.nbs.client.ui.panels.im.IMPeersPanel;
1212
import io.nbs.client.vo.ContactsItem;
1313

14+
import io.nbs.commons.helper.ConfigurationHelper;
1415
import io.nbs.commons.utils.DataBaseUtil;
1516
import io.nbs.commons.utils.UUIDGenerator;
1617
import io.nbs.sdk.beans.MessageItem;
@@ -58,7 +59,13 @@ public void notifyRecvMessage(MessageItem item) {
5859
listView.setAutoScrollToBottom();
5960
//
6061
saveWorldMessage(item);
61-
autoRepaly(item.getSenderUsername());
62+
/**
63+
* AutoReplay enabled
64+
*/
65+
if(ConfigurationHelper.getInstance().getCfgProps().getProperty("nbs.client.im.replay-open","false").equals("true")){
66+
autoRepaly(item.getSenderUsername());
67+
}
68+
//
6269
}
6370
}
6471

@@ -103,16 +110,13 @@ private void saveWorldMessage(MessageItem item){
103110
}
104111

105112
private void autoRepaly(final String name){
106-
new Thread(()->{
107-
IpfsMessageSender sender = MainFrame.getContext().getMessageSender();
108-
String text = "你好"+name+"收到!";
109-
try {
110-
sender.ipfsSendMessage(text);
111-
} catch (Exception e) {
112-
e.printStackTrace();
113-
}
114-
}).start();
115-
113+
IpfsMessageSender sender = MainFrame.getContext().getMessageSender();
114+
String text = "你好"+name+"收到!";
115+
try {
116+
sender.ipfsSendMessage(text);
117+
} catch (Exception e) {
118+
e.printStackTrace();
119+
}
116120
}
117121

118122
/**

src/main/java/io/nbs/client/cnsts/ColorCnst.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,9 @@ public class ColorCnst {
4444
public static final Color SEEARCH_ITEM_GRAY_LIGHT = new Color(247, 247, 247);
4545
public static final Color SEEARCHTEXT_ITEM_GRAYBG = new Color(175, 175, 175);
4646
public static final Color SEEARCH_ITEM_GRAY_DARKER = new Color(138, 138, 138);
47+
48+
/**
49+
* About
50+
*/
51+
public static final Color FONT_ABOUT_TITLE_BLUE = new Color(59, 54, 98);
4752
}

src/main/java/io/nbs/client/listener/IPFSFileUploader.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,6 @@ private void uploadSuccessNotify(MerkleNode node){
105105
int pos = messageItems.size();
106106
messagePanel.getListView().notifyItemInserted(pos-1,true);
107107
}
108-
109-
// ipfs.pubsub.pub(IpfsMessageSender.NBSWORLD_IMS_TOPIC,)
110-
//ipfs.object.
111-
112-
//ipfs.pin.add()
113108
}
114109

115110
/**

src/main/java/io/nbs/client/services/PeerServiceImpl.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import io.ipfs.api.IPFS;
88
import io.ipfs.api.JSONParser;
99
import io.nbs.client.Launcher;
10+
import io.nbs.commons.helper.ConfigurationHelper;
1011
import io.nbs.commons.helper.RadomCharactersHelper;
1112
import org.apache.ibatis.session.SqlSession;
1213
import org.slf4j.Logger;
@@ -124,12 +125,14 @@ private ContactsItem convert(PeerContactsEntity entity){
124125
public List<String> getOnlinePeers(){
125126
List<String> result = null;
126127
try {
127-
Object o = ipfs.pubsub.peers();
128-
//ipfs.pubsub.peers(IPFSHelper.NBSWORLD_IMS_TOPIC);
128+
Object o = null;
129+
if(ConfigurationHelper.getInstance().subWorldPeers()){
130+
o = ipfs.pubsub.peers(IpfsMessageSender.NBSWORLD_IMS_TOPIC);
131+
}else {
132+
o = ipfs.pubsub.peers();
133+
}
129134
result = (List<String>)JSONParser.getValue(o,"Strings");
130-
/* for(String p : result){
131-
logger.info(">>>>>>>GET {} peers",p);
132-
}*/
135+
133136
} catch (IOException e) {
134137
e.printStackTrace();
135138
}

src/main/java/io/nbs/client/ui/frames/MainFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public static MainFrame getContext() {
213213
}
214214

215215
public static enum MainCardLayoutTypes{
216-
INFO,IM,DATD,MUSIC,ABOUT;
216+
INFO,IM,DATD,MUSIC,ABOUT,MEDIA;
217217
}
218218

219219
public PeerInfo getCurrentPeer() {
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package io.nbs.client.ui.panels.about;
2+
3+
import io.nbs.client.ui.panels.ParentAvailablePanel;
4+
5+
import javax.swing.*;
6+
7+
/**
8+
* @Package : io.nbs.client.ui.panels.about
9+
* @Description : <p></p>
10+
* @Author : lambor.c
11+
* @Date : 2018/7/9-11:38
12+
* Copyright (c) 2018, NBS , lambor.c<[email protected]>.
13+
* All rights reserved.
14+
*/
15+
public class AboutBodyPanel extends ParentAvailablePanel {
16+
private static AboutBodyPanel context;
17+
18+
/**
19+
* construction
20+
*/
21+
public AboutBodyPanel(JPanel parent) {
22+
super(parent);
23+
initComponents();
24+
initView();
25+
setListeners();
26+
}
27+
28+
/**
29+
* [initComponents description]
30+
*
31+
* @return {[type]} [description]
32+
*/
33+
private void initComponents() {
34+
35+
}
36+
37+
/**
38+
* [initView description]
39+
*
40+
* @return {[type]} [description]
41+
*/
42+
private void initView() {
43+
44+
}
45+
46+
private void setListeners() {
47+
48+
}
49+
50+
/**
51+
* [getContext description]
52+
*
53+
* @return {[type]} [description]
54+
*/
55+
public static AboutBodyPanel getContext() {
56+
return context;
57+
}
58+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package io.nbs.client.ui.panels.about;
2+
3+
import io.nbs.client.ui.panels.ParentAvailablePanel;
4+
5+
import javax.swing.*;
6+
7+
/**
8+
* @Package : io.nbs.client.ui.panels.about
9+
* @Description : <p></p>
10+
* @Author : lambor.c
11+
* @Date : 2018/7/9-11:39
12+
* Copyright (c) 2018, NBS , lambor.c<[email protected]>.
13+
* All rights reserved.
14+
*/
15+
public class AboutFooterPanel extends ParentAvailablePanel {
16+
private static AboutFooterPanel context;
17+
18+
/**
19+
* construction
20+
*/
21+
public AboutFooterPanel(JPanel parent) {
22+
super(parent);
23+
initComponents();
24+
initView();
25+
setListeners();
26+
}
27+
28+
/**
29+
* [initComponents description]
30+
*
31+
* @return {[type]} [description]
32+
*/
33+
private void initComponents() {
34+
35+
}
36+
37+
/**
38+
* [initView description]
39+
*
40+
* @return {[type]} [description]
41+
*/
42+
private void initView() {
43+
44+
}
45+
46+
private void setListeners() {
47+
48+
}
49+
50+
/**
51+
* [getContext description]
52+
*
53+
* @return {[type]} [description]
54+
*/
55+
public static AboutFooterPanel getContext() {
56+
return context;
57+
}
58+
}

0 commit comments

Comments
 (0)