From f569f0b9cb00ca3d9c65f1fcd07436500e90bdf6 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Mon, 29 Jan 2018 15:55:18 +0800 Subject: [PATCH] feat(systems): examination data manage menu item in admin control panel --- modules/core/client/app/trans-string-en.js | 10 ++++-- modules/core/client/app/trans-string-zh.js | 10 ++++-- .../config/systems-admin.client.routes.js | 4 +++ .../systems-config.client.controller.js | 4 +++ modules/systems/client/less/systems.less | 27 ++++++++++++++++ .../client/views/examination.client.view.html | 31 +++++++++++++++++++ .../client/views/panel.client.view.html | 2 ++ 7 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 modules/systems/client/views/examination.client.view.html diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 990793c5..347caa4e 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -1262,10 +1262,14 @@ DATABASE_BACKUP: 'Database backup files', TRANS_EDIT: 'Translate strings editor', COMMANDS_EXECUTE: 'Server commands execute', + EXAMINATION_MANAGE: 'Examination data manage', SELECT_FILE: 'Select file, please', BTN_RUN_COMMAND: 'Run', CUSTOM_COMMAND: 'Type command line and rut it:', CONFIG_LOADING: 'Loading file, please wait ...', + CURR_EXAMINATION_CONFIG: 'Current examination config: ./config/env/torrents.js', + BTN_INIT_EXAMINATION_DATA: 'Init examination data', + BTN_CURR_EXAMINATION_STATUS: 'Curr examination status', CONFIG_CHANGED_CONFIRM_CANCEL: 'Cancel', CONFIG_CHANGED_CONFIRM_SAVE: 'Save', @@ -1275,7 +1279,9 @@ CONFIG_SAVE_FAILED: 'Configure save failed', DESC_CONFIG: ':warning: This is the system configuration file of **meanTorrent**. If you know what you are doing, you can modify them. Otherwise, don\'t change it arbitrarily. Incorrect settings may cause the system to not work properly. You can also consult the related system maintenance personnel before modification.', - DESC_COMMAND: ':warning: The following commands are used to maintain **meanTorrent**. If you don\'t understand their functions, please don\'t execute arbitrarily. Erroneous execution will make the server unable to work normally. You can also consult the related system maintenance personnel before execution.' + DESC_COMMAND: ':warning: The following commands are used to maintain **meanTorrent**. If you don\'t understand their functions, please don\'t execute arbitrarily. Erroneous execution will make the server unable to work normally. You can also consult the related system maintenance personnel before execution.', + DESC_INIT_EXAMINATION_DATA: 'Before you restart a new examination, you must init the user`s examination data, this is a dangerous operate.', + DESC_CURR_EXAMINATION_STATUS: 'The status of current examination, you can look at the user`s completion statistical info, if the examination is over, you can ban the unfinished user`s account.' }, //shell command @@ -1561,7 +1567,7 @@ SITE_NOTICE: { GLOBAL_SALES_NOTICE: '### IMPORTANT NOTICE: \n :radio: **Happy new year 2018**, **{{site_name}}** global sale is coming, sales value is **{{sale_value}}**, sales start at **{{sale_start_at | date: "yyyy-MM-dd HH:mm"}}** and continued **{{sale_days}}** days and end at **{{sale_end_at | date: "yyyy-MM-dd HH:mm"}}**, Thank you for all the help and support you have been giving us all the time!', - EXAMINATION_NOTICE: '### IMPORTANT NOTICE: \n :radio: **{{site_name}}** will take a new incremental examination from **{{examination_start_at | date: "yyyy-MM-dd HH:mm"}}** to **{{examination_end_at | date: "yyyy-MM-dd HH:mm"}}**, Incremental data requirements: upload **{{data_upload | bytes:2}}**, download **{{data_download | bytes:2}}**, score **{{data_score}}**, Please arrange your own time and hope to pass the exam smoothly. All VIP users are exempt from this examination, The unfinished user account will be banned.' + EXAMINATION_NOTICE: '### IMPORTANT NOTICE: \n :radio: **{{site_name}}** will take a new incremental examination from **{{examination_start_at | date: "yyyy-MM-dd HH:mm"}}** to **{{examination_end_at | date: "yyyy-MM-dd HH:mm"}}**, Incremental data requirements: upload **{{data_upload | bytes:2}}**, download **{{data_download | bytes:2}}**, score **{{data_score}}**, Please arrange your own time and hope to pass the exam smoothly. All VIP users are exempt, The unfinished user account will be banned.' } }; diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 711f5e0f..771600a1 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -1262,10 +1262,14 @@ DATABASE_BACKUP: '数据库备份文件', TRANS_EDIT: '多语言字符串在线编辑', COMMANDS_EXECUTE: '服务器命令在线执行', + EXAMINATION_MANAGE: '考核数据管理', SELECT_FILE: '请选择文件', BTN_RUN_COMMAND: '执行', CUSTOM_COMMAND: '输入命令行并执行:', CONFIG_LOADING: '正在装载文件, 请稍候 ...', + CURR_EXAMINATION_CONFIG: '当前考核配置: ./config/env/torrents.js', + BTN_INIT_EXAMINATION_DATA: '初始化用户的考核数据', + BTN_CURR_EXAMINATION_STATUS: '当前考核的数据状态', CONFIG_CHANGED_CONFIRM_CANCEL: '取消', CONFIG_CHANGED_CONFIRM_SAVE: '保存', @@ -1275,7 +1279,9 @@ CONFIG_SAVE_FAILED: '系统配置保存失败', DESC_CONFIG: ':warning: 这是 **meantorrent** 的系统配置文件, 如果您知道你在干什么, 您可以修改它们, 否则不要随便改动, 不正确的设置可能会导致系统不能正常工作. 您也可以在修改前咨询相关系统维护人员.', - DESC_COMMAND: ':warning: 下面的命令用来维护 **meanTorrent**, 如果你不明白它们的作用,请不要随意的执行,错误的执行将使服务器不能正常的工作. 您也可以在执行前咨询相关系统维护人员.' + DESC_COMMAND: ':warning: 下面的命令用来维护 **meanTorrent**, 如果你不明白它们的作用,请不要随意的执行,错误的执行将使服务器不能正常的工作. 您也可以在执行前咨询相关系统维护人员.', + DESC_INIT_EXAMINATION_DATA: '在您重新开启一次新的考核之前, 您必须初始化所有用户帐户的考核数据, 请注意这是一个危险的操作, 请谨慎对待哦!', + DESC_CURR_EXAMINATION_STATUS: '当前考核的进展状态, 您可以查看用户的完成情况统计信息, 如果考核已经结束, 您可以根据这些统计信息对未完成任务的帐户进行禁止.' }, //shell command @@ -1561,7 +1567,7 @@ SITE_NOTICE: { GLOBAL_SALES_NOTICE: '### 重要通知! \n :radio: **新年快乐 2018**, **{{site_name}}** 新年促销活动已准备就绪, 促销活动类型为 **{{sale_value}}** , 活动将开始于 **{{sale_start_at | date: "yyyy-MM-dd HH:mm"}}** 并持续 **{{sale_days}}** 天, 结束于 **{{sale_end_at | date: "yyyy-MM-dd HH:mm"}}**, 并感谢所有会员用户一直以来给予我们的帮助与支持!', - EXAMINATION_NOTICE: '### 重要通知!: \n :radio: **{{site_name}}** 将从 **{{examination_start_at | date: "yyyy-MM-dd HH:mm"}}** 到 **{{examination_end_at | date: "yyyy-MM-dd HH:mm"}}** 进行一次新的增量考试, 增量数据要求: 上传 **{{data_upload | bytes:2}}**, 下载 **{{data_download | bytes:2}}**, 积分 **{{data_score}}**, 请各位会员安排好自已的时间,并祝您顺利通过这次考试. 所有vip用户可免于此次考试, 考试未达标的用户帐号将会被禁止.' + EXAMINATION_NOTICE: '### 重要通知!: \n :radio: **{{site_name}}** 将从 **{{examination_start_at | date: "yyyy-MM-dd HH:mm"}}** 到 **{{examination_end_at | date: "yyyy-MM-dd HH:mm"}}** 进行一次新的增量考核, 增量数据要求: 上传 **{{data_upload | bytes:2}}**, 下载 **{{data_download | bytes:2}}**, 积分 **{{data_score}}**, 请各位会员安排好自已的时间,并祝您顺利通过这次考核. 所有vip用户免考, 考核未达标的用户帐号将会被禁止.' } }; diff --git a/modules/systems/client/config/systems-admin.client.routes.js b/modules/systems/client/config/systems-admin.client.routes.js index 1c511e7f..e96c5b4f 100644 --- a/modules/systems/client/config/systems-admin.client.routes.js +++ b/modules/systems/client/config/systems-admin.client.routes.js @@ -35,6 +35,10 @@ url: '/trans', templateUrl: '/modules/systems/client/views/trans.client.view.html' }) + .state('admin.systems.examination', { + url: '/examination', + templateUrl: '/modules/systems/client/views/examination.client.view.html' + }) .state('admin.systems.commands', { url: '/commands', templateUrl: '/modules/systems/client/views/commands.client.view.html' diff --git a/modules/systems/client/controllers/systems-config.client.controller.js b/modules/systems/client/controllers/systems-config.client.controller.js index 3462fd92..e1f69b30 100644 --- a/modules/systems/client/controllers/systems-config.client.controller.js +++ b/modules/systems/client/controllers/systems-config.client.controller.js @@ -14,6 +14,7 @@ vm.user = Authentication.user; vm.selectedFilename = 'null'; vm.shellCommandConfig = MeanTorrentConfig.meanTorrentConfig.shellCommand; + vm.examinationConfig = MeanTorrentConfig.meanTorrentConfig.examination; /** * cmOption @@ -277,5 +278,8 @@ } }; + vm.getCurrExaminationConfig = function () { + return JSON.stringify(vm.examinationConfig); + }; } }()); diff --git a/modules/systems/client/less/systems.less b/modules/systems/client/less/systems.less index 928ef573..ed1cc54e 100644 --- a/modules/systems/client/less/systems.less +++ b/modules/systems/client/less/systems.less @@ -21,6 +21,20 @@ padding: 10px 15px 5px; background-color: @alert-warning-bg; } + .panel-config { + border-bottom: solid 1px #ddd; + padding: 10px 15px 5px; + background-color: #fafbfc; + small { + color: #aaa; + } + .config-tree { + padding: 5px 15px; + background-color: @alert-warning-bg; + border: solid 1px @alert-warning-border; + border-radius: 4px; + } + } .panel-loading { text-align: center; color: #888; @@ -120,3 +134,16 @@ overflow: auto; } } + +.examination-panel { + .panel-body { + padding: 15px; + .op-desc { + color: #555; + } + .fa { + color: @mt-base-color; + font-size: 4em; + } + } +} \ No newline at end of file diff --git a/modules/systems/client/views/examination.client.view.html b/modules/systems/client/views/examination.client.view.html new file mode 100644 index 00000000..a8346527 --- /dev/null +++ b/modules/systems/client/views/examination.client.view.html @@ -0,0 +1,31 @@ +
+
{{'SYSTEMS.EXAMINATION_MANAGE' | translate}}
+
+

+
+ +
+
+
+
+
+

+
+
+

+
+
+

+
+
+

+
+
+ +
+
+ +
+
+
+
\ No newline at end of file diff --git a/modules/systems/client/views/panel.client.view.html b/modules/systems/client/views/panel.client.view.html index 4d11629c..e41c401e 100644 --- a/modules/systems/client/views/panel.client.view.html +++ b/modules/systems/client/views/panel.client.view.html @@ -10,6 +10,8 @@ ui-sref-active="active">{{'SYSTEMS.TRANS_EDIT' | translate}} {{'SYSTEMS.TEMPLATES_EDIT' | translate}} + {{'SYSTEMS.EXAMINATION_MANAGE' | translate}} {{'SYSTEMS.DATABASE_BACKUP' | translate}}