forked from VinokurovVE/tests
Cleanup
This commit is contained in:
@ -116,7 +116,6 @@ export default function AccountMenu() {
|
|||||||
anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }}
|
anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }}
|
||||||
>
|
>
|
||||||
<MenuItem onClick={() => {
|
<MenuItem onClick={() => {
|
||||||
console.log()
|
|
||||||
}}>
|
}}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<Android12Switch
|
<Android12Switch
|
||||||
|
@ -12,7 +12,7 @@ export function useDataFetching<T>(url: string, initData: T): T {
|
|||||||
|
|
||||||
fetchData()
|
fetchData()
|
||||||
}, [url])
|
}, [url])
|
||||||
console.log(data)
|
|
||||||
// Memoize the data value
|
// Memoize the data value
|
||||||
const memoizedData = useMemo<T>(() => data, [data])
|
const memoizedData = useMemo<T>(() => data, [data])
|
||||||
return memoizedData
|
return memoizedData
|
||||||
|
@ -118,7 +118,6 @@ export default function FolderViewer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleDocumentClick = async (doc: IDocument, index: number) => {
|
const handleDocumentClick = async (doc: IDocument, index: number) => {
|
||||||
console.log(doc)
|
|
||||||
setCurrentFileNo(index)
|
setCurrentFileNo(index)
|
||||||
setFileViewerModal(true)
|
setFileViewerModal(true)
|
||||||
}
|
}
|
||||||
|
@ -25,14 +25,12 @@ function ServerData({ id }: IServer) {
|
|||||||
columns={serverIpsColumns}
|
columns={serverIpsColumns}
|
||||||
actions
|
actions
|
||||||
onRowClick={(params, event, details) => {
|
onRowClick={(params, event, details) => {
|
||||||
console.log(params.id, event, details)
|
|
||||||
//setCurrentServerData(params.row)
|
//setCurrentServerData(params.row)
|
||||||
//setServerDataOpen(true)
|
//setServerDataOpen(true)
|
||||||
}}
|
}}
|
||||||
onSave={undefined}
|
onSave={undefined}
|
||||||
onDelete={function (data: any): Promise<AxiosResponse<any, any>> {
|
onDelete={function (data: any): Promise<AxiosResponse<any, any>> {
|
||||||
console.log(data)
|
throw new Error('N/A.')
|
||||||
throw new Error('Function not implemented.')
|
|
||||||
}}
|
}}
|
||||||
loading={false}
|
loading={false}
|
||||||
/>
|
/>
|
||||||
|
@ -127,7 +127,6 @@ export default function ServerHardware() {
|
|||||||
}} />
|
}} />
|
||||||
)} />}
|
)} />}
|
||||||
onSave={(id: any) => {
|
onSave={(id: any) => {
|
||||||
console.log(id)
|
|
||||||
}}
|
}}
|
||||||
onDelete={ServerService.removeServer}
|
onDelete={ServerService.removeServer}
|
||||||
initialRows={hardwares}
|
initialRows={hardwares}
|
||||||
|
@ -125,7 +125,6 @@ export default function ServerIpsView() {
|
|||||||
}} />
|
}} />
|
||||||
)} />}
|
)} />}
|
||||||
onSave={(id: any) => {
|
onSave={(id: any) => {
|
||||||
console.log(id)
|
|
||||||
}}
|
}}
|
||||||
onDelete={ServerService.removeServer}
|
onDelete={ServerService.removeServer}
|
||||||
initialRows={serverIps}
|
initialRows={serverIps}
|
||||||
|
@ -116,7 +116,6 @@ export default function ServerStorage() {
|
|||||||
}} />
|
}} />
|
||||||
)} />}
|
)} />}
|
||||||
onSave={(id: any) => {
|
onSave={(id: any) => {
|
||||||
console.log(id)
|
|
||||||
}}
|
}}
|
||||||
onDelete={ServerService.removeServer}
|
onDelete={ServerService.removeServer}
|
||||||
initialRows={storages}
|
initialRows={storages}
|
||||||
|
@ -170,7 +170,6 @@ export default function ServersView() {
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
onSave={(id: any) => {
|
onSave={(id: any) => {
|
||||||
console.log(id)
|
|
||||||
}}
|
}}
|
||||||
onDelete={ServerService.removeServer}
|
onDelete={ServerService.removeServer}
|
||||||
initialRows={servers}
|
initialRows={servers}
|
||||||
|
@ -43,7 +43,6 @@ export default function CreateCompanyModal({
|
|||||||
const onSubmit: SubmitHandler<ICompany> = async (data) => {
|
const onSubmit: SubmitHandler<ICompany> = async (data) => {
|
||||||
try {
|
try {
|
||||||
const response: AxiosResponse<ApiResponse> = await RoleService.createRole(data)
|
const response: AxiosResponse<ApiResponse> = await RoleService.createRole(data)
|
||||||
console.log(response.data)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,6 @@ export default function CreateDepartmentModal({
|
|||||||
const onSubmit: SubmitHandler<ICompany> = async (data) => {
|
const onSubmit: SubmitHandler<ICompany> = async (data) => {
|
||||||
try {
|
try {
|
||||||
const response: AxiosResponse<ApiResponse> = await RoleService.createRole(data)
|
const response: AxiosResponse<ApiResponse> = await RoleService.createRole(data)
|
||||||
console.log(response.data)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,6 @@ export default function CreateRoleModal({
|
|||||||
const onSubmit: SubmitHandler<IRoleCreate> = async (data) => {
|
const onSubmit: SubmitHandler<IRoleCreate> = async (data) => {
|
||||||
try {
|
try {
|
||||||
const response: AxiosResponse<ApiResponse> = await RoleService.createRole(data)
|
const response: AxiosResponse<ApiResponse> = await RoleService.createRole(data)
|
||||||
console.log(response.data)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,6 @@ export default function CreateUserModal({
|
|||||||
const onSubmit: SubmitHandler<IUserCreate> = async (data) => {
|
const onSubmit: SubmitHandler<IUserCreate> = async (data) => {
|
||||||
try {
|
try {
|
||||||
const response: AxiosResponse<ApiResponse> = await UserService.createUser(data)
|
const response: AxiosResponse<ApiResponse> = await UserService.createUser(data)
|
||||||
console.log(response.data)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ import React, { useEffect } from 'react'
|
|||||||
import ReactDOM from 'react-dom/client'
|
import ReactDOM from 'react-dom/client'
|
||||||
import App from './App.tsx'
|
import App from './App.tsx'
|
||||||
import './index.css'
|
import './index.css'
|
||||||
import { registerSW } from 'virtual:pwa-register'
|
|
||||||
import { ThemeProvider } from '@emotion/react'
|
import { ThemeProvider } from '@emotion/react'
|
||||||
import { createTheme } from '@mui/material'
|
import { createTheme } from '@mui/material'
|
||||||
import { ruRU } from '@mui/material/locale'
|
import { ruRU } from '@mui/material/locale'
|
||||||
@ -51,17 +50,6 @@ const lightTheme = createTheme(
|
|||||||
ruRU,
|
ruRU,
|
||||||
);
|
);
|
||||||
|
|
||||||
const updateSW = registerSW({
|
|
||||||
onNeedRefresh() {
|
|
||||||
if (confirm("New content available. Reload?")) {
|
|
||||||
updateSW(true);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onOfflineReady() {
|
|
||||||
console.log("offline ready");
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
function ThemedApp() {
|
function ThemedApp() {
|
||||||
const prefStore = usePrefStore()
|
const prefStore = usePrefStore()
|
||||||
|
|
||||||
|
@ -68,12 +68,10 @@ export default function Reports() {
|
|||||||
disableRowSelectionOnClick
|
disableRowSelectionOnClick
|
||||||
|
|
||||||
processRowUpdate={(updatedRow, originalRow) => {
|
processRowUpdate={(updatedRow, originalRow) => {
|
||||||
console.log(updatedRow, originalRow)
|
|
||||||
return updatedRow
|
return updatedRow
|
||||||
}}
|
}}
|
||||||
|
|
||||||
onProcessRowUpdateError={(error) => {
|
onProcessRowUpdateError={(error) => {
|
||||||
console.log(error)
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
@ -49,12 +49,10 @@ export default function Roles() {
|
|||||||
disableRowSelectionOnClick
|
disableRowSelectionOnClick
|
||||||
|
|
||||||
processRowUpdate={(updatedRow, originalRow) => {
|
processRowUpdate={(updatedRow, originalRow) => {
|
||||||
console.log(updatedRow, originalRow)
|
|
||||||
return updatedRow
|
return updatedRow
|
||||||
}}
|
}}
|
||||||
|
|
||||||
onProcessRowUpdateError={(error) => {
|
onProcessRowUpdateError={(error) => {
|
||||||
console.log(error)
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
@ -9,7 +9,6 @@ export default function Servers() {
|
|||||||
const [currentTab, setCurrentTab] = useState(0)
|
const [currentTab, setCurrentTab] = useState(0)
|
||||||
|
|
||||||
const handleTabChange = (event: React.SyntheticEvent, newValue: number) => {
|
const handleTabChange = (event: React.SyntheticEvent, newValue: number) => {
|
||||||
console.log(event)
|
|
||||||
setCurrentTab(newValue);
|
setCurrentTab(newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,12 +70,10 @@ export default function Settings() {
|
|||||||
disableRowSelectionOnClick
|
disableRowSelectionOnClick
|
||||||
|
|
||||||
processRowUpdate={(updatedRow, originalRow) => {
|
processRowUpdate={(updatedRow, originalRow) => {
|
||||||
console.log(updatedRow, originalRow)
|
|
||||||
return updatedRow
|
return updatedRow
|
||||||
}}
|
}}
|
||||||
|
|
||||||
onProcessRowUpdateError={(error) => {
|
onProcessRowUpdateError={(error) => {
|
||||||
console.log(error)
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
@ -65,12 +65,10 @@ export default function Users() {
|
|||||||
disableRowSelectionOnClick
|
disableRowSelectionOnClick
|
||||||
|
|
||||||
processRowUpdate={(updatedRow, originalRow) => {
|
processRowUpdate={(updatedRow, originalRow) => {
|
||||||
console.log(updatedRow, originalRow)
|
|
||||||
return updatedRow
|
return updatedRow
|
||||||
}}
|
}}
|
||||||
|
|
||||||
onProcessRowUpdateError={(error) => {
|
onProcessRowUpdateError={(error) => {
|
||||||
console.log(error)
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
@ -29,14 +29,11 @@ const SignIn = () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const response: AxiosResponse<ApiResponse> = await AuthService.login(formBody)
|
const response: AxiosResponse<ApiResponse> = await AuthService.login(formBody)
|
||||||
console.log('Вход произошел успешно:', response.data);
|
|
||||||
|
|
||||||
const token = response.data.access_token
|
const token = response.data.access_token
|
||||||
|
|
||||||
const userDataResponse: AxiosResponse<ApiResponse> = await UserService.getCurrentUser(token)
|
const userDataResponse: AxiosResponse<ApiResponse> = await UserService.getCurrentUser(token)
|
||||||
|
|
||||||
console.log('Пользователь:', userDataResponse.data)
|
|
||||||
|
|
||||||
setUserData(JSON.stringify(userDataResponse.data))
|
setUserData(JSON.stringify(userDataResponse.data))
|
||||||
|
|
||||||
login(token)
|
login(token)
|
||||||
|
@ -22,7 +22,6 @@ const SignUp = () => {
|
|||||||
const onSubmit: SubmitHandler<IUserCreate> = async (data) => {
|
const onSubmit: SubmitHandler<IUserCreate> = async (data) => {
|
||||||
try {
|
try {
|
||||||
const response: AxiosResponse<ApiResponse> = await UserService.createUser(data)
|
const response: AxiosResponse<ApiResponse> = await UserService.createUser(data)
|
||||||
console.log('Успешная регистрация:', response.data);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Ошибка регистрации:', error);
|
console.error('Ошибка регистрации:', error);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,6 @@ const initAuth = async () => {
|
|||||||
if (currentTime - issuedDate < TOKEN_EXPIRY_DURATION) {
|
if (currentTime - issuedDate < TOKEN_EXPIRY_DURATION) {
|
||||||
useAuthStore.setState(() => ({ isAuthenticated: true, token: token }))
|
useAuthStore.setState(() => ({ isAuthenticated: true, token: token }))
|
||||||
} else {
|
} else {
|
||||||
console.log("refreshing token")
|
|
||||||
try {
|
try {
|
||||||
await refreshToken();
|
await refreshToken();
|
||||||
} catch (error) {
|
} 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: [
|
plugins: [
|
||||||
nodePolyfills(),
|
nodePolyfills(),
|
||||||
react(),
|
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
|
html с использованием vuejs
|
||||||
в файле /backend_fastapi/.env добавить адрес базы данных
|
в файле /backend_fastapi/.env добавить адрес базы данных
|
||||||
SQL_URL = "mssql+aioodbc://username:password@host/database?driver=ODBC+Driver+17+for+SQL+Server"
|
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