xianjingfeng commented on code in PR #1969:
URL:
https://github.com/apache/incubator-uniffle/pull/1969#discussion_r1699615896
##########
dashboard/src/main/webapp/src/pages/serverstatus/ExcludeNodeList.vue:
##########
@@ -136,14 +135,115 @@ export default {
getShuffleExcludeNodesPage()
}
+ async function addShuffleExcludeNodesPage() {
+ try {
+ const excludeNodes = textarea.value.split('\n').map((item) =>
item.trim())
+ const excludeNodesObj = { excludeNodes }
+ const res = await addShuffleExcludeNodes(excludeNodesObj)
+ if (res.status >= 200 && res.status < 300) {
+ if (res.data.data === 'success') {
+ ElMessage.success('Add successfully.')
+ } else {
+ ElMessage.error('Add failed.')
+ }
+ } else {
+ ElMessage.error('Failed to add due to server bad.')
+ }
+ } catch (err) {
+ ElMessage.error('Failed to add due to network exception.')
+ }
+ }
+
+ /**
+ * The following describes how to handle blacklist deletion events.
+ */
+ const selectItemNum = ref(0)
+ const rowKey = 'id'
+ const selectedRows = ref([])
+ function handlerSelectionChange(selection) {
+ selectedRows.value = selection
+ selectItemNum.value = selectedRows.value.length
+ }
+ function handlerDeleteNode() {
+ ElMessageBox.confirm('Are you sure about removing these nodes?',
'Warning', {
+ confirmButtonText: 'OK',
+ cancelButtonText: 'Cancel',
+ type: 'warning'
+ })
+ .then(() => {
+ if (selectedRows.value.length === 0) {
+ ElMessage({
+ type: 'info',
+ message: 'No node is selected, Nothing!'
+ })
+ } else {
+ const selectedIds = selectedRows.value.map((row) => row[rowKey])
+ // pageData.tableData = pageData.tableData.filter(row =>
!selectedIds.includes(row[rowKey]));
+ deleteShuffleExcludeNodesPage(selectedIds)
+ // Refreshing the number of blacklists.
+ updateTotalPage()
+ // Refreshing the Blacklist list.
+ getShuffleExcludeNodesPage()
+ ElMessage({
+ type: 'success',
+ message: 'Delete completed'
+ })
+ }
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: 'Delete canceled'
+ })
+ })
+ }
+
+ async function deleteShuffleExcludeNodesPage(excludeNodes) {
Review Comment:
```suggestion
async function deleteShuffleExcludedNodes(excludeNodes) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]