Skip to content
This repository was archived by the owner on Jul 6, 2022. It is now read-only.

Commit ddf4334

Browse files
committed
Adding data client connected icon.
1 parent 15335a6 commit ddf4334

5 files changed

Lines changed: 27 additions & 8 deletions

File tree

‎app/js/Data.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ var Data = {
77
scans: [],
88

99
config: {
10-
data_client: 'http://127.0.0.1:44444/',
10+
data_client: {
11+
url: 'http://127.0.0.1:44444/',
12+
connected: false
13+
},
1114
domain: 'https://standing-fleet.apps.goonswarm.org/',
1215
apiUrl: '/api',
1316
alertStay: 5000,
@@ -61,6 +64,8 @@ var Data = {
6164

6265
bottomMenu: $('#bottom-menu'),
6366
bottomMenu_spinner: $('#bottom-menu-spinner'),
67+
bottomMenu_dataClient: $('#bottom-menu-data-client'),
68+
bottomMenu_dataClient_icon: $('#bottom-menu-data-client i'),
6469
bottomMenu_local: $('#bottom-menu-local'),
6570
bottomMenu_scan: $('#bottom-menu-scan'),
6671
bottomMenu_unlink: $('#bottom-menu-unlink'),

‎app/js/Main.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ $(function () {
33
initialize();
44

55
try {
6-
Data.state.data_client = new Faye.Client(Data.config.data_client);
6+
Data.state.data_client = new Faye.Client(Data.config.data_client.url);
77
Data.state.data_client.subscribe('/events', function(event) {
88
EventHandler.dispatchEvents([event]);
99
});
10+
Data.config.data_client.connected = true;
1011
log('Connected to local data client...');
1112
} catch(err) {
1213
log('Unable to connect to local data client...');

‎app/js/UI.js‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ var UI = {
7373
Data.ui.statusHostile.on('click', $.proxy(UIPanels.showStatusPanel, null, false));
7474

7575
UI.update_scrollables();
76+
UI.data_client_check();
7677
},
7778

7879
update_scrollables: function() {
@@ -82,6 +83,14 @@ var UI = {
8283
Data.ui.events_list.slimScroll({height: 'auto', color: '#ffcc2a', alwaysVisible: true});
8384
Data.ui.fleet_list.slimScroll({height: 'auto', color: '#ffcc2a', alwaysVisible: true});
8485
},
86+
87+
data_client_check: function() {
88+
if (Data.config.data_client.connected) {
89+
Data.ui.bottomMenu_dataClient_icon.addClass('fa-chain');
90+
} else {
91+
Data.ui.bottomMenu_dataClient.remove();
92+
}
93+
},
8594

8695
submitStatusClear: function() {
8796
submitStatus('clear', Data.state.self.characterName);

‎app/styles/main.css‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ div#page, div#content-wrapper { position: relative; height: 100%; width: 100%; b
7474
}
7575

7676
#current {
77-
color: #ff;
77+
color: #fff;
7878
font-family: 'Lato', sans-serif !important;
7979
font-size: 11px !important;
8080
font-weight: 700;
@@ -250,7 +250,8 @@ div#page, div#content-wrapper { position: relative; height: 100%; width: 100%; b
250250
.menu-button.active { height: 2rem }
251251
.menu-button.blink { background-color: #842; }
252252

253-
#bottom-menu-spinner {
253+
#bottom-menu-spinner,
254+
#bottom-menu-data-client {
254255
width: 1.2rem;
255256
background: none;
256257
display: inline-block;
@@ -259,6 +260,11 @@ div#page, div#content-wrapper { position: relative; height: 100%; width: 100%; b
259260
border: none;
260261
}
261262

263+
#bottom-menu-data-client {
264+
cursor: default;
265+
color: #ffcc2a;
266+
}
267+
262268
#bottom-menu a {
263269
color: #fff;
264270
}
@@ -537,10 +543,6 @@ g.node {
537543
fill: #fff;
538544
}
539545

540-
.node rect.current rect:last-child {
541-
542-
}
543-
544546
/* Link line styles */
545547
.link {
546548
stroke: #ccc;

‎server/views/main/index.jade‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ block content
5353
#bottom-menu.sub-bar.right
5454
#bottom-menu-spinner.menu-button
5555
img(src='/images/spinner.gif', alt='Processing...')
56+
#bottom-menu-data-client.menu-button
57+
i.fa
5658
#bottom-menu-scan.menu-button
5759
i.fa.fa-bullseye
5860
span REPORT SCAN

0 commit comments

Comments
 (0)