fix error2
This commit is contained in:
1
global.d.ts
vendored
1
global.d.ts
vendored
@@ -1 +1,2 @@
|
|||||||
declare module 'next-pwa';
|
declare module 'next-pwa';
|
||||||
|
declare module 'jalaali-js';
|
||||||
|
|||||||
7
package-lock.json
generated
7
package-lock.json
generated
@@ -9,6 +9,7 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chart.js": "^4.5.0",
|
"chart.js": "^4.5.0",
|
||||||
|
"jalaali-js": "^1.2.8",
|
||||||
"next": "15.5.4",
|
"next": "15.5.4",
|
||||||
"next-pwa": "^5.6.0",
|
"next-pwa": "^5.6.0",
|
||||||
"react": "19.1.0",
|
"react": "19.1.0",
|
||||||
@@ -6558,6 +6559,12 @@
|
|||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/jalaali-js": {
|
||||||
|
"version": "1.2.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/jalaali-js/-/jalaali-js-1.2.8.tgz",
|
||||||
|
"integrity": "sha512-Jl/EwY84JwjW2wsWqeU4pNd22VNQ7EkjI36bDuLw31wH98WQW4fPjD0+mG7cdCK+Y8D6s9R3zLiQ3LaKu6bD8A==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/jest-worker": {
|
"node_modules/jest-worker": {
|
||||||
"version": "27.5.1",
|
"version": "27.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz",
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
"lint": "eslint"
|
"lint": "eslint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jalaali-js": "^1.2.6",
|
|
||||||
"chart.js": "^4.5.0",
|
"chart.js": "^4.5.0",
|
||||||
|
"jalaali-js": "^1.2.8",
|
||||||
"next": "15.5.4",
|
"next": "15.5.4",
|
||||||
"next-pwa": "^5.6.0",
|
"next-pwa": "^5.6.0",
|
||||||
"react": "19.1.0",
|
"react": "19.1.0",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -70,7 +70,7 @@ export default function DevicesPage() {
|
|||||||
// فراخوانی API برای بررسی دستگاه
|
// فراخوانی API برای بررسی دستگاه
|
||||||
const device = await api.CheckDevice(currentDeviceName.trim(), currentPassword.trim())
|
const device = await api.CheckDevice(currentDeviceName.trim(), currentPassword.trim())
|
||||||
|
|
||||||
if (device) {
|
if (device !=undefined) {
|
||||||
setSelected(device)
|
setSelected(device)
|
||||||
} else {
|
} else {
|
||||||
setError('دستگاه یافت نشد یا رمز عبور نادرست است')
|
setError('دستگاه یافت نشد یا رمز عبور نادرست است')
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ async function http<T>(url: string, init?: RequestInit): Promise<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const api = {
|
export const api = {
|
||||||
CheckDevice: (deviceName: string, password: string) => http<boolean>(`${API_BASE}/api/devices/CheckDevice?deviceName=${deviceName}&password=${password}`),
|
CheckDevice: (deviceName: string, password: string) => http<DeviceDto>(`${API_BASE}/api/devices/CheckDevice?deviceName=${deviceName}&password=${password}`),
|
||||||
listDevices: () => http<DeviceDto[]>(`${API_BASE}/api/devices`),
|
listDevices: () => http<DeviceDto[]>(`${API_BASE}/api/devices`),
|
||||||
createDevice: (dto: DeviceDto) => http<number>(`${API_BASE}/api/devices`, { method: 'POST', body: JSON.stringify(dto) }),
|
createDevice: (dto: DeviceDto) => http<number>(`${API_BASE}/api/devices`, { method: 'POST', body: JSON.stringify(dto) }),
|
||||||
listTelemetry: (q: { deviceId?: number; startUtc?: string; endUtc?: string; page?: number; pageSize?: number }) => {
|
listTelemetry: (q: { deviceId?: number; startUtc?: string; endUtc?: string; page?: number; pageSize?: number }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user