Skip to content

Commit

Permalink
UI fixes (#896)
Browse files Browse the repository at this point in the history
* fix: Add timezone back to UI

* chore: Bump dependencies

* feat: Show execution status

* chore: Update assets
  • Loading branch information
Victor Castell authored Jan 24, 2021
1 parent 802664d commit 1911787
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 65 deletions.
96 changes: 48 additions & 48 deletions dkron/assets_ui/assets_vfsdata.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require (
github.com/DataDog/datadog-go v4.0.0+incompatible // indirect
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2
github.com/armon/go-metrics v0.3.6
github.com/aws/aws-sdk-go v1.34.17 // indirect
github.com/aws/aws-sdk-go v1.36.31 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/fluent/fluent-logger-golang v1.5.0
github.com/gin-contrib/cors v1.3.1
Expand All @@ -13,9 +13,9 @@ require (
github.com/gin-gonic/gin v1.6.3
github.com/gogo/protobuf v1.3.1 // indirect
github.com/golang/protobuf v1.4.3
github.com/hashicorp/go-discover v0.0.0-20200108194735-7698de1390a1
github.com/hashicorp/go-discover v0.0.0-20201029210230-738cb3105cd0
github.com/hashicorp/go-hclog v0.15.0
github.com/hashicorp/go-immutable-radix v1.2.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.0 // indirect
github.com/hashicorp/go-plugin v1.4.0
github.com/hashicorp/go-sockaddr v1.0.2
github.com/hashicorp/go-syslog v1.0.0
Expand Down Expand Up @@ -44,7 +44,7 @@ require (
github.com/stretchr/testify v1.7.0
github.com/tidwall/buntdb v1.1.7
github.com/tinylib/msgp v1.1.2 // indirect
golang.org/x/net v0.0.0-20200822124328-c89045814202
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
google.golang.org/api v0.35.0 // indirect
google.golang.org/grpc v1.35.0
google.golang.org/grpc/examples v0.0.0-20201121004645-9da74c039bbf // indirect
Expand Down
106 changes: 106 additions & 0 deletions go.sum

Large diffs are not rendered by default.

15 changes: 5 additions & 10 deletions ui/src/jobs/JobEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ const EditForm = (props: any) => (
<SimpleForm {...props}>
<TextInput disabled source="id" />
<TextInput source="name" />
<TextInput source="schedule" />
<TextInput source="displayname" />
<TextInput source="timezone" />
<TextInput source="schedule" />
<TextInput source="owner" />
<TextInput source="owner_email" />
<TextInput source="parent_job" />
Expand All @@ -37,36 +38,30 @@ const EditForm = (props: any) => (
]} />
<JsonInput
source="processors"
// validate={required(){ return true }}
reactJsonOptions={{
// Props passed to react-json-view
name: null,
collapsed: false,
enableClipboard: false,
enableClipboard: true,
displayDataTypes: false,
src: {},
}}
/>
<JsonInput
source="tags"
// validate={required(){ return true }}
reactJsonOptions={{
// Props passed to react-json-view
name: null,
collapsed: false,
enableClipboard: false,
enableClipboard: true,
displayDataTypes: false,
src: {},
}}
/>
<JsonInput
source="metadata"
// validate={required(){ return true }}
reactJsonOptions={{
// Props passed to react-json-view
name: null,
collapsed: false,
enableClipboard: false,
enableClipboard: true,
displayDataTypes: false,
src: {},
}}
Expand Down
1 change: 1 addition & 0 deletions ui/src/jobs/JobList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const JobList = (props: any) => (
<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" />
Expand Down
11 changes: 9 additions & 2 deletions ui/src/jobs/JobShow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
TextField,
NumberField,
DateField,
BooleanField,
EditButton,
BooleanField,
TopToolbar,
Show,
TabbedShowLayout,
Expand All @@ -17,6 +17,8 @@ import ToggleButton from "./ToggleButton"
import RunButton from "./RunButton"
import { JsonField } from "react-admin-json-view";
import ZeroDateField from "./ZeroDateField";
import JobIcon from '@material-ui/icons/Update';
import { Tooltip } from '@material-ui/core';

const JobShowActions = ({ basePath, data, resource }: any) => (
<TopToolbar>
Expand All @@ -26,11 +28,16 @@ const JobShowActions = ({ basePath, data, resource }: any) => (
</TopToolbar>
);

const SuccessField = (props: any) => {
return (props.record["finished_at"] === null ? <Tooltip title="Running"><JobIcon /></Tooltip> : <BooleanField {...props} />);
};

const JobShow = (props: any) => (
<Show actions={<JobShowActions {...props}/>} {...props}>
<TabbedShowLayout>
<Tab label="summary">
<TextField source="name" />
<TextField source="timezone" />
<TextField source="schedule" />
<DateField label="Last success" source="last_success" showTime />
<DateField source="last_error" showTime />
Expand Down Expand Up @@ -80,7 +87,7 @@ const JobShow = (props: any) => (
<DateField source="started_at" showTime />
<ZeroDateField source="finished_at" showTime />
<TextField source="node_name" sortable={false} />
<BooleanField source="success" sortable={false} />
<SuccessField source="success" sortable={false} />
<NumberField source="attempt" />
</Datagrid>
</ReferenceManyField>
Expand Down
3 changes: 2 additions & 1 deletion ui/src/jobs/StatusFiled.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import * as React from "react";
import SuccessIcon from '@material-ui/icons/CheckCircle';
import FailedIcon from '@material-ui/icons/Cancel';
import { Tooltip } from '@material-ui/core';

const StatusField = (props: any) => {
return (props.record[props.source] === 'success' ? <SuccessIcon htmlColor="green" /> : <FailedIcon htmlColor="red" />);
return (props.record[props.source] === 'success' ? <Tooltip title="Success"><SuccessIcon htmlColor="green" /></Tooltip> : <Tooltip title="Success"><FailedIcon htmlColor="red" /></Tooltip>);
};

export default StatusField;

0 comments on commit 1911787

Please sign in to comment.