view_1df554c156e28d17a2c570a2e3e3d9b6.c 6.39 KB
/*
   Generated from client/index.esp
 */
#include "esp.h"

static void view_1df554c156e28d17a2c570a2e3e3d9b6(HttpConn *conn) {
  espRenderBlock(conn, "<!DOCTYPE html>\n\
<html>\n\
\n\
<head>\n\
    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\
    <title></title>\n\
    <link href=\"scripts/easyui/themes/default/easyui.css\" rel=\"stylesheet\" />\n\
    <link href=\"scripts/easyui/themes/icon.css\" rel=\"stylesheet\" />\n\
    <link href=\"css/frame.css\" rel=\"stylesheet\" />\n\
    <link href=\"css/index.css\" rel=\"stylesheet\" />\n\
</head>\n\
\n\
<body class=\"easyui-layout mainContainer\" data-options=\"fit:true\" id=\"mainLayout\">\n\
    <!-- 后端验证用户是否登录的逻辑,不需要修改 -->\n\
    ", 543);
cchar* loginedUser = getSessionVar("loginedUser");
            if(loginedUser == NULL)
			{
	            redirect("login.html");
			}
			else
			{
				puts("+++++++++++++*****************--------------");
				printf("loginedUser: %s\n", loginedUser);
				puts("+++++++++++++*****************--------------");
			}
          espRenderBlock(conn, "\n\
        <div data-options=\"region:'north',border:false\" class=\"main-north\">\n\
            <div class=\"log\">\n\
\n\
            </div>\n\
            <div class=\"navMenu\" data-bind=\" with: menuData\">\n\
                <ul class=\"menus_lv1\" data-bind=\"foreach:menus\">\n\
                    <li class=\"menu_level1\" data-bind=\"click: $root.selectMenuLv1, css: { disabled: $root.isLv1MenuDisabled($data) }\">\n\
                        <div class=\"menu_level1_icon\" data-bind=\"attr:{style:getMenuIcon(id)}\"></div>\n\
                        <span class=\"menu_level1_text\" data-bind=\"text:name\"></span>\n\
                    </li>\n\
                </ul>\n\
            </div>\n\
            <div class=\"userInfo\">\n\
                <div class=\"userInfoContainer\">\n\
                    <span id=\"loginedUser\">\n\
                        <span class=\"i18n-item\" data-i18n-key=\"current_user\"></span>:\n\
                        <!-- 显示已登录的用户名 -->\n\
                        ", 941);
  espRenderSafeString(conn, getSessionVar("loginedUser"));
  espRenderBlock(conn, "\n\
                    </span>&nbsp;&nbsp;\n\
                    <a href=\"#\" onclick=\"loginout()\">\n\
                        <span class=\"i18n-item\" data-i18n-key=\"log_out\"></span>\n\
                    </a>\n\
                </div>\n\
            </div>\n\
            <div class=\"clear\"></div>\n\
        </div>\n\
        <div data-options=\"region:'west',border:false,collapsible:false,closeDuration:0\" class=\"left_menu\">\n\
            <ul class=\"lv2MenuContainer\" data-bind=\"foreach:selectedMenuItems\">\n\
                <!--当有可用的子菜单时才显示二级菜单-->\n\
                <li class=\"menuLv2Item\" data-bind=\"click:$root.selectMenuLv2,clickBubble: false,css:{disabled:!$root.isLevel2MenuValid(url,children)}\">\n\
                    <div class=\"menuLv2Title\">\n\
                        <span class=\"menuName\" data-bind=\"text:name\"></span>\n\
                        <span class=\"menuLv2Icon\"></span>\n\
                    </div>\n\
                    <ul class=\"lv3MenuContainer\" data-bind=\"foreach:children\">\n\
                        <li class=\"menuLv3Item\" data-bind=\"text:name,css:{disabled:$root.isLv3MenuDisabled($data)},click:$root.selectMenuLv3,clickBubble: false\"></li>\n\
                    </ul>\n\
                </li>\n\
            </ul>\n\
        </div>\n\
        <div data-options=\"region:'center',border:false\" class=\"main-center\">\n\
            <iframe id=\"mainPageFrame\" frameborder=\"0\" src=\"\"></iframe>\n\
        </div>\n\
        <!-- 消息控件,用来向浏览器抛出事件,发送抓拍图片,抓拍信息,流量信息 -->\n\
        <object id=\"infoOcxObj\" classid=\"clsid:09614DB3-38D7-4C11-8C02-4D1BA8675153\" style=\"height: 0; width: 0;\"></object>\n\
        <!-- 需要的js文件 -->\n\
        <script src=\"scripts/console-polyfill.js\"></script>\n\
        <script src=\"scripts/core-js/core.min.js\"></script>\n\
        <script src=\"scripts/easyui/jquery.min.js\"></script>\n\
        <script src=\"scripts/i18n/jquery.i18n.properties.js\"></script>\n\
        <script src=\"scripts/easyui/easyloader.js\"></script>\n\
        <script src=\"scripts/knockout-3.2.0.js\"></script>\n\
        <script src=\"scripts/utilities.js\"></script>\n\
        <script src=\"scripts/i18n/i18nHelper.js\"></script>\n\
        <script src=\"index.js\"></script>\n\
\n\
        <!-- 下面的script标签,是用来响应Ocx控件的事件, for指向ocx的Id, event指向要响应的事件及参数 -->\n\
        <script type=\"text/javascript\" for=\"infoOcxObj\" event=\"ResultRecved(jsonStr)\">\n\
            var data = $.parseJSON(jsonStr);\n\
            var mainPageViewModel = window.frames[\"mainPageFrame\"].mainPageViewModel;\n\
            if (mainPageViewModel) {\n\
                mainPageViewModel.processInfo(data);\n\
            }\n\
        </script>\n\
        <script type=\"text/javascript\" for=\"infoOcxObj\" event=\"AlarmRecved(jsonStr)\">\n\
            var alarmJsonData = $.parseJSON(jsonStr);\n\
            var mainPageViewModel = window.frames[\"mainPageFrame\"].mainPageViewModel;\n\
            if (mainPageViewModel) {\n\
                mainPageViewModel.processAlarmInfo(alarmJsonData);\n\
            }\n\
        </script>\n\
        <script type=\"text/javascript\" for=\"infoOcxObj\" event=\"FlowRecved(jsonStr)\">\n\
            var flowJsonData = $.parseJSON(jsonStr);\n\
            var mainPageViewModel = window.frames[\"mainPageFrame\"].mainPageViewModel;\n\
            if (mainPageViewModel) {\n\
                mainPageViewModel.processFlowInfo(flowJsonData);\n\
            }\n\
        </script>\n\
        <script type=\"text/javascript\" for=\"infoOcxObj\" event=\"LightStatusRecved(jsonStr)\">\n\
            var flowJsonData = $.parseJSON(jsonStr);\n\
            var mainPageViewModel = window.frames[\"mainPageFrame\"].mainPageViewModel;\n\
            if (mainPageViewModel) {\n\
                mainPageViewModel.signalLight(flowJsonData);\n\
            }\n\
        </script>\n\
</body>\n\
\n\
</html>\n\
", 3778);
}

ESP_EXPORT int esp_view_1df554c156e28d17a2c570a2e3e3d9b6(HttpRoute *route, MprModule *module) {
   espDefineView(route, "client/index.esp", view_1df554c156e28d17a2c570a2e3e3d9b6);
   return 0;
}