github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/ui/src/util/docs.ts (about) 1 // Copyright 2018 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 import { getDataFromServer } from "src/util/dataFromServer"; 12 13 const stable = "stable"; 14 const version = getDataFromServer().Version || stable; 15 const docsURLBase = "https://www.cockroachlabs.com/docs/" + version; 16 const docsURLBaseNoVersion = "https://www.cockroachlabs.com/docs/" + stable; 17 18 function docsURL(pageName: string): string { 19 return `${docsURLBase}/${pageName}`; 20 } 21 22 function docsURLNoVersion(pageName: string): string { 23 return `${docsURLBaseNoVersion}/${pageName}`; 24 } 25 26 export const adminUILoginNoVersion = docsURLNoVersion("admin-ui-access-and-navigate.html#secure-the-admin-ui"); 27 export const startFlags = docsURL("start-a-node.html#flags"); 28 export const pauseJob = docsURL("pause-job.html"); 29 export const cancelJob = docsURL("cancel-job.html"); 30 export const enableNodeMap = docsURL("enable-node-map.html"); 31 export const configureReplicationZones = docsURL("configure-replication-zones.html"); 32 export const transactionalPipelining = docsURL("architecture/transaction-layer.html#transaction-pipelining"); 33 export const adminUIAccess = docsURL("admin-ui-overview.html#admin-ui-access"); 34 export const statementDiagnostics = docsURL("admin-ui-statements-page.html#diagnostics"); 35 export const howAreCapacityMetricsCalculated = docsURL("admin-ui-storage-dashboard.html#capacity-metrics"); 36 export const keyValuePairs = docsURL("architecture/distribution-layer.html#table-data"); 37 export const databaseTable = docsURL("admin-ui-databases-page.html"); 38 export const jobTable = docsURL("admin-ui-jobs-page.html"); 39 export const statementsTable = docsURL("admin-ui-statements-page.html"); 40 41 export const statementsSql = docsURL("admin-ui-statements-page.html#sql-statement-fingerprints"); 42 export const statementsRetries = docsURL("transactions.html#transaction-retries"); 43 export const statementsTimeInterval = docsURL("admin-ui-statements-page.html#time-interval"); 44 // Note that these explicitly don't use the current version, since we want to 45 // link to the most up-to-date documentation available. 46 export const upgradeCockroachVersion = "https://www.cockroachlabs.com/docs/stable/upgrade-cockroach-version.html"; 47 export const enterpriseLicensing = "https://www.cockroachlabs.com/docs/stable/enterprise-licensing.html"; 48 49 // Not actually a docs URL. 50 export const startTrial = "https://www.cockroachlabs.com/pricing/start-trial/";