socket
This commit is contained in:
parent
4ac6adee4d
commit
e6ce38970f
@ -134,7 +134,9 @@ connection
|
||||
});
|
||||
const io = require("socket.io").listen(server);
|
||||
io.sockets.on("connection", socket => {
|
||||
setInterval(function() {
|
||||
universalGetLatestBlockDetails(socket);
|
||||
},1000);
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
|
@ -2,6 +2,7 @@ import { getConnection } from "typeorm";
|
||||
const moment = require("moment");
|
||||
|
||||
export async function universalGetLatestBlockDetails(socket) {
|
||||
|
||||
let block_height = "",
|
||||
letest_block = "",
|
||||
letest_block_num = "",
|
||||
|
@ -16,15 +16,18 @@ export class ChartService {
|
||||
private server = environment.domain;
|
||||
private socket;
|
||||
|
||||
constructor(public http: HttpClient) {}
|
||||
|
||||
public createSocketConnection() {
|
||||
this.socket = io.connect(this.server);
|
||||
this.socket.on("connect", function(socket) {
|
||||
console.log("Connected!");
|
||||
});
|
||||
constructor(public http: HttpClient) {
|
||||
this.socket = io.connect(this.server);
|
||||
}
|
||||
|
||||
// public createSocketConnection() {
|
||||
// console.log("environment.domain",environment.domain);
|
||||
// this.socket = io.connect(this.server);
|
||||
// this.socket.on("connect", function(socket) {
|
||||
// console.log("Connected!");
|
||||
// });
|
||||
// }
|
||||
|
||||
public apiGetRequest(request: any, reqUrl): Observable<any> {
|
||||
return this.http
|
||||
.get(`${environment.apiUrl}` + reqUrl, {
|
||||
|
@ -31,6 +31,8 @@ export class BlockDetailListComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
this.gettinglatesthashList();
|
||||
this.getBlockDetails();
|
||||
console.log("Enter Nginit");
|
||||
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
|
@ -473,7 +473,7 @@ a[aria-expanded="true"] > .tab_hdng:after {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
.timer{
|
||||
min-width: 140px;
|
||||
margin-right: 10px;
|
||||
@ -644,4 +644,11 @@ body.dark_theme {
|
||||
.dark_theme .tab_hdng{color: #ffffff;}
|
||||
.dark_theme .view_content table{border-color: #384566;}
|
||||
.dark_theme .card-body{background-color: #1c2437;}
|
||||
.diff_margin{margin-bottom: -10px !important; margin-top: -10px !important;}
|
||||
.diff_margin{margin-bottom: -10px !important; margin-top: -10px !important;}
|
||||
|
||||
.item-highlight {
|
||||
animation: yellowfade 5s ;
|
||||
-moz-animation: yellowfade 5s ;
|
||||
-webkit-animation: yellowfade 5s ;
|
||||
-o-animation: yellowfade 5s ;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user