feat: refs #7207 show queue in worker summary #3007

Merged
jorgep merged 18 commits from 7207-showPbx into dev 2024-10-10 07:20:18 +00:00
6 changed files with 121 additions and 3 deletions
Showing only changes of commit 6ff76fd74b - Show all commits

View File

@ -175,6 +175,12 @@
"PrintConfig": {
"dataSource": "vn"
},
"QueueMember": {
"dataSource": "vn"
},
"Queue": {
"dataSource": "vn"
},
"ViaexpressConfig": {
"dataSource": "vn"
},

View File

@ -0,0 +1,38 @@
{
"name": "QueueMember",
"base": "VnModel",
"options": {
"mysql": {
"table": "pbx.queueMember"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"queue": {
"type": "string"
},
"extension": {
"type": "string"
}
},
"relations": {
"queueRelation": {
Review

Como tiene un campo llamado queue, no puedo llamar a la relación queue, no funciona.

Como tiene un campo llamado queue, no puedo llamar a la relación queue, no funciona.
"type": "belongsTo",
"model": "Queue",
"foreignKey": "queue",
"primaryKey": "name"
}
},
"acls": [
{
"property": "*",
"accessType": "READ",
"principalType": "ROLE",
"principalId": "employee",
"permission": "ALLOW"
}
]
}

30
back/models/queue.json Normal file
View File

@ -0,0 +1,30 @@
{
"name": "Queue",
"base": "VnModel",
"options": {
"mysql": {
"table": "pbx.queue"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"description": {
"type": "string"
},
"name": {
"type": "string"
}
},
"acls": [
{
"property": "*",
"accessType": "READ",
"principalType": "ROLE",
"principalId": "employee",
"permission": "ALLOW"
}
]
}

View File

@ -3972,3 +3972,22 @@ INSERT INTO vn.accountDetailType (id, description, code)
INSERT IGNORE INTO ormConfig
SET id =1,
selectLimit = 1000;
INSERT INTO pbx.queueMultiConfig
SET id = 'ring',
strategy = 20,
timeout = 2,
retry = 0,
weight = 0,
maxLen = 0,
ringInUse = 0;
INSERT IGNORE INTO pbx.queue
SET description = 'X-men',
name = '1000',
config = 1;
INSERT IGNORE INTO pbx.queueMember
SET queue = '1000',
extension = '1010';

View File

@ -25,7 +25,12 @@
"type": "belongsTo",
"model": "VnUser",
"foreignKey": "user_id"
},
"queueMember": {
"type": "belongsTo",
"model": "QueueMember",
"foreignKey": "extension",
"primaryKey": "extension"
}
}
}

View File

@ -253,7 +253,27 @@
"relation": "client"
},
{
"relation": "sip"
"relation": "sip",
"scope": {
"include": {
"relation": "queueMember",
"scope": {
"fields": [
"queue",
"extension"
],
"include": {
"relation": "queueRelation",
"scope": {
"fields": [
"description",
"name"
]
}
}
}
}
}
}
]
},