Client: Added some missing columns in table
Also configured the default columns to show
This commit is contained in:
@@ -55,6 +55,8 @@
|
||||
"filament": "Filament",
|
||||
"used_weight": "Used Weight",
|
||||
"remaining_weight": "Remaining Weight",
|
||||
"used_length": "Used Length",
|
||||
"remaining_length": "Remaining Length",
|
||||
"location": "Location",
|
||||
"lot_nr": "Lot Nr",
|
||||
"first_used": "First Used",
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
"filament": "Filament",
|
||||
"used_weight": "Använd vikt",
|
||||
"remaining_weight": "Återstående vikt",
|
||||
"used_length": "Använd längd",
|
||||
"remaining_length": "Återstående längd",
|
||||
"location": "Plats",
|
||||
"lot_nr": "Batchnummer",
|
||||
"first_used": "Användes först",
|
||||
|
||||
@@ -83,11 +83,20 @@ export const FilamentList: React.FC<IResourceComponentsProps> = () => {
|
||||
"weight",
|
||||
"spool_weight",
|
||||
"article_number",
|
||||
"settings_extruder_temp",
|
||||
"settings_bed_temp",
|
||||
"registered",
|
||||
"comment",
|
||||
];
|
||||
const defaultColumns = allColumns.filter(
|
||||
(column_id) =>
|
||||
["registered", "density", "diameter", "spool_weight"].indexOf(
|
||||
column_id
|
||||
) === -1
|
||||
);
|
||||
|
||||
const [showColumns, setShowColumns] = React.useState<string[]>(
|
||||
initialState.showColumns ?? allColumns
|
||||
initialState.showColumns ?? defaultColumns
|
||||
);
|
||||
|
||||
// Type the sorters and filters
|
||||
@@ -249,6 +258,22 @@ export const FilamentList: React.FC<IResourceComponentsProps> = () => {
|
||||
dataSource,
|
||||
tableState,
|
||||
})}
|
||||
{NumberColumn({
|
||||
id: "settings_extruder_temp",
|
||||
i18ncat: "filament",
|
||||
unit: "°C",
|
||||
decimals: 0,
|
||||
dataSource,
|
||||
tableState,
|
||||
})}
|
||||
{NumberColumn({
|
||||
id: "settings_bed_temp",
|
||||
i18ncat: "filament",
|
||||
unit: "°C",
|
||||
decimals: 0,
|
||||
dataSource,
|
||||
tableState,
|
||||
})}
|
||||
{DateColumn({
|
||||
id: "registered",
|
||||
i18ncat: "filament",
|
||||
|
||||
@@ -77,14 +77,23 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
|
||||
"filament_name",
|
||||
"used_weight",
|
||||
"remaining_weight",
|
||||
"used_length",
|
||||
"remaining_length",
|
||||
"location",
|
||||
"lot_nr",
|
||||
"first_used",
|
||||
"last_used",
|
||||
"registered",
|
||||
"comment",
|
||||
];
|
||||
const defaultColumns = allColumns.filter(
|
||||
(column_id) =>
|
||||
["registered", "used_length", "remaining_length", "lot_nr"].indexOf(
|
||||
column_id
|
||||
) === -1
|
||||
);
|
||||
const [showColumns, setShowColumns] = React.useState<string[]>(
|
||||
initialState.showColumns ?? allColumns
|
||||
initialState.showColumns ?? defaultColumns
|
||||
);
|
||||
|
||||
// Type the sorters and filters
|
||||
@@ -208,6 +217,23 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
|
||||
dataSource,
|
||||
tableState,
|
||||
})}
|
||||
{NumberColumn({
|
||||
id: "used_length",
|
||||
i18ncat: "spool",
|
||||
unit: "mm",
|
||||
decimals: 0,
|
||||
dataSource,
|
||||
tableState,
|
||||
})}
|
||||
{NumberColumn({
|
||||
id: "remaining_length",
|
||||
i18ncat: "spool",
|
||||
unit: "mm",
|
||||
decimals: 0,
|
||||
defaultText: t("unknown"),
|
||||
dataSource,
|
||||
tableState,
|
||||
})}
|
||||
{FilteredColumn({
|
||||
id: "location",
|
||||
i18ncat: "spool",
|
||||
@@ -232,6 +258,12 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
|
||||
dataSource,
|
||||
tableState,
|
||||
})}
|
||||
{DateColumn({
|
||||
id: "registered",
|
||||
i18ncat: "spool",
|
||||
dataSource,
|
||||
tableState,
|
||||
})}
|
||||
{SortedColumn({
|
||||
id: "comment",
|
||||
i18ncat: "spool",
|
||||
|
||||
@@ -8,6 +8,8 @@ export interface ISpool {
|
||||
filament: IFilament;
|
||||
remaining_weight?: number;
|
||||
used_weight: number;
|
||||
remaining_length?: number;
|
||||
used_length: number;
|
||||
location?: string;
|
||||
lot_nr?: string;
|
||||
comment?: string;
|
||||
|
||||
Reference in New Issue
Block a user