From 0c1e82ccbfa6dcb8ee5d11220a93fefc61465374 Mon Sep 17 00:00:00 2001 From: cyuamber Date: Thu, 29 Aug 2019 18:43:08 +0800 Subject: feat: change the mock data path config file Change-Id: I5ca301d8ff0b084f64366312543c9036d8e76de8 Issue-ID: USECASEUI-307 Signed-off-by: cyuamber --- usecaseui-portal/src/app/mock/fake/fakedata.js | 1 + usecaseui-portal/src/app/mock/fake/mock.js | 3 +- .../src/app/mock/json/alarmFormData.json | 371 --------------------- .../src/app/mock/json/alarm_form_data.json | 371 +++++++++++++++++++++ .../src/app/mock/json/current_language.json | 3 + usecaseui-portal/src/app/mock/json/user_login.json | 8 + usecaseui-portal/src/app/mock/routes.js | 25 ++ usecaseui-portal/src/app/mock/server.js | 42 +-- 8 files changed, 431 insertions(+), 393 deletions(-) delete mode 100644 usecaseui-portal/src/app/mock/json/alarmFormData.json create mode 100644 usecaseui-portal/src/app/mock/json/alarm_form_data.json create mode 100644 usecaseui-portal/src/app/mock/json/current_language.json create mode 100644 usecaseui-portal/src/app/mock/json/user_login.json (limited to 'usecaseui-portal/src/app/mock') diff --git a/usecaseui-portal/src/app/mock/fake/fakedata.js b/usecaseui-portal/src/app/mock/fake/fakedata.js index a008c14a..3fc3a588 100644 --- a/usecaseui-portal/src/app/mock/fake/fakedata.js +++ b/usecaseui-portal/src/app/mock/fake/fakedata.js @@ -21,4 +21,5 @@ module.exports = { avatar: faker.internet.avatar() } }), + language: { language: faker.random.locale() } } \ No newline at end of file diff --git a/usecaseui-portal/src/app/mock/fake/mock.js b/usecaseui-portal/src/app/mock/fake/mock.js index 2864d4c5..74b9fc9f 100644 --- a/usecaseui-portal/src/app/mock/fake/mock.js +++ b/usecaseui-portal/src/app/mock/fake/mock.js @@ -2,6 +2,7 @@ const fakeData = require('./fakedata.js'); module.exports = { //Mock json 'customer_info': fakeData.customer, - 'alarm_formdata_multiple': fakeData, + 'alarm_formdata_multiple': fakeData.customer, 'home': fakeData.home, + 'language': fakeData.language, } \ No newline at end of file diff --git a/usecaseui-portal/src/app/mock/json/alarmFormData.json b/usecaseui-portal/src/app/mock/json/alarmFormData.json deleted file mode 100644 index fc97ae0c..00000000 --- a/usecaseui-portal/src/app/mock/json/alarmFormData.json +++ /dev/null @@ -1,371 +0,0 @@ -{ - "totalRecolds": 22, - "list": [ - { - "id": 11, - "version": "3", - "eventName": "Fault_MultiCloud_VMFailureCleared", - "domain": "fault", - "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", - "eventType": null, - "nfcNamingCode": null, - "nfNamingCode": null, - "sourceId": "shentao-test-1001", - "sourceName": "shentao-test-1001", - "reportingEntityId": null, - "reportingEntityName": "Multi-Cloud", - "priority": "High", - "startEpochMicrosec": "1513630880000000", - "lastEpochMicroSec": "1513630880000000", - "startEpochMicrosecCleared": "112", - "lastEpochMicroSecCleared": "112", - "sequence": "0", - "faultFieldsVersion": "2", - "eventServrity": "CRITICAL", - "eventSourceType": "other", - "eventCategory": null, - "alarmCondition": "Guest_Os_Failure", - "specificProblem": "Fault_MultiCloud_VMFailure", - "vfStatus": "Active", - "alarmInterfaceA": "aaaa", - "status": "active" - }, - { - "id": 12, - "version": "3", - "eventName": "Fault_MultiCloud_VMFailureCleared", - "domain": "fault", - "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", - "eventType": null, - "nfcNamingCode": null, - "nfNamingCode": null, - "sourceId": "shentao-test-1002", - "sourceName": "shentao-test-1002", - "reportingEntityId": null, - "reportingEntityName": "Multi-Cloud", - "priority": "High", - "startEpochMicrosec": "1513630880000000", - "lastEpochMicroSec": "1513630880000000", - "startEpochMicrosecCleared": "112", - "lastEpochMicroSecCleared": "112", - "sequence": "0", - "faultFieldsVersion": "2", - "eventServrity": "CRITICAL", - "eventSourceType": "other", - "eventCategory": null, - "alarmCondition": "Guest_Os_Failure", - "specificProblem": "Fault_MultiCloud_VMFailure", - "vfStatus": "Active", - "alarmInterfaceA": "aaaa", - "status": "active" - }, - { - "id": 13, - "version": "3", - "eventName": "Fault_MultiCloud_VMFailureCleared", - "domain": "fault", - "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", - "eventType": null, - "nfcNamingCode": null, - "nfNamingCode": null, - "sourceId": "shentao-test-1003", - "sourceName": "shentao-test-1003", - "reportingEntityId": null, - "reportingEntityName": "Multi-Cloud", - "priority": "High", - "startEpochMicrosec": "1513630880000000", - "lastEpochMicroSec": "1513630880000000", - "startEpochMicrosecCleared": "112", - "lastEpochMicroSecCleared": "112", - "sequence": "0", - "faultFieldsVersion": "2", - "eventServrity": "CRITICAL", - "eventSourceType": "other", - "eventCategory": null, - "alarmCondition": "Guest_Os_Failure", - "specificProblem": "Fault_MultiCloud_VMFailure", - "vfStatus": "Active", - "alarmInterfaceA": "aaaa", - "status": "active" - }, - { - "id": 14, - "version": "3", - "eventName": "Fault_MultiCloud_VMFailureCleared", - "domain": "fault", - "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", - "eventType": null, - "nfcNamingCode": null, - "nfNamingCode": null, - "sourceId": "shentao-test-2001", - "sourceName": "shentao-test-2001", - "reportingEntityId": null, - "reportingEntityName": "Multi-Cloud", - "priority": "High", - "startEpochMicrosec": "1513630880000000", - "lastEpochMicroSec": "1513630880000000", - "startEpochMicrosecCleared": "112", - "lastEpochMicroSecCleared": "112", - "sequence": "0", - "faultFieldsVersion": "2", - "eventServrity": "CRITICAL", - "eventSourceType": "other", - "eventCategory": null, - "alarmCondition": "Guest_Os_Failure", - "specificProblem": "Fault_MultiCloud_VMFailure", - "vfStatus": "Active", - "alarmInterfaceA": "aaaa", - "status": "active" - }, - { - "id": 15, - "version": "3", - "eventName": "Fault_MultiCloud_VMFailureCleared", - "domain": "fault", - "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", - "eventType": null, - "nfcNamingCode": null, - "nfNamingCode": null, - "sourceId": "shentao-test-2002", - "sourceName": "shentao-test-2002", - "reportingEntityId": null, - "reportingEntityName": "Multi-Cloud", - "priority": "High", - "startEpochMicrosec": "1513630880000000", - "lastEpochMicroSec": "1513630880000000", - "startEpochMicrosecCleared": "112", - "lastEpochMicroSecCleared": "112", - "sequence": "0", - "faultFieldsVersion": "2", - "eventServrity": "CRITICAL", - "eventSourceType": "other", - "eventCategory": null, - "alarmCondition": "Guest_Os_Failure", - "specificProblem": "Fault_MultiCloud_VMFailure", - "vfStatus": "Active", - "alarmInterfaceA": "aaaa", - "status": "active" - }, - { - "id": 16, - "version": "3", - "eventName": "Fault_MultiCloud_VMFailureCleared", - "domain": "fault", - "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", - "eventType": null, - "nfcNamingCode": null, - "nfNamingCode": null, - "sourceId": "shentao-test-2003", - "sourceName": "shentao-test-2003", - "reportingEntityId": null, - "reportingEntityName": "Multi-Cloud", - "priority": "High", - "startEpochMicrosec": "1513630880000000", - "lastEpochMicroSec": "1513630880000000", - "startEpochMicrosecCleared": "112", - "lastEpochMicroSecCleared": "112", - "sequence": "0", - "faultFieldsVersion": "2", - "eventServrity": "CRITICAL", - "eventSourceType": "other", - "eventCategory": null, - "alarmCondition": "Guest_Os_Failure", - "specificProblem": "Fault_MultiCloud_VMFailure", - "vfStatus": "Active", - "alarmInterfaceA": "aaaa", - "status": "active" - }, - { - "id": 17, - "version": "3", - "eventName": "Fault_MultiCloud_VMFailureCleared", - "domain": "fault", - "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", - "eventType": null, - "nfcNamingCode": null, - "nfNamingCode": null, - "sourceId": "shentao-test-2004", - "sourceName": "vnf_a_1", - "reportingEntityId": null, - "reportingEntityName": "Multi-Cloud", - "priority": "High", - "startEpochMicrosec": "1516784364860", - "lastEpochMicroSec": "1516784364860", - "startEpochMicrosecCleared": "112", - "lastEpochMicroSecCleared": "112", - "sequence": "0", - "faultFieldsVersion": "2", - "eventServrity": "CRITICAL", - "eventSourceType": "other", - "eventCategory": null, - "alarmCondition": "Guest_Os_Failure", - "specificProblem": "Fault_MultiCloud_VMFailure", - "vfStatus": "Active", - "alarmInterfaceA": "aaaa", - "status": "active" - }, - { - "id": 18, - "version": "3", - "eventName": "Fault_MultiCloud_VMFailureCleared", - "domain": "fault", - "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", - "eventType": null, - "nfcNamingCode": null, - "nfNamingCode": null, - "sourceId": "shentao-test-2005", - "sourceName": "shentao-test-2005", - "reportingEntityId": null, - "reportingEntityName": "Multi-Cloud", - "priority": "High", - "startEpochMicrosec": "1516784364860", - "lastEpochMicroSec": "1516784364860", - "startEpochMicrosecCleared": "112", - "lastEpochMicroSecCleared": "112", - "sequence": "0", - "faultFieldsVersion": "2", - "eventServrity": "CRITICAL", - "eventSourceType": "other", - "eventCategory": null, - "alarmCondition": "Guest_Os_Failure", - "specificProblem": "Fault_MultiCloud_VMFailure", - "vfStatus": "Active", - "alarmInterfaceA": "aaaa", - "status": "active" - }, - { - "id": 19, - "version": "3", - "eventName": "Fault_MultiCloud_VMFailureCleared", - "domain": "fault", - "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", - "eventType": null, - "nfcNamingCode": null, - "nfNamingCode": null, - "sourceId": "shentao-test-3001", - "sourceName": "shentao-test-3001", - "reportingEntityId": null, - "reportingEntityName": "Multi-Cloud", - "priority": "High", - "startEpochMicrosec": "1516784364860", - "lastEpochMicroSec": "1516784364860", - "startEpochMicrosecCleared": "112", - "lastEpochMicroSecCleared": "112", - "sequence": "0", - "faultFieldsVersion": "2", - "eventServrity": "CRITICAL", - "eventSourceType": "other", - "eventCategory": null, - "alarmCondition": "Guest_Os_Failure", - "specificProblem": "Fault_MultiCloud_VMFailure", - "vfStatus": "Active", - "alarmInterfaceA": "aaaa", - "status": "active" - }, - { - "id": 20, - "version": "3", - "eventName": "Fault_MultiCloud_VMFailureCleared", - "domain": "fault", - "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", - "eventType": null, - "nfcNamingCode": null, - "nfNamingCode": null, - "sourceId": "shentao-test-3003", - "sourceName": "vnf_a_3", - "reportingEntityId": null, - "reportingEntityName": "Multi-Cloud", - "priority": "High", - "startEpochMicrosec": "1516784364860", - "lastEpochMicroSec": "1516784364860", - "startEpochMicrosecCleared": "112", - "lastEpochMicroSecCleared": "112", - "sequence": "0", - "faultFieldsVersion": "2", - "eventServrity": "CRITICAL", - "eventSourceType": "other", - "eventCategory": null, - "alarmCondition": "Guest_Os_Failure", - "specificProblem": "Fault_MultiCloud_VMFailure", - "vfStatus": "Active", - "alarmInterfaceA": "aaaa", - "status": "active" - }, - { - "id": 21, - "version": "3", - "eventName": "Fault_MultiCloud_VMFailureCleared", - "domain": "fault", - "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", - "eventType": null, - "nfcNamingCode": null, - "nfNamingCode": null, - "sourceId": "shentao-test-3004", - "sourceName": "vnf_a_3", - "reportingEntityId": null, - "reportingEntityName": "Multi-Cloud", - "priority": "High", - "startEpochMicrosec": "1516784364860", - "lastEpochMicroSec": "1516784364860", - "startEpochMicrosecCleared": "112", - "lastEpochMicroSecCleared": "112", - "sequence": "0", - "faultFieldsVersion": "2", - "eventServrity": "CRITICAL", - "eventSourceType": "other", - "eventCategory": null, - "alarmCondition": "Guest_Os_Failure", - "specificProblem": "Fault_MultiCloud_VMFailure", - "vfStatus": "Active", - "alarmInterfaceA": "aaaa", - "status": "active" - }, - { - "id": 22, - "version": "3", - "eventName": "Fault_MultiCloud_VMFailure", - "domain": "fault", - "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", - "eventType": null, - "nfcNamingCode": null, - "nfNamingCode": null, - "sourceId": "vnf_a_20180205_2", - "sourceName": "vnf_b_3", - "reportingEntityId": null, - "reportingEntityName": "vnf_a_20180205_2", - "priority": "High", - "startEpochMicrosec": "1516784364860", - "lastEpochMicroSec": "1516784364860", - "startEpochMicrosecCleared": "", - "lastEpochMicroSecCleared": "", - "sequence": "0", - "faultFieldsVersion": "2", - "eventServrity": "CRITICAL", - "eventSourceType": "other", - "eventCategory": null, - "alarmCondition": "Guest_Os_Failure", - "specificProblem": "Fault_MultiCloud_VMFailure", - "vfStatus": "Active", - "alarmInterfaceA": "aaaa", - "status": "active" - } - ], - "countActive": 12, - "reportingEntityNameList": [ - "vnf_a_20180205_2", - "Multi-Cloud" - ], - "sourceNameList": [ - "shentao-test-2001", - "shentao-test-3001", - "shentao-test-1001", - "shentao-test-2002", - "vnf_a_3", - "shentao-test-1002", - "shentao-test-2003", - "vnf_b_3", - "shentao-test-1003", - "vnf_a_1", - "shentao-test-2005" - ] -} \ No newline at end of file diff --git a/usecaseui-portal/src/app/mock/json/alarm_form_data.json b/usecaseui-portal/src/app/mock/json/alarm_form_data.json new file mode 100644 index 00000000..fc97ae0c --- /dev/null +++ b/usecaseui-portal/src/app/mock/json/alarm_form_data.json @@ -0,0 +1,371 @@ +{ + "totalRecolds": 22, + "list": [ + { + "id": 11, + "version": "3", + "eventName": "Fault_MultiCloud_VMFailureCleared", + "domain": "fault", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "eventType": null, + "nfcNamingCode": null, + "nfNamingCode": null, + "sourceId": "shentao-test-1001", + "sourceName": "shentao-test-1001", + "reportingEntityId": null, + "reportingEntityName": "Multi-Cloud", + "priority": "High", + "startEpochMicrosec": "1513630880000000", + "lastEpochMicroSec": "1513630880000000", + "startEpochMicrosecCleared": "112", + "lastEpochMicroSecCleared": "112", + "sequence": "0", + "faultFieldsVersion": "2", + "eventServrity": "CRITICAL", + "eventSourceType": "other", + "eventCategory": null, + "alarmCondition": "Guest_Os_Failure", + "specificProblem": "Fault_MultiCloud_VMFailure", + "vfStatus": "Active", + "alarmInterfaceA": "aaaa", + "status": "active" + }, + { + "id": 12, + "version": "3", + "eventName": "Fault_MultiCloud_VMFailureCleared", + "domain": "fault", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "eventType": null, + "nfcNamingCode": null, + "nfNamingCode": null, + "sourceId": "shentao-test-1002", + "sourceName": "shentao-test-1002", + "reportingEntityId": null, + "reportingEntityName": "Multi-Cloud", + "priority": "High", + "startEpochMicrosec": "1513630880000000", + "lastEpochMicroSec": "1513630880000000", + "startEpochMicrosecCleared": "112", + "lastEpochMicroSecCleared": "112", + "sequence": "0", + "faultFieldsVersion": "2", + "eventServrity": "CRITICAL", + "eventSourceType": "other", + "eventCategory": null, + "alarmCondition": "Guest_Os_Failure", + "specificProblem": "Fault_MultiCloud_VMFailure", + "vfStatus": "Active", + "alarmInterfaceA": "aaaa", + "status": "active" + }, + { + "id": 13, + "version": "3", + "eventName": "Fault_MultiCloud_VMFailureCleared", + "domain": "fault", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "eventType": null, + "nfcNamingCode": null, + "nfNamingCode": null, + "sourceId": "shentao-test-1003", + "sourceName": "shentao-test-1003", + "reportingEntityId": null, + "reportingEntityName": "Multi-Cloud", + "priority": "High", + "startEpochMicrosec": "1513630880000000", + "lastEpochMicroSec": "1513630880000000", + "startEpochMicrosecCleared": "112", + "lastEpochMicroSecCleared": "112", + "sequence": "0", + "faultFieldsVersion": "2", + "eventServrity": "CRITICAL", + "eventSourceType": "other", + "eventCategory": null, + "alarmCondition": "Guest_Os_Failure", + "specificProblem": "Fault_MultiCloud_VMFailure", + "vfStatus": "Active", + "alarmInterfaceA": "aaaa", + "status": "active" + }, + { + "id": 14, + "version": "3", + "eventName": "Fault_MultiCloud_VMFailureCleared", + "domain": "fault", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "eventType": null, + "nfcNamingCode": null, + "nfNamingCode": null, + "sourceId": "shentao-test-2001", + "sourceName": "shentao-test-2001", + "reportingEntityId": null, + "reportingEntityName": "Multi-Cloud", + "priority": "High", + "startEpochMicrosec": "1513630880000000", + "lastEpochMicroSec": "1513630880000000", + "startEpochMicrosecCleared": "112", + "lastEpochMicroSecCleared": "112", + "sequence": "0", + "faultFieldsVersion": "2", + "eventServrity": "CRITICAL", + "eventSourceType": "other", + "eventCategory": null, + "alarmCondition": "Guest_Os_Failure", + "specificProblem": "Fault_MultiCloud_VMFailure", + "vfStatus": "Active", + "alarmInterfaceA": "aaaa", + "status": "active" + }, + { + "id": 15, + "version": "3", + "eventName": "Fault_MultiCloud_VMFailureCleared", + "domain": "fault", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "eventType": null, + "nfcNamingCode": null, + "nfNamingCode": null, + "sourceId": "shentao-test-2002", + "sourceName": "shentao-test-2002", + "reportingEntityId": null, + "reportingEntityName": "Multi-Cloud", + "priority": "High", + "startEpochMicrosec": "1513630880000000", + "lastEpochMicroSec": "1513630880000000", + "startEpochMicrosecCleared": "112", + "lastEpochMicroSecCleared": "112", + "sequence": "0", + "faultFieldsVersion": "2", + "eventServrity": "CRITICAL", + "eventSourceType": "other", + "eventCategory": null, + "alarmCondition": "Guest_Os_Failure", + "specificProblem": "Fault_MultiCloud_VMFailure", + "vfStatus": "Active", + "alarmInterfaceA": "aaaa", + "status": "active" + }, + { + "id": 16, + "version": "3", + "eventName": "Fault_MultiCloud_VMFailureCleared", + "domain": "fault", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "eventType": null, + "nfcNamingCode": null, + "nfNamingCode": null, + "sourceId": "shentao-test-2003", + "sourceName": "shentao-test-2003", + "reportingEntityId": null, + "reportingEntityName": "Multi-Cloud", + "priority": "High", + "startEpochMicrosec": "1513630880000000", + "lastEpochMicroSec": "1513630880000000", + "startEpochMicrosecCleared": "112", + "lastEpochMicroSecCleared": "112", + "sequence": "0", + "faultFieldsVersion": "2", + "eventServrity": "CRITICAL", + "eventSourceType": "other", + "eventCategory": null, + "alarmCondition": "Guest_Os_Failure", + "specificProblem": "Fault_MultiCloud_VMFailure", + "vfStatus": "Active", + "alarmInterfaceA": "aaaa", + "status": "active" + }, + { + "id": 17, + "version": "3", + "eventName": "Fault_MultiCloud_VMFailureCleared", + "domain": "fault", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "eventType": null, + "nfcNamingCode": null, + "nfNamingCode": null, + "sourceId": "shentao-test-2004", + "sourceName": "vnf_a_1", + "reportingEntityId": null, + "reportingEntityName": "Multi-Cloud", + "priority": "High", + "startEpochMicrosec": "1516784364860", + "lastEpochMicroSec": "1516784364860", + "startEpochMicrosecCleared": "112", + "lastEpochMicroSecCleared": "112", + "sequence": "0", + "faultFieldsVersion": "2", + "eventServrity": "CRITICAL", + "eventSourceType": "other", + "eventCategory": null, + "alarmCondition": "Guest_Os_Failure", + "specificProblem": "Fault_MultiCloud_VMFailure", + "vfStatus": "Active", + "alarmInterfaceA": "aaaa", + "status": "active" + }, + { + "id": 18, + "version": "3", + "eventName": "Fault_MultiCloud_VMFailureCleared", + "domain": "fault", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "eventType": null, + "nfcNamingCode": null, + "nfNamingCode": null, + "sourceId": "shentao-test-2005", + "sourceName": "shentao-test-2005", + "reportingEntityId": null, + "reportingEntityName": "Multi-Cloud", + "priority": "High", + "startEpochMicrosec": "1516784364860", + "lastEpochMicroSec": "1516784364860", + "startEpochMicrosecCleared": "112", + "lastEpochMicroSecCleared": "112", + "sequence": "0", + "faultFieldsVersion": "2", + "eventServrity": "CRITICAL", + "eventSourceType": "other", + "eventCategory": null, + "alarmCondition": "Guest_Os_Failure", + "specificProblem": "Fault_MultiCloud_VMFailure", + "vfStatus": "Active", + "alarmInterfaceA": "aaaa", + "status": "active" + }, + { + "id": 19, + "version": "3", + "eventName": "Fault_MultiCloud_VMFailureCleared", + "domain": "fault", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "eventType": null, + "nfcNamingCode": null, + "nfNamingCode": null, + "sourceId": "shentao-test-3001", + "sourceName": "shentao-test-3001", + "reportingEntityId": null, + "reportingEntityName": "Multi-Cloud", + "priority": "High", + "startEpochMicrosec": "1516784364860", + "lastEpochMicroSec": "1516784364860", + "startEpochMicrosecCleared": "112", + "lastEpochMicroSecCleared": "112", + "sequence": "0", + "faultFieldsVersion": "2", + "eventServrity": "CRITICAL", + "eventSourceType": "other", + "eventCategory": null, + "alarmCondition": "Guest_Os_Failure", + "specificProblem": "Fault_MultiCloud_VMFailure", + "vfStatus": "Active", + "alarmInterfaceA": "aaaa", + "status": "active" + }, + { + "id": 20, + "version": "3", + "eventName": "Fault_MultiCloud_VMFailureCleared", + "domain": "fault", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "eventType": null, + "nfcNamingCode": null, + "nfNamingCode": null, + "sourceId": "shentao-test-3003", + "sourceName": "vnf_a_3", + "reportingEntityId": null, + "reportingEntityName": "Multi-Cloud", + "priority": "High", + "startEpochMicrosec": "1516784364860", + "lastEpochMicroSec": "1516784364860", + "startEpochMicrosecCleared": "112", + "lastEpochMicroSecCleared": "112", + "sequence": "0", + "faultFieldsVersion": "2", + "eventServrity": "CRITICAL", + "eventSourceType": "other", + "eventCategory": null, + "alarmCondition": "Guest_Os_Failure", + "specificProblem": "Fault_MultiCloud_VMFailure", + "vfStatus": "Active", + "alarmInterfaceA": "aaaa", + "status": "active" + }, + { + "id": 21, + "version": "3", + "eventName": "Fault_MultiCloud_VMFailureCleared", + "domain": "fault", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "eventType": null, + "nfcNamingCode": null, + "nfNamingCode": null, + "sourceId": "shentao-test-3004", + "sourceName": "vnf_a_3", + "reportingEntityId": null, + "reportingEntityName": "Multi-Cloud", + "priority": "High", + "startEpochMicrosec": "1516784364860", + "lastEpochMicroSec": "1516784364860", + "startEpochMicrosecCleared": "112", + "lastEpochMicroSecCleared": "112", + "sequence": "0", + "faultFieldsVersion": "2", + "eventServrity": "CRITICAL", + "eventSourceType": "other", + "eventCategory": null, + "alarmCondition": "Guest_Os_Failure", + "specificProblem": "Fault_MultiCloud_VMFailure", + "vfStatus": "Active", + "alarmInterfaceA": "aaaa", + "status": "active" + }, + { + "id": 22, + "version": "3", + "eventName": "Fault_MultiCloud_VMFailure", + "domain": "fault", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "eventType": null, + "nfcNamingCode": null, + "nfNamingCode": null, + "sourceId": "vnf_a_20180205_2", + "sourceName": "vnf_b_3", + "reportingEntityId": null, + "reportingEntityName": "vnf_a_20180205_2", + "priority": "High", + "startEpochMicrosec": "1516784364860", + "lastEpochMicroSec": "1516784364860", + "startEpochMicrosecCleared": "", + "lastEpochMicroSecCleared": "", + "sequence": "0", + "faultFieldsVersion": "2", + "eventServrity": "CRITICAL", + "eventSourceType": "other", + "eventCategory": null, + "alarmCondition": "Guest_Os_Failure", + "specificProblem": "Fault_MultiCloud_VMFailure", + "vfStatus": "Active", + "alarmInterfaceA": "aaaa", + "status": "active" + } + ], + "countActive": 12, + "reportingEntityNameList": [ + "vnf_a_20180205_2", + "Multi-Cloud" + ], + "sourceNameList": [ + "shentao-test-2001", + "shentao-test-3001", + "shentao-test-1001", + "shentao-test-2002", + "vnf_a_3", + "shentao-test-1002", + "shentao-test-2003", + "vnf_b_3", + "shentao-test-1003", + "vnf_a_1", + "shentao-test-2005" + ] +} \ No newline at end of file diff --git a/usecaseui-portal/src/app/mock/json/current_language.json b/usecaseui-portal/src/app/mock/json/current_language.json new file mode 100644 index 00000000..db3a4f27 --- /dev/null +++ b/usecaseui-portal/src/app/mock/json/current_language.json @@ -0,0 +1,3 @@ +{ + "language": "en" +} \ No newline at end of file diff --git a/usecaseui-portal/src/app/mock/json/user_login.json b/usecaseui-portal/src/app/mock/json/user_login.json new file mode 100644 index 00000000..1e6321b1 --- /dev/null +++ b/usecaseui-portal/src/app/mock/json/user_login.json @@ -0,0 +1,8 @@ +{ + "esr-system-info-id": "xuran", + "service-url": "http://10.10.10.10:8080/", + "user-name": "demo", + "password": "demo123456!", + "system-type": "ONAP", + "resource-version": "1536221798873" +} \ No newline at end of file diff --git a/usecaseui-portal/src/app/mock/routes.js b/usecaseui-portal/src/app/mock/routes.js index 269f008c..11dedb0f 100644 --- a/usecaseui-portal/src/app/mock/routes.js +++ b/usecaseui-portal/src/app/mock/routes.js @@ -1,8 +1,33 @@ // proxy routers setting module.exports = { + //text interface + "/user/login/:user/test": "/user/login?user=:user", + "/pnf/:cloudnode/p-interfaces/p-interface/:interface-name/createTerminationPoint": + "/status", + "/alarm/form/data": "/alarm_form_data", + "/upload/:url_upId": "/status", + /////////////// + ///////<-------------home services--------->///// + "/portal-auxapi/languageSetting/user/:currentloginId": "/language", + ///////////////////////// + ///////<-------------managemence services--------->///// + + ///////////////////////// + ///////<-------------myhttp services--------->///// + + ///////////////////////// + ///////<-------------networkhttp services--------->///// + + ///////////////////////// + ///////<-------------onboard services--------->///// + + ///////////////////////// + + ///////<-------------general interface--------->///// "/api/*": "/$1", "/*/*": "/$1_$2", "/*/*/*": "/$1_$2_$3", "/*/*/*/*": "/$1_$2_$3_$4", + ///////////////////////// } diff --git a/usecaseui-portal/src/app/mock/server.js b/usecaseui-portal/src/app/mock/server.js index 45773284..b993734c 100644 --- a/usecaseui-portal/src/app/mock/server.js +++ b/usecaseui-portal/src/app/mock/server.js @@ -1,7 +1,7 @@ const jsonServer = require('json-server'); const server = jsonServer.create(); const middlewares = jsonServer.defaults(); -// const customersRouters = require('./routes'); +const customersRouters = require('./routes'); // Set default middlewares (logger, static, cors and no-cache) server.use(middlewares); @@ -19,8 +19,8 @@ fileDisplay(filePath); function fileDisplay(filePath) { let fileList = []; - let originPath = []; - let rewriter = {}; + // let originPath = []; + // let rewriter = {}; // Return filelist on based of filePath const files = fs.readdirSync(filePath); files.forEach((filename) => { @@ -36,11 +36,11 @@ function fileDisplay(filePath) { if (isFile) { fileList.push(path.basename(filedir, '.json')); fileList.forEach(item => { - let paser = item.split("_").join("/"); - originPath.push({ route: `/${paser}`, origin: `/${item}` }) - originPath.map(route => { - rewriter[route.route] = route.origin; - }) + // let paser = item.split("_").join("/"); + // originPath.push({ route: `/${paser}`, origin: `/${item}` }) + // originPath.map(route => { + // rewriter[route.route] = route.origin; + // }) localJsonDb[item] = getjsonContent(item); }) } @@ -55,7 +55,8 @@ function fileDisplay(filePath) { }) }) setTimeout(() => { - serverRewrite(rewriter); + // serverRewrite(rewriter); + serverRewrite(); runServer(localJsonDb); }, 100) } @@ -66,23 +67,22 @@ function getjsonContent(path) { } //only multi router data needs jsonServer.rewriter -function serverRewrite(routerpath) { - let routerpathArr = routerpath; - //rewrite mock multiple routers here - Object.keys(fakeoriginalData).map(item => { - let newPath = item.split("_").join("/") - routerpathArr[`/${newPath}`] = `/${item}`; - }) +function serverRewrite() { + // let routerpathArr = routerpath; + // rewrite mock multiple routers here + // Object.keys(fakeoriginalData).map(item => { + // let newPath = item.split("_").join("/") + // routerpathArr[`/${newPath}`] = `/${item}`; + // }) //start to rewrite routers - // console.log(customersRouters, "===customersRouters") - // server.use(jsonServer.rewriter(customersRouters)) - server.use(jsonServer.rewriter(routerpathArr)); + server.use(jsonServer.rewriter(customersRouters)) + // server.use(jsonServer.rewriter(routerpathArr)); } function runServer(db) { server.use(jsonServer.router(db)); } -server.listen(3004, () => { - console.log('Mock Server is successfully running on port 3004 😁') +server.listen(3002, () => { + console.log('Mock Server is successfully running on port 3002 😁') }); -- cgit 1.2.3-korg