Skip to content

Commit d2d0f7c

Browse files
committed
feat: remove unused fields
1 parent 9548505 commit d2d0f7c

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed

api/src/store/modules/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export const config = createSlice({
270270
});
271271

272272
builder.addCase(setGraphqlConnectionStatus, (state, action) => {
273-
state.connectionStatus.minigraph = action.payload.status;
273+
state.connectionStatus.minigraph = action.payload.status;
274274
});
275275

276276
builder.addCase(setupRemoteAccessThunk.fulfilled, (state, action) => {

api/src/unraid-api/cli/cli.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { VersionCommand } from '@app/unraid-api/cli/version.command';
1111
import { StatusCommand } from '@app/unraid-api/cli/status.command';
1212
import { ValidateTokenCommand } from '@app/unraid-api/cli/validate-token.command';
1313
import { LogsCommand } from '@app/unraid-api/cli/logs.command';
14+
import { ConfigCommand } from '@app/unraid-api/cli/config.command';
1415

1516
@Module({
1617
providers: [
@@ -24,7 +25,8 @@ import { LogsCommand } from '@app/unraid-api/cli/logs.command';
2425
VersionCommand,
2526
StatusCommand,
2627
ValidateTokenCommand,
27-
LogsCommand
28+
LogsCommand,
29+
ConfigCommand
2830
],
2931
})
3032
export class CliModule {}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Injectable } from '@nestjs/common';
2+
import { readFile } from 'fs/promises';
3+
4+
import { Command, CommandRunner } from 'nest-commander';
5+
6+
import { getters } from '@app/store/index';
7+
import { LogService } from '@app/unraid-api/cli/log.service';
8+
9+
@Injectable()
10+
@Command({
11+
name: 'config',
12+
description: 'Display current configuration values',
13+
})
14+
export class ConfigCommand extends CommandRunner {
15+
constructor(private readonly logger: LogService) {
16+
super();
17+
}
18+
19+
async run(): Promise<void> {
20+
this.logger.log('\nDisk Configuration:');
21+
const diskConfig = await readFile(getters.paths()['myservers-config'], 'utf8');
22+
this.logger.log(diskConfig);
23+
process.exit(0);
24+
}
25+
}

api/src/unraid-api/cli/restart.command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class RestartCommand extends CommandRunner {
1414
}
1515

1616
async run(_): Promise<void> {
17-
const { stderr, stdout } = await execa(PM2_PATH, ['restart', ECOSYSTEM_PATH]);
17+
const { stderr, stdout } = await execa(PM2_PATH, ['restart', ECOSYSTEM_PATH, '--update-env']);
1818
if (stderr) {
1919
this.logger.error(stderr);
2020
process.exit(1);

api/src/unraid-api/cli/validate-token.command.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export class ValidateTokenCommand extends CommandRunner {
7979
const possibleUserIds = configFile.remote.ssoSubIds.split(',');
8080
if (possibleUserIds.includes(username)) {
8181
this.logger.info(JSON.stringify({ error: null, valid: true, username }));
82+
process.exit(0);
8283
} else {
8384
this.createErrorAndExit('Username on token does not match');
8485
}

0 commit comments

Comments
 (0)