updated js syntax and resolved merge conflicts

pull/6079/head
Scott Anderson 2025-06-04 14:51:27 -06:00
commit ef5fc1862e
10 changed files with 170 additions and 88 deletions

View File

@ -1,4 +1,4 @@
version: 2
version: 2.1
jobs:
build:
docker:
@ -68,7 +68,6 @@ jobs:
when: on_success
workflows:
version: 2
build:
jobs:
- build

13
.vscode/launch.json vendored
View File

@ -1,19 +1,18 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Docs (console-based)",
"type": "chrome",
"request": "launch",
"name": "Open Docs on localhost:1313",
"url": "http://localhost:1313",
"webRoot": "${workspaceFolder}",
"skipFiles": [
"<node_internals>/**",
"${workspaceFolder}/node_modules/**"
]
"<node_internals>/**"
],
"sourceMaps": false,
"trace": true,
"smartStep": false
}
]
}

View File

@ -82,13 +82,16 @@ function getPreferences() {
//////////// MANAGE INFLUXDATA DOCS URLS IN LOCAL STORAGE //////////////////////
////////////////////////////////////////////////////////////////////////////////
const defaultUrls = {};
// Guard against pageParams being null/undefined and safely access nested properties
if (pageParams && pageParams.influxdb_urls) {
Object.entries(pageParams.influxdb_urls).forEach(([product, {providers}]) => {
defaultUrls[product] = providers.filter(provider => provider.name === 'Default')[0]?.regions[0]?.url || 'https://cloud2.influxdata.com';
});
Object.entries(pageParams.influxdb_urls).forEach(
([product, { providers }]) => {
defaultUrls[product] =
providers.filter((provider) => provider.name === 'Default')[0]
?.regions[0]?.url || 'https://cloud2.influxdata.com';
}
);
}
export const DEFAULT_STORAGE_URLS = {
@ -177,7 +180,10 @@ const defaultNotificationsObj = {
function getNotifications() {
// Initialize notifications data if it doesn't already exist
if (localStorage.getItem(notificationStorageKey) === null) {
initializeStorageItem('notifications', JSON.stringify(defaultNotificationsObj));
initializeStorageItem(
'notifications',
JSON.stringify(defaultNotificationsObj)
);
}
// Retrieve and parse the notifications data as JSON
@ -221,7 +227,10 @@ function setNotificationAsRead(notificationID, notificationType) {
readNotifications.push(notificationID);
notificationsObj[notificationType + 's'] = readNotifications;
localStorage.setItem(notificationStorageKey, JSON.stringify(notificationsObj));
localStorage.setItem(
notificationStorageKey,
JSON.stringify(notificationsObj)
);
}
// Export functions as a module and make the file backwards compatible for non-module environments until all remaining dependent scripts are ported to modules

View File

@ -0,0 +1,38 @@
/**
* Helper functions for debugging without source maps
* Example usage:
* In your code, you can use these functions like this:
* ```javascript
* import { debugLog, debugBreak, debugInspect } from './debug-helpers.js';
*
* const data = debugInspect(someData, 'Data');
* debugLog('Processing data', 'myFunction');
*
* function processData() {
* // Add a breakpoint that works with DevTools
* debugBreak();
*
* // Your existing code...
* }
* ```
*
* @fileoverview DEVELOPMENT USE ONLY - Functions should not be committed to production
*/
/* eslint-disable no-debugger */
/* eslint-disable-next-line */
// NOTE: These functions are detected by ESLint rules to prevent committing debug code
export function debugLog(message, context = '') {
const contextStr = context ? `[${context}]` : '';
console.log(`DEBUG${contextStr}: ${message}`);
}
export function debugBreak() {
debugger;
}
export function debugInspect(value, label = 'Inspect') {
console.log(`DEBUG[${label}]:`, value);
return value;
}

View File

@ -15,29 +15,6 @@ preserveTaxonomyNames: true
# Generate a robots.txt
enableRobotsTXT: true
# Override settings for testing
buildFuture: true
# Configure what content is built in testing env
params:
env: testing
environment: testing
buildTestContent: true
# Server configuration for testing
server:
port: 1315
baseURL: 'http://localhost:1315/'
watchChanges: true
disableLiveReload: false
# Keep your shared content exclusions
ignoreFiles:
- "content/shared/.*"
# Ignore specific warning logs
ignoreLogs:
- warning-goldmark-raw-html
# Markdown rendering options
blackfriday:
@ -55,7 +32,6 @@ taxonomies:
influxdb3/enterprise/tag: influxdb3/enterprise/tags
flux/v0/tag: flux/v0/tags
# Markup configuration
markup:
goldmark:
renderer:
@ -66,7 +42,6 @@ markup:
attribute:
block: true
# Privacy settings
privacy:
googleAnalytics:
anonymizeIP: false
@ -77,7 +52,6 @@ privacy:
disable: false
privacyEnhanced: true
# Output formats
outputFormats:
json:
mediaType: application/json
@ -86,11 +60,43 @@ outputFormats:
# Asset processing for testing (disable minification)
build:
writeStats: true
writeStats: false
useResourceCacheWhen: "fallback"
buildOptions:
sourcemap: "inline"
target: "es2020"
noJSConfigInAssets: false
# Asset processing configuration
assetDir: "assets"
module:
mounts:
- source: assets
target: assets
- source: node_modules
target: assets/node_modules
# Override settings for testing
buildFuture: true
# Configure what content is built in testing env
params:
env: testing
environment: testing
buildTestContent: true
# Configure the server for testing
server:
port: 1315
baseURL: 'http://localhost:1315/'
watchChanges: true
disableLiveReload: false
# Keep your shared content exclusions
ignoreFiles:
- "content/shared/.*"
# Ignore specific warning logs
ignoreLogs:
- warning-goldmark-raw-html
# Disable minification for testing
minify:
@ -98,14 +104,3 @@ minify:
disableCSS: true
disableHTML: true
minifyOutput: false
# Asset processing configuration
assetDir: "assets"
# Module mounts
module:
mounts:
- source: assets
target: assets
- source: node_modules
target: assets/node_modules

View File

@ -9,6 +9,22 @@ aliases:
- /kapacitor/v1/about_the_project/releasenotes-changelog/
---
## v1.7.7 {date="2025-05-27"}
> [!Warning]
> #### Python 2 UDFs deprecated
>
> Python 2-based UDFs are deprecated** as of Kapacitor 1.7.7 and will be removed in **Kapacitor 1.8.0**.
>
> In preparation for Kapacitor 1.8.0, update your User-Defined Functions (UDFs) to be Python 3-compatible.
> This required change aligns with modern security practices and ensures your custom functions will continue to work after upgrading.
### Dependency updates
- Upgrade Go to 1.22.12.
---
## v1.7.6 {date="2024-10-28"}
### Features

View File

@ -172,7 +172,7 @@ kapacitor:
versions: [v1]
latest: v1.7
latest_patches:
v1: 1.7.6
v1: 1.7.7
ai_sample_questions:
- How do I configure Kapacitor for InfluxDB v1?
- How do I write a custom Kapacitor task?

View File

@ -106,6 +106,33 @@ export default [
files: ['assets/js/**/*.js'],
rules: {
// Rules specific to JavaScript in Hugo assets
// Prevent imports from debug-helpers.js
'no-restricted-imports': [
'error',
{
paths: [
{
name: './utils/debug-helpers.js',
message:
'Remove debugging functions before committing. Debug helpers should not be used in production code.',
},
{
name: '/utils/debug-helpers.js',
message:
'Remove debugging functions before committing. Debug helpers should not be used in production code.',
},
],
},
],
// Prevent use of debug functions in production code
'no-restricted-syntax': [
'error',
{
selector: 'CallExpression[callee.name=/^debug(Log|Break|Inspect)$/]',
message:
'Remove debugging functions before committing. Debug helpers should not be used in production code.',
},
],
},
},
{

View File

@ -49,6 +49,7 @@ privacy:
youtube:
disable: false
privacyEnhanced: true
outputFormats:
json:
mediaType: application/json
@ -57,13 +58,8 @@ outputFormats:
# Asset processing configuration for development
build:
writeStats: true
writeStats: false
useResourceCacheWhen: "fallback"
# Enable source maps for debugging
buildOptions:
sourcemap: "inline"
target: "es2020"
# Disable asset bundling in development
noJSConfigInAssets: false
# Asset processing configuration
@ -82,14 +78,17 @@ params:
environment: development
# Configure the server for development
# Specify the port for development to avoid conflicts with testing
server:
port: 1313
baseURL: 'http://localhost:1313/'
watchChanges: true
disableLiveReload: false
# Disable minification and bundling for development
# Ignore specific warning logs
ignoreLogs:
- warning-goldmark-raw-html
# Disable minification for development
minify:
disableJS: true
disableCSS: true

View File

@ -23,17 +23,15 @@
{{ $mainJS := resources.Get "js/main.js" }}
{{ if $mainJS }}
{{ $opts := dict
"minify" false
"sourceMap" "external"
"sourcesContent" true
"targetPath" "js/main.js"
"params" $sharedParams
"format" "esm"
"external" (slice "*")
"define" (dict
"process.env.NODE_ENV" "\"development\""
)
"splitting" false
"bundle" true
"bundle" false
"minify" false
"target" "es2017"
"write" true
"params" $sharedParams
}}
{{ $processed := $mainJS | js.Build $opts }}
{{ if $processed }}
@ -47,25 +45,26 @@
{{ range $file := (readDir $jsDir) }}
{{ if and (strings.HasSuffix $file.Name ".js") (ne $file.Name "main.js") }}
{{ $jsPath := printf "js/%s" $file.Name }}
{{ $jsResource := resources.Get $jsPath }}
{{ if $jsResource }}
{{ $jsRes := resources.Get $jsPath }}
{{ with $jsRes }}
{{ $opts := dict
"minify" false
"sourceMap" "external"
"sourceMap" ""
"targetPath" $jsPath
"params" $sharedParams
"format" "esm"
"external" (slice "*")
"define" (dict
"process.env.NODE_ENV" "\"development\""
)
"splitting" false
"bundle" true
"bundle" false
"minify" false
"target" "es2015"
"write" true
"params" $sharedParams
}}
{{ $processed := $jsResource | js.Build $opts }}
{{ if $processed }}
<script type="module" src="{{ $processed.RelPermalink }}"></script>
{{ end }}
{{ $out := . | js.Build $opts }}
{{/* Add descriptive debug comments at the beginning of each file */}}
{{ $debugHeader := printf "// DEBUG MODE: %s\n// Original file: assets/js/%s\n\n" $file.Name $file.Name }}
{{ $modifiedContent := printf "%s%s" $debugHeader $out.Content }}
{{ $out = resources.FromString $jsPath $modifiedContent }}
<script type="module" src="{{ $out.RelPermalink }}"></script>
{{ end }}
{{ end }}
{{ end }}
@ -82,6 +81,7 @@
"targetPath" "js/main.js"
"params" $sharedParams
"format" "iife"
"target" "es2019"
"splitting" false
"external" (slice "*")
"define" (dict