mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-28 13:46:33 +00:00
patch: removed diagnostic stop button
This commit is contained in:
parent
37e2ef1fef
commit
7690f0e861
@ -19,10 +19,9 @@ import * as _ from 'lodash';
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
import { Box, Button, Flex, Checkbox, TextWithCopy, Txt } from 'rendition';
|
import { Box, Button, Flex, Checkbox, TextWithCopy, Txt } from 'rendition';
|
||||||
import { faTimes } from '@fortawesome/free-solid-svg-icons';
|
import { faTimes, faChartBar } from '@fortawesome/free-solid-svg-icons';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
|
|
||||||
|
|
||||||
import { version, packageType } from '../../../../../package.json';
|
import { version, packageType } from '../../../../../package.json';
|
||||||
import * as settings from '../../models/settings';
|
import * as settings from '../../models/settings';
|
||||||
import * as analytics from '../../modules/analytics';
|
import * as analytics from '../../modules/analytics';
|
||||||
@ -105,9 +104,7 @@ export function SettingsModal({ toggleModal }: SettingsModalProps) {
|
|||||||
})();
|
})();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
const toggleSetting = async (setting: string) => {
|
const toggleSetting = async (setting: string) => {
|
||||||
|
|
||||||
const value = currentSettings[setting];
|
const value = currentSettings[setting];
|
||||||
analytics.logEvent('Toggle setting', { setting, value });
|
analytics.logEvent('Toggle setting', { setting, value });
|
||||||
await settings.set(setting, !value);
|
await settings.set(setting, !value);
|
||||||
@ -135,7 +132,7 @@ export function SettingsModal({ toggleModal }: SettingsModalProps) {
|
|||||||
try {
|
try {
|
||||||
unlinkSync('/usr/src/diag-data/startup.lock');
|
unlinkSync('/usr/src/diag-data/startup.lock');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Can't remove diag lock", error)
|
console.log("Can't remove diag lock", error);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -158,9 +155,8 @@ export function SettingsModal({ toggleModal }: SettingsModalProps) {
|
|||||||
setErrorMessage(`${errorMessage} :: ${startRes.statusText}`);
|
setErrorMessage(`${errorMessage} :: ${startRes.statusText}`);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error in starting diag", error)
|
console.log('Error in starting diag', error);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeDiag = async () => {
|
const removeDiag = async () => {
|
||||||
@ -258,16 +254,21 @@ export function SettingsModal({ toggleModal }: SettingsModalProps) {
|
|||||||
<Box>
|
<Box>
|
||||||
{diagApiIsUp ? (
|
{diagApiIsUp ? (
|
||||||
<>
|
<>
|
||||||
<Button primary onClick={() => openDiagFrame()}>
|
<Button
|
||||||
Open Diagnostics
|
icon={<FontAwesomeIcon icon={faChartBar} />}
|
||||||
</Button>
|
onClick={() => openDiagFrame()}
|
||||||
<Button danger onClick={() => removeDiag()}>
|
plain
|
||||||
Stop container
|
>
|
||||||
|
Run self-test
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Button primary onClick={() => startDiag()}>
|
<Button
|
||||||
|
icon={<FontAwesomeIcon icon={faChartBar} />}
|
||||||
|
plain
|
||||||
|
onClick={() => startDiag()}
|
||||||
|
>
|
||||||
Start diag container
|
Start diag container
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user