fix: pulsar admin/client cli docs jump incorrect
Master Issue:
Motivation
Support auto generate HTML page for pulsar client cli tool, for example:
Modifications
Fix pulsar-admin and pulsar-client jump
@@ -25,23 +25,18 @@ function getCliByVersion(){
var minMinorVersion = 5
var referenceLink = "/pulsar-admin"
if (clientModule === "pulsar-client") {
- minMinorVersion = 7
+ minMinorVersion = 8
referenceLink = "/reference-cli-tools/#pulsar-client"
}
- if (clientModule === "pulsar-admin") {
- if ((majorVersion == 2 && minorVersion <= minMinorVersion) || majorVersion === 1) {
+ if ((majorVersion > 1 && minorVersion <= minMinorVersion) || majorVersion === 1) {
if (version === latestVersion) {
window.location.href = "/docs/en" + referenceLink
- return
} else {
window.location.href = "/docs/en/" + version + referenceLink
- return
}
} else {
version = parseInt(versions[0]) + "." + parseInt(versions[1]) + ".0"
- window.location.href = "http://pulsar.apache.org/tools/ + " + clientModule + "/" + version + "-SNAPSHOT"
- return
- }
+ window.location.href = "http://pulsar.apache.org/tools/" + clientModule + "/" + version + "-SNAPSHOT"
}
}
window.onload=getCliByVersion
