Skip to content

Commit

Permalink
frontend: Add create namespace ui
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent T <vtaylor@microsoft.com>
  • Loading branch information
vyncent-t committed Jul 10, 2024
1 parent efc166f commit 8fddbd4
Show file tree
Hide file tree
Showing 210 changed files with 7,479 additions and 2,678 deletions.
2 changes: 1 addition & 1 deletion app/electron/i18next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ i18next
read<Namespace extends keyof typeof en>(
language: string | any,
namespace: Namespace,
callback: (errorValue: unknown, translations: null | (typeof en)[Namespace]) => void
callback: (errorValue: unknown, translations: null | (typeof en)[Namespace]) => void,
) {
import(`./locales/${language}/${namespace}.json`)
.then(resources => {
Expand Down
26 changes: 13 additions & 13 deletions app/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class PluginManagerEventListeners {
progress => {
updateCache(progress);
},
controller.signal
controller.signal,
);

return { type: 'info', message: 'Installation started' };
Expand Down Expand Up @@ -331,7 +331,7 @@ class PluginManagerEventListeners {
progress => {
updateCache(progress);
},
controller.signal
controller.signal,
);
}

Expand Down Expand Up @@ -393,7 +393,7 @@ class PluginManagerEventListeners {
cacheEntry.controller.abort();
event.sender.send(
'plugin-manager',
JSON.stringify({ type: 'success', message: 'cancelled' })
JSON.stringify({ type: 'success', message: 'cancelled' }),
);
}
}
Expand All @@ -416,15 +416,15 @@ class PluginManagerEventListeners {
identifier: identifier,
...cacheEntry.progress,
percentage: cacheEntry.percentage,
})
}),
);
} else {
event.sender.send(
'plugin-manager',
JSON.stringify({
type: 'error',
message: 'No such operation in progress',
})
}),
);
}
}
Expand Down Expand Up @@ -974,7 +974,7 @@ function startElecron() {
} catch (e) {
dialog.showErrorBox(
i18n.t('Invalid URL'),
i18n.t('Application opened with an invalid URL: {{ url }}', { url })
i18n.t('Application opened with an invalid URL: {{ url }}', { url }),
);
return;
}
Expand Down Expand Up @@ -1077,16 +1077,16 @@ function startElecron() {
if (!validCommands.includes(eventData.command)) {
console.error(
`Invalid command: ${eventData.command}, only valid commands are: ${JSON.stringify(
validCommands
)}`
validCommands,
)}`,
);
return;
}

const child: ChildProcessWithoutNullStreams = spawn(
eventData.command,
eventData.args,
eventData.options
eventData.options,
);

child.stdout.on('data', (data: string | Buffer) => {
Expand Down Expand Up @@ -1115,7 +1115,7 @@ function startElecron() {
// Avoiding mentioning Headlamp here because it may run under a different name depending on branding (plugins).
title: i18n.t('Another process is running'),
message: i18n.t(
'Looks like another process is already running. Continue by terminating that process automatically, or quit?'
'Looks like another process is already running. Continue by terminating that process automatically, or quit?',
),
type: 'question',
buttons: [i18n.t('Continue'), i18n.t('Quit')],
Expand Down Expand Up @@ -1146,7 +1146,7 @@ function startElecron() {
// @todo: Use an iterative back-off strategy for the wait (so we can start by waiting for shorter times).
for (let tries = 1; timeWaited < maxWaitTime && stillRunning; tries++) {
console.debug(
`Checking if Headlamp is still running after we asked it to be killed; ${tries} ${timeWaited}/${maxWaitTime}ms wait.`
`Checking if Headlamp is still running after we asked it to be killed; ${tries} ${timeWaited}/${maxWaitTime}ms wait.`,
);

// Wait (10 * powers of 2) ms with a max of 250 ms
Expand All @@ -1168,7 +1168,7 @@ function startElecron() {
title: i18n.t('Failed to quit the other running process'),
message: i18n.t(
`Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.`,
{ process_list: processes }
{ process_list: processes },
),
});

Expand All @@ -1192,7 +1192,7 @@ function startElecron() {
['arm', 'arm64'].includes(process.arch)
) {
log.info(
'Disabling GPU hardware acceleration. Reason: known graphical issues in Linux on ARM (use --disable-gpu=false to force it if needed).'
'Disabling GPU hardware acceleration. Reason: known graphical issues in Linux on ARM (use --disable-gpu=false to force it if needed).',
);
disableGPU = true;
}
Expand Down
2 changes: 1 addition & 1 deletion app/electron/windowSize.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default function calculateWindowSize(
workArea: { width: number; height: number },
withMargin: boolean
withMargin: boolean,
) {
const [maxWidth, maxHeight] = [1920, 1080];
const { width, height } = workArea;
Expand Down
8 changes: 4 additions & 4 deletions app/scripts/push-release-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async function getChecksums(release) {
headers: {
accept: 'application/octet-stream',
},
}
},
);

var decoder = new TextDecoder('utf-8');
Expand Down Expand Up @@ -182,7 +182,7 @@ async function pushFiles(release, files) {
});
} catch (e) {
console.error(
`Error uploading asset ${baseFileName}: ${e}; skipping adding it to the checksums.txt`
`Error uploading asset ${baseFileName}: ${e}; skipping adding it to the checksums.txt`,
);
continue;
}
Expand Down Expand Up @@ -232,7 +232,7 @@ async function main() {

if (!process.env.GITHUB_TOKEN) {
console.error(
'GITHUB_TOKEN not set! Make sure you have set a GITHUB_TOKEN environment variable with to a personal access token.'
'GITHUB_TOKEN not set! Make sure you have set a GITHUB_TOKEN environment variable with to a personal access token.',
);
process.exit(1);
}
Expand All @@ -257,7 +257,7 @@ async function main() {
if (!release) {
if (args.releaseName.startsWith('v')) {
console.error(
`Release ${args.releaseName} not found. Did you mean ${args.releaseName.substring(1)}?`
`Release ${args.releaseName} not found. Did you mean ${args.releaseName.substring(1)}?`,
);
} else {
console.error(`Release ${args.releaseName} not found`);
Expand Down
8 changes: 4 additions & 4 deletions app/scripts/setup-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const manifest = require(MANIFEST_FILE);
async function extractArchive(
name,
archivePath,
tmpFolder = fs.mkdtempSync(path.join(os.tmpdir(), 'headlamp-plugins'))
tmpFolder = fs.mkdtempSync(path.join(os.tmpdir(), 'headlamp-plugins')),
) {
console.log('Extracting archive', archivePath, 'to', tmpFolder, '...');
// Extract the archive
Expand All @@ -23,7 +23,7 @@ async function extractArchive(
.pipe(
tar.x({
C: tmpFolder,
})
}),
)
.on('error', err => {
console.error(`Error extracting archive: ${err}`);
Expand All @@ -39,11 +39,11 @@ async function extractArchive(
// Move the plugins contents to the plugins folder
fs.copyFileSync(
path.join(tmpFolder, 'package', 'dist', 'main.js'),
path.join(pluginFolder, 'main.js')
path.join(pluginFolder, 'main.js'),
);
fs.copyFileSync(
path.join(tmpFolder, 'package', 'package.json'),
path.join(pluginFolder, 'package.json')
path.join(pluginFolder, 'package.json'),
);
resolve();
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],

addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions'],

core: {
builder: '@storybook/builder-vite',
Expand Down
Loading

0 comments on commit 8fddbd4

Please sign in to comment.