Merge pull request #1139 from proddy/dev

use number as table id's - #1126
This commit is contained in:
Proddy
2023-03-24 12:14:17 +01:00
committed by GitHub
9 changed files with 254 additions and 262 deletions

View File

@@ -52,15 +52,7 @@ import { useI18nContext } from 'i18n/i18n-react';
import * as EMSESP from './api';
function makeid() {
let result = '';
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
const charactersLength = characters.length;
let counter = 0;
while (counter < 4) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
counter += 1;
}
return result;
return Math.floor(Math.random() * (Math.floor(200) - 100) + 100);
}
const SettingsScheduler: FC = () => {
@@ -70,7 +62,7 @@ const SettingsScheduler: FC = () => {
const blocker = useBlocker(numChanges !== 0);
const emptySchedule = {
id: '0',
id: 0,
active: false,
deleted: false,
flags: 0,

View File

@@ -43,7 +43,7 @@ export enum busConnectionStatus {
}
export interface Stat {
id: string; // id - needs to be a string
id: number; // id
s: number; // success
f: number; // fail
q: number; // quality
@@ -305,7 +305,7 @@ export enum DeviceEntityMask {
}
export interface ScheduleItem {
id: string; // unique index
id: number; // unique index
active: boolean;
deleted?: boolean; // optional
flags: number;
@@ -313,7 +313,7 @@ export interface ScheduleItem {
cmd: string;
value: string;
name?: string; // optional
o_id?: string;
o_id?: number;
o_active?: boolean;
o_deleted?: boolean;
o_flags?: number;