Merge branch 'zgo-test' of https://gitlab.com/pitmutt/zgo into zgo-test
2022-07-22 - actualizacion
This commit is contained in:
commit
e4a557660d
5 changed files with 14 additions and 30 deletions
19
server.js
19
server.js
|
@ -1,19 +0,0 @@
|
||||||
var fs = require('fs');
|
|
||||||
var http = require('http');
|
|
||||||
//var https = require('https');
|
|
||||||
|
|
||||||
//var certificate = fs.readFileSync('/etc/letsencrypt/live/zgo.cash/fullchain.pem');
|
|
||||||
//var privateKey = fs.readFileSync('/etc/letsencrypt/live/zgo.cash/privkey.pem');
|
|
||||||
|
|
||||||
//var credentials = {key: privateKey, cert: certificate};
|
|
||||||
|
|
||||||
const app = require('./backend/app');
|
|
||||||
const port = 3000;
|
|
||||||
|
|
||||||
app.set('port', port);
|
|
||||||
|
|
||||||
const httpServer = http.createServer(app);
|
|
||||||
//const httpsServer = https.createServer(credentials, app);
|
|
||||||
|
|
||||||
httpServer.listen(port);
|
|
||||||
//httpsServer.listen(port);
|
|
|
@ -23,10 +23,10 @@
|
||||||
<div class="rv_price" *ngIf="!owner.zats">
|
<div class="rv_price" *ngIf="!owner.zats">
|
||||||
<img class="icon"
|
<img class="icon"
|
||||||
src="/assets/zec_rv.png"
|
src="/assets/zec_rv.png"
|
||||||
height="16px">{{(item.cost/price) | number: '1.06'}}
|
height="16px">{{(item.cost/zecPrice) | number: '1.06'}}
|
||||||
[{{item.cost | number: '1.02' | currency: getCurrency() }}]
|
[{{item.cost | number: '1.02' | currency: getCurrency() }}]
|
||||||
</div>
|
</div>
|
||||||
<p class="price" *ngIf="owner.zats"> ⓩ(item.cost/price)*100000000 | number: '1.0-0'}}</p>
|
<p class="price" *ngIf="owner.zats"> ⓩ(item.cost/zecPrice)*100000000 | number: '1.0-0'}}</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit, Input } from '@angular/core';
|
||||||
import { MatDialog, MatDialogConfig} from '@angular/material/dialog';
|
import { MatDialog, MatDialogConfig} from '@angular/material/dialog';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Item } from '../item.model';
|
import { Item } from '../item.model';
|
||||||
|
@ -19,6 +19,10 @@ import { ItemAddComponent } from '../item-add/item-add.component';
|
||||||
})
|
})
|
||||||
|
|
||||||
export class ItemListComponent implements OnInit{
|
export class ItemListComponent implements OnInit{
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
zecPrice: number = 1;
|
||||||
|
|
||||||
public items: Item[] = [];
|
public items: Item[] = [];
|
||||||
owner: Owner = {
|
owner: Owner = {
|
||||||
_id: '',
|
_id: '',
|
||||||
|
@ -45,10 +49,8 @@ export class ItemListComponent implements OnInit{
|
||||||
expiration: new Date(Date.now()).toISOString(),
|
expiration: new Date(Date.now()).toISOString(),
|
||||||
viewkey: ''
|
viewkey: ''
|
||||||
};
|
};
|
||||||
public price: number = 1;
|
|
||||||
public ownerUpdate: Observable<Owner>;
|
public ownerUpdate: Observable<Owner>;
|
||||||
public itemsUpdate: Observable<Item[]>;
|
public itemsUpdate: Observable<Item[]>;
|
||||||
public priceUpdate: Observable<number>;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public itemService: ItemService,
|
public itemService: ItemService,
|
||||||
|
@ -59,18 +61,13 @@ export class ItemListComponent implements OnInit{
|
||||||
) {
|
) {
|
||||||
this.ownerUpdate = userService.ownerUpdate;
|
this.ownerUpdate = userService.ownerUpdate;
|
||||||
this.itemsUpdate = itemService.itemsUpdated;
|
this.itemsUpdate = itemService.itemsUpdated;
|
||||||
this.priceUpdate = fullnodeService.priceUpdate;
|
|
||||||
this.ownerUpdate.subscribe((owner) => {
|
this.ownerUpdate.subscribe((owner) => {
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
fullnodeService.getPrice(this.owner.currency);
|
|
||||||
itemService.getItems(this.owner.address);
|
itemService.getItems(this.owner.address);
|
||||||
this.itemsUpdate.subscribe((items) => {
|
this.itemsUpdate.subscribe((items) => {
|
||||||
this.items = items;
|
this.items = items;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.priceUpdate.subscribe((price) => {
|
|
||||||
this.price = price;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(){
|
ngOnInit(){
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="orientation">
|
<div *ngIf="orientation">
|
||||||
<app-order></app-order>
|
<app-order></app-order>
|
||||||
<app-item-list></app-item-list>
|
<app-item-list [zecPrice]="price"></app-item-list>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!orientation" align="center">
|
<div *ngIf="!orientation" align="center">
|
||||||
<table cellspacing="0" width="75%">
|
<table cellspacing="0" width="75%">
|
||||||
|
|
|
@ -52,9 +52,11 @@ export class ViewerComponent implements OnInit {
|
||||||
expiration: new Date(Date.now()).toISOString(),
|
expiration: new Date(Date.now()).toISOString(),
|
||||||
viewkey: ''
|
viewkey: ''
|
||||||
};
|
};
|
||||||
|
public price: number = 1;
|
||||||
public addrUpdate: Observable<string>;
|
public addrUpdate: Observable<string>;
|
||||||
public ownerUpdate: Observable<Owner>;
|
public ownerUpdate: Observable<Owner>;
|
||||||
public userUpdate: Observable<User>;
|
public userUpdate: Observable<User>;
|
||||||
|
public priceUpdate: Observable<number>;
|
||||||
orientation: boolean = false;
|
orientation: boolean = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -65,6 +67,7 @@ export class ViewerComponent implements OnInit {
|
||||||
){
|
){
|
||||||
this.addrUpdate = fullnodeService.addrUpdate;
|
this.addrUpdate = fullnodeService.addrUpdate;
|
||||||
this.ownerUpdate = userService.ownerUpdate;
|
this.ownerUpdate = userService.ownerUpdate;
|
||||||
|
this.priceUpdate = fullnodeService.priceUpdate;
|
||||||
this.ownerUpdate.subscribe((owner) => {
|
this.ownerUpdate.subscribe((owner) => {
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
});
|
});
|
||||||
|
@ -72,6 +75,9 @@ export class ViewerComponent implements OnInit {
|
||||||
this.userUpdate.subscribe((user) => {
|
this.userUpdate.subscribe((user) => {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
});
|
});
|
||||||
|
this.priceUpdate.subscribe((price) => {
|
||||||
|
this.price = price;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(){
|
ngOnInit(){
|
||||||
|
|
Loading…
Reference in a new issue