Skip to content

Commit

Permalink
fix: Fix cluster API
Browse files Browse the repository at this point in the history
Signed-off-by: leoliu <leoliu@yunify.com>
  • Loading branch information
leoliu committed Aug 7, 2020
1 parent fe9e89b commit b811ad7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/stores/cluster/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export default class ClusterStore extends Base {
getAgentUrl = ({ cluster }) =>
`kapis/cluster.kubesphere.io/v1alpha1/clusters/${cluster}/agent/deployment`

getTenantUrl = (params = {}) =>
`kapis/tenant.kubesphere.io/v1alpha2${this.getPath(params)}/${this.module}`

@action
async fetchList({ cluster, workspace, namespace, more, ...params } = {}) {
this.list.isLoading = true
Expand Down
5 changes: 4 additions & 1 deletion src/utils/object.mapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@ const PodsMapper = item => ({

const EventsMapper = item => {
const now = Date.now()

item.lastTimestamp = item.lastTimestamp || now

const age =
item.count > 1
? `${moment(item.lastTimestamp).to(now, true)} (x${
Expand Down Expand Up @@ -1072,7 +1075,7 @@ const ClusterMapper = item => {
const FederatedMapper = resourceMapper => item => {
const baseInfo = getBaseInfo(item)
const overrides = get(item, 'spec.overrides', [])
const template = get(item, 'spec.template', {})
const template = cloneDeep(get(item, 'spec.template', {}))
const clusters = get(item, 'spec.placement.clusters', [])
const overrideClusterMap = keyBy(overrides, 'clusterName')
const clusterTemplates = {}
Expand Down

0 comments on commit b811ad7

Please sign in to comment.