mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-19 03:05:53 +08:00
(ui): Hide action buttons in read-only mode
This commit is contained in:
parent
3805ae6e06
commit
49eece97f7
@ -52,6 +52,7 @@
|
|||||||
<script>
|
<script>
|
||||||
window.ROOT_PATH = "%PUBLIC_URL%";
|
window.ROOT_PATH = "%PUBLIC_URL%";
|
||||||
window.PROMETHEUS_SERVER_ADDRESS = "/[[.PrometheusAddr]]";
|
window.PROMETHEUS_SERVER_ADDRESS = "/[[.PrometheusAddr]]";
|
||||||
|
window.READ_ONLY = /[[.ReadOnly]];
|
||||||
</script>
|
</script>
|
||||||
<title>Asynq - Monitoring</title>
|
<title>Asynq - Monitoring</title>
|
||||||
</head>
|
</head>
|
||||||
|
@ -161,6 +161,7 @@ function ActiveTasksTable(props: Props & ReduxProps) {
|
|||||||
const numSelected = selectedIds.length;
|
const numSelected = selectedIds.length;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableActions
|
<TableActions
|
||||||
showIconButtons={numSelected > 0}
|
showIconButtons={numSelected > 0}
|
||||||
iconButtonActions={[
|
iconButtonActions={[
|
||||||
@ -179,6 +180,7 @@ function ActiveTasksTable(props: Props & ReduxProps) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
<TableContainer component={Paper}>
|
<TableContainer component={Paper}>
|
||||||
<Table
|
<Table
|
||||||
stickyHeader={true}
|
stickyHeader={true}
|
||||||
@ -188,6 +190,7 @@ function ActiveTasksTable(props: Props & ReduxProps) {
|
|||||||
>
|
>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell
|
<TableCell
|
||||||
padding="checkbox"
|
padding="checkbox"
|
||||||
classes={{ stickyHeader: classes.stickyHeaderCell }}
|
classes={{ stickyHeader: classes.stickyHeaderCell }}
|
||||||
@ -203,7 +206,13 @@ function ActiveTasksTable(props: Props & ReduxProps) {
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
{columns.map((col) => (
|
)}
|
||||||
|
{columns
|
||||||
|
.filter((col) => {
|
||||||
|
// Filter out actions column in readonly mode.
|
||||||
|
return !window.READ_ONLY || col.key !== "actions";
|
||||||
|
})
|
||||||
|
.map((col) => (
|
||||||
<TableCell
|
<TableCell
|
||||||
key={col.key}
|
key={col.key}
|
||||||
align={col.align}
|
align={col.align}
|
||||||
@ -311,6 +320,7 @@ function Row(props: RowProps) {
|
|||||||
selected={props.isSelected}
|
selected={props.isSelected}
|
||||||
onClick={() => history.push(taskDetailsPath(task.queue, task.id))}
|
onClick={() => history.push(taskDetailsPath(task.queue, task.id))}
|
||||||
>
|
>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell padding="checkbox" onClick={(e) => e.stopPropagation()}>
|
<TableCell padding="checkbox" onClick={(e) => e.stopPropagation()}>
|
||||||
<IconButton>
|
<IconButton>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@ -321,6 +331,7 @@ function Row(props: RowProps) {
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
<TableCell component="th" scope="row" className={classes.idCell}>
|
<TableCell component="th" scope="row" className={classes.idCell}>
|
||||||
<div className={classes.IdGroup}>
|
<div className={classes.IdGroup}>
|
||||||
{uuidPrefix(task.id)}
|
{uuidPrefix(task.id)}
|
||||||
@ -364,6 +375,7 @@ function Row(props: RowProps) {
|
|||||||
<TableCell>
|
<TableCell>
|
||||||
{task.deadline === "-" ? "-" : durationBefore(task.deadline)}
|
{task.deadline === "-" ? "-" : durationBefore(task.deadline)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell
|
<TableCell
|
||||||
align="center"
|
align="center"
|
||||||
onMouseEnter={props.onActionCellEnter}
|
onMouseEnter={props.onActionCellEnter}
|
||||||
@ -390,6 +402,7 @@ function Row(props: RowProps) {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -180,6 +180,7 @@ function ArchivedTasksTable(props: Props & ReduxProps) {
|
|||||||
const numSelected = selectedIds.length;
|
const numSelected = selectedIds.length;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableActions
|
<TableActions
|
||||||
showIconButtons={numSelected > 0}
|
showIconButtons={numSelected > 0}
|
||||||
iconButtonActions={[
|
iconButtonActions={[
|
||||||
@ -209,6 +210,7 @@ function ArchivedTasksTable(props: Props & ReduxProps) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
<TableContainer component={Paper}>
|
<TableContainer component={Paper}>
|
||||||
<Table
|
<Table
|
||||||
stickyHeader={true}
|
stickyHeader={true}
|
||||||
@ -218,6 +220,7 @@ function ArchivedTasksTable(props: Props & ReduxProps) {
|
|||||||
>
|
>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell
|
<TableCell
|
||||||
padding="checkbox"
|
padding="checkbox"
|
||||||
classes={{ stickyHeader: classes.stickyHeaderCell }}
|
classes={{ stickyHeader: classes.stickyHeaderCell }}
|
||||||
@ -233,7 +236,13 @@ function ArchivedTasksTable(props: Props & ReduxProps) {
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
{columns.map((col) => (
|
)}
|
||||||
|
{columns
|
||||||
|
.filter((col) => {
|
||||||
|
// Filter out actions column in readonly mode.
|
||||||
|
return !window.READ_ONLY || col.key !== "actions";
|
||||||
|
})
|
||||||
|
.map((col) => (
|
||||||
<TableCell
|
<TableCell
|
||||||
key={col.key}
|
key={col.key}
|
||||||
align={col.align}
|
align={col.align}
|
||||||
@ -353,6 +362,7 @@ function Row(props: RowProps) {
|
|||||||
selected={props.isSelected}
|
selected={props.isSelected}
|
||||||
onClick={() => history.push(taskDetailsPath(task.queue, task.id))}
|
onClick={() => history.push(taskDetailsPath(task.queue, task.id))}
|
||||||
>
|
>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell padding="checkbox" onClick={(e) => e.stopPropagation()}>
|
<TableCell padding="checkbox" onClick={(e) => e.stopPropagation()}>
|
||||||
<IconButton>
|
<IconButton>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@ -363,6 +373,7 @@ function Row(props: RowProps) {
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
<TableCell component="th" scope="row" className={classes.idCell}>
|
<TableCell component="th" scope="row" className={classes.idCell}>
|
||||||
<div className={classes.IdGroup}>
|
<div className={classes.IdGroup}>
|
||||||
{uuidPrefix(task.id)}
|
{uuidPrefix(task.id)}
|
||||||
@ -391,6 +402,7 @@ function Row(props: RowProps) {
|
|||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>{timeAgo(task.last_failed_at)}</TableCell>
|
<TableCell>{timeAgo(task.last_failed_at)}</TableCell>
|
||||||
<TableCell>{task.error_message}</TableCell>
|
<TableCell>{task.error_message}</TableCell>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell
|
<TableCell
|
||||||
align="center"
|
align="center"
|
||||||
className={classes.actionCell}
|
className={classes.actionCell}
|
||||||
@ -427,6 +439,7 @@ function Row(props: RowProps) {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -167,6 +167,7 @@ function CompletedTasksTable(props: Props & ReduxProps) {
|
|||||||
const numSelected = selectedIds.length;
|
const numSelected = selectedIds.length;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableActions
|
<TableActions
|
||||||
showIconButtons={numSelected > 0}
|
showIconButtons={numSelected > 0}
|
||||||
iconButtonActions={[
|
iconButtonActions={[
|
||||||
@ -185,6 +186,7 @@ function CompletedTasksTable(props: Props & ReduxProps) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
<TableContainer component={Paper}>
|
<TableContainer component={Paper}>
|
||||||
<Table
|
<Table
|
||||||
stickyHeader={true}
|
stickyHeader={true}
|
||||||
@ -194,6 +196,7 @@ function CompletedTasksTable(props: Props & ReduxProps) {
|
|||||||
>
|
>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell
|
<TableCell
|
||||||
padding="checkbox"
|
padding="checkbox"
|
||||||
classes={{ stickyHeader: classes.stickyHeaderCell }}
|
classes={{ stickyHeader: classes.stickyHeaderCell }}
|
||||||
@ -209,7 +212,13 @@ function CompletedTasksTable(props: Props & ReduxProps) {
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
{columns.map((col) => (
|
)}
|
||||||
|
{columns
|
||||||
|
.filter((col) => {
|
||||||
|
// Filter out actions column in readonly mode.
|
||||||
|
return !window.READ_ONLY || col.key !== "actions";
|
||||||
|
})
|
||||||
|
.map((col) => (
|
||||||
<TableCell
|
<TableCell
|
||||||
key={col.key}
|
key={col.key}
|
||||||
align={col.align}
|
align={col.align}
|
||||||
@ -328,6 +337,7 @@ function Row(props: RowProps) {
|
|||||||
selected={props.isSelected}
|
selected={props.isSelected}
|
||||||
onClick={() => history.push(taskDetailsPath(task.queue, task.id))}
|
onClick={() => history.push(taskDetailsPath(task.queue, task.id))}
|
||||||
>
|
>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell padding="checkbox" onClick={(e) => e.stopPropagation()}>
|
<TableCell padding="checkbox" onClick={(e) => e.stopPropagation()}>
|
||||||
<IconButton>
|
<IconButton>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@ -338,6 +348,7 @@ function Row(props: RowProps) {
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
<TableCell component="th" scope="row" className={classes.idCell}>
|
<TableCell component="th" scope="row" className={classes.idCell}>
|
||||||
<div className={classes.IdGroup}>
|
<div className={classes.IdGroup}>
|
||||||
{uuidPrefix(task.id)}
|
{uuidPrefix(task.id)}
|
||||||
@ -378,6 +389,7 @@ function Row(props: RowProps) {
|
|||||||
? `${stringifyDuration(durationFromSeconds(task.ttl_seconds))} left`
|
? `${stringifyDuration(durationFromSeconds(task.ttl_seconds))} left`
|
||||||
: `expired`}
|
: `expired`}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell
|
<TableCell
|
||||||
align="center"
|
align="center"
|
||||||
className={classes.actionCell}
|
className={classes.actionCell}
|
||||||
@ -404,6 +416,7 @@ function Row(props: RowProps) {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -176,6 +176,7 @@ function PendingTasksTable(props: Props & ReduxProps) {
|
|||||||
const numSelected = selectedIds.length;
|
const numSelected = selectedIds.length;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableActions
|
<TableActions
|
||||||
showIconButtons={numSelected > 0}
|
showIconButtons={numSelected > 0}
|
||||||
iconButtonActions={[
|
iconButtonActions={[
|
||||||
@ -205,6 +206,7 @@ function PendingTasksTable(props: Props & ReduxProps) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
<TableContainer component={Paper}>
|
<TableContainer component={Paper}>
|
||||||
<Table
|
<Table
|
||||||
stickyHeader={true}
|
stickyHeader={true}
|
||||||
@ -214,6 +216,7 @@ function PendingTasksTable(props: Props & ReduxProps) {
|
|||||||
>
|
>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell
|
<TableCell
|
||||||
padding="checkbox"
|
padding="checkbox"
|
||||||
classes={{ stickyHeader: classes.stickyHeaderCell }}
|
classes={{ stickyHeader: classes.stickyHeaderCell }}
|
||||||
@ -229,7 +232,13 @@ function PendingTasksTable(props: Props & ReduxProps) {
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
{columns.map((col) => (
|
)}
|
||||||
|
{columns
|
||||||
|
.filter((col) => {
|
||||||
|
// Filter out actions column in readonly mode.
|
||||||
|
return !window.READ_ONLY || col.key !== "actions";
|
||||||
|
})
|
||||||
|
.map((col) => (
|
||||||
<TableCell
|
<TableCell
|
||||||
key={col.key}
|
key={col.key}
|
||||||
align={col.align}
|
align={col.align}
|
||||||
@ -355,6 +364,7 @@ function Row(props: RowProps) {
|
|||||||
selected={props.isSelected}
|
selected={props.isSelected}
|
||||||
onClick={() => history.push(taskDetailsPath(task.queue, task.id))}
|
onClick={() => history.push(taskDetailsPath(task.queue, task.id))}
|
||||||
>
|
>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell padding="checkbox" onClick={(e) => e.stopPropagation()}>
|
<TableCell padding="checkbox" onClick={(e) => e.stopPropagation()}>
|
||||||
<IconButton>
|
<IconButton>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@ -365,6 +375,7 @@ function Row(props: RowProps) {
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
<TableCell component="th" scope="row" className={classes.idCell}>
|
<TableCell component="th" scope="row" className={classes.idCell}>
|
||||||
<div className={classes.IdGroup}>
|
<div className={classes.IdGroup}>
|
||||||
{uuidPrefix(task.id)}
|
{uuidPrefix(task.id)}
|
||||||
@ -393,6 +404,7 @@ function Row(props: RowProps) {
|
|||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="right">{task.retried}</TableCell>
|
<TableCell align="right">{task.retried}</TableCell>
|
||||||
<TableCell align="right">{task.max_retry}</TableCell>
|
<TableCell align="right">{task.max_retry}</TableCell>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell
|
<TableCell
|
||||||
align="center"
|
align="center"
|
||||||
className={classes.actionCell}
|
className={classes.actionCell}
|
||||||
@ -429,6 +441,7 @@ function Row(props: RowProps) {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,12 @@ export default function QueuesOverviewTable(props: Props) {
|
|||||||
<Table className={classes.table} aria-label="queues overview table">
|
<Table className={classes.table} aria-label="queues overview table">
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
{colConfigs.map((cfg, i) => (
|
{colConfigs
|
||||||
|
.filter((cfg) => {
|
||||||
|
// Filter out actions column in readonly mode.
|
||||||
|
return !window.READ_ONLY || cfg.key !== "actions";
|
||||||
|
})
|
||||||
|
.map((cfg, i) => (
|
||||||
<TableCell
|
<TableCell
|
||||||
key={cfg.key}
|
key={cfg.key}
|
||||||
align={cfg.align}
|
align={cfg.align}
|
||||||
@ -298,6 +303,7 @@ function Row(props: RowProps) {
|
|||||||
<TableCell align="right">{q.processed}</TableCell>
|
<TableCell align="right">{q.processed}</TableCell>
|
||||||
<TableCell align="right">{q.failed}</TableCell>
|
<TableCell align="right">{q.failed}</TableCell>
|
||||||
<TableCell align="right">{percentage(q.failed, q.processed)}</TableCell>
|
<TableCell align="right">{percentage(q.failed, q.processed)}</TableCell>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell
|
<TableCell
|
||||||
align="center"
|
align="center"
|
||||||
onMouseEnter={() => setShowIcons(true)}
|
onMouseEnter={() => setShowIcons(true)}
|
||||||
@ -342,6 +348,7 @@ function Row(props: RowProps) {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -196,6 +196,7 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
|||||||
const numSelected = selectedIds.length;
|
const numSelected = selectedIds.length;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableActions
|
<TableActions
|
||||||
showIconButtons={numSelected > 0}
|
showIconButtons={numSelected > 0}
|
||||||
iconButtonActions={[
|
iconButtonActions={[
|
||||||
@ -236,6 +237,7 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
<TableContainer component={Paper}>
|
<TableContainer component={Paper}>
|
||||||
<Table
|
<Table
|
||||||
stickyHeader={true}
|
stickyHeader={true}
|
||||||
@ -245,6 +247,7 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
|||||||
>
|
>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell
|
<TableCell
|
||||||
padding="checkbox"
|
padding="checkbox"
|
||||||
classes={{ stickyHeader: classes.stickyHeaderCell }}
|
classes={{ stickyHeader: classes.stickyHeaderCell }}
|
||||||
@ -260,7 +263,13 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
{columns.map((col) => (
|
)}
|
||||||
|
{columns
|
||||||
|
.filter((col) => {
|
||||||
|
// Filter out actions column in readonly mode.
|
||||||
|
return !window.READ_ONLY || col.key !== "actions";
|
||||||
|
})
|
||||||
|
.map((col) => (
|
||||||
<TableCell
|
<TableCell
|
||||||
key={col.label}
|
key={col.label}
|
||||||
align={col.align}
|
align={col.align}
|
||||||
@ -388,6 +397,7 @@ function Row(props: RowProps) {
|
|||||||
selected={props.isSelected}
|
selected={props.isSelected}
|
||||||
onClick={() => history.push(taskDetailsPath(task.queue, task.id))}
|
onClick={() => history.push(taskDetailsPath(task.queue, task.id))}
|
||||||
>
|
>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell padding="checkbox" onClick={(e) => e.stopPropagation()}>
|
<TableCell padding="checkbox" onClick={(e) => e.stopPropagation()}>
|
||||||
<IconButton>
|
<IconButton>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@ -398,6 +408,7 @@ function Row(props: RowProps) {
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
<TableCell component="th" scope="row" className={classes.idCell}>
|
<TableCell component="th" scope="row" className={classes.idCell}>
|
||||||
<div className={classes.IdGroup}>
|
<div className={classes.IdGroup}>
|
||||||
{uuidPrefix(task.id)}
|
{uuidPrefix(task.id)}
|
||||||
@ -428,6 +439,7 @@ function Row(props: RowProps) {
|
|||||||
<TableCell>{task.error_message}</TableCell>
|
<TableCell>{task.error_message}</TableCell>
|
||||||
<TableCell align="right">{task.retried}</TableCell>
|
<TableCell align="right">{task.retried}</TableCell>
|
||||||
<TableCell align="right">{task.max_retry}</TableCell>
|
<TableCell align="right">{task.max_retry}</TableCell>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell
|
<TableCell
|
||||||
align="center"
|
align="center"
|
||||||
className={classes.actionCell}
|
className={classes.actionCell}
|
||||||
@ -474,6 +486,7 @@ function Row(props: RowProps) {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -193,6 +193,7 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
|||||||
const numSelected = selectedIds.length;
|
const numSelected = selectedIds.length;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableActions
|
<TableActions
|
||||||
showIconButtons={numSelected > 0}
|
showIconButtons={numSelected > 0}
|
||||||
iconButtonActions={[
|
iconButtonActions={[
|
||||||
@ -233,6 +234,7 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
<TableContainer component={Paper}>
|
<TableContainer component={Paper}>
|
||||||
<Table
|
<Table
|
||||||
stickyHeader={true}
|
stickyHeader={true}
|
||||||
@ -242,6 +244,7 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
|||||||
>
|
>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell
|
<TableCell
|
||||||
padding="checkbox"
|
padding="checkbox"
|
||||||
classes={{ stickyHeader: classes.stickyHeaderCell }}
|
classes={{ stickyHeader: classes.stickyHeaderCell }}
|
||||||
@ -257,7 +260,13 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
{columns.map((col) => (
|
)}
|
||||||
|
{columns
|
||||||
|
.filter((col) => {
|
||||||
|
// Filter out actions column in readonly mode.
|
||||||
|
return !window.READ_ONLY || col.key !== "actions";
|
||||||
|
})
|
||||||
|
.map((col) => (
|
||||||
<TableCell
|
<TableCell
|
||||||
key={col.label}
|
key={col.label}
|
||||||
align={col.align}
|
align={col.align}
|
||||||
@ -384,6 +393,7 @@ function Row(props: RowProps) {
|
|||||||
selected={props.isSelected}
|
selected={props.isSelected}
|
||||||
onClick={() => history.push(taskDetailsPath(task.queue, task.id))}
|
onClick={() => history.push(taskDetailsPath(task.queue, task.id))}
|
||||||
>
|
>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell padding="checkbox" onClick={(e) => e.stopPropagation()}>
|
<TableCell padding="checkbox" onClick={(e) => e.stopPropagation()}>
|
||||||
<IconButton>
|
<IconButton>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@ -394,6 +404,7 @@ function Row(props: RowProps) {
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
<TableCell component="th" scope="row" className={classes.idCell}>
|
<TableCell component="th" scope="row" className={classes.idCell}>
|
||||||
<div className={classes.IdGroup}>
|
<div className={classes.IdGroup}>
|
||||||
{uuidPrefix(task.id)}
|
{uuidPrefix(task.id)}
|
||||||
@ -421,6 +432,7 @@ function Row(props: RowProps) {
|
|||||||
</SyntaxHighlighter>
|
</SyntaxHighlighter>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>{durationBefore(task.next_process_at)}</TableCell>
|
<TableCell>{durationBefore(task.next_process_at)}</TableCell>
|
||||||
|
{!window.READ_ONLY && (
|
||||||
<TableCell
|
<TableCell
|
||||||
align="center"
|
align="center"
|
||||||
className={classes.actionCell}
|
className={classes.actionCell}
|
||||||
@ -467,6 +479,7 @@ function Row(props: RowProps) {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
3
ui/src/global.d.ts
vendored
3
ui/src/global.d.ts
vendored
@ -6,4 +6,7 @@ interface Window {
|
|||||||
// Prometheus server address to query time series data.
|
// Prometheus server address to query time series data.
|
||||||
// This field is set to empty string by default. Use this field only if it's set.
|
// This field is set to empty string by default. Use this field only if it's set.
|
||||||
PROMETHEUS_SERVER_ADDRESS: string;
|
PROMETHEUS_SERVER_ADDRESS: string;
|
||||||
|
|
||||||
|
// If true, app hides buttons/links to make non-GET requests to the API server.
|
||||||
|
READ_ONLY: boolean;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user