Skip to content

Commit

Permalink
feat(ui): add authentication for individual apn setting
Browse files Browse the repository at this point in the history
  • Loading branch information
zack9433 committed Aug 29, 2017
1 parent 6f24d0a commit 09266a1
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 35 deletions.
94 changes: 62 additions & 32 deletions schema/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -256,31 +256,13 @@ definitions:
primary:
type: object
description: Primary PDP context.
properties:
apn:
type: string
description: Edit APN of the specified PDP context.
type:
type: string
description: Indicate the PDP type to use.
enum:
- ipv4
- ipv6
- ipv4v6
items:
$ref: '#/definitions/CellularProfileEntry'
secondary:
type: object
description: Secondary PDP context.
properties:
apn:
type: string
description: Edit APN of the specified PDP context.
type:
type: string
description: Indicate the PDP type to use.
enum:
- ipv4
- ipv6
- ipv4v6
items:
$ref: '#/definitions/CellularProfileEntry'
list:
readOnly: true
type: array
Expand Down Expand Up @@ -347,6 +329,47 @@ definitions:
example:
$ref: '#/externalDocs/x-mocks/Cellular'

CellularProfileEntry:
title: CellularProfileEntry
description: A profile for connection
required:
- apn
properties:
apn:
type: string
description: Edit APN of the specified PDP context.
type:
type: string
description: Indicate the PDP type to use.
enum:
- ipv4
- ipv6
- ipv4v6
auth:
type: object
description: The negotiated authentication.
required:
- protocol
properties:
protocol:
type: string
description: The negotiated authentication protocol.
enum:
- none
- chap
- pap
- both
username:
type: string
description: Username for PAP and/or CHAP.
minLength: 0
maxLength: 255
password:
type: string
description: Password for PAP and/or CHAP.
minLength: 0
maxLength: 255

CellularFirmwareInfo:
title: CellularFirmwareInfo
description: Display current, preferred, available firmware properties, if current firmware is not equal to preferred firmware, you should check your configuration. (fwver, config, carrier mismatch?).
Expand All @@ -364,7 +387,7 @@ definitions:
items:
$ref: '#/definitions/CellularFirmwareEntry'
example:
$ref : '#/externalDocs/x-mocks/CellularFirmwareInfoExample'
$ref: '#/externalDocs/x-mocks/CellularFirmwareInfoExample'

CellularFirmwareEntry:
title: CellularFirmwareEntry
Expand Down Expand Up @@ -435,10 +458,20 @@ externalDocs:
"primary": {
"apn": "internet",
"type": "ipv4v6",
"auth": {
"protocol": "none",
"username": "",
"password": "",
}
},
"secondary": {
"apn": "internet",
"type": "ipv4v6",
"auth": {
"protocol": "none",
"username": "",
"password": "",
}
},
"list": [
{
Expand All @@ -459,25 +492,23 @@ externalDocs:
}
}
}

Cellulars:
[
$ref: '#/externalDocs/x-mocks/Cellular'
]

CellularFirmwareInfoExample:

{
"switchable": true,
"current": {
"fwver": "05.05.58.01",
"config": "ATT_005.029_001",
"carrier": "ATT"
"fwver": "05.05.58.01",
"config": "ATT_005.029_001",
"carrier": "ATT"
},
"preferred": {
"fwver": "05.05.58.01",
"config": "ATT_005.029_001",
"carrier": "ATT"
"fwver": "05.05.58.01",
"config": "ATT_005.029_001",
"carrier": "ATT"
},
"available": [
{
Expand All @@ -494,7 +525,6 @@ externalDocs:
}

CellularFirmwareEntryExample:

{
"fwver": "05.05.58.01",
"config": "ATT_005.029_001",
Expand Down
92 changes: 91 additions & 1 deletion src/component/component.resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,51 @@
"label": "CELLULAR_FORM_LABEL_PRIVATE_NETWORK"
}
},
{
"key": "protocol",
"model": "model.pdpContext.primary.auth",
"type": "select",
"templateOptions": {
"label": "CELLULAR_FORM_PRIMARY_AUTH_TYPE",
"required": true,
"options": [
{
"label": "None",
"value": "none"
},
{
"label": "CHAP",
"value": "chap"
},
{
"label": "PAP",
"value": "pap"
},
{
"label": "Both",
"value": "both"
}
]
}
},
{
"key": "pdpContext.primary.auth.username",
"type": "input",
"templateOptions": {
"label": "CELLULAR_FORM_PRIMARY_AUTH_USERNAME",
"required": true
},
"hideExpression": "model.pdpContext.primary.auth.protocol === 'none'"
},
{
"key": "pdpContext.primary.auth.password",
"type": "input",
"templateOptions": {
"label": "CELLULAR_FORM_PRIMARY_AUTH_PASSWORD",
"required": true
},
"hideExpression": "model.pdpContext.primary.auth.protocol === 'none'"
},
{
"key": "pdpContext.primary.apn",
"type": "input",
Expand All @@ -32,6 +77,51 @@
},
"hideExpression": "!model.pdpContext.static"
},
{
"key": "protocol",
"model": "model.pdpContext.secondary.auth",
"type": "select",
"templateOptions": {
"label": "CELLULAR_FORM_SECONDARY_AUTH_TYPE",
"required": true,
"options": [
{
"label": "None",
"value": "none"
},
{
"label": "CHAP",
"value": "chap"
},
{
"label": "PAP",
"value": "pap"
},
{
"label": "Both",
"value": "both"
}
]
}
},
{
"key": "pdpContext.secondary.auth.username",
"type": "input",
"templateOptions": {
"label": "CELLULAR_FORM_SECONDARY_AUTH_USERNAME",
"required": true
},
"hideExpression": "model.pdpContext.secondary.auth.protocol === 'none'"
},
{
"key": "pdpContext.secondary.auth.password",
"type": "input",
"templateOptions": {
"label": "CELLULAR_FORM_SECONDARY_AUTH_PASSWORD",
"required": true
},
"hideExpression": "model.pdpContext.secondary.auth.protocol === 'none'"
},
{
"key": "pdpContext.secondary.apn",
"type": "input",
Expand Down Expand Up @@ -95,7 +185,7 @@
"hideExpression": "!model.keepalive.enable"
},
{
"key": "keepalive.reboot.enable",
"key": "keepalive.rebbot.enable",
"type": "switch",
"className": "reboot-highlight",
"templateOptions": {
Expand Down
1 change: 1 addition & 0 deletions src/component/form/container.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class CellularFormContainerController {
}

mapStateToThis(state) {
console.log(state.cellulars);
return {
data: state.cellulars,
carrier: state.carrier
Expand Down
8 changes: 7 additions & 1 deletion src/component/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,11 @@
"CELLULAR_FORM_CARRIER": "Carrier",
"CELLULAR_FORM_APPLY": "Apply",
"CELLULAR_FORM_SWITCH_CARRIER_MSG": "This operation will take several minutes and cellular module may not be available during operation, please ensure stable power supply.",
"CELLULAR_FORM_CURRENT_CARRIER": "Current Carrier"
"CELLULAR_FORM_CURRENT_CARRIER": "Current Carrier",
"CELLULAR_FORM_PRIMARY_AUTH_USERNAME": "Primary Username",
"CELLULAR_FORM_PRIMARY_AUTH_PASSWORD": "Primary Password",
"CELLULAR_FORM_PRIMARY_AUTH_TYPE": "Primary Authentication Type",
"CELLULAR_FORM_SECONDARY_AUTH_USERNAME": "Secondary Username",
"CELLULAR_FORM_SECONDARY_AUTH_PASSWORD": "Secondary Password",
"CELLULAR_FORM_SECONDARY_AUTH_TYPE": "Secondary Authentication Type"
}
5 changes: 4 additions & 1 deletion src/component/lang/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,8 @@
"CELLULAR_FORM_CARRIER": "電信商",
"CELLULAR_FORM_APPLY": "套用",
"CELLULAR_FORM_SWITCH_CARRIER_MSG": "這個動作需要數分鐘,過程中模組可能無法被正常存取,請保持電源的穩定供應.",
"CELLULAR_FORM_CURRENT_CARRIER": "目前的電信商"
"CELLULAR_FORM_CURRENT_CARRIER": "目前的電信商",
"CELLULAR_FORM_APN_USERNAME": "APN 帳號",
"CELLULAR_FORM_APN_PASSWORD": "APN 密碼 ",
"CELLULAR_FORM_AUTHENTICATION_TYPE": "認證型態"
}

0 comments on commit 09266a1

Please sign in to comment.