Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/highcharts-11.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jgresham authored Aug 1, 2024
2 parents 816daf5 + 01415f1 commit 9a0ea5d
Show file tree
Hide file tree
Showing 60 changed files with 1,047 additions and 384 deletions.
3 changes: 3 additions & 0 deletions assets/icons/tray/status/error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/tray/status/stopped.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/tray/status/synced.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/tray/status/syncing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion assets/locales/cs/genericComponents.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
"InitialSyncInProgress": "Probíhá počáteční synchronizace...",
"NodeSettings": "Nastavení Uzlu...",
"RemoveNode": "Odstranit Uzel...",
"RemovingNode": "Odstraňování Uzlu...",
"ErrorOccurred": "Došlo k chybě",
"DataLocation": "Umístění dat",
"AvailableDiskSpace": "{{space}}GB dostupného místa na disku",
Expand Down
1 change: 1 addition & 0 deletions assets/locales/cs/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"AddNode": "Přidat Uzel",
"StopeNodeToChangeSettings": "Uzel musí být zastaven pro provedení změn",
"RemoveNode": "Odstranit uzel",
"RemovingNode": "Odstraňování Uzlu...",
"RemoveThisNode": "Odstranit tento uzel",
"Install Docker": "Nainstalovat Docker",
"Type": "Typ",
Expand Down
1 change: 0 additions & 1 deletion assets/locales/en/genericComponents.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
"InitialSyncInProgress": "Initial sync in progress...",
"NodeSettings": "Node Settings...",
"RemoveNode": "Remove Node...",
"RemovingNode": "Removing node...",
"ErrorOccurred": "Error occurred",
"DataLocation": "Data location",
"AvailableDiskSpace": "{{space}}GB available disk space",
Expand Down
2 changes: 2 additions & 0 deletions assets/locales/en/systemRequirements.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"macOSTitle": "MacOS version is at least {{minVersion}} to run Podman 5.0",
"macOSDescription": "MacOS version: {{version}}",
"processorCoresTitle": "Processor has {{minCores}} cores or more",
"processorCoresDescription": "Processor cores: {{cores}}",
"memorySizeTitle": "At least {{minSize}}GB of system memory (RAM)",
Expand Down
8 changes: 7 additions & 1 deletion assets/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"AddNode": "Add Node",
"StopeNodeToChangeSettings": "The node must be stopped to make changes",
"RemoveNode": "Remove node",
"RemovingNode": "Removing node...",
"RemoveThisNode": "Remove this node",
"Install Docker": "Install Docker",
"Type": "Type",
Expand Down Expand Up @@ -168,5 +169,10 @@
"CalculatingDataSize": "(calculating data size...)",
"KeepNodeData": "Keep node related chain data {{data}}",
"NoResults": "No results",
"TrySearching": "Try searching for another keyword or clear all filters"
"TrySearching": "Try searching for another keyword or clear all filters",
"RunningOutdatedPodman": "You are running an outdated version of Podman",
"CurrentPodman": "Your current Podman installation ({{currentPodmanVersion}}) is incompatible with NiceNode and requires version {{requiredPodmanVersion}} or higher for it to run.",
"PodmanIsRequiredComponent": "Podman is a required component for NiceNode to run the many client options. Podman facilitates the running of containers within a virtualised Linux environment and will operate in the background.",
"DownloadAndUpdate": "Download and update",
"PodmanUpdate": "Podman update"
}
1 change: 1 addition & 0 deletions assets/locales/en/windowMenu.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

"Help": "Help",
"NiceNodeWebsite": "NiceNode website",
"OpenLogs": "Open Logs",
"ReportAProblem": "Report a problem",
"RemoveAllNodesAndData": "Remove all nodes and data",
"UninstallPodman": "Uninstall Podman",
Expand Down
103 changes: 103 additions & 0 deletions assets/trayIndex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Tray Menu</title>
<style>
body {
margin: 0;
padding: 6px;
font-size: 12.5px;
font-family: Arial, sans-serif;
/* background: #2b2b2b; */
color: black;
}

body.dark {
color: white; /* Color for dark theme */
}

body.light {
color: black; /* Color for light theme */
}

.menu-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 4px 10px;
}

.light .menu-item.stopped {
color: rgba(0, 0, 0, 0.25);
}

.dark .menu-item.stopped {
color: rgba(255,255,255,0.25);
}

.menu-item:hover {
border-radius: 4px;
color: white;
background: rgba(0, 122, 255, 0.8);
}

.menu-item.stopped:hover {
background: none;
}

.dark .separator {
border-bottom: 1px solid rgba(255, 255, 255, 0.1)
}

.light .separator {
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.separator {
margin: 3px 0;
}

.menu-status-container {
display: flex;
align-items: center;
}

.light .menu-status-container {
color: rgba(0, 0, 0, 0.5);
}

.light .menu-item.stopped .menu-status-container {
color: rgba(0, 0, 0, 0.25);
}

.dark .menu-status-container {
color: rgba(255,255,255,0.5);
}

.dark .menu-item.stopped .menu-status-container {
color: rgba(255,255,255,0.25);
}

.menu-status {
text-transform: capitalize;
}

.menu-status-icon {
display: flex;
align-items: center;
margin-right: 5px;
}

.status-icon {
width: 12px; /* Adjust size as needed */
height: 12px; /* Adjust size as needed */
vertical-align: middle; /* Align icon with text */
}
</style>
</head>
<body>
<div id="menu-container"></div>
<script src="trayIndex.js"></script>
</body>
</html>
131 changes: 131 additions & 0 deletions assets/trayIndex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
const { ipcRenderer } = require('electron');

const getIconKey = (status) => {
switch (status) {
case 'running':
case 'starting':
return 'syncing';
//TODO: consider camelcased strings
case 'error running':
case 'error starting':
case 'error stopping':
case 'notInstalled':
case 'notRunning':
case 'isOutdated':
return 'error';
default:
return status;
}
};

const getStatusText = (status) => {
switch (status) {
case 'notInstalled':
return 'Not Installed';
case 'notRunning':
return 'Not Running';
case 'isOutdated':
return 'Update Now';
default:
return status;
}
};

ipcRenderer.on(
'update-menu',
(event, { nodePackageTrayMenu, podmanMenuItem, statusIcons }) => {
const menuItems = [
...nodePackageTrayMenu.map((item) => ({
name: item.name,
status: item.status,
action: () => ipcRenderer.send('node-package-click', item.id),
})),
...(nodePackageTrayMenu.length >= 1 ? [{ separator: true }] : []),
...(podmanMenuItem.status !== 'isRunning'
? [
{
name: 'Podman',
status: podmanMenuItem.status,
action: () => ipcRenderer.send('podman-click'),
},
{ separator: true },
]
: []),
{
name: 'Open NiceNode',
action: () => ipcRenderer.send('show-main-window'),
},
{ name: 'Quit', action: () => ipcRenderer.send('quit-app') },
];

const container = document.getElementById('menu-container');
container.innerHTML = ''; // Clear existing items

menuItems.forEach((item) => {
if (item.separator) {
const separator = document.createElement('div');
separator.className = 'separator';
container.appendChild(separator);
} else {
const menuItem = document.createElement('div');
menuItem.className = 'menu-item';

if (item.status === 'stopped') {
menuItem.classList.add('stopped');
}

const nameSpan = document.createElement('span');
nameSpan.textContent = item.name;
menuItem.appendChild(nameSpan);

if (item.status) {
const statusContainer = document.createElement('div');
statusContainer.className = 'menu-status-container';

const statusIconContainer = document.createElement('div');
statusIconContainer.className = 'menu-status-icon';

const statusIcon = document.createElement('div');
statusIcon.innerHTML =
statusIcons[getIconKey(item.status)] || statusIcons.default;
statusIcon.className = 'status-icon';

const statusText = document.createElement('div');
statusText.className = 'menu-status';
statusText.textContent = getStatusText(item.status);

statusIconContainer.appendChild(statusIcon);
statusContainer.appendChild(statusIconContainer);
statusContainer.appendChild(statusText);
menuItem.appendChild(statusContainer);
}

menuItem.addEventListener('click', item.action);

container.appendChild(menuItem);
}
});
ipcRenderer.send('adjust-height', document.body.scrollHeight);
},
);

ipcRenderer.on('set-theme', (event, theme) => {
applyTheme(theme);
});

// Apply theme-based styles
const applyTheme = (theme) => {
const body = document.body;
const menuItems = document.querySelectorAll('.menu-item');
if (theme === 'dark') {
body.classList.add('dark');
body.classList.remove('light');
} else {
body.classList.add('light');
body.classList.remove('dark');
}
};

ipcRenderer.on('update-menu', (event, updatedItems) => {
// Update menu items if necessary
});
3 changes: 3 additions & 0 deletions FUNDING.json → funding.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"ethereum": {
"ownedBy": "0x9cce47E9cF12C6147c9844adBB81fE85880c4df4"
}
},
"opRetro": {
"projectId": "0xf603b0a365deb7d7130d5c6ebd2ca4f8b7661aae8dcbee822d0ff4187dbcfc76"
}
}
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nice-node",
"version": "6.1.4-alpha",
"version": "6.3.0-alpha",
"description": "Run a node at home, the easy way.",
"homepage": "https://nicenode.xyz",
"productName": "NiceNode",
Expand Down Expand Up @@ -65,7 +65,7 @@
"@wdio/mocha-framework": "^8.36.1",
"@wdio/spec-reporter": "^8.36.1",
"cross-env": "^7.0.3",
"electron": "^30.0.1",
"electron": "^31.3.1",
"electron-devtools-installer": "^3.2.0",
"electron-extension-installer": "^1.2.0",
"electron-mock-ipc": "^0.3.12",
Expand Down Expand Up @@ -125,7 +125,13 @@
"url": "http://nicenode.xyz"
},
"license": "MIT",
"keywords": ["ethereum", "node", "blockchain", "web3", "local"],
"keywords": [
"ethereum",
"node",
"blockchain",
"web3",
"local"
],
"devEngines": {
"node": ">=20.x",
"npm": ">=9.x"
Expand Down
2 changes: 1 addition & 1 deletion src/common/NodeSpecs/base/base-v1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"documentation": "https://docs.base.org/network-information/"
}
},
"iconUrl": "https://ethereum.png",
"iconUrl": "https://pub-9f2dc808c3d748eabde036c3d3465ee6.r2.dev/base.png",
"addNodeDescription": "Decentralization and collaboration are critical for the longer-term success of Base and scaling Ethereum. That’s why we are working with OP Labs and the Optimism Collective on a plan to scale Ethereum in a decentralized way.",
"description": "Base is a secure, low-cost, developer-friendly Ethereum L2 built to bring the next billion users onchain. It's built on Optimism’s open-source OP Stack.",
"documentation": {
Expand Down
Loading

0 comments on commit 9a0ea5d

Please sign in to comment.