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
54e0e39e
Commit
54e0e39e
authored
Dec 15, 2023
by
Muhammadali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
cbf3fa28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
99 deletions
+75
-99
package.json
package.json
+1
-1
index.jsx
src/root/index.jsx
+74
-98
No files found.
package.json
View file @
54e0e39e
{
"name"
:
"boxdialer"
,
"version"
:
"4.8.7
3
"
,
"version"
:
"4.8.7
4
"
,
"description"
:
""
,
"main"
:
"src/boxDialer.js"
,
"scripts"
:
{
...
...
src/root/index.jsx
View file @
54e0e39e
...
...
@@ -25,9 +25,7 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => {
// const [secondLine, setSecondLine] = useState(false);
const
[
innerTimer
,
setInnerTimer
]
=
useState
(
null
);
const
[
innerCallerModal
,
setInnerCallerModal
]
=
useState
({
bool
:
false
,
type
:
null
,
from
:
''
,
bool
:
false
,
type
:
null
,
from
:
''
,
});
useEffect
(()
=>
{
...
...
@@ -38,7 +36,7 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => {
}
},
[
secondLine
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
boxDialer
.
setGlobalHistoryData
(
useColorConfigStore
.
state
)
},
[
useColorConfigStore
.
state
])
...
...
@@ -50,18 +48,12 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => {
boxDialer
.
setSipStateChangeCallback
(
setPhoneModal
,
'
phoneModal
'
);
boxDialer
.
setSipStateChangeCallback
(
setInnerTimer
,
'
innerTimer
'
);
boxDialer
.
setSipStateChangeCallback
(
configHoldMute
.
setState
,
'
setCallEvents
'
);
boxDialer
.
setSipStateChangeCallback
(
setInnerCallerModal
,
'
innerCallerModal
'
,
);
boxDialer
.
setSipStateChangeCallback
(
setInnerCallerModal
,
'
innerCallerModal
'
,);
if
(
boxDialer
.
isUaRunning
())
console
.
log
(
'
UA is running! in other tab
'
);
else
boxDialer
.
sipRegister
(
wsphonedata
);
if
(
boxDialer
.
isUaRunning
())
console
.
log
(
'
UA is running! in other tab
'
);
else
boxDialer
.
sipRegister
(
wsphonedata
);
setTimeout
(
function
waitUaRegisterLost
()
{
if
(
boxDialer
.
isUaRunning
()
||
boxDialer
.
isRestarting
)
setTimeout
(
waitUaRegisterLost
,
10
);
else
boxDialer
.
sipRegister
(
wsphonedata
);
if
(
boxDialer
.
isUaRunning
()
||
boxDialer
.
isRestarting
)
setTimeout
(
waitUaRegisterLost
,
10
);
else
boxDialer
.
sipRegister
(
wsphonedata
);
},
10
);
}
},
[]);
...
...
@@ -100,42 +92,35 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => {
const
selectWidjetType
=
(
type
)
=>
{
switch
(
type
)
{
case
'
bxmini
'
:
return
(
<
BxMiniWidjetUi
widjetState=
{
dynamicValue
}
phoneNumber=
{
wsphonedata
?.
number
}
reason=
{
wsphonedata
?.
reason
}
widjetVersion=
{
packageJson
?.
version
}
leftTime=
{
wsphonedata
.
lefttime
}
position=
{
wsphonedata
.
position
||
'
bottomLeft
'
}
onClick=
{
()
=>
{
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
}
}
/>
);
return
(<
BxMiniWidjetUi
widjetState=
{
dynamicValue
}
phoneNumber=
{
wsphonedata
?.
number
}
reason=
{
wsphonedata
?.
reason
}
widjetVersion=
{
packageJson
?.
version
}
leftTime=
{
wsphonedata
.
lefttime
}
position=
{
wsphonedata
.
position
||
'
bottomLeft
'
}
onClick=
{
()
=>
{
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
}
}
/>);
default
:
return
(
<
DefaultWidjetUi
widjetState=
{
dynamicValue
}
phoneNumber=
{
wsphonedata
?.
number
}
reason=
{
wsphonedata
?.
reason
}
widjetVersion=
{
packageJson
?.
version
}
leftTime=
{
wsphonedata
.
lefttime
}
position=
{
wsphonedata
.
position
||
'
bottomLeft
'
}
onClick=
{
()
=>
{
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
}
}
/>
);
return
(<
DefaultWidjetUi
widjetState=
{
dynamicValue
}
phoneNumber=
{
wsphonedata
?.
number
}
reason=
{
wsphonedata
?.
reason
}
widjetVersion=
{
packageJson
?.
version
}
leftTime=
{
wsphonedata
.
lefttime
}
position=
{
wsphonedata
.
position
||
'
bottomLeft
'
}
onClick=
{
()
=>
{
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
}
}
/>);
}
};
console
.
log
(
'
wsphonedata_all_data:
'
,
wsphonedata
?.
position
,
wsphonedata
?.
number
,
wsphonedata
,
);
console
.
log
(
'
wsphonedata_all_data:
'
,
wsphonedata
?.
position
,
wsphonedata
?.
number
,
wsphonedata
,);
console
.
log
(
'
modalState_callType:
'
,
modalState
.
callType
)
window
.
onbeforeunload
=
()
=>
{
if
(
typeof
BX
!==
'
undefined
'
)
{
...
...
@@ -144,63 +129,54 @@ const Root = ({wsphonedata, onSetDnd, setWsphonedata, callMethod}) => {
localStorage
.
removeItem
(
'
mycall
'
);
localStorage
.
removeItem
(
BX
.
bitrix_sessid
()
+
'
_mycall
'
);
console
.
log
(
'
--==== Checking removed Items:
'
,
localStorage
.
getItem
(
'
mycall
'
),
localStorage
.
getItem
(
BX
.
bitrix_sessid
()
+
'
_mycall
'
),
);
console
.
log
(
'
--==== Checking removed Items:
'
,
localStorage
.
getItem
(
'
mycall
'
),
localStorage
.
getItem
(
BX
.
bitrix_sessid
()
+
'
_mycall
'
),);
}
};
if
(
!
wsphonedata
?.
number
&&
!
wsphonedata
?.
position
)
return
;
return
(
<>
{
selectWidjetType
(
wsphonedata
.
variant
)
}
<
SettingComponent
settingHidden=
{
settingHidden
&&
phoneModal
?
true
:
false
}
variant=
{
wsphonedata
.
variant
||
'
defaultWidjet
'
}
position=
{
wsphonedata
.
position
||
'
bottomLeft
'
}
/>
<
ModalPhoneNumpad
setSettingHidden=
{
setSettingHidden
}
settingHidden=
{
settingHidden
}
modalState=
{
modalState
}
phoneModal=
{
phoneModal
}
reasons=
{
wsphonedata
?.
reasons
}
reason=
{
wsphonedata
?.
reason
}
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
dynamicValue=
{
dynamicValue
}
onSetDnd=
{
reasonSelect
}
variant=
{
wsphonedata
.
variant
||
'
defaultWidjet
'
}
position=
{
wsphonedata
.
position
||
'
bottomLeft
'
}
extnums=
{
wsphonedata
.
extnums
}
/>
<
Modal
className=
'tailwindGlobalCss'
hidden=
{
modalState
.
bool
}
callType=
{
modalState
.
callType
}
// hidden={true}
// callType={'incoming'}
hangupButton=
{
hangupButton
}
phoneNumber=
{
modalState
.
callType
===
'
outcoming
'
?
'
inputValue
'
:
modalState
.
callFromName
}
/>
<
InnerCaller
hidden=
{
innerCallerModal
.
bool
}
type=
{
innerCallerModal
.
type
}
from=
{
innerCallerModal
.
from
}
innerTimer=
{
innerTimer
}
/>
<
SecondNotifSip
secondLine=
{
secondLine
}
/>
</>
);
return
(<>
{
selectWidjetType
(
wsphonedata
.
variant
)
}
<
SettingComponent
settingHidden=
{
settingHidden
&&
phoneModal
?
true
:
false
}
variant=
{
wsphonedata
.
variant
||
'
defaultWidjet
'
}
position=
{
wsphonedata
.
position
||
'
bottomLeft
'
}
/>
<
ModalPhoneNumpad
setSettingHidden=
{
setSettingHidden
}
settingHidden=
{
settingHidden
}
modalState=
{
modalState
}
phoneModal=
{
phoneModal
}
reasons=
{
wsphonedata
?.
reasons
}
reason=
{
wsphonedata
?.
reason
}
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
dynamicValue=
{
dynamicValue
}
onSetDnd=
{
reasonSelect
}
variant=
{
wsphonedata
.
variant
||
'
defaultWidjet
'
}
position=
{
wsphonedata
.
position
||
'
bottomLeft
'
}
extnums=
{
wsphonedata
.
extnums
}
/>
<
Modal
className=
'tailwindGlobalCss'
hidden=
{
modalState
.
bool
}
callType=
{
modalState
.
callType
}
// hidden={true}
// callType={'incoming'}
hangupButton=
{
hangupButton
}
phoneNumber=
{
modalState
.
callType
===
'
outcoming
'
?
'
inputValue
'
:
modalState
.
callFromName
}
/>
<
InnerCaller
hidden=
{
innerCallerModal
.
bool
}
type=
{
innerCallerModal
.
type
}
from=
{
innerCallerModal
.
from
}
innerTimer=
{
innerTimer
}
/>
<
SecondNotifSip
secondLine=
{
secondLine
}
/>
</>);
};
export
default
Root
;
...
...
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