mirror of
https://github.com/unraid/api.git
synced 2026-01-01 06:01:18 -06:00
feat: remove unused fields
This commit is contained in:
@@ -270,7 +270,7 @@ export const config = createSlice({
|
|||||||
});
|
});
|
||||||
|
|
||||||
builder.addCase(setGraphqlConnectionStatus, (state, action) => {
|
builder.addCase(setGraphqlConnectionStatus, (state, action) => {
|
||||||
state.connectionStatus.minigraph = action.payload.status;
|
state.connectionStatus.minigraph = action.payload.status;
|
||||||
});
|
});
|
||||||
|
|
||||||
builder.addCase(setupRemoteAccessThunk.fulfilled, (state, action) => {
|
builder.addCase(setupRemoteAccessThunk.fulfilled, (state, action) => {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { VersionCommand } from '@app/unraid-api/cli/version.command';
|
|||||||
import { StatusCommand } from '@app/unraid-api/cli/status.command';
|
import { StatusCommand } from '@app/unraid-api/cli/status.command';
|
||||||
import { ValidateTokenCommand } from '@app/unraid-api/cli/validate-token.command';
|
import { ValidateTokenCommand } from '@app/unraid-api/cli/validate-token.command';
|
||||||
import { LogsCommand } from '@app/unraid-api/cli/logs.command';
|
import { LogsCommand } from '@app/unraid-api/cli/logs.command';
|
||||||
|
import { ConfigCommand } from '@app/unraid-api/cli/config.command';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
providers: [
|
providers: [
|
||||||
@@ -24,7 +25,8 @@ import { LogsCommand } from '@app/unraid-api/cli/logs.command';
|
|||||||
VersionCommand,
|
VersionCommand,
|
||||||
StatusCommand,
|
StatusCommand,
|
||||||
ValidateTokenCommand,
|
ValidateTokenCommand,
|
||||||
LogsCommand
|
LogsCommand,
|
||||||
|
ConfigCommand
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class CliModule {}
|
export class CliModule {}
|
||||||
|
|||||||
25
api/src/unraid-api/cli/config.command.ts
Normal file
25
api/src/unraid-api/cli/config.command.ts
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,7 +14,7 @@ export class RestartCommand extends CommandRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async run(_): Promise<void> {
|
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) {
|
if (stderr) {
|
||||||
this.logger.error(stderr);
|
this.logger.error(stderr);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ export class ValidateTokenCommand extends CommandRunner {
|
|||||||
const possibleUserIds = configFile.remote.ssoSubIds.split(',');
|
const possibleUserIds = configFile.remote.ssoSubIds.split(',');
|
||||||
if (possibleUserIds.includes(username)) {
|
if (possibleUserIds.includes(username)) {
|
||||||
this.logger.info(JSON.stringify({ error: null, valid: true, username }));
|
this.logger.info(JSON.stringify({ error: null, valid: true, username }));
|
||||||
|
process.exit(0);
|
||||||
} else {
|
} else {
|
||||||
this.createErrorAndExit('Username on token does not match');
|
this.createErrorAndExit('Username on token does not match');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user