From fb7c06afa6befca6d0525451cb419f9871c85001 Mon Sep 17 00:00:00 2001 From: strawmanbobi Date: Sun, 13 Nov 2016 13:52:57 +0800 Subject: [PATCH] reformatted encoding algorithm --- src/ir_decoder/irda_decode.c | 30 ++- src/ir_decoder/irda_main.c | 3 +- src/ir_decoder/irda_tv_parse_protocol.c | 9 +- src/ir_decoder/irda_utils.c | 4 - src/ir_encoder/irda_ac_encode.py | 2 +- src/ir_encoder/irda_tv_protocol.py | 2 +- src/ir_encoder/irda_tv_protocol_hex.py | 4 +- .../configuration/system_configs.js | 143 +++------- src/web_console/irext_console.js | 9 +- .../mini-poem/configuration/constants.js | 17 +- src/web_console/routes/certificate_routes.js | 8 +- src/web_console/routes/internal_routes.js | 48 ++-- src/web_console/routes/push_routes.js | 8 +- src/web_console/routes/stat_routes.js | 8 +- src/web_console/script_compiler.sh | 2 +- src/web_console/script_npm.sh | 4 + .../services/certificate_service.js | 2 +- src/web_console/services/internal_service.js | 2 +- src/web_console/services/stat_service.js | 2 +- src/web_console/web/code/index.html | 12 +- src/web_console/web/code/js/remote.js | 48 ++-- src/web_console/web/css/cover.css | 163 ++++++++++++ src/web_console/web/doc/index.html | 250 +++++++++--------- src/web_console/web/error/auth_error.html | 6 +- src/web_console/web/error/confirm_pw.html | 6 +- src/web_console/web/index.html | 131 ++++----- src/web_console/web/index_1.html | 87 ++++++ src/web_console/web/js/index.js | 6 +- src/web_console/web/js/ui.js | 2 +- src/web_console/web/push/index.html | 4 +- src/web_console/web/push/js/push.js | 4 +- src/web_console/web/stat/index.html | 8 +- src/web_console/web/stat/js/stat.js | 12 +- src/web_console/web/version/index.html | 6 +- src/web_console/web/version/js/version.js | 24 +- src/web_console/web/welcome/index.html | 4 +- src/web_console/web/welcome/js/welcome.js | 6 +- .../work_unit/certificate_logic.js | 8 +- src/web_console/work_unit/internal_logic.js | 42 ++- src/web_console/work_unit/stat_logic.js | 10 +- 40 files changed, 663 insertions(+), 483 deletions(-) create mode 100644 src/web_console/web/css/cover.css create mode 100644 src/web_console/web/index_1.html diff --git a/src/ir_decoder/irda_decode.c b/src/ir_decoder/irda_decode.c index 7b0be10..aae8a5b 100644 --- a/src/ir_decoder/irda_decode.c +++ b/src/ir_decoder/irda_decode.c @@ -83,7 +83,7 @@ lp_apply_ac_parameter apply_table[AC_APPLY_MAX] = void free_pirda(void); #endif -///////////////////////////////////////////////// Air Conditioner Begin ///////////////////////////////////////////////// +///////////////////////////////////////////////// AC Begin ///////////////////////////////////////////////// INT8 binary_parse_offset() { @@ -509,7 +509,9 @@ INT8 irda_ac_lib_parse() { IR_PRINTF("\nparse mode 2\n"); context->mode2.len = tags[i].len >> 1; - if (IR_DECODE_FAILED == parse_common_ac_parameter(&tags[i], context->mode2.comp_data, AC_MODE_MAX, AC_PARAMETER_TYPE_1)) + if (IR_DECODE_FAILED == + parse_common_ac_parameter(&tags[i], + context->mode2.comp_data, AC_MODE_MAX, AC_PARAMETER_TYPE_1)) { return IR_DECODE_FAILED; } @@ -518,7 +520,9 @@ INT8 irda_ac_lib_parse() { IR_PRINTF("\nparse speed 2\n"); context->speed2.len = tags[i].len >> 1; - if (IR_DECODE_FAILED == parse_common_ac_parameter(&tags[i], context->speed2.comp_data, AC_WS_MAX, AC_PARAMETER_TYPE_1)) + if (IR_DECODE_FAILED == + parse_common_ac_parameter(&tags[i], + context->speed2.comp_data, AC_WS_MAX, AC_PARAMETER_TYPE_1)) { return IR_DECODE_FAILED; } @@ -864,11 +868,13 @@ INT8 apply_temperature(remote_ac_status_t ac_status, UINT8 function_code) { if(IR_DECODE_FAILED == apply_ac_temperature(context, ac_status.acTemp)) { - if(function_code == AC_FUNCTION_TEMPERATURE_UP /*&& FALSE == has_function(context, AC_FUNCTION_TEMPERATURE_UP)*/) + if(function_code == AC_FUNCTION_TEMPERATURE_UP + /*&& FALSE == has_function(context, AC_FUNCTION_TEMPERATURE_UP)*/) { return IR_DECODE_FAILED; } - else if(function_code == AC_FUNCTION_TEMPERATURE_DOWN /*&& FALSE == has_function(context, AC_FUNCTION_TEMPERATURE_DOWN)*/) + else if(function_code == AC_FUNCTION_TEMPERATURE_DOWN + /*&& FALSE == has_function(context, AC_FUNCTION_TEMPERATURE_DOWN)*/) { return IR_DECODE_FAILED; } @@ -877,11 +883,13 @@ INT8 apply_temperature(remote_ac_status_t ac_status, UINT8 function_code) else { // if this level is in black list, do not send IR wave if user want to apply this function - if(function_code == AC_FUNCTION_TEMPERATURE_UP /*&& FALSE == has_function(context, AC_FUNCTION_TEMPERATURE_UP)*/) + if(function_code == AC_FUNCTION_TEMPERATURE_UP + /*&& FALSE == has_function(context, AC_FUNCTION_TEMPERATURE_UP)*/) { return IR_DECODE_FAILED; } - else if(function_code == AC_FUNCTION_TEMPERATURE_DOWN /*&& FALSE == has_function(context, AC_FUNCTION_TEMPERATURE_DOWN)*/) + else if(function_code == AC_FUNCTION_TEMPERATURE_DOWN + /*&& FALSE == has_function(context, AC_FUNCTION_TEMPERATURE_DOWN)*/) { return IR_DECODE_FAILED; } @@ -890,11 +898,13 @@ INT8 apply_temperature(remote_ac_status_t ac_status, UINT8 function_code) else { // if this level is in black list, do not send IR wave if user want to apply this function - if(function_code == AC_FUNCTION_TEMPERATURE_UP /*&& FALSE == has_function(context, AC_FUNCTION_TEMPERATURE_UP)*/) + if(function_code == AC_FUNCTION_TEMPERATURE_UP + /*&& FALSE == has_function(context, AC_FUNCTION_TEMPERATURE_UP)*/) { return IR_DECODE_FAILED; } - else if(function_code == AC_FUNCTION_TEMPERATURE_DOWN /*&& FALSE == has_function(context, AC_FUNCTION_TEMPERATURE_DOWN)*/) + else if(function_code == AC_FUNCTION_TEMPERATURE_DOWN + /*&& FALSE == has_function(context, AC_FUNCTION_TEMPERATURE_DOWN)*/) { return IR_DECODE_FAILED; } @@ -1165,7 +1175,7 @@ INT8 get_supported_wind_direction(UINT8* supported_wind_direction) } } -///////////////////////////////////////////////// Air Conditioner End ///////////////////////////////////////////////// +///////////////////////////////////////////////// AC End ////////////////////////////////////////////////// ///////////////////////////////////////////////// TV Begin ///////////////////////////////////////////////// INT8 irda_tv_lib_open(UINT8 *binary, UINT16 binary_length) diff --git a/src/ir_decoder/irda_main.c b/src/ir_decoder/irda_main.c index 5541bbf..771fcf1 100644 --- a/src/ir_decoder/irda_main.c +++ b/src/ir_decoder/irda_main.c @@ -172,7 +172,8 @@ INT8 decode_as_ac(const char* file_name) case '6': if (IR_DECODE_SUCCEEDED == get_temperature_range(ac_status.acMode, &min_temperature, &max_temperature)) { - IR_PRINTF("\nsupported temperature range in mode %d = %d, %d\n", ac_status.acMode, min_temperature, max_temperature); + IR_PRINTF("\nsupported temperature range in mode %d = %d, %d\n", + ac_status.acMode, min_temperature, max_temperature); } need_control = FALSE; break; diff --git a/src/ir_decoder/irda_tv_parse_protocol.c b/src/ir_decoder/irda_tv_parse_protocol.c index c489f94..ca37506 100644 --- a/src/ir_decoder/irda_tv_parse_protocol.c +++ b/src/ir_decoder/irda_tv_parse_protocol.c @@ -361,15 +361,18 @@ static void print_irda_time(irda_data_t *data, UINT8 keyindex, UINT16 *irda_time if (irda_decode_flag == IRDA_DECODE_1_BIT) { - process_decode_number(keycode, data, 1, irda_time); // '0','1' + // for binary formatted code + process_decode_number(keycode, data, 1, irda_time); } else if (irda_decode_flag == IRDA_DECODE_2_BITS) { - process_decode_number(keycode, data, 2, irda_time); // '0','1','2','3' + // for quanternary formatted code + process_decode_number(keycode, data, 2, irda_time); } else if (irda_decode_flag == IRDA_DECODE_4_BITS) { - process_decode_number(keycode, data, 4, irda_time); // '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F', + // for hexadecimal formatted code + process_decode_number(keycode, data, 4, irda_time); } } } diff --git a/src/ir_decoder/irda_utils.c b/src/ir_decoder/irda_utils.c index 7b3a45d..094f5aa 100644 --- a/src/ir_decoder/irda_utils.c +++ b/src/ir_decoder/irda_utils.c @@ -8,13 +8,9 @@ Description: This file provides generic utils for IRDA algorithms Revision log: * 2016-10-01: created by strawmanbobi **************************************************************************************************/ -#include #include "include/irda_utils.h" -/* -*0123456789abcdef/0123456789ABCDEF -*/ UINT8 char_to_hex(char chr) { UINT8 value = 0; diff --git a/src/ir_encoder/irda_ac_encode.py b/src/ir_encoder/irda_ac_encode.py index be51dab..f9f7843 100644 --- a/src/ir_encoder/irda_ac_encode.py +++ b/src/ir_encoder/irda_ac_encode.py @@ -73,7 +73,7 @@ def create_binary(ac_device): tags_max_size[i] = ac_device.tags[j].len; find = 1 break - + if find == 0: f_head.write(struct.pack("H", 0xffff)) # f.write(ac_device) diff --git a/src/ir_encoder/irda_tv_protocol.py b/src/ir_encoder/irda_tv_protocol.py index 83d02b5..49732c7 100644 --- a/src/ir_encoder/irda_tv_protocol.py +++ b/src/ir_encoder/irda_tv_protocol.py @@ -115,7 +115,7 @@ def printProtocol(file): else: mode = 1 - print "{%d, \"%s\", %d, %d, %s}" % (index, i.getAttribute('bits'), \ + print "{%d, \"%s\", %d, %d, %s}" % (index, i.getAttribute('bits'), lsb, mode, i.firstChild.data) flag = IRDAData(int(i.getAttribute('bits')), lsb, mode, int(i.firstChild.data)) irda_frame.append(flag) diff --git a/src/ir_encoder/irda_tv_protocol_hex.py b/src/ir_encoder/irda_tv_protocol_hex.py index f6b6432..376aed8 100644 --- a/src/ir_encoder/irda_tv_protocol_hex.py +++ b/src/ir_encoder/irda_tv_protocol_hex.py @@ -97,7 +97,9 @@ def printProtocol(file): mode = 0 flag = 0 irda_frame = [] - flag_tab_dict = {"boot": 0, "stop": 1, "separator": 2, "one": 3, "zero": 4, "flip": 5, "two": 6, "three": 7, "four": 8, "five": 9, "six": 10, "seven": 11, "eight": 12, "nine": 13, "A": 14, "B": 15, "C": 16, "D": 17, "E": 18, "F": 19} + flag_tab_dict = {"boot": 0, "stop": 1, "separator": 2, "one": 3, "zero": 4, "flip": 5, "two": 6, "three": 7, + "four": 8, "five": 9, "six": 10, "seven": 11, "eight": 12, "nine": 13, + "A": 14, "B": 15, "C": 16, "D": 17, "E": 18, "F": 19} for i in frame[0].childNodes: if i.nodeType == i.ELEMENT_NODE: index += 1 diff --git a/src/web_console/configuration/system_configs.js b/src/web_console/configuration/system_configs.js index 1756c32..e00d74d 100644 --- a/src/web_console/configuration/system_configs.js +++ b/src/web_console/configuration/system_configs.js @@ -10,120 +10,55 @@ exports.setupEnvironment = function () { var env = process.env.NODE_ENV || 'development'; ENV = env; if (undefined == typeof env || null == env || "" == env || enums.APP_PRODUCTION_MODE == env) { - console.log("production mode"); - console.log("configuring MySQL db connection ability..."); - MYSQL_DB_SERVER_ADDRESS = "rm-bp11c9w1bz8q47zzx.mysql.rds.aliyuncs.com"; - MYSQL_DB_NAME = "ucon_generic"; - MYSQL_DB_USER = "uconrds"; - MYSQL_DB_PASSWORD = "ucon923"; - - console.log("configuring MongoDB kv connection ability..."); - MONGO_DB_SERVER_ADDRESS = "127.0.0.1"; - MONGO_DB_NAME = "yuekong_remote_code"; - MONGO_DB_USER = "yuekong"; - MONGO_DB_PASSWORD = "yuekong"; - - console.log("configuring kv storage ability..."); - OSS_HOST = "oss-cn-hangzhou.aliyuncs.com"; - OSS_PORT = "80"; - OSS_APP_ID = "f6bWxSdkNyu9FlyC"; - OSS_APP_SECRET = "nO2bzv8yETA6TwPsYNFlYpWRT867Zg"; - - console.log("configuring external PYTHON path"); - FILE_TEMP_PATH = "/root/rc_extension"; - PYTHON_PATH = "/usr/bin/python"; - - console.log("configuring external server connection ability..."); - LISTEN_PORT = "8300"; - MAIN_SERVER_ADDRESS = "yuekongdev.wicp.net"; - MAIN_SERVER_PORT = LISTEN_PORT; - - console.log("configuring cache ability..."); - MEMCACHED_HOST = "127.0.0.1"; - MEMCACHED_PORT = "11211"; - MEMCACHED_SASL_USER = ""; - MEMCACHED_SASL_PASSWORD = ""; - - console.log("configuring push credential"); - PUSH_APP_KEY = "b5e8e6123de67977dcb9813a"; - PUSH_APP_SECRET = "38c6aecde1c7f82c741b4a2a"; - } else if (enums.APP_DEVELOPMENT_MODE == env) { - console.log("develop mode"); - console.log("configuring MySQL db connection ability..."); - MYSQL_DB_SERVER_ADDRESS = "127.0.0.1"; - MYSQL_DB_NAME = "ucon_generic"; + MYSQL_DB_SERVER_ADDRESS = "localhost"; + MYSQL_DB_NAME = "irext"; MYSQL_DB_USER = "root"; MYSQL_DB_PASSWORD = "root"; - - console.log("configuring MongoDB kv connection ability..."); - MONGO_DB_SERVER_ADDRESS = "127.0.0.1"; - MONGO_DB_NAME = "yuekong_remote_code"; - MONGO_DB_USER = "yuekong"; - MONGO_DB_PASSWORD = "yuekong"; - - console.log("configuring kv storage ability..."); - OSS_HOST = "oss-cn-hangzhou.aliyuncs.com"; + OSS_HOST = ""; OSS_PORT = "80"; - OSS_APP_ID = "f6bWxSdkNyu9FlyC"; - OSS_APP_SECRET = "nO2bzv8yETA6TwPsYNFlYpWRT867Zg"; - - console.log("configuring external PYTHON path"); + OSS_APP_ID = ""; + OSS_APP_SECRET = ""; + FILE_TEMP_PATH = "~/home/strawmanbobi/rc_extension"; + PYTHON_PATH = "/usr/bin/python"; + LISTEN_PORT = "8300"; + MAIN_SERVER_ADDRESS = "localhost"; + MAIN_SERVER_PORT = 80; + REDIS_HOST = "localhost"; + REDIS_PORT = "6379"; + REDIS_PASSWORD = ""; + } else if (enums.APP_DEVELOPMENT_MODE == env) { + MYSQL_DB_SERVER_ADDRESS = "localhost"; + MYSQL_DB_NAME = "irext"; + MYSQL_DB_USER = "root"; + MYSQL_DB_PASSWORD = "root"; + OSS_HOST = ""; + OSS_PORT = "80"; + OSS_APP_ID = ""; + OSS_APP_SECRET = ""; FILE_TEMP_PATH = "D:/rc_extension"; PYTHON_PATH = "C:/Python27/python.exe"; - - console.log("configuring external server connection ability..."); LISTEN_PORT = "8300"; - MAIN_SERVER_ADDRESS = "192.168.1.170"; - MAIN_SERVER_PORT = LISTEN_PORT; - - console.log("configuring cache ability..."); - MEMCACHED_HOST = "127.0.0.1"; - MEMCACHED_PORT = "11211"; - MEMCACHED_SASL_USER = ""; - MEMCACHED_SASL_PASSWORD = ""; - - console.log("configuring push credential"); - PUSH_APP_KEY = "b5e8e6123de67977dcb9813a"; - PUSH_APP_SECRET = "38c6aecde1c7f82c741b4a2a"; + MAIN_SERVER_ADDRESS = "localhost"; + MAIN_SERVER_PORT = 80; + REDIS_HOST = "localhost"; + REDIS_PORT = "6379"; + REDIS_PASSWORD = ""; } else if (enums.APP_USERDEBUG_MODE == env) { - console.log("user debug mode"); - console.log("configuring MySQL db connection ability..."); - MYSQL_DB_SERVER_ADDRESS = "127.0.0.1"; - MYSQL_DB_NAME = "ucon_generic"; + MYSQL_DB_SERVER_ADDRESS = "localhost"; + MYSQL_DB_NAME = "irext"; MYSQL_DB_USER = "root"; MYSQL_DB_PASSWORD = "root"; - - console.log("configuring MongoDB kv connection ability..."); - MONGO_DB_SERVER_ADDRESS = "127.0.0.1"; - MONGO_DB_NAME = "yuekong_remote_code"; - MONGO_DB_USER = "yuekong"; - MONGO_DB_PASSWORD = "yuekong"; - - console.log("configuring kv storage ability..."); - OSS_HOST = "oss-cn-hangzhou.aliyuncs.com"; + OSS_HOST = ""; OSS_PORT = "80"; - OSS_APP_ID = "f6bWxSdkNyu9FlyC"; - OSS_APP_SECRET = "nO2bzv8yETA6TwPsYNFlYpWRT867Zg"; - - console.log("configuring external PYTHON path"); - FILE_TEMP_PATH = "/root/rc_extension"; - PYTHON_PATH = "/usr/bin/python"; - - console.log("configuring external server connection ability..."); + OSS_APP_ID = ""; + OSS_APP_SECRET = ""; + FILE_TEMP_PATH = "D:/rc_extension"; + PYTHON_PATH = "C:/Python27/python.exe"; LISTEN_PORT = "8300"; - MAIN_SERVER_ADDRESS = "yuekongdev.wicp.net"; - MAIN_SERVER_PORT = LISTEN_PORT; - - console.log("configuring cache ability..."); - MEMCACHED_HOST = "127.0.0.1"; - MEMCACHED_PORT = "11211"; - MEMCACHED_SASL_USER = ""; - MEMCACHED_SASL_PASSWORD = ""; - - console.log("configuring push credential"); - PUSH_APP_KEY = "b5e8e6123de67977dcb9813a"; - PUSH_APP_SECRET = "38c6aecde1c7f82c741b4a2a"; - } else { - console.log("runtime mode err : " + env); + MAIN_SERVER_ADDRESS = "localhost"; + MAIN_SERVER_PORT = 80; + REDIS_HOST = "localhost"; + REDIS_PORT = "6379"; + REDIS_PASSWORD = ""; } }; \ No newline at end of file diff --git a/src/web_console/irext_console.js b/src/web_console/irext_console.js index 94ed868..8a68118 100644 --- a/src/web_console/irext_console.js +++ b/src/web_console/irext_console.js @@ -40,17 +40,12 @@ var dbConn = require('./mini-poem/db/mysql/mysql_connection'); console.log("initializing MySQL connection to : " + MYSQL_DB_SERVER_ADDRESS + ":" + MYSQL_DB_NAME); dbConn.setMySQLParameter(MYSQL_DB_SERVER_ADDRESS, MYSQL_DB_NAME, MYSQL_DB_USER, MYSQL_DB_PASSWORD); -// the following statements is automatically generated according to system configuration -var kvConn = require('./mini-poem/db/mongodb/mongodb_connection'); -console.log('initializing MongoDB connection to : ' + MONGO_DB_SERVER_ADDRESS + ":" + MONGO_DB_NAME); -kvConn.setMongoDBParameter(MONGO_DB_SERVER_ADDRESS, MONGO_DB_NAME, MONGO_DB_USER, MONGO_DB_PASSWORD); - require('./routes'); var certificateLogic = require('./work_unit/certificate_logic.js'); // kick start the engine -System.startup(app, serverListenPort, "UCON Console V1.7.3"); +System.startup(app, serverListenPort, "irext Console V0.0.1"); ////////////////// middleware ////////////////// function tokenValidation (req, res, next) { @@ -60,7 +55,7 @@ function tokenValidation (req, res, next) { var menu3 = req.url.indexOf("stat/index.html"); var menu4 = req.url.indexOf("push/index.html"); - if (req.url.indexOf("/yuekong/int") != -1) { + if (req.url.indexOf("/irext/int") != -1) { var contentType = req.get("content-type"); if (null != contentType && contentType.indexOf("multipart/form-data") != -1) { next(); diff --git a/src/web_console/mini-poem/configuration/constants.js b/src/web_console/mini-poem/configuration/constants.js index e649037..1b97dd9 100644 --- a/src/web_console/mini-poem/configuration/constants.js +++ b/src/web_console/mini-poem/configuration/constants.js @@ -30,11 +30,11 @@ global.MONGO_DB_USER = null; global.MONGO_DB_PASSWORD = null; // data_set : Aliyun-OSS -global.OSS_HOST = "oss-cn-hangzhou.aliyuncs.com"; +global.OSS_HOST = "default_host"; global.OSS_PORT = "80"; -global.OSS_APP_ID = "T82nbipHSESmHzd8"; -global.OSS_APP_SECRET = "SOweQ8UVwCwPr2NC8EC89EOeKJc5Um"; -global.BUCKET_NAME = "strawmanbobi-beats"; +global.OSS_APP_ID = ""; +global.OSS_APP_SECRET = ""; +global.BUCKET_NAME = "default_bucket"; // cache : memcached global.MEMCACHED_HOST = ""; @@ -42,13 +42,16 @@ global.MEMCACHED_PORT = ""; global.MEMCACHED_SASL_USER = ""; global.MEMCACHED_SASL_PASSWORD = ""; +// cache : redis +global.REDIS_HOST = ""; +global.REDIS_PORT = ""; +global.REDIS_PASSWORD = ""; + // sns : Weixin global.WEIXIN_APP_ID = ""; global.WEIXIN_APP_SECRET = ""; global.WEIXIN_TOKEN = ""; -// sns : facebook - // external : python path global.PYTHON_PATH = ""; @@ -57,7 +60,7 @@ global.PUSH_APP_KEY = ""; global.PUSH_APP_SECRET = ""; // generic server configuration -global.SERVER_LISTEN_PORT = "8080"; +global.SERVER_LISTEN_PORT = "80"; global.SERVER_ADDRESS = "127.0.0.1"; // OSS direct download bucket name diff --git a/src/web_console/routes/certificate_routes.js b/src/web_console/routes/certificate_routes.js index d363f2f..ac99527 100644 --- a/src/web_console/routes/certificate_routes.js +++ b/src/web_console/routes/certificate_routes.js @@ -6,8 +6,8 @@ var app = require('../irext_console.js'); var certificateService = require('../services/certificate_service.js'); -app.get('/yuekong/certificate/confirm_pw', certificateService.confirmPassword); +app.get('/irext/certificate/confirm_pw', certificateService.confirmPassword); -app.post('/yuekong/certificate/admin_login', certificateService.adminLogin); -app.post('/yuekong/certificate/token_verify', certificateService.verifyToken); -app.post('/yuekong/certificate/change_pw', certificateService.changePassword); \ No newline at end of file +app.post('/irext/certificate/admin_login', certificateService.adminLogin); +app.post('/irext/certificate/token_verify', certificateService.verifyToken); +app.post('/irext/certificate/change_pw', certificateService.changePassword); \ No newline at end of file diff --git a/src/web_console/routes/internal_routes.js b/src/web_console/routes/internal_routes.js index 5289029..bf4274a 100644 --- a/src/web_console/routes/internal_routes.js +++ b/src/web_console/routes/internal_routes.js @@ -6,34 +6,34 @@ var app = require('../irext_console.js'); var intService = require('../services/internal_service.js'); -app.get('/yuekong/int/list_provinces', intService.listProvinces); -app.get('/yuekong/int/list_cities', intService.listCities); -app.get('/yuekong/int/list_operators', intService.listOperators); -app.get('/yuekong/int/list_categories', intService.listCategories); -app.get('/yuekong/int/list_brands', intService.listBrands); -app.get('/yuekong/int/list_ir_protocols', intService.listIRProtocols); -app.get('/yuekong/int/list_remote_indexes', intService.listRemoteIndexes); -app.get('/yuekong/int/search_remote_indexes', intService.searchRemoteIndexes); +app.get('/irext/int/list_provinces', intService.listProvinces); +app.get('/irext/int/list_cities', intService.listCities); +app.get('/irext/int/list_operators', intService.listOperators); +app.get('/irext/int/list_categories', intService.listCategories); +app.get('/irext/int/list_brands', intService.listBrands); +app.get('/irext/int/list_ir_protocols', intService.listIRProtocols); +app.get('/irext/int/list_remote_indexes', intService.listRemoteIndexes); +app.get('/irext/int/search_remote_indexes', intService.searchRemoteIndexes); -app.get('/yuekong/int/list_unpublished_brands', intService.listUnpublishedBrands); -app.get('/yuekong/int/list_unpublished_remote_indexes', intService.listUnpublishedRemoteIndexes); +app.get('/irext/int/list_unpublished_brands', intService.listUnpublishedBrands); +app.get('/irext/int/list_unpublished_remote_indexes', intService.listUnpublishedRemoteIndexes); -app.get('/yuekong/int/list_versions', intService.listVersions); +app.get('/irext/int/list_versions', intService.listVersions); -app.post('/yuekong/int/create_remote_index', intService.createRemoteIndex); -app.post('/yuekong/int/delete_remote_index', intService.deleteRemoteIndex); -app.post('/yuekong/int/verify_remote_index', intService.verifyRemoteIndex); -app.post('/yuekong/int/fallback_remote_index', intService.fallbackRemoteIndex); -app.post('/yuekong/int/publish_remote_index', intService.publishRemoteIndex); +app.post('/irext/int/create_remote_index', intService.createRemoteIndex); +app.post('/irext/int/delete_remote_index', intService.deleteRemoteIndex); +app.post('/irext/int/verify_remote_index', intService.verifyRemoteIndex); +app.post('/irext/int/fallback_remote_index', intService.fallbackRemoteIndex); +app.post('/irext/int/publish_remote_index', intService.publishRemoteIndex); -app.post('/yuekong/int/create_brand', intService.createBrand); -app.post('/yuekong/int/publish_brands', intService.publishBrands); +app.post('/irext/int/create_brand', intService.createBrand); +app.post('/irext/int/publish_brands', intService.publishBrands); -app.post('/yuekong/int/create_protocol', intService.createProtocol); +app.post('/irext/int/create_protocol', intService.createProtocol); -app.post('/yuekong/int/create_version', intService.createVersion); -app.post('/yuekong/int/delete_version', intService.deleteVersion); -app.post('/yuekong/int/verify_version', intService.verifyVersion); -app.post('/yuekong/int/fallback_version', intService.fallbackVersion); -app.post('/yuekong/int/publish_version', intService.publishVersion); +app.post('/irext/int/create_version', intService.createVersion); +app.post('/irext/int/delete_version', intService.deleteVersion); +app.post('/irext/int/verify_version', intService.verifyVersion); +app.post('/irext/int/fallback_version', intService.fallbackVersion); +app.post('/irext/int/publish_version', intService.publishVersion); diff --git a/src/web_console/routes/push_routes.js b/src/web_console/routes/push_routes.js index 11e7dd6..5ddacbb 100644 --- a/src/web_console/routes/push_routes.js +++ b/src/web_console/routes/push_routes.js @@ -6,8 +6,8 @@ var app = require('../yk_console.js'); var pushService = require('../services/push_service.js'); -app.get('/yuekong/push/list_mobiles', pushService.listMobiles); -app.get('/yuekong/push/list_push_messages', pushService.listPushMessages); +app.get('/irext/push/list_mobiles', pushService.listMobiles); +app.get('/irext/push/list_push_messages', pushService.listPushMessages); -app.post('/yuekong/push/push_to_peer', pushService.pushToPeer); -app.post('/yuekong/push/broadcast', pushService.broadcast); \ No newline at end of file +app.post('/irext/push/push_to_peer', pushService.pushToPeer); +app.post('/irext/push/broadcast', pushService.broadcast); \ No newline at end of file diff --git a/src/web_console/routes/stat_routes.js b/src/web_console/routes/stat_routes.js index 71482a8..e7be06c 100644 --- a/src/web_console/routes/stat_routes.js +++ b/src/web_console/routes/stat_routes.js @@ -5,7 +5,7 @@ var app = require('../irext_console.js'); var statService = require('../services/stat_service.js'); -app.get('/yuekong/stat/generic_count', statService.genericCount); -app.get('/yuekong/stat/stat_categories', statService.statCategories); -app.get('/yuekong/stat/stat_brands', statService.statBrands); -app.get('/yuekong/stat/stat_cities', statService.statCities); \ No newline at end of file +app.get('/irext/stat/generic_count', statService.genericCount); +app.get('/irext/stat/stat_categories', statService.statCategories); +app.get('/irext/stat/stat_brands', statService.statBrands); +app.get('/irext/stat/stat_cities', statService.statCities); \ No newline at end of file diff --git a/src/web_console/script_compiler.sh b/src/web_console/script_compiler.sh index 2d0974c..ddbb456 100644 --- a/src/web_console/script_compiler.sh +++ b/src/web_console/script_compiler.sh @@ -1,5 +1,5 @@ SOURCE="." -TARGET="$POEM_APPLICATION/yuekong_console" +TARGET="$POEM_APPLICATION/irext_console" MODULE_API="./web/api_doc/js/" function deploy() diff --git a/src/web_console/script_npm.sh b/src/web_console/script_npm.sh index 72de534..45cbaba 100644 --- a/src/web_console/script_npm.sh +++ b/src/web_console/script_npm.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # run this script before you setup the irext web console echo "running script of npm install needed by irext..." @@ -43,4 +44,7 @@ npm install aliyun-sdk echo "npm install nodemailer" npm install nodemailer +echo "npm install mongoose" +npm install mongoose + echo "npm install done" \ No newline at end of file diff --git a/src/web_console/services/certificate_service.js b/src/web_console/services/certificate_service.js index ea80897..b13b196 100644 --- a/src/web_console/services/certificate_service.js +++ b/src/web_console/services/certificate_service.js @@ -82,7 +82,7 @@ exports.changePassword = function (req, res) { * function : Confirm password change * parameter : id of Adminstrator * new password fetch ID - * return : redirection to UCON data center + * return : redirection to irext data center */ exports.confirmPassword = function (req, res) { var id = req.query.id; diff --git a/src/web_console/services/internal_service.js b/src/web_console/services/internal_service.js index 98b9ba3..c8e51d2 100644 --- a/src/web_console/services/internal_service.js +++ b/src/web_console/services/internal_service.js @@ -236,7 +236,7 @@ exports.listUnpublishedRemoteIndexes = function (req, res) { }; /* - * function : List published version of UCON + * function : List published version of irext * parameter : version_type * upload date * purpose diff --git a/src/web_console/services/stat_service.js b/src/web_console/services/stat_service.js index d679d16..b49c0f7 100644 --- a/src/web_console/services/stat_service.js +++ b/src/web_console/services/stat_service.js @@ -24,7 +24,7 @@ var enums = new Enums(); var errorCode = new ErrorCode(); /* - * function : Count remote of UCON remote and device + * function : Count remote of irext remote and device * parameter : stat_type * return : Customized statistics response */ diff --git a/src/web_console/web/code/index.html b/src/web_console/web/code/index.html index 5b57578..d14c1f0 100644 --- a/src/web_console/web/code/index.html +++ b/src/web_console/web/code/index.html @@ -6,9 +6,9 @@ - + - UCON 控制台 + irext 控制台 @@ -114,7 +114,7 @@
- 点这里下载测试专用APP + 点这里下载测试专用APP
@@ -130,7 +130,7 @@