1111import { getDataFromServer } from "src/util/dataFromServer" ;
1212
1313const 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 ;
1714
1815function docsURL ( pageName : string ) : string {
16+ const version = getDataFromServer ( ) . Version || stable ;
17+ const docsURLBase = "https://www.cockroachlabs.com/docs/" + version ;
1918 return `${ docsURLBase } /${ pageName } ` ;
2019}
2120
2221function docsURLNoVersion ( pageName : string ) : string {
22+ const docsURLBaseNoVersion = "https://www.cockroachlabs.com/docs/" + stable ;
2323 return `${ docsURLBaseNoVersion } /${ pageName } ` ;
2424}
2525
26- export const adminUILoginNoVersion = docsURLNoVersion (
26+ export let adminUILoginNoVersion = docsURLNoVersion (
2727 "ui-overview.html#db-console-security" ,
2828) ;
29- export const startFlags = docsURL ( "start-a-node.html#flags" ) ;
30- export const pauseJob = docsURL ( "pause-job.html" ) ;
31- export const cancelJob = docsURL ( "cancel-job.html" ) ;
32- export const enableNodeMap = docsURL ( "enable-node-map.html" ) ;
33- export const configureReplicationZones = docsURL (
34- "configure-replication-zones.html" ,
35- ) ;
36- export const transactionalPipelining = docsURL (
37- "architecture/transaction-layer.html#transaction-pipelining" ,
38- ) ;
39- export const adminUIAccess = docsURL ( "ui-overview.html#db-console-access" ) ;
40- export const howAreCapacityMetricsCalculated = docsURL (
41- "ui-storage-dashboard.html#capacity-metrics" ,
42- ) ;
43- export const howAreCapacityMetricsCalculatedOverview = docsURL (
44- "ui-cluster-overview-page.html#capacity-metrics" ,
45- ) ;
46- export const keyValuePairs = docsURL (
47- "architecture/distribution-layer.html#table-data" ,
48- ) ;
49- export const writeIntents = docsURL (
50- "architecture/transaction-layer.html#write-intents" ,
51- ) ;
52- export const metaRanges = docsURL (
53- "architecture/distribution-layer.html#meta-ranges" ,
54- ) ;
55- export const databaseTable = docsURL ( "ui-databases-page.html" ) ;
56- export const jobTable = docsURL ( "ui-jobs-page.html" ) ;
57- export const jobStatus = docsURL ( "ui-jobs-page.html#job-status" ) ;
58- export const jobsPause = docsURL ( "pause-job" ) ;
59- export const jobsResume = docsURL ( "resume-job" ) ;
60- export const jobsCancel = docsURL ( "cancel-job" ) ;
61- export const statementsTable = docsURL ( "ui-statements-page.html" ) ;
62- export const statementDiagnostics = docsURL (
63- "ui-statements-page.html#diagnostics" ,
64- ) ;
65- export const statementsSql = docsURL (
66- "ui-statements-page.html#sql-statement-fingerprints" ,
67- ) ;
68- export const statementsRetries = docsURL (
69- "transactions.html#transaction-retries" ,
70- ) ;
71- export const transactionRetryErrorReference = docsURL (
72- "transaction-retry-error-reference.html" ,
73- ) ;
74- export const capacityMetrics = docsURL (
75- "ui-cluster-overview-page.html#capacity-metrics" ,
76- ) ;
77- export const nodeLivenessIssues = docsURL (
78- "cluster-setup-troubleshooting.html#node-liveness-issues" ,
79- ) ;
80- export const howItWork = docsURL ( "cockroach-quit.html#how-it-works" ) ;
81- export const clusterStore = docsURL ( "cockroach-start.html#store" ) ;
82- export const clusterGlossary = docsURL ( "architecture/overview.html#glossary" ) ;
83- export const clusterSettings = docsURL ( "cluster-settings.html" ) ;
84- export const reviewOfCockroachTerminology = docsURL (
85- "ui-replication-dashboard.html#review-of-cockroachdb-terminology" ,
86- ) ;
87- export const privileges = docsURL ( "authorization.html#privileges" ) ;
88- export const showSessions = docsURL ( "show-sessions.html" ) ;
89- export const sessionsTable = docsURL ( "ui-sessions-page.html" ) ;
29+ export let startFlags : string ;
30+ export let pauseJob : string ;
31+ export let cancelJob : string ;
32+ export let enableNodeMap : string ;
33+ export let configureReplicationZones : string ;
34+ export let transactionalPipelining : string ;
35+ export let adminUIAccess : string ;
36+ export let howAreCapacityMetricsCalculated : string ;
37+ export let howAreCapacityMetricsCalculatedOverview : string ;
38+ export let keyValuePairs : string ;
39+ export let writeIntents : string ;
40+ export let metaRanges : string ;
41+ export let databaseTable : string ;
42+ export let jobTable : string ;
43+ export let jobStatus : string ;
44+ export let jobsPause : string ;
45+ export let jobsResume : string ;
46+ export let jobsCancel : string ;
47+ export let statementsTable : string ;
48+ export let statementDiagnostics : string ;
49+ export let statementsSql : string ;
50+ export let statementsRetries : string ;
51+ export let transactionRetryErrorReference : string ;
52+ export let capacityMetrics : string ;
53+ export let nodeLivenessIssues : string ;
54+ export let howItWork : string ;
55+ export let clusterStore : string ;
56+ export let clusterGlossary : string ;
57+ export let clusterSettings : string ;
58+ export let reviewOfCockroachTerminology : string ;
59+ export let privileges : string ;
60+ export let showSessions : string ;
61+ export let sessionsTable : string ;
9062// Note that these explicitly don't use the current version, since we want to
9163// link to the most up-to-date documentation available.
9264export const upgradeCockroachVersion =
@@ -97,16 +69,70 @@ export const enterpriseLicensing =
9769// Not actually a docs URL.
9870export const startTrial = "https://www.cockroachlabs.com/pricing/start-trial/" ;
9971
100- export const reduceStorageOfTimeSeriesDataOperationalFlags = docsURL (
101- "operational-faqs.html#can-i-reduce-or-disable-the-storage-of-time-series-data" ,
102- ) ;
103-
104- export const performanceBestPracticesHotSpots = docsURL (
105- "performance-best-practices-overview.html#hot-spots" ,
106- ) ;
72+ export let reduceStorageOfTimeSeriesDataOperationalFlags : string ;
73+ export let performanceBestPracticesHotSpots : string ;
74+ export let uiDebugPages : string ;
75+ export let readsAndWritesOverviewPage : string ;
10776
108- export const uiDebugPages = docsURL ( "ui-debug-pages.html" ) ;
77+ export const recomputeDocsURLs = ( ) => {
78+ adminUILoginNoVersion = docsURLNoVersion (
79+ "ui-overview.html#db-console-security" ,
80+ ) ;
81+ startFlags = docsURL ( "start-a-node.html#flags" ) ;
82+ pauseJob = docsURL ( "pause-job.html" ) ;
83+ cancelJob = docsURL ( "cancel-job.html" ) ;
84+ enableNodeMap = docsURL ( "enable-node-map.html" ) ;
85+ configureReplicationZones = docsURL ( "configure-replication-zones.html" ) ;
86+ transactionalPipelining = docsURL (
87+ "architecture/transaction-layer.html#transaction-pipelining" ,
88+ ) ;
89+ adminUIAccess = docsURL ( "ui-overview.html#db-console-access" ) ;
90+ howAreCapacityMetricsCalculated = docsURL (
91+ "ui-storage-dashboard.html#capacity-metrics" ,
92+ ) ;
93+ howAreCapacityMetricsCalculatedOverview = docsURL (
94+ "ui-cluster-overview-page.html#capacity-metrics" ,
95+ ) ;
96+ keyValuePairs = docsURL ( "architecture/distribution-layer.html#table-data" ) ;
97+ writeIntents = docsURL ( "architecture/transaction-layer.html#write-intents" ) ;
98+ metaRanges = docsURL ( "architecture/distribution-layer.html#meta-ranges" ) ;
99+ databaseTable = docsURL ( "ui-databases-page.html" ) ;
100+ jobTable = docsURL ( "ui-jobs-page.html" ) ;
101+ jobStatus = docsURL ( "ui-jobs-page.html#job-status" ) ;
102+ jobsPause = docsURL ( "pause-job" ) ;
103+ jobsResume = docsURL ( "resume-job" ) ;
104+ jobsCancel = docsURL ( "cancel-job" ) ;
105+ statementsTable = docsURL ( "ui-statements-page.html" ) ;
106+ statementDiagnostics = docsURL ( "ui-statements-page.html#diagnostics" ) ;
107+ statementsSql = docsURL ( "ui-statements-page.html#sql-statement-fingerprints" ) ;
108+ statementsRetries = docsURL ( "transactions.html#transaction-retries" ) ;
109+ transactionRetryErrorReference = docsURL (
110+ "transaction-retry-error-reference.html" ,
111+ ) ;
112+ capacityMetrics = docsURL ( "ui-cluster-overview-page.html#capacity-metrics" ) ;
113+ nodeLivenessIssues = docsURL (
114+ "cluster-setup-troubleshooting.html#node-liveness-issues" ,
115+ ) ;
116+ howItWork = docsURL ( "cockroach-quit.html#how-it-works" ) ;
117+ clusterStore = docsURL ( "cockroach-start.html#store" ) ;
118+ clusterGlossary = docsURL ( "architecture/overview.html#glossary" ) ;
119+ clusterSettings = docsURL ( "cluster-settings.html" ) ;
120+ reviewOfCockroachTerminology = docsURL (
121+ "ui-replication-dashboard.html#review-of-cockroachdb-terminology" ,
122+ ) ;
123+ privileges = docsURL ( "authorization.html#privileges" ) ;
124+ showSessions = docsURL ( "show-sessions.html" ) ;
125+ sessionsTable = docsURL ( "ui-sessions-page.html" ) ;
126+ reduceStorageOfTimeSeriesDataOperationalFlags = docsURL (
127+ "operational-faqs.html#can-i-reduce-or-disable-the-storage-of-time-series-data" ,
128+ ) ;
129+ performanceBestPracticesHotSpots = docsURL (
130+ "performance-best-practices-overview.html#hot-spots" ,
131+ ) ;
132+ uiDebugPages = docsURL ( "ui-debug-pages.html" ) ;
133+ readsAndWritesOverviewPage = docsURLNoVersion (
134+ "architecture/reads-and-writes-overview.html#important-concepts" ,
135+ ) ;
136+ } ;
109137
110- export const readsAndWritesOverviewPage = docsURLNoVersion (
111- "architecture/reads-and-writes-overview.html#important-concepts" ,
112- ) ;
138+ recomputeDocsURLs ( ) ;
0 commit comments