Skip to content

Commit

Permalink
Hide new columns by default, default to - if no data, and remove .ide…
Browse files Browse the repository at this point in the history
…a folder
  • Loading branch information
jsdw committed Aug 29, 2024
1 parent c69e044 commit 7805fe1
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 74 deletions.
5 changes: 0 additions & 5 deletions .idea/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

16 changes: 0 additions & 16 deletions .idea/substrate-telemetry.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

24 changes: 12 additions & 12 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ export default class App extends React.Component {
networkId: false,
peers: true,
txs: true,
cpu: true,
mem: true,
upload: false,
download: false,
stateCacheSize: false,
Expand All @@ -66,25 +64,27 @@ export default class App extends React.Component {
diskWrite: false,
blocknumber: true,
blockhash: true,
blocktime: true,
finalized: false,
finalizedhash: false,
blocktime: true,
blockpropagation: true,
blocklasttime: false,
uptime: false,
version: true,
target_os: true,
target_arch: true,
core_count: true,
memory: true,
is_virtual_machine: true,
linux_distro: true,
linux_kernel: true,
version: false,
target_os: false,
target_arch: false,
cpu: false,
cpu_hashrate_score: true,
cpu_vendor: true,
core_count: false,
mem: true,
memory: false,
linux_distro: false,
linux_kernel: false,
memory_memcpy_score: true,
disk_sequential_write_score: true,
disk_random_write_score: true,
cpu_vendor: true,
is_virtual_machine: false,
},
(settings) => {
const selectedColumns = this.selectedColumns(settings);
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ export type BytesPerSecond = Opaque<number, 'BytesPerSecond'>;
export type NetworkId = Opaque<string, 'NetworkId'>;

export type NodeSysInfo = {
cpu: string | null;
memory: number | null;
core_count: number | null;
linux_kernel: string | null;
linux_distro: string | null;
is_virtual_machine: boolean | null;
} | null;
cpu: string;
memory: number;
core_count: number;
linux_kernel: string;
linux_distro: string;
is_virtual_machine: boolean;
};

export type BlockDetails = [
BlockNumber,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ export class CpuArchitectureColumn extends React.Component<ColumnProps> {

this.data = target_arch;

return <td className="Column">{target_arch}</td>;
return <td className="Column">{target_arch || '-'}</td>;
}
}
2 changes: 1 addition & 1 deletion frontend/src/components/List/Column/CpuColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ export class CpuColumn extends React.Component<ColumnProps> {

this.data = cpu;

return <td className="Column">{cpu}</td>;
return <td className="Column">{cpu || '-'}</td>;
}
}
2 changes: 1 addition & 1 deletion frontend/src/components/List/Column/CpuCoresColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ export class CpuCoresColumn extends React.Component<ColumnProps> {

this.data = core_count;

return <td className="Column">{core_count}</td>;
return <td className="Column">{core_count || '-'}</td>;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ export class IsVirtualMachineColumn extends React.Component<ColumnProps> {

this.data = is_virtual_machine;

return <td className="Column">{is_virtual_machine ? 'True' : 'False'}</td>;
return <td className="Column">{is_virtual_machine ? 'Yes' : 'No'}</td>;
}
}
2 changes: 1 addition & 1 deletion frontend/src/components/List/Column/LinuxDistroColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ export class LinuxDistroColumn extends React.Component<ColumnProps> {

this.data = linux_distro;

return <td className="Column">{linux_distro}</td>;
return <td className="Column">{linux_distro || '-'}</td>;
}
}
2 changes: 1 addition & 1 deletion frontend/src/components/List/Column/LinuxKernelColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ export class LinuxKernelColumn extends React.Component<ColumnProps> {

this.data = linux_kernel;

return <td className="Column">{linux_kernel}</td>;
return <td className="Column">{linux_kernel || '-'}</td>;
}
}
2 changes: 1 addition & 1 deletion frontend/src/components/List/Column/MemoryColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ export class MemoryColumn extends React.Component<ColumnProps> {

this.data = memory;

return <td className="Column">{memory}</td>;
return <td className="Column">{memory || '-'}</td>;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ export class OperatingSystemColumn extends React.Component<ColumnProps> {

this.data = target_os;

return <td className="Column">{target_os}</td>;
return <td className="Column">{target_os || '-'}</td>;
}
}
2 changes: 1 addition & 1 deletion frontend/src/components/List/Column/VersionColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ export class VersionColumn extends React.Component<ColumnProps> {

this.data = version;

return <td className="Column">{version}</td>;
return <td className="Column">{version || '-'}</td>;
}
}
6 changes: 3 additions & 3 deletions frontend/src/components/List/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ export class Row extends React.Component<RowProps, RowState> {
BlockPropagationColumn,
LastBlockColumn,
UptimeColumn,
VersionColumn,
OperatingSystemColumn,
CpuArchitectureColumn,
CpuColumn,
CpuCoresColumn,
MemoryColumn,
LinuxDistroColumn,
LinuxKernelColumn,
MemoryColumn,
OperatingSystemColumn,
VersionColumn,
IsVirtualMachineColumn,
];
private renderedChangeRef = 0;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export const PINNED_CHAINS = {
};

export function comparePinnedChains(a: string, b: string) {
const aWeight = PINNED_CHAINS[a] || 1024;
const bWeight = PINNED_CHAINS[b] || 1024;
const aWeight: number = (PINNED_CHAINS as any)[a] || 1024;
const bWeight: number = (PINNED_CHAINS as any)[b] || 1024;

return aWeight - bWeight;
}
Expand Down

0 comments on commit 7805fe1

Please sign in to comment.