Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataGrid UI fixes for long fields #965

Merged
merged 1 commit into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions dkron/ui-dist/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"files": {
"main.css": "./static/css/main.356b93bb.chunk.css",
"main.js": "./static/js/main.2eedb209.chunk.js",
"main.js.map": "./static/js/main.2eedb209.chunk.js.map",
"main.js": "./static/js/main.080a47b0.chunk.js",
"main.js.map": "./static/js/main.080a47b0.chunk.js.map",
"runtime-main.js": "./static/js/runtime-main.7a7f3ef5.js",
"runtime-main.js.map": "./static/js/runtime-main.7a7f3ef5.js.map",
"static/js/2.707251cd.chunk.js": "./static/js/2.707251cd.chunk.js",
"static/js/2.707251cd.chunk.js.map": "./static/js/2.707251cd.chunk.js.map",
"static/js/2.f94c37f3.chunk.js": "./static/js/2.f94c37f3.chunk.js",
"static/js/2.f94c37f3.chunk.js.map": "./static/js/2.f94c37f3.chunk.js.map",
"static/js/3.7b2d85fb.chunk.js": "./static/js/3.7b2d85fb.chunk.js",
"static/js/3.7b2d85fb.chunk.js.map": "./static/js/3.7b2d85fb.chunk.js.map",
"index.html": "./index.html",
"static/css/main.356b93bb.chunk.css.map": "./static/css/main.356b93bb.chunk.css.map",
"static/js/2.707251cd.chunk.js.LICENSE.txt": "./static/js/2.707251cd.chunk.js.LICENSE.txt",
"static/js/2.f94c37f3.chunk.js.LICENSE.txt": "./static/js/2.f94c37f3.chunk.js.LICENSE.txt",
"static/media/dkron-logo.cd9d7840.png": "./static/media/dkron-logo.cd9d7840.png"
},
"entrypoints": [
"static/js/runtime-main.7a7f3ef5.js",
"static/js/2.707251cd.chunk.js",
"static/js/2.f94c37f3.chunk.js",
"static/css/main.356b93bb.chunk.css",
"static/js/main.2eedb209.chunk.js"
"static/js/main.080a47b0.chunk.js"
]
}
2 changes: 1 addition & 1 deletion dkron/ui-dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
window.DKRON_TOTAL_JOBS={{.DKRON_TOTAL_JOBS}};
window.DKRON_SUCCESSFUL_JOBS={{.DKRON_SUCCESSFUL_JOBS}};
window.DKRON_FAILED_JOBS={{.DKRON_FAILED_JOBS}};
window.DKRON_UNTRIGGERED_JOBS={{.DKRON_UNTRIGGERED_JOBS}};</script><link href="./static/css/main.356b93bb.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"7b2d85fb"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="./",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpwebui=this.webpackJsonpwebui||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var l=0;l<a.length;l++)r(a[l]);var f=c;t()}([])</script><script src="./static/js/2.707251cd.chunk.js"></script><script src="./static/js/main.2eedb209.chunk.js"></script></body></html>
window.DKRON_UNTRIGGERED_JOBS={{.DKRON_UNTRIGGERED_JOBS}};</script><link href="./static/css/main.356b93bb.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"7b2d85fb"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="./",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpwebui=this.webpackJsonpwebui||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var l=0;l<a.length;l++)r(a[l]);var f=c;t()}([])</script><script src="./static/js/2.f94c37f3.chunk.js"></script><script src="./static/js/main.080a47b0.chunk.js"></script></body></html>
1 change: 0 additions & 1 deletion dkron/ui-dist/static/js/2.707251cd.chunk.js.map

This file was deleted.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dkron/ui-dist/static/js/2.f94c37f3.chunk.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dkron/ui-dist/static/js/main.080a47b0.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dkron/ui-dist/static/js/main.080a47b0.chunk.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dkron/ui-dist/static/js/main.2eedb209.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion dkron/ui-dist/static/js/main.2eedb209.chunk.js.map

This file was deleted.

58 changes: 39 additions & 19 deletions ui/src/jobs/JobList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Fragment } from 'react';
import BulkRunButton from "./BulkRunButton"
import BulkToggleButton from "./BulkToggleButton"
import StatusField from "./StatusField"
import { makeStyles } from '@material-ui/core/styles';

const JobFilter = (props: any) => (
<Filter {...props}>
Expand All @@ -41,24 +42,43 @@ const JobBulkActionButtons = (props: any) => (

const JobPagination = (props: any) => <Pagination rowsPerPageOptions={[5, 10, 25, 50, 100]} {...props} />;

const JobList = (props: any) => (
<List {...props} filters={<JobFilter />} bulkActionButtons={<JobBulkActionButtons />} pagination={<JobPagination />}>
<Datagrid rowClick="show" style={{tableLayout: 'fixed'}}>
<TextField source="id" />
<TextField source="displayname" label="Display name" />
<TextField source="timezone" />
<TextField source="schedule" />
<NumberField source="success_count" />
<NumberField source="error_count" />
<DateField source="last_success" showTime />
<DateField source="last_error" showTime />
<BooleanField source="disabled" sortable={false} />
<NumberField source="retries" sortable={false} />
<StatusField source="status" sortable={false} />
<DateField source="next" showTime />
<EditButton/>
</Datagrid>
</List>
);
const useStyles = makeStyles(theme => ({
hiddenOnSmallScreens: {
display: 'table-cell',
[theme.breakpoints.down('md')]: {
display: 'none',
},
},
cell: {
padding: "6px 8px 6px 8px",
},
}));

const JobList = (props: any) => {
const classes = useStyles();
return (
<List {...props} filters={<JobFilter />} bulkActionButtons={<JobBulkActionButtons />} pagination={<JobPagination />}>
<Datagrid rowClick="show" classes={{rowCell: classes.cell}}>
<TextField source="id"
cellClassName={classes.hiddenOnSmallScreens}
headerClassName={classes.hiddenOnSmallScreens} />
<TextField source="displayname" label="Display name" />
<TextField source="timezone" sortable={false}
cellClassName={classes.hiddenOnSmallScreens}
headerClassName={classes.hiddenOnSmallScreens} />
<TextField source="schedule" />
<NumberField source="success_count" />
<NumberField source="error_count" />
<DateField source="last_success" showTime />
<DateField source="last_error" showTime />
<BooleanField source="disabled" sortable={false} />
<NumberField source="retries" sortable={false} />
<StatusField source="status" sortable={false} />
<DateField source="next" showTime />
<EditButton/>
</Datagrid>
</List>
);
};

export default JobList;