Files
threshold-ui/ui/desktop/electron-app/src/config/menu.js
T
CyberCoveandClaude Sonnet 5.5 89089dbb9a Rebrand Boundary UI to Threshold; neutralize HashiCorp update/phone-home endpoints
- Product name, app id, installer names, translations, titles -> Threshold
- Desktop: look for threshold CLI first, then boundary; migrate legacy
  Boundary user-data dir; updater/release lookups disabled unless configured
- Remove HashiCorp/IBM logos and art (plain placeholder mark), GitHub
  release workflows and HashiCorp release metadata
- Add NOTICE and README 'About this fork'

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 12:24:16 -07:00

140 lines
3.6 KiB
JavaScript

const { shell, dialog } = require('electron');
const appUpdater = require('../helpers/app-updater.js');
const { isMac, isWindows } = require('../helpers/platform.js');
const config = require('../../config/config.js');
const { isBuiltInCli, version } = require('../cli/index.js');
const generateMenuTemplate = () => {
const aboutDialog = () => {
const appVersion = `Version: ${config.releaseVersion}`;
const appCommit = `Commit: ${config.releaseCommit}`;
const cliVersion = version().formatted;
const copyright = config.copyright;
dialog.showMessageBox({
type: 'none',
message: config.productName,
detail: `${appVersion}\n${appCommit}\n\n${cliVersion}\n\n${copyright}`,
});
};
return [
// { role: 'appMenu' }
...(isMac()
? [
{
label: 'Threshold',
submenu: [
// { role: 'about' },
{
label: `About ${config.productName}`,
click: aboutDialog,
},
...(isBuiltInCli && appUpdater.isEnabled()
? [
{
id: 'update',
label: 'Check for Updates',
click: async () => appUpdater.run(),
},
]
: []),
{ type: 'separator' },
{ role: 'services' },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideothers' },
{ role: 'unhide' },
{ type: 'separator' },
{ role: 'quit' },
],
},
]
: []),
// { role: 'fileMenu' }
{
label: 'File',
submenu: [{ role: 'close' }],
},
// { role: 'editMenu' }
{
label: 'Edit',
submenu: [
{ role: 'undo' },
{ role: 'redo' },
{ type: 'separator' },
{ role: 'cut' },
{ role: 'copy' },
{ role: 'paste' },
...(isMac()
? [
{ role: 'pasteAndMatchStyle' },
{ role: 'delete' },
{ role: 'selectAll' },
{ type: 'separator' },
{
label: 'Speech',
submenu: [{ role: 'startspeaking' }, { role: 'stopspeaking' }],
},
]
: [{ role: 'delete' }, { type: 'separator' }, { role: 'selectAll' }]),
],
},
// { role: 'viewMenu' }
{
id: 'view',
label: 'View',
submenu: [
{ role: 'reload' },
{ type: 'separator' },
{ role: 'resetZoom' },
{ role: 'zoomIn', accelerator: 'CommandOrControl+=' },
{ role: 'zoomOut' },
{ type: 'separator' },
{ role: 'togglefullscreen' },
],
},
// { role: 'windowMenu' }
{
label: 'Window',
submenu: [
{ role: 'minimize' },
{ role: 'zoom' },
...(isMac()
? [
{ type: 'separator' },
{ role: 'front' },
{ type: 'separator' },
{ role: 'window' },
]
: [{ role: 'close' }]),
],
},
{
role: 'help',
submenu: [
{
label: 'Documentation',
click: () =>
shell.openExternal(
'https://repo.anhonesthost.net/CyberCoveLLC/threshold-ui',
),
},
...(isWindows()
? [
// { role: 'about' },
{
label: `About ${config.productName}`,
click: aboutDialog,
},
]
: []),
],
},
];
};
module.exports = {
generateMenuTemplate: generateMenuTemplate,
};