Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BoxDialer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
BoxDialer
Commits
1298655f
Commit
1298655f
authored
Sep 20, 2023
by
Muhammadali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2fd839c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
40 deletions
+48
-40
package.json
package.json
+1
-1
index.jsx
src/root/index.jsx
+47
-39
No files found.
package.json
View file @
1298655f
{
{
"name"
:
"boxdialer"
,
"name"
:
"boxdialer"
,
"version"
:
"1.9.
2
"
,
"version"
:
"1.9.
3
"
,
"description"
:
""
,
"description"
:
""
,
"main"
:
"src/boxDialer.js"
,
"main"
:
"src/boxDialer.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
src/root/index.jsx
View file @
1298655f
...
@@ -10,26 +10,35 @@ import SecondNotifSip from '../components/SecondNotifSip';
...
@@ -10,26 +10,35 @@ import SecondNotifSip from '../components/SecondNotifSip';
const
Root
=
({
data
,
onSetDnd
})
=>
{
const
Root
=
({
data
,
onSetDnd
})
=>
{
let
localValue
=
localStorage
.
getItem
(
'
activeValue
'
)
||
false
;
let
localValue
=
localStorage
.
getItem
(
'
activeValue
'
)
||
false
;
const
[
dataSecond
,
setDataSecond
]
=
useState
([]);
const
[
stateData
,
setStateData
]
=
useState
({});
if
(
!
data
)
{
data
=
{
iscloud
:
true
,
number
:
'
4003
'
,
wsurl
:
'
cld.alovoice.uz:61040
'
,
server_id
:
40
,
secret
:
'
26a830
'
,
lefttime
:
231461
,
reasons
:
[
'
free
'
,
'
outcalls
'
,
'
home
'
,
'
totop
'
],
reason
:
'
free
'
,
variant
:
'
bxmini
'
,
position
:
'
bottomRight
'
,
};
}
if
(
window
?.
alovoice_wsphone
)
{
// if (!data) {
data
=
window
.
alovoice_wsphone
;
// data = {
onSetDnd
=
window
.
alovoice_onsetdnd
;
// iscloud: true,
}
// number: '4003',
// wsurl: 'cld.alovoice.uz:61040',
// server_id: 40,
// secret: '26a830',
// lefttime: 231461,
// reasons: ['free', 'outcalls', 'home', 'totop'],
// reason: 'free',
// variant: 'bxmini',
// position: 'bottomRight',
// };
// }
// if (window?.alovoice_wsphone) {
// data = window.alovoice_wsphone;
// onSetDnd = window.alovoice_onsetdnd;
// }
useEffect
(()
=>
{
if
(
window
?.
alovoice_wsphone
)
{
// data = window.alovoice_wsphone;
setStateData
(
window
.
alovoice_wsphone
);
onSetDnd
=
window
.
alovoice_onsetdnd
;
}
},
[]);
const
[
phoneModal
,
setPhoneModal
]
=
useState
(
false
);
const
[
phoneModal
,
setPhoneModal
]
=
useState
(
false
);
const
[
dynamicValue
,
setDynamicValue
]
=
useState
(
'
pending
'
);
const
[
dynamicValue
,
setDynamicValue
]
=
useState
(
'
pending
'
);
...
@@ -47,26 +56,25 @@ const Root = ({ data, onSetDnd }) => {
...
@@ -47,26 +56,25 @@ const Root = ({ data, onSetDnd }) => {
},
[
secondLine
]);
},
[
secondLine
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
data
&&
d
ata
?.
number
)
{
if
(
stateData
&&
stateD
ata
?.
number
)
{
boxDialer
.
setSipStateChangeCallback
(
setDynamicValue
,
'
dynamicValue
'
);
boxDialer
.
setSipStateChangeCallback
(
setDynamicValue
,
'
dynamicValue
'
);
boxDialer
.
setSipStateChangeCallback
(
setModalState
,
'
modalState
'
);
boxDialer
.
setSipStateChangeCallback
(
setModalState
,
'
modalState
'
);
boxDialer
.
setSipStateChangeCallback
(
setPhoneModal
,
'
phoneModal
'
);
boxDialer
.
setSipStateChangeCallback
(
setPhoneModal
,
'
phoneModal
'
);
boxDialer
.
setSipStateChangeCallback
(
setSecondLine
,
'
secondLine
'
);
boxDialer
.
setSipStateChangeCallback
(
setSecondLine
,
'
secondLine
'
);
boxDialer
.
sipRegister
(
d
ata
);
boxDialer
.
sipRegister
(
stateD
ata
);
}
}
set
DataSecond
(
d
ata
);
set
StateData
(
stateD
ata
);
},
[]);
},
[]);
const
hangupButton
=
()
=>
{
const
hangupButton
=
()
=>
{
boxDialer
.
hangupButtonClick
();
boxDialer
.
hangupButtonClick
();
};
};
window
.
setWSData
=
(
result
)
=>
{
window
.
setWSData
=
(
result
)
=>
{
set
DataSecond
(
result
);
set
StateData
(
result
);
};
};
const
reasonSelect
=
async
(
e
)
=>
{
const
reasonSelect
=
async
(
e
)
=>
{
let
result
=
await
onSetDnd
(
e
);
let
result
=
await
onSetDnd
(
e
);
console
.
log
(
'
result:
'
,
result
);
setStateData
(
result
);
setDataSecond
(
result
);
// data = result;
// data = result;
};
};
const
selectWidjetType
=
(
type
)
=>
{
const
selectWidjetType
=
(
type
)
=>
{
...
@@ -75,11 +83,11 @@ const Root = ({ data, onSetDnd }) => {
...
@@ -75,11 +83,11 @@ const Root = ({ data, onSetDnd }) => {
return
(
return
(
<
BxMiniWidjetUi
<
BxMiniWidjetUi
widjetState=
{
dynamicValue
}
widjetState=
{
dynamicValue
}
phoneNumber=
{
d
ata
?.
number
}
phoneNumber=
{
stateD
ata
?.
number
}
reason=
{
dataSecond
?.
reason
}
reason=
{
stateData
?.
reason
}
widjetVersion=
{
packageJson
?.
version
}
widjetVersion=
{
packageJson
?.
version
}
leftTime=
{
dataSecond
.
lefttime
||
d
ata
.
lefttime
}
leftTime=
{
stateD
ata
.
lefttime
}
position=
{
d
ata
.
position
||
'
bottomLeft
'
}
position=
{
stateD
ata
.
position
||
'
bottomLeft
'
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
}
}
}
}
...
@@ -89,11 +97,11 @@ const Root = ({ data, onSetDnd }) => {
...
@@ -89,11 +97,11 @@ const Root = ({ data, onSetDnd }) => {
return
(
return
(
<
DefaultWidjetUi
<
DefaultWidjetUi
widjetState=
{
dynamicValue
}
widjetState=
{
dynamicValue
}
phoneNumber=
{
d
ata
?.
number
}
phoneNumber=
{
stateD
ata
?.
number
}
reason=
{
dataSecond
?.
reason
}
reason=
{
stateData
?.
reason
}
widjetVersion=
{
packageJson
?.
version
}
widjetVersion=
{
packageJson
?.
version
}
leftTime=
{
d
ata
.
lefttime
}
leftTime=
{
stateD
ata
.
lefttime
}
position=
{
d
ata
.
position
||
'
bottomLeft
'
}
position=
{
stateD
ata
.
position
||
'
bottomLeft
'
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
}
}
}
}
...
@@ -102,22 +110,22 @@ const Root = ({ data, onSetDnd }) => {
...
@@ -102,22 +110,22 @@ const Root = ({ data, onSetDnd }) => {
}
}
};
};
if
(
!
data
||
!
data
?.
number
||
!
d
ata
?.
position
)
return
;
if
(
!
stateData
||
!
stateData
?.
number
||
!
stateD
ata
?.
position
)
return
;
console
.
log
(
modalState
,
'
modalState
'
);
console
.
log
(
modalState
,
'
modalState
'
);
return
(
return
(
<>
<>
{
selectWidjetType
(
d
ata
.
variant
)
}
{
selectWidjetType
(
stateD
ata
.
variant
)
}
<
ModalPhoneNumpad
<
ModalPhoneNumpad
modalState=
{
modalState
}
modalState=
{
modalState
}
phoneModal=
{
phoneModal
}
phoneModal=
{
phoneModal
}
reasons=
{
d
ata
?.
reasons
}
reasons=
{
stateD
ata
?.
reasons
}
reason=
{
dataSecond
?.
reason
}
reason=
{
stateData
?.
reason
}
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
dynamicValue=
{
dynamicValue
}
dynamicValue=
{
dynamicValue
}
onSetDnd=
{
reasonSelect
}
onSetDnd=
{
reasonSelect
}
variant=
{
d
ata
.
variant
||
'
defaultWidjet
'
}
variant=
{
stateD
ata
.
variant
||
'
defaultWidjet
'
}
position=
{
d
ata
.
position
||
'
bottomLeft
'
}
position=
{
stateD
ata
.
position
||
'
bottomLeft
'
}
/>
/>
<
Modal
<
Modal
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment