Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function getClustersList in get-Kar-List.js has Error #32

Closed
masterjyq opened this issue Sep 22, 2022 · 2 comments
Closed

function getClustersList in get-Kar-List.js has Error #32

masterjyq opened this issue Sep 22, 2022 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@masterjyq
Copy link

resolve({ total, rows: listResult }) should in callBack function

Error code

const getClustersList = () => {
  const listResult = []
  let total = 0
  return new Promise(function(resolve) {
    getClusters().then(res => {
      const { items } = res
      items.forEach((n) => {
        listResult.push({
          name: n.metadata.name,
          tag: '',
          desc: '',
          node: n.status.nodeSummary?.readyNum + '/' + n.status.nodeSummary?.totalNum,
          method: n.spec.syncMode,
          tactics: '',
          status: n.status.conditions.map(r => r.type).join('、'),
          version: n.status.kubernetesVersion,
          time: n.metadata.creationTimestamp
        })
      })
      total = items.length
    })
    resolve({ total, rows: listResult })
  })
}

Should be

const getClustersList = () => {
  const listResult = []
  let total = 0
  return new Promise(function(resolve) {
    getClusters().then(res => {
      const { items } = res
      items.forEach((n) => {
        listResult.push({
          name: n.metadata.name,
          tag: '',
          desc: '',
          node: n.status.nodeSummary?.readyNum + '/' + n.status.nodeSummary?.totalNum,
          method: n.spec.syncMode,
          tactics: '',
          status: n.status.conditions.map(r => r.type).join('、'),
          version: n.status.kubernetesVersion,
          time: n.metadata.creationTimestamp
        })
      })
      total = items.length
      resolve({ total, rows: listResult })
    })
  })
}
@masterjyq masterjyq added the kind/bug Categorizes issue or PR as related to a bug. label Sep 22, 2022
@RainbowMango
Copy link
Member

/close
We are currently refactoring the dashboard, please look at the document on the readme file.

@karmada-bot
Copy link
Collaborator

@RainbowMango: Closing this issue.

In response to this:

/close
We are currently refactoring the dashboard, please look at the document on the readme file.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants