add OPc field to Subscriber and Profile Document

This commit is contained in:
Sukchan Lee 2017-10-25 12:17:52 +09:00
parent d4dd8bb72d
commit 588a6ba012
10 changed files with 5852 additions and 41 deletions

5724
webui/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "nextepc",
"version": "0.1.0",
"version": "0.2.0",
"description": "NextEPC",
"main": "index.js",
"repository": "https://github.com/acetcom/nextepc",

View File

@ -8,6 +8,7 @@ const Profile = new Schema({
security: {
k: String,
op: String,
opc: String,
amf: String,
},

View File

@ -8,6 +8,7 @@ const Subscriber = new Schema({
security: {
k: String,
op: String,
opc: String,
amf: String,
rand: String,
sqn: Schema.Types.Long

View File

@ -27,15 +27,6 @@ const schema = {
"pattern": "Only hexadecimal digits are allowed"
}
},
"op": {
"type": "string",
"title": "Operator Key (OP)*",
"required": true,
"pattern": "^[0-9a-fA-F\\s]+$",
"messages": {
"pattern": "Only hexadecimal digits are allowed"
}
},
"amf": {
"type": "string",
"title": "Authentication Management Field (AMF)*",
@ -44,7 +35,23 @@ const schema = {
"messages": {
"pattern": "Only hexadecimal digits are allowed"
}
}
},
"op_type": {
"type": "number",
"title": "USIM Type",
"enum": [0, 1],
"enumNames": ["OPc", "OP"],
"default": 0,
},
"op_value": {
"type": "string",
"title": "Operator Key (OPc/OP)*",
"required": true,
"pattern": "^[0-9a-fA-F\\s]+$",
"messages": {
"pattern": "Only hexadecimal digits are allowed"
}
},
}
},
"ambr": {
@ -273,14 +280,17 @@ const uiSchema = {
},
"security" : {
"k" : {
classNames: "col-xs-12",
},
"op" : {
classNames: "col-xs-7",
},
"amf" : {
classNames: "col-xs-5",
},
"op_type" : {
classNames: "col-xs-3",
},
"op_value" : {
classNames: "col-xs-8",
},
},
"ambr" : {
"downlink" : {

View File

@ -200,10 +200,18 @@ const View = ({ visible, disableOnClickOutside, profile, onEdit, onDelete, onHid
{security.k}
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>K</span>
</div>
<div className="data">
{security.op}
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>OP</span>
</div>
{security.opc &&
<div className="data">
{security.opc}
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>OPc</span>
</div>
}
{security.op &&
<div className="data">
{security.op}
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>OP</span>
</div>
}
<div className="data">
{security.amf}
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>AMF</span>

View File

@ -31,15 +31,6 @@ const schema = {
"pattern": "Only hexadecimal digits are allowed"
}
},
"op": {
"type": "string",
"title": "Operator Key (OP)*",
"required": true,
"pattern": "^[0-9a-fA-F\\s]+$",
"messages": {
"pattern": "Only hexadecimal digits are allowed"
}
},
"amf": {
"type": "string",
"title": "Authentication Management Field (AMF)*",
@ -48,7 +39,23 @@ const schema = {
"messages": {
"pattern": "Only hexadecimal digits are allowed"
}
}
},
"op_type": {
"type": "number",
"title": "USIM Type",
"enum": [0, 1],
"enumNames": ["OPc", "OP"],
"default": 0,
},
"op_value": {
"type": "string",
"title": "Operator Key (OPc/OP)*",
"required": true,
"pattern": "^[0-9a-fA-F\\s]+$",
"messages": {
"pattern": "Only hexadecimal digits are allowed"
}
},
}
},
"ambr": {
@ -277,14 +284,17 @@ const uiSchema = {
},
"security" : {
"k" : {
classNames: "col-xs-12",
},
"op" : {
classNames: "col-xs-7",
},
"amf" : {
classNames: "col-xs-5",
},
"op_type" : {
classNames: "col-xs-3",
},
"op_value" : {
classNames: "col-xs-8",
},
},
"ambr" : {
"downlink" : {

View File

@ -199,10 +199,18 @@ const View = ({ visible, disableOnClickOutside, subscriber, onEdit, onDelete, on
{security.k}
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>K</span>
</div>
<div className="data">
{security.op}
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>OP</span>
</div>
{security.opc &&
<div className="data">
{security.opc}
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>OPc</span>
</div>
}
{security.op &&
<div className="data">
{security.op}
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>OP</span>
</div>
}
<div className="data">
{security.amf}
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>AMF</span>

View File

@ -16,8 +16,8 @@ import traverse from 'traverse';
const formData = {
"security": {
k: "465B5CE8 B199B49F AA5F0A2E E238A6BC",
op: "5F1D289C 5D354D0A 140C2548 F5F3E3BA",
amf: "8000"
amf: "8000",
op_value: "E8ED289D EBA952E4 283B54E8 8E6183CA",
},
"ambr": {
"downlink": 1024000,
@ -81,6 +81,16 @@ class Document extends Component {
if (this.key == 'downlink') this.update(Number(x));
if (this.key == 'uplink') this.update(Number(x));
})
if (profile.data.security) {
if (profile.data.security.opc) {
profile.data.security.op_type = 0;
profile.data.security.op_value = profile.data.security.opc;
} else {
profile.data.security.op_type = 1;
profile.data.security.op_value = profile.data.security.op;
}
}
this.setState({ formData: profile.data })
} else {
this.setState({ formData });
@ -163,6 +173,16 @@ class Document extends Component {
handleSubmit = (formData) => {
const { dispatch, action } = this.props;
if (formData.security) {
if (formData.security.op_type === 1) {
formData.security.op = formData.security.op_value;
formData.security.opc = null;
} else {
formData.security.op = null;
formData.security.opc = formData.security.op_value;
}
}
NProgress.configure({
parent: '#nprogress-base-form',
trickleSpeed: 5

View File

@ -17,8 +17,8 @@ import traverse from 'traverse';
const formData = {
"security": {
k: "465B5CE8 B199B49F AA5F0A2E E238A6BC",
op: "5F1D289C 5D354D0A 140C2548 F5F3E3BA",
amf: "8000"
amf: "8000",
op_value: "E8ED289D EBA952E4 283B54E8 8E6183CA",
},
"ambr": {
"downlink": 1024000,
@ -88,17 +88,37 @@ class Document extends Component {
if (this.key == 'downlink') this.update(Number(x));
if (this.key == 'uplink') this.update(Number(x));
})
if (subscriber.data.security) {
if (subscriber.data.security.opc) {
subscriber.data.security.op_type = 0;
subscriber.data.security.op_value = subscriber.data.security.opc;
} else {
subscriber.data.security.op_type = 1;
subscriber.data.security.op_value = subscriber.data.security.op;
}
}
this.setState({ formData: subscriber.data })
} else {
this.setState({ formData });
}
profiles.data.map(profile =>
profiles.data.map(profile => {
traverse(profile).forEach(function(x) {
if (this.key == 'downlink') this.update(Number(x));
if (this.key == 'uplink') this.update(Number(x));
})
);
if (profile.security) {
if (profile.security.opc) {
profile.security.op_type = 0;
profile.security.op_value = profile.security.opc;
} else {
profile.security.op_type = 1;
profile.security.op_value = profile.security.op;
}
}
});
if (status.response) {
NProgress.configure({
@ -181,6 +201,15 @@ class Document extends Component {
handleSubmit = (formData) => {
const { dispatch, action } = this.props;
if (formData.security) {
if (formData.security.op_type === 1) {
formData.security.op = formData.security.op_value;
formData.security.opc = null;
} else {
formData.security.op = null;
formData.security.opc = formData.security.op_value;
}
}
NProgress.configure({
parent: '#nprogress-base-form',