This commit is contained in:
cocktailpeanut
2024-01-04 14:12:21 -05:00
parent 455944fc0f
commit 326fa960b7
2 changed files with 46 additions and 37 deletions
+42 -30
View File
@@ -9,36 +9,48 @@ module.exports = async kernel =>
{
if (kernel.running(__dirname, 'start.js'))
{
const session = await kernel.require(__dirname, 'session.json');
menu =
[
{
icon: 'fa-solid fa-spin fa-circle-notch',
text: 'Running ' + session.mode
},
{
icon: 'fa-solid fa-desktop',
text: 'Server',
href: 'start.js',
params:
{
fullscreen: true
}
}
];
if (session && session.url)
{
menu.push(
{
icon: 'fa-solid fa-rocket',
text: 'Open session',
href: session.url,
target: '_blank'
});
}
return menu;
}
const memory = kernel.memory.local[path.resolve(__dirname, "start.json")]
if (memory && memory.url && memory.mode)
{
menu =
[
{
icon: 'fa-solid fa-spin fa-circle-notch',
text: 'Running ' + memory.mode
},
{
icon: 'fa-solid fa-desktop',
text: 'Server',
href: 'start.js',
params:
{
fullscreen: true
}
},
{
icon: 'fa-solid fa-rocket',
text: 'Open session',
href: memory.url,
target: '_blank'
}
];
}
else
{
menu =
[
{
icon: 'fa-solid fa-desktop',
text: 'Server',
href: 'start.js',
params:
{
fullscreen: true
}
}
];
}
}
menu =
[
{
+4 -7
View File
@@ -35,21 +35,18 @@ module.exports = () =>
}
},
{
method: 'self.set',
method: 'local.set',
params:
{
'session.json':
{
mode: '{{local.mode}}',
url: '{{input.stdout.match(/(http:\\S+)/gi)[0]}}'
}
mode: '{{local.mode}}',
url: '{{input.stdout.match(/(http:\\S+)/gi)[0]}}'
}
},
{
method: 'browser.open',
params:
{
uri: '{{self.session.url}}',
uri: '{{local.url}}',
target: '_blank'
}
}