feat(ui) - dashboard - wip
This commit is contained in:
parent
4602de3caf
commit
ff3e185c43
8 changed files with 3 additions and 10 deletions
|
|
@ -113,7 +113,7 @@ function CustomMetricPieChart(props: Props) {
|
|||
}}
|
||||
>
|
||||
{data && data.values && data.values.map((entry, index) => (
|
||||
<Cell key={`cell-${index}`} fill={Styles.colorsPie[index % Styles.colorsPie.length]} />
|
||||
<Cell key={`cell-${index}`} fill={Styles.colorsPie[index % Styles.colorsPie.length]} />
|
||||
))}
|
||||
</Pie>
|
||||
<Tooltip {...Styles.tooltip} />
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ interface Props {
|
|||
}
|
||||
function DashboardModal(props) {
|
||||
const { history, siteId, dashboardId } = props;
|
||||
console.log('DashboardModal', props);
|
||||
const { dashboardStore } = useStore();
|
||||
const { hideModal } = useModal();
|
||||
const dashboard = useObserver(() => dashboardStore.dashboardInstance);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ function MetricsList(props: Props) {
|
|||
const filterList = (list) => {
|
||||
const filterRE = getRE(metricsSearch, 'i');
|
||||
let _list = list.filter(w => {
|
||||
return filterRE.test(w.name) || filterRE.test(w.metricType) || filterRE.test(w.owner) ;
|
||||
const dashbaordNames = w.dashboards.map(d => d.name).join(' ');
|
||||
return filterRE.test(w.name) || filterRE.test(w.metricType) || filterRE.test(w.owner) || filterRE.test(dashbaordNames);
|
||||
});
|
||||
return _list
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@ function WidgetPreview(props: Props) {
|
|||
metric.update({ ...changedDates, rangeName: changedDates.rangeValue });
|
||||
}
|
||||
|
||||
console.log('view', metric.viewType)
|
||||
|
||||
return useObserver(() => (
|
||||
<div className={cn(className)}>
|
||||
<div className="flex items-center justify-between">
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ function Trend({ title = '', chart, onDateChange, timeFormat = 'hh:mm a' }) {
|
|||
if (!Array.isArray(chart)) return null
|
||||
|
||||
const getDateFormat = val => {
|
||||
console.log(val);
|
||||
const d = new Date(val);
|
||||
return (d.getMonth()+ 1) + '/' + d.getDate()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,7 +151,6 @@ const NodesCountTooltip = ({ active, payload } ) => {
|
|||
const TICKS_COUNT = 10;
|
||||
function generateTicks(data: Array<Timed>): Array<number> {
|
||||
if (data.length === 0) return [];
|
||||
console.log(data, data[0])
|
||||
const minTime = data[0].time;
|
||||
const maxTime = data[data.length-1].time;
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,6 @@ export default class MetricStore implements IMetricStore {
|
|||
}
|
||||
|
||||
get paginatedList(): IWidget[] {
|
||||
console.log('here...' + this.page)
|
||||
const start = (this.page - 1) * this.pageSize
|
||||
const end = start + this.pageSize
|
||||
return this.metrics.slice(start, end)
|
||||
|
|
@ -187,7 +186,6 @@ export default class MetricStore implements IMetricStore {
|
|||
this.isLoading = true
|
||||
return metricService.getMetricChartData(metric)
|
||||
.then(data => {
|
||||
console.log('data', data)
|
||||
// runInAction(() => {
|
||||
// metric.data = data
|
||||
// })
|
||||
|
|
|
|||
|
|
@ -139,7 +139,6 @@ export default class Dashboard implements IDashboard {
|
|||
}
|
||||
|
||||
swapWidgetPosition(positionA, positionB) {
|
||||
console.log('swapWidgetPosition', positionA, positionB)
|
||||
const widgetA = this.widgets[positionA]
|
||||
const widgetB = this.widgets[positionB]
|
||||
this.widgets[positionA] = widgetB
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue