mirror of
https://github.com/unraid/api.git
synced 2025-12-31 21:49:57 -06:00
fix: use some instead of every for connect detection
This commit is contained in:
@@ -56,8 +56,7 @@ export class ConnectSettingsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isConnectPluginInstalled(): boolean {
|
isConnectPluginInstalled(): boolean {
|
||||||
// logic ported from webguid
|
return ['/var/lib/pkgtools/packages/dynamix.unraid.net', '/usr/local/bin/unraid-api'].some(
|
||||||
return ['/var/lib/pkgtools/packages/dynamix.unraid.net', '/usr/local/sbin/unraid-api'].every(
|
|
||||||
(path) => fileExistsSync(path)
|
(path) => fileExistsSync(path)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -319,7 +318,9 @@ export class ConnectSettingsService {
|
|||||||
* Computes the JSONForms schema definition for remote access settings.
|
* Computes the JSONForms schema definition for remote access settings.
|
||||||
*/
|
*/
|
||||||
async remoteAccessSlice(): Promise<SettingSlice> {
|
async remoteAccessSlice(): Promise<SettingSlice> {
|
||||||
const precondition = (await this.isSignedIn()) && (await this.isSSLCertProvisioned());
|
const isSignedIn = await this.isSignedIn();
|
||||||
|
const isSSLCertProvisioned = await this.isSSLCertProvisioned();
|
||||||
|
const precondition = isSignedIn && isSSLCertProvisioned;
|
||||||
|
|
||||||
/** shown when preconditions are not met */
|
/** shown when preconditions are not met */
|
||||||
const requirements: UIElement[] = [
|
const requirements: UIElement[] = [
|
||||||
@@ -332,11 +333,11 @@ export class ConnectSettingsService {
|
|||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
text: 'You are signed in to Unraid Connect',
|
text: 'You are signed in to Unraid Connect',
|
||||||
status: await this.isSignedIn(),
|
status: isSignedIn,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'You have provisioned a valid SSL certificate',
|
text: 'You have provisioned a valid SSL certificate',
|
||||||
status: await this.isSSLCertProvisioned(),
|
status: isSSLCertProvisioned,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user