Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
dashboard: Accept autoOpen option in config, cli
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffoo committed Jun 15, 2023
1 parent f580f0c commit 0ce88e2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/config/src/configDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const getInitialConfig = ({
dashboard: {
host: "localhost",
port: 24012,
autoOpen: true,
verbose: false
},
ens: {
Expand Down
8 changes: 8 additions & 0 deletions packages/core/lib/commands/dashboard/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ module.exports = {
describe: "Specify the host to start the dashboard and RPC endpoint on",
type: "string"
},
autoOpen: {
describe: "Open dashboard in default browser on start",
type: "boolean"
},
verbose: {
describe: "Display debug logs for the dashboard server and message bus",
type: "boolean"
Expand All @@ -27,6 +31,10 @@ module.exports = {
option: "--host <string>",
description: "Start the dashboard and RPC endpoint on a specific host."
},
{
option: "--autoOpen <boolean>",
description: "Open dashboard in default browser on start"
},
{
option: "--verbose",
description:
Expand Down
3 changes: 2 additions & 1 deletion packages/core/lib/commands/dashboard/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ module.exports = async function (options) {

const port = options.port || config.dashboard.port;
const host = options.host || config.dashboard.host;
const autoOpen = options.autoOpen ?? config.dashboard.autoOpen;
const verbose = options.verbose || config.dashboard.verbose;
const rpc = true;

const dashboardServerOptions = { port, host, verbose, rpc };
const dashboardServerOptions = { port, host, autoOpen, verbose, rpc };
const dashboardServer = new DashboardServer(dashboardServerOptions);
await dashboardServer.start();

Expand Down

0 comments on commit 0ce88e2

Please sign in to comment.