Gate all disconnect rules on PTW70 product line
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
f350c5ba7d
commit
cc8f3ecf5f
10 files changed
+31
-19
No files matched your search
@@ -7,7 +7,7 @@ Short reference so an AI or new dev can understand and modify this project witho
|
|||||||
- **Electron** desktop app (Windows). One window; no browser opened.
|
- **Electron** desktop app (Windows). One window; no browser opened.
|
||||||
- Connects to **localhost:1947** sessions/config pages in a **hidden webview**.
|
- Connects to **localhost:1947** sessions/config pages in a **hidden webview**.
|
||||||
- **On startup:** Loads config page → ensures “Table Rows per Page” = 100 → submits if changed → loads sessions page.
|
- **On startup:** Loads config page → ensures “Table Rows per Page” = 100 → submits if changed → loads sessions page.
|
||||||
- **When Monitor ON:** Every 60s reloads sessions page; scans table rows; **clicks Disconnect** on rows whose text contains any of the **target keywords**.
|
- **When Monitor ON:** Every 60s reloads sessions page; scans table rows; **clicks Disconnect** when **Product** contains **PTW70** and **Feature** matches **TARGET_KEYWORDS** (substring) or modules **19**/**9** (exact).
|
||||||
- **UI:** Left = “Logged in” (by user); Right = “Activity log”; bottom = Monitor ON/OFF + Clear. Uses **powerSaveBlocker** so Windows/display don’t sleep while the app runs.
|
- **UI:** Left = “Logged in” (by user); Right = “Activity log”; bottom = Monitor ON/OFF + Clear. Uses **powerSaveBlocker** so Windows/display don’t sleep while the app runs.
|
||||||
|
|
||||||
## Tech stack
|
## Tech stack
|
||||||
@@ -30,7 +30,7 @@ Short reference so an AI or new dev can understand and modify this project witho
|
|||||||
|
|
||||||
## Important conventions
|
## Important conventions
|
||||||
|
|
||||||
- **Keywords:** Edit **inject.js** only — array `TARGET_KEYWORDS`. Row is disconnected if `row.innerText` contains any keyword.
|
- **Keywords:** Edit **inject.js** — `TARGET_KEYWORDS` (Feature substring) and `TARGET_FEATURE_IDS`. Disconnect only if Product contains `PTW70` and Feature matches (see `matchesPtw70FeatureKeyword` / `matchesFeatureId`).
|
||||||
- **Config check:** In **renderer.js**, `ensureConfigThenSessions()` runs on config.html load; sets `#linesperpage` to 100 and clicks Submit if needed, then navigates webview to sessions.
|
- **Config check:** In **renderer.js**, `ensureConfigThenSessions()` runs on config.html load; sets `#linesperpage` to 100 and clicks Submit if needed, then navigates webview to sessions.
|
||||||
- **URLs:** Config = `http://localhost:1947/_int_/config.html`, Sessions = `http://localhost:1947/_int_/sessions.html`. Defined in renderer.js.
|
- **URLs:** Config = `http://localhost:1947/_int_/config.html`, Sessions = `http://localhost:1947/_int_/sessions.html`. Defined in renderer.js.
|
||||||
- **Log/sessions bridge:** Inject script pushes to `__ptw_logQueue` and exposes `__ptw_flushLogs()` / `__ptw_getSessions()`. Renderer polls via `webview.executeJavaScript()` and updates DOM.
|
- **Log/sessions bridge:** Inject script pushes to `__ptw_logQueue` and exposes `__ptw_flushLogs()` / `__ptw_getSessions()`. Renderer polls via `webview.executeJavaScript()` and updates DOM.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Standalone desktop app that monitors your PTW sessions page and automatically di
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Auto-disconnect** — When Monitor is ON, scans the sessions table and clicks Disconnect on rows containing any of the target keywords.
|
- **Auto-disconnect** — When Monitor is ON, scans the sessions table and clicks Disconnect on **PTW70** product rows whose **Feature** matches the configured list (or modules 19 / 9).
|
||||||
- **Logged in** — Left panel shows who is logged in, grouped by user, with product/feature per session.
|
- **Logged in** — Left panel shows who is logged in, grouped by user, with product/feature per session.
|
||||||
- **Activity log** — Right panel shows timestamps and disconnect/refresh events.
|
- **Activity log** — Right panel shows timestamps and disconnect/refresh events.
|
||||||
- **Config on startup** — On launch, checks `http://localhost:1947/_int_/config.html` and ensures **Table Rows per Page** is set to **100** (and submits if changed).
|
- **Config on startup** — On launch, checks `http://localhost:1947/_int_/config.html` and ensures **Table Rows per Page** is set to **100** (and submits if changed).
|
||||||
@@ -13,7 +13,7 @@ Standalone desktop app that monitors your PTW sessions page and automatically di
|
|||||||
|
|
||||||
## Target keywords (disconnect when present)
|
## Target keywords (disconnect when present)
|
||||||
|
|
||||||
Matching uses the **Feature** column only (not the whole row). Product text such as `1 PTW70` is not searched for keywords.
|
Applies only when **Product** contains **`PTW70`** (e.g. `1 PTW70`). Matching uses the **Feature** column only (substring for the list below; exact cell for modules 19 and 9).
|
||||||
|
|
||||||
- PTW_DATAEXCHANGE
|
- PTW_DATAEXCHANGE
|
||||||
- PTW_ARC_FLASH
|
- PTW_ARC_FLASH
|
||||||
@@ -25,7 +25,7 @@ Matching uses the **Feature** column only (not the whole row). Product text such
|
|||||||
- PTW_IEC_FAULT
|
- PTW_IEC_FAULT
|
||||||
- PTW_IEC61363
|
- PTW_IEC61363
|
||||||
|
|
||||||
**Modules 19 and 9:** Disconnect when **Product** contains `PTW70` (e.g. `1 PTW70`) and **Feature** equals exactly `19` or `9`.
|
**Modules 19 and 9:** Same **PTW70** product line; **Feature** equals exactly `19` or `9`.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:b260c75fa8daca6d82340cb27a6cebc72bcffad7ab2fa1e0c323b1cf3fdf17bc
|
oid sha256:582e1076e64e5bb83b6536d59f18637857d06b444e6baf4b77429c02265805e2
|
||||||
size 75947276
|
size 75947419
|
||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:7e4b34356b1daf44c6a0aa67519cb9ab2ff0d54b13478a26cd70a8f481e8234f
|
oid sha256:8a3c4bc7a0d5f6d67a9feae61c7cead903f8be53ab727a6aa65590d3ed054b2d
|
||||||
size 76113012
|
size 76113154
|
||||||
Binary file not shown.
Vendored
+1
-1
@@ -13,4 +13,4 @@ x64:
|
|||||||
- '!.yarnrc.yml'
|
- '!.yarnrc.yml'
|
||||||
nodeModuleFilePatterns: []
|
nodeModuleFilePatterns: []
|
||||||
nsis:
|
nsis:
|
||||||
script: "!include \"C:\\Users\\Michael Sloan\\Desktop\\git\\Start-PTW-Auto-Disconnect\\node_modules\\app-builder-lib\\templates\\nsis\\include\\StdUtils.nsh\"\n!addincludedir \"C:\\Users\\Michael Sloan\\Desktop\\git\\Start-PTW-Auto-Disconnect\\node_modules\\app-builder-lib\\templates\\nsis\\include\"\n!macro _isUpdated _a _b _t _f\n ${StdUtils.TestParameter} $R9 \"updated\"\n StrCmp \"$R9\" \"true\" `${_t}` `${_f}`\n!macroend\n!define isUpdated `\"\" isUpdated \"\"`\n\n!macro _isForceRun _a _b _t _f\n ${StdUtils.TestParameter} $R9 \"force-run\"\n StrCmp \"$R9\" \"true\" `${_t}` `${_f}`\n!macroend\n!define isForceRun `\"\" isForceRun \"\"`\n\n!macro _isKeepShortcuts _a _b _t _f\n ${StdUtils.TestParameter} $R9 \"keep-shortcuts\"\n StrCmp \"$R9\" \"true\" `${_t}` `${_f}`\n!macroend\n!define isKeepShortcuts `\"\" isKeepShortcuts \"\"`\n\n!macro _isNoDesktopShortcut _a _b _t _f\n ${StdUtils.TestParameter} $R9 \"no-desktop-shortcut\"\n StrCmp \"$R9\" \"true\" `${_t}` `${_f}`\n!macroend\n!define isNoDesktopShortcut `\"\" isNoDesktopShortcut \"\"`\n\n!macro _isDeleteAppData _a _b _t _f\n ${StdUtils.TestParameter} $R9 \"delete-app-data\"\n StrCmp \"$R9\" \"true\" `${_t}` `${_f}`\n!macroend\n!define isDeleteAppData `\"\" isDeleteAppData \"\"`\n\n!macro _isForAllUsers _a _b _t _f\n ${StdUtils.TestParameter} $R9 \"allusers\"\n StrCmp \"$R9\" \"true\" `${_t}` `${_f}`\n!macroend\n!define isForAllUsers `\"\" isForAllUsers \"\"`\n\n!macro _isForCurrentUser _a _b _t _f\n ${StdUtils.TestParameter} $R9 \"currentuser\"\n StrCmp \"$R9\" \"true\" `${_t}` `${_f}`\n!macroend\n!define isForCurrentUser `\"\" isForCurrentUser \"\"`\n\n!macro addLangs\n !insertmacro MUI_LANGUAGE \"English\"\n !insertmacro MUI_LANGUAGE \"German\"\n !insertmacro MUI_LANGUAGE \"French\"\n !insertmacro MUI_LANGUAGE \"SpanishInternational\"\n !insertmacro MUI_LANGUAGE \"SimpChinese\"\n !insertmacro MUI_LANGUAGE \"TradChinese\"\n !insertmacro MUI_LANGUAGE \"Japanese\"\n !insertmacro MUI_LANGUAGE \"Korean\"\n !insertmacro MUI_LANGUAGE \"Italian\"\n !insertmacro MUI_LANGUAGE \"Dutch\"\n !insertmacro MUI_LANGUAGE \"Danish\"\n !insertmacro MUI_LANGUAGE \"Swedish\"\n !insertmacro MUI_LANGUAGE \"Norwegian\"\n !insertmacro MUI_LANGUAGE \"Finnish\"\n !insertmacro MUI_LANGUAGE \"Russian\"\n !insertmacro MUI_LANGUAGE \"Portuguese\"\n !insertmacro MUI_LANGUAGE \"PortugueseBR\"\n !insertmacro MUI_LANGUAGE \"Polish\"\n !insertmacro MUI_LANGUAGE \"Ukrainian\"\n !insertmacro MUI_LANGUAGE \"Czech\"\n !insertmacro MUI_LANGUAGE \"Slovak\"\n !insertmacro MUI_LANGUAGE \"Hungarian\"\n !insertmacro MUI_LANGUAGE \"Arabic\"\n !insertmacro MUI_LANGUAGE \"Turkish\"\n !insertmacro MUI_LANGUAGE \"Thai\"\n !insertmacro MUI_LANGUAGE \"Vietnamese\"\n!macroend\n\n!addplugindir /x86-unicode \"C:\\Users\\Michael Sloan\\AppData\\Local\\electron-builder\\Cache\\nsis\\nsis-resources-3.4.1\\plugins\\x86-unicode\"\n!include \"C:\\Users\\MICHAE~1\\AppData\\Local\\Temp\\t-jYP2Pc\\1-messages.nsh\"\n\n!include \"common.nsh\"\r\n!include \"extractAppPackage.nsh\"\r\n\r\n# https://github.com/electron-userland/electron-builder/issues/3972#issuecomment-505171582\r\nCRCCheck off\r\nWindowIcon Off\r\nAutoCloseWindow True\r\nRequestExecutionLevel ${REQUEST_EXECUTION_LEVEL}\r\n\r\nFunction .onInit\r\n !ifndef SPLASH_IMAGE\r\n SetSilent silent\r\n !endif\r\n\r\n !insertmacro check64BitAndSetRegView\r\nFunctionEnd\r\n\r\nFunction .onGUIInit\r\n InitPluginsDir\r\n\r\n !ifdef SPLASH_IMAGE\r\n File /oname=$PLUGINSDIR\\splash.bmp \"${SPLASH_IMAGE}\"\r\n BgImage::SetBg $PLUGINSDIR\\splash.bmp\r\n BgImage::Redraw\r\n !endif\r\nFunctionEnd\r\n\r\nSection\r\n !ifdef SPLASH_IMAGE\r\n HideWindow\r\n !endif\r\n\r\n StrCpy $INSTDIR \"$PLUGINSDIR\\app\"\r\n !ifdef UNPACK_DIR_NAME\r\n StrCpy $INSTDIR \"$TEMP\\${UNPACK_DIR_NAME}\"\r\n !endif\r\n\r\n RMDir /r $INSTDIR\r\n SetOutPath $INSTDIR\r\n\r\n !ifdef APP_DIR_64\r\n !ifdef APP_DIR_ARM64\r\n !ifdef APP_DIR_32\r\n ${if} ${IsNativeARM64}\r\n File /r \"${APP_DIR_ARM64}\\*.*\"\r\n ${elseif} ${RunningX64}\r\n File /r \"${APP_DIR_64}\\*.*\"\r\n ${else}\r\n File /r \"${APP_DIR_32}\\*.*\"\r\n ${endIf}\r\n !else\r\n ${if} ${IsNativeARM64}\r\n File /r \"${APP_DIR_ARM64}\\*.*\"\r\n ${else}\r\n File /r \"${APP_DIR_64}\\*.*\"\r\n {endIf}\r\n !endif\r\n !else\r\n !ifdef APP_DIR_32\r\n ${if} ${RunningX64}\r\n File /r \"${APP_DIR_64}\\*.*\"\r\n ${else}\r\n File /r \"${APP_DIR_32}\\*.*\"\r\n ${endIf}\r\n !else\r\n File /r \"${APP_DIR_64}\\*.*\"\r\n !endif\r\n !endif\r\n !else\r\n !ifdef APP_DIR_32\r\n File /r \"${APP_DIR_32}\\*.*\"\r\n !else\r\n !insertmacro extractEmbeddedAppPackage\r\n !endif\r\n !endif\r\n\r\n System::Call 'Kernel32::SetEnvironmentVariable(t, t)i (\"PORTABLE_EXECUTABLE_DIR\", \"$EXEDIR\").r0'\r\n Line truncated
|
script: "!include \"C:\\Users\\Michael Sloan\\Desktop\\git\\Start-PTW-Auto-Disconnect\\node_modules\\app-builder-lib\\templates\\nsis\\include\\StdUtils.nsh\"\n!addincludedir \"C:\\Users\\Michael Sloan\\Desktop\\git\\Start-PTW-Auto-Disconnect\\node_modules\\app-builder-lib\\templates\\nsis\\include\"\n!macro _isUpdated _a _b _t _f\n ${StdUtils.TestParameter} $R9 \"updated\"\n StrCmp \"$R9\" \"true\" `${_t}` `${_f}`\n!macroend\n!define isUpdated `\"\" isUpdated \"\"`\n\n!macro _isForceRun _a _b _t _f\n ${StdUtils.TestParameter} $R9 \"force-run\"\n StrCmp \"$R9\" \"true\" `${_t}` `${_f}`\n!macroend\n!define isForceRun `\"\" isForceRun \"\"`\n\n!macro _isKeepShortcuts _a _b _t _f\n ${StdUtils.TestParameter} $R9 \"keep-shortcuts\"\n StrCmp \"$R9\" \"true\" `${_t}` `${_f}`\n!macroend\n!define isKeepShortcuts `\"\" isKeepShortcuts \"\"`\n\n!macro _isNoDesktopShortcut _a _b _t _f\n ${StdUtils.TestParameter} $R9 \"no-desktop-shortcut\"\n StrCmp \"$R9\" \"true\" `${_t}` `${_f}`\n!macroend\n!define isNoDesktopShortcut `\"\" isNoDesktopShortcut \"\"`\n\n!macro _isDeleteAppData _a _b _t _f\n ${StdUtils.TestParameter} $R9 \"delete-app-data\"\n StrCmp \"$R9\" \"true\" `${_t}` `${_f}`\n!macroend\n!define isDeleteAppData `\"\" isDeleteAppData \"\"`\n\n!macro _isForAllUsers _a _b _t _f\n ${StdUtils.TestParameter} $R9 \"allusers\"\n StrCmp \"$R9\" \"true\" `${_t}` `${_f}`\n!macroend\n!define isForAllUsers `\"\" isForAllUsers \"\"`\n\n!macro _isForCurrentUser _a _b _t _f\n ${StdUtils.TestParameter} $R9 \"currentuser\"\n StrCmp \"$R9\" \"true\" `${_t}` `${_f}`\n!macroend\n!define isForCurrentUser `\"\" isForCurrentUser \"\"`\n\n!macro addLangs\n !insertmacro MUI_LANGUAGE \"English\"\n !insertmacro MUI_LANGUAGE \"German\"\n !insertmacro MUI_LANGUAGE \"French\"\n !insertmacro MUI_LANGUAGE \"SpanishInternational\"\n !insertmacro MUI_LANGUAGE \"SimpChinese\"\n !insertmacro MUI_LANGUAGE \"TradChinese\"\n !insertmacro MUI_LANGUAGE \"Japanese\"\n !insertmacro MUI_LANGUAGE \"Korean\"\n !insertmacro MUI_LANGUAGE \"Italian\"\n !insertmacro MUI_LANGUAGE \"Dutch\"\n !insertmacro MUI_LANGUAGE \"Danish\"\n !insertmacro MUI_LANGUAGE \"Swedish\"\n !insertmacro MUI_LANGUAGE \"Norwegian\"\n !insertmacro MUI_LANGUAGE \"Finnish\"\n !insertmacro MUI_LANGUAGE \"Russian\"\n !insertmacro MUI_LANGUAGE \"Portuguese\"\n !insertmacro MUI_LANGUAGE \"PortugueseBR\"\n !insertmacro MUI_LANGUAGE \"Polish\"\n !insertmacro MUI_LANGUAGE \"Ukrainian\"\n !insertmacro MUI_LANGUAGE \"Czech\"\n !insertmacro MUI_LANGUAGE \"Slovak\"\n !insertmacro MUI_LANGUAGE \"Hungarian\"\n !insertmacro MUI_LANGUAGE \"Arabic\"\n !insertmacro MUI_LANGUAGE \"Turkish\"\n !insertmacro MUI_LANGUAGE \"Thai\"\n !insertmacro MUI_LANGUAGE \"Vietnamese\"\n!macroend\n\n!addplugindir /x86-unicode \"C:\\Users\\Michael Sloan\\AppData\\Local\\electron-builder\\Cache\\nsis\\nsis-resources-3.4.1\\plugins\\x86-unicode\"\n!include \"C:\\Users\\MICHAE~1\\AppData\\Local\\Temp\\t-bHvZJG\\1-messages.nsh\"\n\n!include \"common.nsh\"\r\n!include \"extractAppPackage.nsh\"\r\n\r\n# https://github.com/electron-userland/electron-builder/issues/3972#issuecomment-505171582\r\nCRCCheck off\r\nWindowIcon Off\r\nAutoCloseWindow True\r\nRequestExecutionLevel ${REQUEST_EXECUTION_LEVEL}\r\n\r\nFunction .onInit\r\n !ifndef SPLASH_IMAGE\r\n SetSilent silent\r\n !endif\r\n\r\n !insertmacro check64BitAndSetRegView\r\nFunctionEnd\r\n\r\nFunction .onGUIInit\r\n InitPluginsDir\r\n\r\n !ifdef SPLASH_IMAGE\r\n File /oname=$PLUGINSDIR\\splash.bmp \"${SPLASH_IMAGE}\"\r\n BgImage::SetBg $PLUGINSDIR\\splash.bmp\r\n BgImage::Redraw\r\n !endif\r\nFunctionEnd\r\n\r\nSection\r\n !ifdef SPLASH_IMAGE\r\n HideWindow\r\n !endif\r\n\r\n StrCpy $INSTDIR \"$PLUGINSDIR\\app\"\r\n !ifdef UNPACK_DIR_NAME\r\n StrCpy $INSTDIR \"$TEMP\\${UNPACK_DIR_NAME}\"\r\n !endif\r\n\r\n RMDir /r $INSTDIR\r\n SetOutPath $INSTDIR\r\n\r\n !ifdef APP_DIR_64\r\n !ifdef APP_DIR_ARM64\r\n !ifdef APP_DIR_32\r\n ${if} ${IsNativeARM64}\r\n File /r \"${APP_DIR_ARM64}\\*.*\"\r\n ${elseif} ${RunningX64}\r\n File /r \"${APP_DIR_64}\\*.*\"\r\n ${else}\r\n File /r \"${APP_DIR_32}\\*.*\"\r\n ${endIf}\r\n !else\r\n ${if} ${IsNativeARM64}\r\n File /r \"${APP_DIR_ARM64}\\*.*\"\r\n ${else}\r\n File /r \"${APP_DIR_64}\\*.*\"\r\n {endIf}\r\n !endif\r\n !else\r\n !ifdef APP_DIR_32\r\n ${if} ${RunningX64}\r\n File /r \"${APP_DIR_64}\\*.*\"\r\n ${else}\r\n File /r \"${APP_DIR_32}\\*.*\"\r\n ${endIf}\r\n !else\r\n File /r \"${APP_DIR_64}\\*.*\"\r\n !endif\r\n !endif\r\n !else\r\n !ifdef APP_DIR_32\r\n File /r \"${APP_DIR_32}\\*.*\"\r\n !else\r\n !insertmacro extractEmbeddedAppPackage\r\n !endif\r\n !endif\r\n\r\n System::Call 'Kernel32::SetEnvironmentVariable(t, t)i (\"PORTABLE_EXECUTABLE_DIR\", \"$EXEDIR\").r0'\r\n Line truncated
|
||||||
+2
-2
@@ -7,7 +7,7 @@ Short reference so an AI or new dev can understand and modify this project witho
|
|||||||
- **Electron** desktop app (Windows). One window; no browser opened.
|
- **Electron** desktop app (Windows). One window; no browser opened.
|
||||||
- Connects to **localhost:1947** sessions/config pages in a **hidden webview**.
|
- Connects to **localhost:1947** sessions/config pages in a **hidden webview**.
|
||||||
- **On startup:** Loads config page → ensures “Table Rows per Page” = 100 → submits if changed → loads sessions page.
|
- **On startup:** Loads config page → ensures “Table Rows per Page” = 100 → submits if changed → loads sessions page.
|
||||||
- **When Monitor ON:** Every 60s reloads sessions page; scans table rows; **clicks Disconnect** on rows whose text contains any of the **target keywords**.
|
- **When Monitor ON:** Every 60s reloads sessions page; scans table rows; **clicks Disconnect** when **Product** contains **PTW70** and **Feature** matches **TARGET_KEYWORDS** (substring) or modules **19**/**9** (exact).
|
||||||
- **UI:** Left = “Logged in” (by user); Right = “Activity log”; bottom = Monitor ON/OFF + Clear. Uses **powerSaveBlocker** so Windows/display don’t sleep while the app runs.
|
- **UI:** Left = “Logged in” (by user); Right = “Activity log”; bottom = Monitor ON/OFF + Clear. Uses **powerSaveBlocker** so Windows/display don’t sleep while the app runs.
|
||||||
|
|
||||||
## Tech stack
|
## Tech stack
|
||||||
@@ -30,7 +30,7 @@ Short reference so an AI or new dev can understand and modify this project witho
|
|||||||
|
|
||||||
## Important conventions
|
## Important conventions
|
||||||
|
|
||||||
- **Keywords:** Edit **inject.js** only — array `TARGET_KEYWORDS`. Row is disconnected if `row.innerText` contains any keyword.
|
- **Keywords:** Edit **inject.js** — `TARGET_KEYWORDS` (Feature substring) and `TARGET_FEATURE_IDS`. Disconnect only if Product contains `PTW70` and Feature matches (see `matchesPtw70FeatureKeyword` / `matchesFeatureId`).
|
||||||
- **Config check:** In **renderer.js**, `ensureConfigThenSessions()` runs on config.html load; sets `#linesperpage` to 100 and clicks Submit if needed, then navigates webview to sessions.
|
- **Config check:** In **renderer.js**, `ensureConfigThenSessions()` runs on config.html load; sets `#linesperpage` to 100 and clicks Submit if needed, then navigates webview to sessions.
|
||||||
- **URLs:** Config = `http://localhost:1947/_int_/config.html`, Sessions = `http://localhost:1947/_int_/sessions.html`. Defined in renderer.js.
|
- **URLs:** Config = `http://localhost:1947/_int_/config.html`, Sessions = `http://localhost:1947/_int_/sessions.html`. Defined in renderer.js.
|
||||||
- **Log/sessions bridge:** Inject script pushes to `__ptw_logQueue` and exposes `__ptw_flushLogs()` / `__ptw_getSessions()`. Renderer polls via `webview.executeJavaScript()` and updates DOM.
|
- **Log/sessions bridge:** Inject script pushes to `__ptw_logQueue` and exposes `__ptw_flushLogs()` / `__ptw_getSessions()`. Renderer polls via `webview.executeJavaScript()` and updates DOM.
|
||||||
|
|||||||
+3
-3
@@ -4,7 +4,7 @@ Standalone desktop app that monitors your PTW sessions page and automatically di
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Auto-disconnect** — When Monitor is ON, scans the sessions table and clicks Disconnect on rows containing any of the target keywords.
|
- **Auto-disconnect** — When Monitor is ON, scans the sessions table and clicks Disconnect on **PTW70** product rows whose **Feature** matches the configured list (or modules 19 / 9).
|
||||||
- **Logged in** — Left panel shows who is logged in, grouped by user, with product/feature per session.
|
- **Logged in** — Left panel shows who is logged in, grouped by user, with product/feature per session.
|
||||||
- **Activity log** — Right panel shows timestamps and disconnect/refresh events.
|
- **Activity log** — Right panel shows timestamps and disconnect/refresh events.
|
||||||
- **Config on startup** — On launch, checks `http://localhost:1947/_int_/config.html` and ensures **Table Rows per Page** is set to **100** (and submits if changed).
|
- **Config on startup** — On launch, checks `http://localhost:1947/_int_/config.html` and ensures **Table Rows per Page** is set to **100** (and submits if changed).
|
||||||
@@ -13,7 +13,7 @@ Standalone desktop app that monitors your PTW sessions page and automatically di
|
|||||||
|
|
||||||
## Target keywords (disconnect when present)
|
## Target keywords (disconnect when present)
|
||||||
|
|
||||||
Matching uses the **Feature** column only (not the whole row). Product text such as `1 PTW70` is not searched for keywords.
|
Applies only when **Product** contains **`PTW70`** (e.g. `1 PTW70`). Matching uses the **Feature** column only (substring for the list below; exact cell for modules 19 and 9).
|
||||||
|
|
||||||
- PTW_DATAEXCHANGE
|
- PTW_DATAEXCHANGE
|
||||||
- PTW_ARC_FLASH
|
- PTW_ARC_FLASH
|
||||||
@@ -25,7 +25,7 @@ Matching uses the **Feature** column only (not the whole row). Product text such
|
|||||||
- PTW_IEC_FAULT
|
- PTW_IEC_FAULT
|
||||||
- PTW_IEC61363
|
- PTW_IEC61363
|
||||||
|
|
||||||
**Modules 19 and 9:** Disconnect when **Product** contains `PTW70` (e.g. `1 PTW70`) and **Feature** equals exactly `19` or `9`.
|
**Modules 19 and 9:** Same **PTW70** product line; **Feature** equals exactly `19` or `9`.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
|
|||||||
+8
-2
@@ -7,7 +7,7 @@
|
|||||||
'PTW_DAPPER', 'PTW_COOREVAL', 'PTW_CAPTOR', 'PTW_IEC_FAULT', 'PTW_IEC61363'
|
'PTW_DAPPER', 'PTW_COOREVAL', 'PTW_CAPTOR', 'PTW_IEC_FAULT', 'PTW_IEC61363'
|
||||||
];
|
];
|
||||||
|
|
||||||
/** Exact match on Feature cell only; Product must look like PTW70 (e.g. "1 PTW70") so "9"/"19" do not fire on other lines. */
|
/** Exact Feature cell match; only evaluated when Product contains PTW70 (same product gate as PTW_* keywords). */
|
||||||
const TARGET_FEATURE_IDS = ['19', '9'];
|
const TARGET_FEATURE_IDS = ['19', '9'];
|
||||||
|
|
||||||
window.__ptw_logQueue = window.__ptw_logQueue || [];
|
window.__ptw_logQueue = window.__ptw_logQueue || [];
|
||||||
@@ -54,6 +54,12 @@
|
|||||||
return TARGET_KEYWORDS.some(function (k) { return feature.indexOf(k) !== -1; });
|
return TARGET_KEYWORDS.some(function (k) { return feature.indexOf(k) !== -1; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** PTW_* strings must appear in Feature; Product must contain PTW70 (e.g. "1 PTW70") for any auto-disconnect. */
|
||||||
|
function matchesPtw70FeatureKeyword(product, feature) {
|
||||||
|
if (!isPtw70Product(product)) return false;
|
||||||
|
return matchesKeywordInFeature(feature);
|
||||||
|
}
|
||||||
|
|
||||||
function matchesFeatureId(product, feature) {
|
function matchesFeatureId(product, feature) {
|
||||||
if (!isPtw70Product(product)) return false;
|
if (!isPtw70Product(product)) return false;
|
||||||
return TARGET_FEATURE_IDS.some(function (id) { return feature === id; });
|
return TARGET_FEATURE_IDS.some(function (id) { return feature === id; });
|
||||||
@@ -64,7 +70,7 @@
|
|||||||
const rows = document.querySelectorAll('#mydata table.list tr');
|
const rows = document.querySelectorAll('#mydata table.list tr');
|
||||||
rows.forEach(function (row) {
|
rows.forEach(function (row) {
|
||||||
var pf = productFeatureCells(row);
|
var pf = productFeatureCells(row);
|
||||||
const keywordMatch = matchesKeywordInFeature(pf.feature);
|
const keywordMatch = matchesPtw70FeatureKeyword(pf.product, pf.feature);
|
||||||
const idMatch = matchesFeatureId(pf.product, pf.feature);
|
const idMatch = matchesFeatureId(pf.product, pf.feature);
|
||||||
if (keywordMatch || idMatch) {
|
if (keywordMatch || idMatch) {
|
||||||
const disconnectLink = row.querySelector('a.sbutton');
|
const disconnectLink = row.querySelector('a.sbutton');
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
'PTW_DAPPER', 'PTW_COOREVAL', 'PTW_CAPTOR', 'PTW_IEC_FAULT', 'PTW_IEC61363'
|
'PTW_DAPPER', 'PTW_COOREVAL', 'PTW_CAPTOR', 'PTW_IEC_FAULT', 'PTW_IEC61363'
|
||||||
];
|
];
|
||||||
|
|
||||||
/** Exact match on Feature cell only; Product must look like PTW70 (e.g. "1 PTW70") so "9"/"19" do not fire on other lines. */
|
/** Exact Feature cell match; only evaluated when Product contains PTW70 (same product gate as PTW_* keywords). */
|
||||||
const TARGET_FEATURE_IDS = ['19', '9'];
|
const TARGET_FEATURE_IDS = ['19', '9'];
|
||||||
|
|
||||||
window.__ptw_logQueue = window.__ptw_logQueue || [];
|
window.__ptw_logQueue = window.__ptw_logQueue || [];
|
||||||
@@ -54,6 +54,12 @@
|
|||||||
return TARGET_KEYWORDS.some(function (k) { return feature.indexOf(k) !== -1; });
|
return TARGET_KEYWORDS.some(function (k) { return feature.indexOf(k) !== -1; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** PTW_* strings must appear in Feature; Product must contain PTW70 (e.g. "1 PTW70") for any auto-disconnect. */
|
||||||
|
function matchesPtw70FeatureKeyword(product, feature) {
|
||||||
|
if (!isPtw70Product(product)) return false;
|
||||||
|
return matchesKeywordInFeature(feature);
|
||||||
|
}
|
||||||
|
|
||||||
function matchesFeatureId(product, feature) {
|
function matchesFeatureId(product, feature) {
|
||||||
if (!isPtw70Product(product)) return false;
|
if (!isPtw70Product(product)) return false;
|
||||||
return TARGET_FEATURE_IDS.some(function (id) { return feature === id; });
|
return TARGET_FEATURE_IDS.some(function (id) { return feature === id; });
|
||||||
@@ -64,7 +70,7 @@
|
|||||||
const rows = document.querySelectorAll('#mydata table.list tr');
|
const rows = document.querySelectorAll('#mydata table.list tr');
|
||||||
rows.forEach(function (row) {
|
rows.forEach(function (row) {
|
||||||
var pf = productFeatureCells(row);
|
var pf = productFeatureCells(row);
|
||||||
const keywordMatch = matchesKeywordInFeature(pf.feature);
|
const keywordMatch = matchesPtw70FeatureKeyword(pf.product, pf.feature);
|
||||||
const idMatch = matchesFeatureId(pf.product, pf.feature);
|
const idMatch = matchesFeatureId(pf.product, pf.feature);
|
||||||
if (keywordMatch || idMatch) {
|
if (keywordMatch || idMatch) {
|
||||||
const disconnectLink = row.querySelector('a.sbutton');
|
const disconnectLink = row.querySelector('a.sbutton');
|
||||||
|
|||||||
Reference in new issue
Block a user