socket
This commit is contained in:
parent
4ac6adee4d
commit
e6ce38970f
@ -134,7 +134,9 @@ connection
|
|||||||
});
|
});
|
||||||
const io = require("socket.io").listen(server);
|
const io = require("socket.io").listen(server);
|
||||||
io.sockets.on("connection", socket => {
|
io.sockets.on("connection", socket => {
|
||||||
|
setInterval(function() {
|
||||||
universalGetLatestBlockDetails(socket);
|
universalGetLatestBlockDetails(socket);
|
||||||
|
},1000);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
@ -2,6 +2,7 @@ import { getConnection } from "typeorm";
|
|||||||
const moment = require("moment");
|
const moment = require("moment");
|
||||||
|
|
||||||
export async function universalGetLatestBlockDetails(socket) {
|
export async function universalGetLatestBlockDetails(socket) {
|
||||||
|
|
||||||
let block_height = "",
|
let block_height = "",
|
||||||
letest_block = "",
|
letest_block = "",
|
||||||
letest_block_num = "",
|
letest_block_num = "",
|
||||||
|
@ -16,15 +16,18 @@ export class ChartService {
|
|||||||
private server = environment.domain;
|
private server = environment.domain;
|
||||||
private socket;
|
private socket;
|
||||||
|
|
||||||
constructor(public http: HttpClient) {}
|
constructor(public http: HttpClient) {
|
||||||
|
|
||||||
public createSocketConnection() {
|
|
||||||
this.socket = io.connect(this.server);
|
this.socket = io.connect(this.server);
|
||||||
this.socket.on("connect", function(socket) {
|
|
||||||
console.log("Connected!");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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> {
|
public apiGetRequest(request: any, reqUrl): Observable<any> {
|
||||||
return this.http
|
return this.http
|
||||||
.get(`${environment.apiUrl}` + reqUrl, {
|
.get(`${environment.apiUrl}` + reqUrl, {
|
||||||
|
@ -31,6 +31,8 @@ export class BlockDetailListComponent implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.gettinglatesthashList();
|
this.gettinglatesthashList();
|
||||||
this.getBlockDetails();
|
this.getBlockDetails();
|
||||||
|
console.log("Enter Nginit");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
|
@ -645,3 +645,10 @@ body.dark_theme {
|
|||||||
.dark_theme .view_content table{border-color: #384566;}
|
.dark_theme .view_content table{border-color: #384566;}
|
||||||
.dark_theme .card-body{background-color: #1c2437;}
|
.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…
x
Reference in New Issue
Block a user