-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CE-369] Implement invoke/query smart contract
Add running smart contract page for show all running chain code. Can invoke/query smart contract in running chain code detail page. Fix chain root path not clean when chain is released. Change-Id: I1ab6af5bc4023182f28e03651e30f282d5d2502e Signed-off-by: Haitao Yue <hightall@me.com>
- Loading branch information
Showing
23 changed files
with
1,389 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
import { queryDeploys, queryDeploy, operateDeploy } from "../services/deploy"; | ||
|
||
export default { | ||
namespace: "deploy", | ||
|
||
state: { | ||
deploys: [], | ||
currentDeploy: {}, | ||
total: 0, | ||
instantiatedCount: 0, | ||
instantiatingCount: 0, | ||
errorCount: 0, | ||
}, | ||
|
||
effects: { | ||
*fetch({ payload }, { call, put }) { | ||
const response = yield call(queryDeploys, payload); | ||
const { | ||
data, | ||
total, | ||
instantiatedCount, | ||
instantiatingCount, | ||
errorCount, | ||
} = response.data; | ||
yield put({ | ||
type: "setDeploys", | ||
payload: { | ||
deploys: data, | ||
total, | ||
instantiatingCount, | ||
instantiatedCount, | ||
errorCount, | ||
}, | ||
}); | ||
}, | ||
*queryDeploy({ payload }, { call, put }) { | ||
const response = yield call(queryDeploy, payload.id); | ||
const { deploy } = response; | ||
yield put({ | ||
type: "setDeploy", | ||
payload: { | ||
currentDeploy: deploy, | ||
}, | ||
}); | ||
}, | ||
*operateDeploy({ payload }, { call }) { | ||
const response = yield call(operateDeploy, payload); | ||
if (payload.callback) { | ||
yield call(payload.callback, { | ||
request: payload, | ||
response, | ||
}); | ||
} | ||
}, | ||
}, | ||
|
||
reducers: { | ||
setDeploys(state, action) { | ||
const { | ||
deploys, | ||
total, | ||
instantiatedCount, | ||
instantiatingCount, | ||
errorCount, | ||
} = action.payload; | ||
return { | ||
...state, | ||
deploys, | ||
total, | ||
instantiatedCount, | ||
instantiatingCount, | ||
errorCount, | ||
}; | ||
}, | ||
setDeploy(state, action) { | ||
const { currentDeploy } = action.payload; | ||
return { | ||
...state, | ||
currentDeploy, | ||
}; | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,3 +107,7 @@ | |
align-content: center; | ||
text-align: center; | ||
} | ||
|
||
.status-text { | ||
text-transform: capitalize; | ||
} |
Oops, something went wrong.