feat: remove unused fields

This commit is contained in:
Eli Bosley
2025-01-19 23:14:03 -05:00
parent 0ab40fefda
commit 2d3892deb8
5 changed files with 31 additions and 3 deletions

View File

@@ -270,7 +270,7 @@ export const config = createSlice({
});
builder.addCase(setGraphqlConnectionStatus, (state, action) => {
state.connectionStatus.minigraph = action.payload.status;
state.connectionStatus.minigraph = action.payload.status;
});
builder.addCase(setupRemoteAccessThunk.fulfilled, (state, action) => {

View File

@@ -11,6 +11,7 @@ import { VersionCommand } from '@app/unraid-api/cli/version.command';
import { StatusCommand } from '@app/unraid-api/cli/status.command';
import { ValidateTokenCommand } from '@app/unraid-api/cli/validate-token.command';
import { LogsCommand } from '@app/unraid-api/cli/logs.command';
import { ConfigCommand } from '@app/unraid-api/cli/config.command';
@Module({
providers: [
@@ -24,7 +25,8 @@ import { LogsCommand } from '@app/unraid-api/cli/logs.command';
VersionCommand,
StatusCommand,
ValidateTokenCommand,
LogsCommand
LogsCommand,
ConfigCommand
],
})
export class CliModule {}

View File

@@ -0,0 +1,25 @@
import { Injectable } from '@nestjs/common';
import { readFile } from 'fs/promises';
import { Command, CommandRunner } from 'nest-commander';
import { getters } from '@app/store/index';
import { LogService } from '@app/unraid-api/cli/log.service';
@Injectable()
@Command({
name: 'config',
description: 'Display current configuration values',
})
export class ConfigCommand extends CommandRunner {
constructor(private readonly logger: LogService) {
super();
}
async run(): Promise<void> {
this.logger.log('\nDisk Configuration:');
const diskConfig = await readFile(getters.paths()['myservers-config'], 'utf8');
this.logger.log(diskConfig);
process.exit(0);
}
}

View File

@@ -14,7 +14,7 @@ export class RestartCommand extends CommandRunner {
}
async run(_): Promise<void> {
const { stderr, stdout } = await execa(PM2_PATH, ['restart', ECOSYSTEM_PATH]);
const { stderr, stdout } = await execa(PM2_PATH, ['restart', ECOSYSTEM_PATH, '--update-env']);
if (stderr) {
this.logger.error(stderr);
process.exit(1);

View File

@@ -79,6 +79,7 @@ export class ValidateTokenCommand extends CommandRunner {
const possibleUserIds = configFile.remote.ssoSubIds.split(',');
if (possibleUserIds.includes(username)) {
this.logger.info(JSON.stringify({ error: null, valid: true, username }));
process.exit(0);
} else {
this.createErrorAndExit('Username on token does not match');
}