Skip to content

Commit

Permalink
fix partitioned topic + obj handling (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfortman11 authored Jun 7, 2022
1 parent 81df8e9 commit 8a9ec03
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions dashboard/src/services/ApiService.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,15 +491,15 @@ export default {
createPartitionedTopic (cluster, topicPath, numPartitions) {
const response = ApiBase().put(`${cluster}/persistent/${topicPath}/partitions`, numPartitions, {
headers: {
'Content-Type': 'application/json'
'Content-Type': 'text/plain'
}
})
return response
},
createMissingPartitions (cluster, topicPath) {
const response = ApiBase().post(`${cluster}/persistent/${topicPath}/createMissedPartitions`, '', {
headers: {
'Content-Type': 'application/json'
'Content-Type': 'text/plain'
}
})
return response
Expand Down Expand Up @@ -594,42 +594,42 @@ export default {
return response
},
updateNamespaceOffloadThreshold (cluster, namespacePath, threshold) {
const response = ApiBase().put(`${cluster}/namespaces/${namespacePath}/offloadThreshold`, threshold, { headers: {
const response = ApiBase().put(`${cluster}/namespaces/${namespacePath}/offloadThreshold`, JSON.stringify(threshold), { headers: {
'Content-Type': 'application/json'
}} )
return response
},
updateMaxProducers (cluster, namespacePath, producers) {

const response = ApiBase().post(`${cluster}/namespaces/${namespacePath}/maxProducersPerTopic`, producers, { headers: {
const response = ApiBase().post(`${cluster}/namespaces/${namespacePath}/maxProducersPerTopic`, JSON.stringify(producers), { headers: {
'Content-Type': 'application/json'
}} )
return response
},
updateTtl (cluster, namespacePath, ttl) {

const response = ApiBase().post(`${cluster}/namespaces/${namespacePath}/messageTTL`, ttl, { headers: {
const response = ApiBase().post(`${cluster}/namespaces/${namespacePath}/messageTTL`, JSON.stringify(ttl), { headers: {
'Content-Type': 'application/json'
}} )
return response
},
updateDedupe (cluster, namespacePath, dedupe) {

const response = ApiBase().post(`${cluster}/namespaces/${namespacePath}/deduplication`, dedupe, { headers: {
const response = ApiBase().post(`${cluster}/namespaces/${namespacePath}/deduplication`, JSON.stringify(dedupe), { headers: {
'Content-Type': 'application/json'
}} )
return response
},
updateMaxConsTopic (cluster, namespacePath, consumers) {

const response = ApiBase().post(`${cluster}/namespaces/${namespacePath}/maxConsumersPerTopic`, consumers, { headers: {
const response = ApiBase().post(`${cluster}/namespaces/${namespacePath}/maxConsumersPerTopic`, JSON.stringify(consumers), { headers: {
'Content-Type': 'application/json'
}} )
return response
},
updateMaxConsSub (cluster, namespacePath, consumers) {

const response = ApiBase().post(`${cluster}/namespaces/${namespacePath}/maxConsumersPerSubscription`, consumers, { headers: {
const response = ApiBase().post(`${cluster}/namespaces/${namespacePath}/maxConsumersPerSubscription`, JSON.stringify(consumers), { headers: {
'Content-Type': 'application/json'
}} )
return response
Expand Down
1 change: 0 additions & 1 deletion dashboard/src/store/modules/pulsar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,6 @@ const actions = {
} else {
compatMode = newStrat
}
console.log(compatMode)
if (state.namespacesConfig.data[nsIdx].backlog_quota_map.destination_storage) {
// Name of property changed in 2.8. Making sure the admin console can work before and after 2.8
if (state.namespacesConfig.data[nsIdx].backlog_quota_map.destination_storage.limit) {
Expand Down
3 changes: 2 additions & 1 deletion server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ app.use('/config.js', (req, res, next) => {

// Right the body to the req object. Fixes the issues body-parser causes for the proxies
const onProxyReq = (proxyReq, req, res) => {
if (!req.body || !Object.keys(req.body).length) {
const emptyObj = '{}'
if (req.body == undefined || JSON.stringify(req.body) == emptyObj) {
return;
}

Expand Down

0 comments on commit 8a9ec03

Please sign in to comment.