mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-23 01:55:10 +00:00
Updated initial ledger details and added proper field names in the frontend
This commit is contained in:
parent
324e03b56a
commit
a58bb6897d
2 changed files with 33 additions and 33 deletions
|
|
@ -14,46 +14,46 @@ export class AssetTransferContract extends Contract {
|
|||
public async InitLedger(ctx: Context): Promise<void> {
|
||||
const assets: Asset[] = [
|
||||
{
|
||||
ID: 'asset1',
|
||||
Color: 'blue',
|
||||
ID: '1',
|
||||
Color: 'Cotton',
|
||||
Size: 5,
|
||||
Owner: 'Tomoko',
|
||||
AppraisedValue: 300,
|
||||
Owner: 'ABC Ltd',
|
||||
AppraisedValue: 200,
|
||||
},
|
||||
{
|
||||
ID: 'asset2',
|
||||
Color: 'red',
|
||||
Size: 5,
|
||||
Owner: 'Brad',
|
||||
ID: '2',
|
||||
Color: 'Wool',
|
||||
Size: 2,
|
||||
Owner: 'ABC Ltd',
|
||||
AppraisedValue: 400,
|
||||
},
|
||||
{
|
||||
ID: 'asset3',
|
||||
Color: 'green',
|
||||
ID: '3',
|
||||
Color: 'Silk',
|
||||
Size: 10,
|
||||
Owner: 'Jin Soo',
|
||||
Owner: 'ABC Ltd',
|
||||
AppraisedValue: 500,
|
||||
},
|
||||
{
|
||||
ID: 'asset4',
|
||||
Color: 'yellow',
|
||||
ID: '4',
|
||||
Color: 'Linen',
|
||||
Size: 10,
|
||||
Owner: 'Max',
|
||||
Owner: 'ABC Ltd',
|
||||
AppraisedValue: 600,
|
||||
},
|
||||
{
|
||||
ID: 'asset5',
|
||||
Color: 'black',
|
||||
ID: '5',
|
||||
Color: 'Flannel',
|
||||
Size: 15,
|
||||
Owner: 'Adriana',
|
||||
AppraisedValue: 700,
|
||||
Owner: 'ABC Ltd',
|
||||
AppraisedValue: 300,
|
||||
},
|
||||
{
|
||||
ID: 'asset6',
|
||||
Color: 'white',
|
||||
ID: '6',
|
||||
Color: 'Cotton Blend',
|
||||
Size: 15,
|
||||
Owner: 'Michel',
|
||||
AppraisedValue: 800,
|
||||
Owner: 'ABC Ltd',
|
||||
AppraisedValue: 150,
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -71,15 +71,15 @@
|
|||
<a href="transaction_flow.PNG" target="_blank">
|
||||
<img src="transaction_flow.PNG" style="width:100%">
|
||||
</a>
|
||||
<label>List All Fabric items in the Ledger</label>
|
||||
<label>List all Fabric items in the Ledger</label>
|
||||
<p><input id="queryAllProduce" type="submit" value="Query" class="btn btn-primary" ng-click="queryAllProduce()"></p>
|
||||
</div>
|
||||
|
||||
<table id="all_produce" class="table" align="center">
|
||||
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Color</th>
|
||||
<th>ProductID</th>
|
||||
<th>Type</th>
|
||||
<th>Size</th>
|
||||
<th>Price</th>
|
||||
<th>Owner</th>
|
||||
|
|
@ -98,15 +98,15 @@
|
|||
<label>Query a Specific Fabric by ID</label><br>
|
||||
<h5 style="color:red;margin-bottom:2%" id="error_query">Error: Please enter a valid Id</h5>
|
||||
|
||||
Enter a ID number: <input id="createName" class="form-control" type="text" placeholder="Ex: 3" ng-model="produce_id">
|
||||
Enter an ID number: <input id="createName" class="form-control" type="text" placeholder="Ex: 3" ng-model="produce_id">
|
||||
<input id="querySubmit" type="submit" value="Query" class="btn btn-primary" ng-click="queryProduce()">
|
||||
</div>
|
||||
|
||||
<table id="query_produce" class="table" align="center">
|
||||
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Color</th>
|
||||
<th>ProductID</th>
|
||||
<th>Type</th>
|
||||
<th>Size</th>
|
||||
<th>Price</th>
|
||||
<th>Owner</th>
|
||||
|
|
@ -126,19 +126,19 @@
|
|||
<h5 style="color:green;margin-bottom:2%" id="success_create">Successfully added to Ledger!</h5>
|
||||
<br>
|
||||
Fabric id: <input class="form-control" type="text" placeholder="Ex: 6" ng-model="produce.assetID">
|
||||
Color: <input class="form-control" type=text placeholder="Ex: blue" ng-model="produce.color">
|
||||
Type: <input class="form-control" type=text placeholder="Ex: Cotton" ng-model="produce.color">
|
||||
Size: <input class="form-control" type=number step=1 ng-model="produce.size">
|
||||
Price: <input class="form-control" type=number step=1 ng-model="produce.appraisedValue">
|
||||
Owner name: <input class="form-control" type="text" placeholder="Ex: Sakya" ng-model="produce.owner">
|
||||
Owner name: <input class="form-control" type="text" placeholder="Ex: Alice" ng-model="produce.owner">
|
||||
<input id="createSubmit" type="submit" value="Create" class="btn btn-primary" ng-click="recordProduce()">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Change Product Owner</label><br>
|
||||
<h5 style="color:green;margin-bottom:2%" id="success_holder">Successfully updated Ledger! Tx ID: {{change_holder}}</h5>
|
||||
<h5 style="color:green;margin-bottom:2%" id="success_holder">Successfully updated Ledger!</h5>
|
||||
<h5 style="color:red;margin-bottom:2%" id="error_holder">Error: Please enter a valid Product Id</h5>
|
||||
Enter a ID of the product to transfer ownership: <input class="form-control" name="assetSelect" placeholder="Ex: 1" ng-model="holder.assetID">
|
||||
Enter name of new owner: <input class="form-control" name="assetSelect" placeholder="Ex: Dalio" ng-model="holder.name">
|
||||
Enter the product ID to transfer ownership: <input class="form-control" name="assetSelect" placeholder="Ex: 1" ng-model="holder.assetID">
|
||||
Enter the name of new owner: <input class="form-control" name="assetSelect" placeholder="Ex: Dalio" ng-model="holder.name">
|
||||
<input id="transferSubmit" type="submit" value="Change" class="btn btn-primary" ng-click="changeHolder()">
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue