mirror of https://github.com/sipwise/ngcp-csc.git
Implement ngcp-csc fax spool module mockup with a listing in grid- form of fax data, and create mockup data. Change-Id: I6bc59a3eb506b9bd1ff908175aad899835a0aa9echanges/10/9610/3
parent
48f719a115
commit
354d337e55
@ -0,0 +1,30 @@
|
||||
Ext.define('NgcpCsc.model.FaxSpool', {
|
||||
extend: 'Ext.data.Model',
|
||||
|
||||
fields: [{
|
||||
name: 'id',
|
||||
type: 'string'
|
||||
}, {
|
||||
name: 'timestamp',
|
||||
type: 'string'
|
||||
}, {
|
||||
name: 'status',
|
||||
type: 'string'
|
||||
}, {
|
||||
name: 'duration',
|
||||
type: 'string'
|
||||
}, {
|
||||
name: 'direction',
|
||||
type: 'string'
|
||||
}, {
|
||||
name: 'caller',
|
||||
type: 'string'
|
||||
}, {
|
||||
name: 'callee',
|
||||
type: 'string'
|
||||
}, {
|
||||
name: 'pages',
|
||||
type: 'string'
|
||||
}]
|
||||
|
||||
});
|
@ -0,0 +1,19 @@
|
||||
Ext.define('NgcpCsc.store.FaxSpool', {
|
||||
extend: 'Ext.data.Store',
|
||||
|
||||
storeId: 'FaxSpool',
|
||||
|
||||
model: 'NgcpCsc.model.FaxSpool',
|
||||
|
||||
autoLoad: true,
|
||||
|
||||
proxy: {
|
||||
type: 'ajax',
|
||||
url: '/resources/data/faxspool.json',
|
||||
reader: {
|
||||
type: 'json',
|
||||
rootProperty: 'data'
|
||||
}
|
||||
}
|
||||
|
||||
});
|
@ -0,0 +1,4 @@
|
||||
// custom rules
|
||||
.faxspool-heading {
|
||||
font-size: 24px;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
Ext.define('NgcpCsc.view.pages.faxspool.FaxSpool', {
|
||||
extend: 'Ext.panel.Panel',
|
||||
|
||||
xtype: 'faxspool',
|
||||
|
||||
controller: 'faxspool',
|
||||
|
||||
title: Ngcp.csc.locales.fax_spool.title[localStorage.getItem('languageSelected')],
|
||||
|
||||
layout: {
|
||||
type: 'hbox',
|
||||
align: 'stretch'
|
||||
},
|
||||
|
||||
initComponent: function() {
|
||||
this.items = [{
|
||||
flex: 4,
|
||||
items: [{
|
||||
height: 60,
|
||||
padding: '20 0 5 20',
|
||||
html: Ngcp.csc.locales.fax_spool.subtitle[localStorage.getItem('languageSelected')]
|
||||
}, {
|
||||
height: 60,
|
||||
padding: '5 0 0 20',
|
||||
html: Ext.String.format('<div class="faxspool-heading">{0} {1}</div>', Ngcp.csc.locales.fax_spool.user_label[localStorage.getItem('languageSelected')], localStorage.getItem('username'))
|
||||
}, {
|
||||
xtype: 'faxspool-grid'
|
||||
}]
|
||||
}, {
|
||||
flex: 1,
|
||||
xtype: 'gridfilters',
|
||||
_linkedStoreId: 'FaxSpool'
|
||||
}];
|
||||
this.callParent();
|
||||
}
|
||||
});
|
@ -0,0 +1,17 @@
|
||||
Ext.define('NgcpCsc.view.pages.faxspool.FaxSpoolController', {
|
||||
extend: 'Ext.app.ViewController',
|
||||
|
||||
alias: 'controller.faxspool',
|
||||
|
||||
reproduceFax: function (val, rec) {
|
||||
this.fireEvent('showmessage', false, 'Todo');
|
||||
},
|
||||
|
||||
removeFax: function(grid, rowIndex, colIndex) {
|
||||
var store = grid.getStore();
|
||||
var rec = grid.getStore().getAt(rowIndex);
|
||||
store.remove(rec);
|
||||
this.fireEvent('showmessage', true, Ngcp.csc.locales.common.remove_success[localStorage.getItem('languageSelected')]);
|
||||
}
|
||||
|
||||
});
|
@ -0,0 +1,73 @@
|
||||
Ext.define('NgcpCsc.view.pages.faxspool.FaxSpoolGrid', {
|
||||
extend: 'Ext.grid.Panel',
|
||||
|
||||
xtype: 'faxspool-grid',
|
||||
|
||||
layout: 'fit',
|
||||
|
||||
store: 'FaxSpool',
|
||||
|
||||
padding: 10,
|
||||
|
||||
columns: {
|
||||
defaults: {
|
||||
menuDisabled: true,
|
||||
resizable: false
|
||||
},
|
||||
items: [{
|
||||
xtype: 'actioncolumn',
|
||||
width: 30,
|
||||
items: [{
|
||||
glyph: 'xf0f6@FontAwesome',
|
||||
tooltip: Ngcp.csc.locales.common.view[localStorage.getItem('languageSelected')],
|
||||
handler: 'reproduceFax'
|
||||
}]
|
||||
}, {
|
||||
dataIndex: 'id',
|
||||
text: '#',
|
||||
width: 60
|
||||
}
|
||||
, {
|
||||
flex: 1,
|
||||
xtype:'datecolumn',
|
||||
dataIndex: 'timestamp',
|
||||
text: 'timestamp',
|
||||
format: 'd.m.Y h:i:s'
|
||||
}
|
||||
, {
|
||||
flex: 1,
|
||||
dataIndex: 'status',
|
||||
text: 'status'
|
||||
}, {
|
||||
flex: 1,
|
||||
dataIndex: 'duration',
|
||||
text: 'duration'
|
||||
}, {
|
||||
flex: 1,
|
||||
dataIndex: 'direction',
|
||||
text: 'direction'
|
||||
}, {
|
||||
flex: 1,
|
||||
dataIndex: 'caller',
|
||||
text: 'caller'
|
||||
}, {
|
||||
flex: 1,
|
||||
dataIndex: 'callee',
|
||||
text: 'callee'
|
||||
}, {
|
||||
flex: 1,
|
||||
dataIndex: 'pages',
|
||||
text: 'pages',
|
||||
align: 'right'
|
||||
}, {
|
||||
xtype: 'actioncolumn',
|
||||
width: 30,
|
||||
align: 'right',
|
||||
items: [{
|
||||
glyph: 'xf00d@FontAwesome',
|
||||
tooltip: Ngcp.csc.locales.common.delete[localStorage.getItem('languageSelected')],
|
||||
handler: 'removeFax'
|
||||
}]
|
||||
}]
|
||||
}
|
||||
})
|
@ -0,0 +1,84 @@
|
||||
{
|
||||
"data": [{
|
||||
"id": "1",
|
||||
"timestamp": "2016-10-08T17:41:12",
|
||||
"status": "FAILED",
|
||||
"duration": "19.488",
|
||||
"direction": "out",
|
||||
"caller": "43991001",
|
||||
"callee": "11228844",
|
||||
"pages": "7"
|
||||
}, {
|
||||
"id": "2",
|
||||
"timestamp": "2016-10-08T11:14:12",
|
||||
"status": "SUCCESS",
|
||||
"duration": "43.144",
|
||||
"direction": "in",
|
||||
"caller": "11223344",
|
||||
"callee": "43991001",
|
||||
"pages": "4"
|
||||
}, {
|
||||
"id": "3",
|
||||
"timestamp": "2016-10-03T07:23:43",
|
||||
"status": "SUCCESS",
|
||||
"duration": "231.743",
|
||||
"direction": "in",
|
||||
"caller": "11223344",
|
||||
"callee": "43991001",
|
||||
"pages": "34"
|
||||
}, {
|
||||
"id": "4",
|
||||
"timestamp": "2016-09-31T03:41:12",
|
||||
"status": "FAILED",
|
||||
"duration": "09.488",
|
||||
"direction": "out",
|
||||
"caller": "43991001",
|
||||
"callee": "11228844",
|
||||
"pages": "1"
|
||||
}, {
|
||||
"id": "5",
|
||||
"timestamp": "2016-09-31T03:41:40",
|
||||
"status": "SUCCESS",
|
||||
"duration": "04.144",
|
||||
"direction": "in",
|
||||
"caller": "11223344",
|
||||
"callee": "43991001",
|
||||
"pages": "4"
|
||||
}, {
|
||||
"id": "6",
|
||||
"timestamp": "2016-09-27T09:11:43",
|
||||
"status": "FAILED",
|
||||
"duration": "17.793",
|
||||
"direction": "in",
|
||||
"caller": "11223344",
|
||||
"callee": "43991001",
|
||||
"pages": "1"
|
||||
}, {
|
||||
"id": "7",
|
||||
"timestamp": "2016-09-18T13:12:53",
|
||||
"status": "FAILED",
|
||||
"duration": "14.468",
|
||||
"direction": "out",
|
||||
"caller": "43991001",
|
||||
"callee": "11228844",
|
||||
"pages": "1"
|
||||
}, {
|
||||
"id": "8",
|
||||
"timestamp": "2016-09-14T11:11:17",
|
||||
"status": "SUCCESS",
|
||||
"duration": "123.144",
|
||||
"direction": "in",
|
||||
"caller": "11223344",
|
||||
"callee": "43991001",
|
||||
"pages": "4"
|
||||
}, {
|
||||
"id": "9",
|
||||
"timestamp": "2016-09-14T11:23:53",
|
||||
"status": "SUCCESS",
|
||||
"duration": "31.743",
|
||||
"direction": "in",
|
||||
"caller": "11223344",
|
||||
"callee": "43991001",
|
||||
"pages": "2"
|
||||
}]
|
||||
}
|
Loading…
Reference in new issue