forked from VinokurovVE/tests
Cleanup
This commit is contained in:
@ -116,7 +116,6 @@ export default function AccountMenu() {
|
||||
anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }}
|
||||
>
|
||||
<MenuItem onClick={() => {
|
||||
console.log()
|
||||
}}>
|
||||
<ListItemIcon>
|
||||
<Android12Switch
|
||||
|
@ -12,7 +12,7 @@ export function useDataFetching<T>(url: string, initData: T): T {
|
||||
|
||||
fetchData()
|
||||
}, [url])
|
||||
console.log(data)
|
||||
|
||||
// Memoize the data value
|
||||
const memoizedData = useMemo<T>(() => data, [data])
|
||||
return memoizedData
|
||||
|
@ -118,7 +118,6 @@ export default function FolderViewer() {
|
||||
}
|
||||
|
||||
const handleDocumentClick = async (doc: IDocument, index: number) => {
|
||||
console.log(doc)
|
||||
setCurrentFileNo(index)
|
||||
setFileViewerModal(true)
|
||||
}
|
||||
|
@ -25,14 +25,12 @@ function ServerData({ id }: IServer) {
|
||||
columns={serverIpsColumns}
|
||||
actions
|
||||
onRowClick={(params, event, details) => {
|
||||
console.log(params.id, event, details)
|
||||
//setCurrentServerData(params.row)
|
||||
//setServerDataOpen(true)
|
||||
}}
|
||||
onSave={undefined}
|
||||
onDelete={function (data: any): Promise<AxiosResponse<any, any>> {
|
||||
console.log(data)
|
||||
throw new Error('Function not implemented.')
|
||||
throw new Error('N/A.')
|
||||
}}
|
||||
loading={false}
|
||||
/>
|
||||
|
@ -127,7 +127,6 @@ export default function ServerHardware() {
|
||||
}} />
|
||||
)} />}
|
||||
onSave={(id: any) => {
|
||||
console.log(id)
|
||||
}}
|
||||
onDelete={ServerService.removeServer}
|
||||
initialRows={hardwares}
|
||||
|
@ -125,7 +125,6 @@ export default function ServerIpsView() {
|
||||
}} />
|
||||
)} />}
|
||||
onSave={(id: any) => {
|
||||
console.log(id)
|
||||
}}
|
||||
onDelete={ServerService.removeServer}
|
||||
initialRows={serverIps}
|
||||
|
@ -116,7 +116,6 @@ export default function ServerStorage() {
|
||||
}} />
|
||||
)} />}
|
||||
onSave={(id: any) => {
|
||||
console.log(id)
|
||||
}}
|
||||
onDelete={ServerService.removeServer}
|
||||
initialRows={storages}
|
||||
|
@ -170,7 +170,6 @@ export default function ServersView() {
|
||||
/>
|
||||
}
|
||||
onSave={(id: any) => {
|
||||
console.log(id)
|
||||
}}
|
||||
onDelete={ServerService.removeServer}
|
||||
initialRows={servers}
|
||||
|
@ -43,7 +43,6 @@ export default function CreateCompanyModal({
|
||||
const onSubmit: SubmitHandler<ICompany> = async (data) => {
|
||||
try {
|
||||
const response: AxiosResponse<ApiResponse> = await RoleService.createRole(data)
|
||||
console.log(response.data)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
@ -40,7 +40,6 @@ export default function CreateDepartmentModal({
|
||||
const onSubmit: SubmitHandler<ICompany> = async (data) => {
|
||||
try {
|
||||
const response: AxiosResponse<ApiResponse> = await RoleService.createRole(data)
|
||||
console.log(response.data)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ export default function CreateRoleModal({
|
||||
const onSubmit: SubmitHandler<IRoleCreate> = async (data) => {
|
||||
try {
|
||||
const response: AxiosResponse<ApiResponse> = await RoleService.createRole(data)
|
||||
console.log(response.data)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
@ -44,7 +44,6 @@ export default function CreateUserModal({
|
||||
const onSubmit: SubmitHandler<IUserCreate> = async (data) => {
|
||||
try {
|
||||
const response: AxiosResponse<ApiResponse> = await UserService.createUser(data)
|
||||
console.log(response.data)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ import React, { useEffect } from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import App from './App.tsx'
|
||||
import './index.css'
|
||||
import { registerSW } from 'virtual:pwa-register'
|
||||
import { ThemeProvider } from '@emotion/react'
|
||||
import { createTheme } from '@mui/material'
|
||||
import { ruRU } from '@mui/material/locale'
|
||||
@ -51,17 +50,6 @@ const lightTheme = createTheme(
|
||||
ruRU,
|
||||
);
|
||||
|
||||
const updateSW = registerSW({
|
||||
onNeedRefresh() {
|
||||
if (confirm("New content available. Reload?")) {
|
||||
updateSW(true);
|
||||
}
|
||||
},
|
||||
onOfflineReady() {
|
||||
console.log("offline ready");
|
||||
},
|
||||
});
|
||||
|
||||
function ThemedApp() {
|
||||
const prefStore = usePrefStore()
|
||||
|
||||
|
@ -68,12 +68,10 @@ export default function Reports() {
|
||||
disableRowSelectionOnClick
|
||||
|
||||
processRowUpdate={(updatedRow, originalRow) => {
|
||||
console.log(updatedRow, originalRow)
|
||||
return updatedRow
|
||||
}}
|
||||
|
||||
onProcessRowUpdateError={(error) => {
|
||||
console.log(error)
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
@ -49,12 +49,10 @@ export default function Roles() {
|
||||
disableRowSelectionOnClick
|
||||
|
||||
processRowUpdate={(updatedRow, originalRow) => {
|
||||
console.log(updatedRow, originalRow)
|
||||
return updatedRow
|
||||
}}
|
||||
|
||||
onProcessRowUpdateError={(error) => {
|
||||
console.log(error)
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
|
@ -9,7 +9,6 @@ export default function Servers() {
|
||||
const [currentTab, setCurrentTab] = useState(0)
|
||||
|
||||
const handleTabChange = (event: React.SyntheticEvent, newValue: number) => {
|
||||
console.log(event)
|
||||
setCurrentTab(newValue);
|
||||
}
|
||||
|
||||
|
@ -70,12 +70,10 @@ export default function Settings() {
|
||||
disableRowSelectionOnClick
|
||||
|
||||
processRowUpdate={(updatedRow, originalRow) => {
|
||||
console.log(updatedRow, originalRow)
|
||||
return updatedRow
|
||||
}}
|
||||
|
||||
onProcessRowUpdateError={(error) => {
|
||||
console.log(error)
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
|
@ -65,12 +65,10 @@ export default function Users() {
|
||||
disableRowSelectionOnClick
|
||||
|
||||
processRowUpdate={(updatedRow, originalRow) => {
|
||||
console.log(updatedRow, originalRow)
|
||||
return updatedRow
|
||||
}}
|
||||
|
||||
onProcessRowUpdateError={(error) => {
|
||||
console.log(error)
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
|
@ -29,14 +29,11 @@ const SignIn = () => {
|
||||
|
||||
try {
|
||||
const response: AxiosResponse<ApiResponse> = await AuthService.login(formBody)
|
||||
console.log('Вход произошел успешно:', response.data);
|
||||
|
||||
const token = response.data.access_token
|
||||
|
||||
const userDataResponse: AxiosResponse<ApiResponse> = await UserService.getCurrentUser(token)
|
||||
|
||||
console.log('Пользователь:', userDataResponse.data)
|
||||
|
||||
setUserData(JSON.stringify(userDataResponse.data))
|
||||
|
||||
login(token)
|
||||
|
@ -22,7 +22,6 @@ const SignUp = () => {
|
||||
const onSubmit: SubmitHandler<IUserCreate> = async (data) => {
|
||||
try {
|
||||
const response: AxiosResponse<ApiResponse> = await UserService.createUser(data)
|
||||
console.log('Успешная регистрация:', response.data);
|
||||
} catch (error) {
|
||||
console.error('Ошибка регистрации:', error);
|
||||
}
|
||||
|
@ -32,7 +32,6 @@ const initAuth = async () => {
|
||||
if (currentTime - issuedDate < TOKEN_EXPIRY_DURATION) {
|
||||
useAuthStore.setState(() => ({ isAuthenticated: true, token: token }))
|
||||
} else {
|
||||
console.log("refreshing token")
|
||||
try {
|
||||
await refreshToken();
|
||||
} catch (error) {
|
||||
|
2
frontend_reactjs/vite.config.d.ts
vendored
2
frontend_reactjs/vite.config.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
declare const _default: import("vite").UserConfig;
|
||||
export default _default;
|
@ -1,86 +0,0 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react-swc';
|
||||
import { VitePWA } from "vite-plugin-pwa";
|
||||
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
server: {
|
||||
host: "0.0.0.0",
|
||||
port: 5173
|
||||
},
|
||||
plugins: [
|
||||
nodePolyfills(),
|
||||
react(),
|
||||
VitePWA({
|
||||
registerType: 'autoUpdate',
|
||||
workbox: {
|
||||
globPatterns: ["**/*"],
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: function (_a) {
|
||||
var request = _a.request;
|
||||
return request.mode === 'navigate';
|
||||
},
|
||||
handler: 'NetworkFirst',
|
||||
options: {
|
||||
cacheName: 'html-cache',
|
||||
},
|
||||
},
|
||||
{
|
||||
urlPattern: /\.(?:js|css)$/,
|
||||
handler: 'StaleWhileRevalidate',
|
||||
options: {
|
||||
cacheName: 'static-resources',
|
||||
},
|
||||
},
|
||||
{
|
||||
urlPattern: /\.(?:png|jpg|jpeg|svg|gif)$/,
|
||||
handler: 'CacheFirst',
|
||||
options: {
|
||||
cacheName: 'image-cache',
|
||||
expiration: {
|
||||
maxEntries: 50,
|
||||
maxAgeSeconds: 30 * 24 * 60 * 60, // 30 days
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
includeAssets: [
|
||||
"**/*",
|
||||
],
|
||||
manifest: {
|
||||
"theme_color": "#f69435",
|
||||
"background_color": "#f69435",
|
||||
"display": "standalone",
|
||||
"scope": "/",
|
||||
"start_url": "/",
|
||||
"short_name": "Vite PWA",
|
||||
"description": "Vite PWA Boilerplate",
|
||||
"name": "Vite PWA Boilerplate",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/icon-256x256.png",
|
||||
"sizes": "256x256",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/icon-384x384.png",
|
||||
"sizes": "384x384",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/icon-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
]
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
@ -12,73 +12,5 @@ export default defineConfig({
|
||||
plugins: [
|
||||
nodePolyfills(),
|
||||
react(),
|
||||
VitePWA({
|
||||
registerType: 'autoUpdate',
|
||||
workbox: {
|
||||
globPatterns: ["**/*"],
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: ({ request }) => request.mode === 'navigate',
|
||||
handler: 'NetworkFirst',
|
||||
options: {
|
||||
cacheName: 'html-cache',
|
||||
},
|
||||
},
|
||||
{
|
||||
urlPattern: /\.(?:js|css)$/,
|
||||
handler: 'StaleWhileRevalidate',
|
||||
options: {
|
||||
cacheName: 'static-resources',
|
||||
},
|
||||
},
|
||||
{
|
||||
urlPattern: /\.(?:png|jpg|jpeg|svg|gif)$/,
|
||||
handler: 'CacheFirst',
|
||||
options: {
|
||||
cacheName: 'image-cache',
|
||||
expiration: {
|
||||
maxEntries: 50,
|
||||
maxAgeSeconds: 30 * 24 * 60 * 60, // 30 days
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
includeAssets: [
|
||||
"**/*",
|
||||
],
|
||||
manifest: {
|
||||
"theme_color": "#f69435",
|
||||
"background_color": "#f69435",
|
||||
"display": "standalone",
|
||||
"scope": "/",
|
||||
"start_url": "/",
|
||||
"short_name": "Vite PWA",
|
||||
"description": "Vite PWA Boilerplate",
|
||||
"name": "Vite PWA Boilerplate",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/icon-256x256.png",
|
||||
"sizes": "256x256",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/icon-384x384.png",
|
||||
"sizes": "384x384",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/icon-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
]
|
||||
},
|
||||
}),
|
||||
],
|
||||
})
|
||||
|
@ -4,3 +4,8 @@ pip install -r requierements.txt
|
||||
html с использованием vuejs
|
||||
в файле /backend_fastapi/.env добавить адрес базы данных
|
||||
SQL_URL = "mssql+aioodbc://username:password@host/database?driver=ODBC+Driver+17+for+SQL+Server"
|
||||
|
||||
# Docker
|
||||
### Инструкция по запуску фронтенда
|
||||
Запустить билд контейнеров:
|
||||
`docker compose up -d --build`
|
||||
|
Reference in New Issue
Block a user