Custom endpoints

This commit is contained in:
Sedat ÖZTÜRK 2025-07-28 15:48:30 +03:00
parent ec951d0876
commit f72d93b262
5 changed files with 56 additions and 31 deletions

View file

@ -6569,9 +6569,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
new EditingFormItemDto { Order = 2, DataField = "Url", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 2, DataField = "Url", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "Method", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions="{ \"showClearButton\" : true }" }, new EditingFormItemDto { Order = 3, DataField = "Method", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions="{ \"showClearButton\" : true }" },
new EditingFormItemDto { Order = 4, DataField = "DataSourceCode", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions="{ \"showClearButton\" : true }" }, new EditingFormItemDto { Order = 4, DataField = "DataSourceCode", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions="{ \"showClearButton\" : true }" },
new EditingFormItemDto { Order = 5, DataField = "Sql", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextArea }, new EditingFormItemDto { Order = 5, DataField = "Sql", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextArea, EditorOptions="{ \"height\" : 60 }" },
new EditingFormItemDto { Order = 6, DataField = "ParametersJson", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxTextArea }, new EditingFormItemDto { Order = 6, DataField = "ParametersJson", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxTextArea, EditorOptions="{ \"height\" : 60 }" },
new EditingFormItemDto { Order = 7, DataField = "PermissionsJson", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxTextArea }, new EditingFormItemDto { Order = 7, DataField = "PermissionsJson", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxTextArea, EditorOptions="{ \"height\" : 60 }" },
new EditingFormItemDto { Order = 8, DataField = "Description", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxTextArea }, new EditingFormItemDto { Order = 8, DataField = "Description", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxTextArea },
] ]
} }
@ -6625,7 +6625,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
CultureName = LanguageCodes.En, CultureName = LanguageCodes.En,
SourceDbType = DbType.String, SourceDbType = DbType.String,
FieldName = "Name", FieldName = "Name",
Width = 300, Width = 150,
ListOrderNo = 2, ListOrderNo = 2,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -6651,7 +6651,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
CultureName = LanguageCodes.En, CultureName = LanguageCodes.En,
SourceDbType = DbType.String, SourceDbType = DbType.String,
FieldName = "Description", FieldName = "Description",
Width = 300, Width = 350,
ListOrderNo = 3, ListOrderNo = 3,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -6677,7 +6677,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
CultureName = LanguageCodes.En, CultureName = LanguageCodes.En,
SourceDbType = DbType.String, SourceDbType = DbType.String,
FieldName = "Url", FieldName = "Url",
Width = 300, Width = 100,
ListOrderNo = 4, ListOrderNo = 4,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -6777,7 +6777,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
CultureName = LanguageCodes.En, CultureName = LanguageCodes.En,
SourceDbType = DbType.String, SourceDbType = DbType.String,
FieldName = "Sql", FieldName = "Sql",
Width = 500, Width = 200,
ListOrderNo = 7, ListOrderNo = 7,
Visible = true, Visible = true,
IsActive = true, IsActive = true,

View file

@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict';
"revision": "3ca0b8505b4bec776b69afdba2768812" "revision": "3ca0b8505b4bec776b69afdba2768812"
}, { }, {
"url": "index.html", "url": "index.html",
"revision": "0.q0hdfv947pg" "revision": "0.opl3kd80omo"
}], {}); }], {});
workbox.cleanupOutdatedCaches(); workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

View file

@ -1,12 +1,27 @@
import React, { useEffect, useRef } from 'react' import React from 'react'
import { useNavigate } from 'react-router-dom'
const NotFoundPage = () => { const NotFoundPage = () => {
const navigate = useNavigate()
return ( return (
<div className="flex flex-col items-center justify-center min-h-[90vh] bg-white font-inter"> <div>
<div className="text-[8rem] sm:text-[10rem] md:text-[12rem] font-bold mb-6 bg-gradient-to-br from-primary to-secondary bg-clip-text animate-pulse"> <div className="flex items-center justify-center font-inter">
<div className="text-[8rem] sm:text-[10rem] md:text-[12rem] font-bold bg-gradient-to-br from-primary to-secondary bg-clip-text animate-pulse">
404 404
</div> </div>
</div> </div>
<p className="flex items-center justify-center text-xl mb-6 text-gray-600">Aradığınız sayfa bulunamadı.</p>
<div className="flex items-center justify-center font-inter">
<button
onClick={() => navigate('/')}
className="px-6 py-3 bg-primary rounded-xl shadow hover:bg-secondary transition"
>
Ana Sayfa'ya Dön
</button>
</div>
</div>
) )
} }

View file

@ -66,7 +66,7 @@ const Views = (props: ViewsProps) => {
</UiDialog> </UiDialog>
))} ))}
<DialogProvider> <DialogProvider>
<DialogShowComponent></DialogShowComponent> <DialogShowComponent />
<DynamicRouter /> <DynamicRouter />
</DialogProvider> </DialogProvider>
</Suspense> </Suspense>

View file

@ -40,7 +40,7 @@ import DataGrid, {
Sorting, Sorting,
Summary, Summary,
Toolbar, Toolbar,
TotalItem TotalItem,
} from 'devextreme-react/data-grid' } from 'devextreme-react/data-grid'
import { Item } from 'devextreme-react/toolbar' import { Item } from 'devextreme-react/toolbar'
import { DataType } from 'devextreme/common' import { DataType } from 'devextreme/common'
@ -64,10 +64,10 @@ import { GridBoxEditorComponent } from './editors/GridBoxEditorComponent'
import { TagBoxEditorComponent } from './editors/TagBoxEditorComponent' import { TagBoxEditorComponent } from './editors/TagBoxEditorComponent'
import { useFilters } from './useFilters' import { useFilters } from './useFilters'
import { useToolbar } from './useToolbar' import { useToolbar } from './useToolbar'
import { Workbook } from 'exceljs'; import { Workbook } from 'exceljs'
import saveAs from 'file-saver'; import saveAs from 'file-saver'
import { jsPDF } from 'jspdf' import { jsPDF } from 'jspdf'
import { exportDataGrid as exportDataPdf } from 'devextreme/pdf_exporter'; import { exportDataGrid as exportDataPdf } from 'devextreme/pdf_exporter'
import { exportDataGrid as exportDataExcel } from 'devextreme/excel_exporter' import { exportDataGrid as exportDataExcel } from 'devextreme/excel_exporter'
interface GridProps { interface GridProps {
@ -441,7 +441,10 @@ const Grid = (props: GridProps) => {
autoFilterEnabled: true, autoFilterEnabled: true,
}).then(() => { }).then(() => {
workbook.xlsx.writeBuffer().then((buffer) => { workbook.xlsx.writeBuffer().then((buffer) => {
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `${listFormCode}_export.xlsx`) saveAs(
new Blob([buffer], { type: 'application/octet-stream' }),
`${listFormCode}_export.xlsx`,
)
}) })
}) })
} else if (e.format == 'pdf') { } else if (e.format == 'pdf') {
@ -454,18 +457,21 @@ const Grid = (props: GridProps) => {
doc.save(`${listFormCode}_export.pdf`) doc.save(`${listFormCode}_export.pdf`)
}) })
} else if (e.format == 'csv') { } else if (e.format == 'csv') {
const workbook = new Workbook(); const workbook = new Workbook()
const worksheet = workbook.addWorksheet(`${listFormCode}_sheet`) const worksheet = workbook.addWorksheet(`${listFormCode}_sheet`)
exportDataExcel({ exportDataExcel({
component: gridRef?.current?.instance, component: gridRef?.current?.instance,
worksheet: worksheet worksheet: worksheet,
}).then(function () { }).then(function () {
workbook.csv.writeBuffer().then(function (buffer) { workbook.csv.writeBuffer().then(function (buffer) {
saveAs(new Blob([buffer], { type: "application/octet-stream" }), `${listFormCode}_export.csv`) saveAs(
new Blob([buffer], { type: 'application/octet-stream' }),
`${listFormCode}_export.csv`,
)
}) })
}) })
} }
}; }
return ( return (
<Container className={DX_CLASSNAMES}> <Container className={DX_CLASSNAMES}>
@ -524,7 +530,11 @@ const Grid = (props: GridProps) => {
props.refreshData?.() props.refreshData?.()
}} }}
> >
<Export enabled={true} allowExportSelectedData={false} formats={['pdf', 'xlsx', 'csv']} /> <Export
enabled={true}
allowExportSelectedData={false}
formats={['pdf', 'xlsx', 'csv']}
/>
<Editing <Editing
refreshMode={gridDto.gridOptions.editingOptionDto?.refreshMode} refreshMode={gridDto.gridOptions.editingOptionDto?.refreshMode}
mode={smaller.md ? 'form' : gridDto.gridOptions.editingOptionDto?.mode} mode={smaller.md ? 'form' : gridDto.gridOptions.editingOptionDto?.mode}