{"title":"在线用户列表","inframe":false,"hidden":false,"roles":{},"pageLink":"","children":[{"configs":{"itemId":"module"},"events":{"initialize":"app.loadSessions = function(rec) {\n  if (!app.grid2.collapsed) {\n    if (!rec)\n      rec = app.grid1.getSelection()[0];\n    if (rec) {\n      if (app.grid2.disable)\n        app.grid2.setDisabled(false);\n      user = rec.data.user;\n      app.sessionStore.load({\n        params: {\n          user: user\n        }\n      });\n    } else {\n      app.sessionStore.removeAll();\n      app.grid2.setDisabled(true);\n    }\n  }\n};\napp.agentRender = function(record) {\n  var img, isOpera, isChrome, isSafari, isIE, isWebKit, isGecko,\n    userAgent = record.get('userAgent'),\n    agent = userAgent ? userAgent.toLowerCase() : '',\n    check = function(regex) {\n      return regex.test(agent);\n    };\n  if (check(/mobile/))\n    return Wb.getIcon('phone_icon', '移动终端');\n  else {\n    isOpera = check(/opera/);\n    isChrome = check(/\\bchrome\\b/);\n    isSafari = !isChrome && check(/safari/);\n    isIE = !isOpera && (check(/msie/) || check(/trident/));\n    isWebKit = check(/webkit/);\n    isGecko = !isWebKit && !isIE && check(/gecko/);\n    if (isOpera)\n      img = 'opera';\n    else if (isChrome)\n      img = 'chrome';\n    else if (isSafari)\n      img = 'safari';\n    else if (isIE)\n      img = 'ie';\n    else if (isGecko)\n      img = 'firefox';\n    if (img)\n      return Wb.getUrlIcon('wb/images/icon16/' + img + '.png', img);\n    else return Wb.getIcon('web_icon', '未知类型');\n  }\n};"},"children":[{"configs":{"layout":"border","itemId":"viewport1"},"children":[{"configs":{"region":"center","itemId":"grid1"},"events":{"selectionchange":"app.loadSessions(selected[0]);"},"children":[{"configs":{"autoLoad":"true","itemId":"store","url":"m?xwl=admin/user-list/get-user-list","fields":"['sessionCount', 'user', 'username', 'dispname', 'ip', 'userAgent']"},"children":[],"type":"store","expanded":true},{"configs":{"enableTextSelection":"true","itemId":"viewConfig"},"children":[],"type":"tableview","expanded":false},{"configs":{"itemId":"columns"},"children":[{"configs":{"xtype":"rownumberer","itemId":"numCol"},"children":[],"type":"column","expanded":false},{"configs":{"text":"用户名称","width":"140","dataIndex":"username","itemId":"usernameCol","renderer":"var multiUsers = record.data.sessionCount > 1;\nreturn Wb.getIcon(multiUsers ? 'user_group_icon' : 'user_icon', multiUsers ? '多用户登录' : '单用户登录') + value;"},"children":[],"type":"column","expanded":false},{"configs":{"text":"显示名称","width":"140","dataIndex":"dispname","itemId":"dispnameCol"},"children":[],"type":"column","expanded":false},{"configs":{"text":"IP地址","width":"190","dataIndex":"ip","itemId":"ipCol"},"children":[],"type":"column","expanded":false},{"configs":{"text":"终端信息","autoWrap":"true","dataIndex":"userAgent","itemId":"userAgentCol","flex":"1"},"children":[],"type":"column","expanded":false},{"configs":{"showInMenu":"false","menuDisabled":"true","width":"30","itemId":"agentIconCol","renderer":"return app.agentRender(record);"},"children":[],"type":"column","expanded":false}],"type":"array","expanded":true}],"type":"grid","expanded":true},{"configs":{"region":"south","title":"用户下的所有会话信息","height":"150","floatable":"false","collapsible":"true","split":"true","itemId":"grid2","iconCls":"list_icon","header":"false","collapsed":"true"},"events":{"expand":"app.loadSessions();"},"children":[{"configs":{"normalName":"sessionStore","itemId":"store","url":"m?xwl=admin/user-list/get-session-list","fields":"['ip', {\n  name: 'createDate',\n  dateFormat: Wb.dateFormat,\n  type: 'date'\n}, {\n  name: 'lastAccessDate',\n  dateFormat: Wb.dateFormat,\n  type: 'date'\n}, 'userAgent']"},"children":[],"type":"store","expanded":false},{"configs":{"enableTextSelection":"true","itemId":"viewConfig"},"children":[],"type":"tableview","expanded":false},{"configs":{"itemId":"columns"},"children":[{"configs":{"xtype":"rownumberer","itemId":"numCol"},"children":[],"type":"column","expanded":false},{"configs":{"text":"IP地址","width":"190","dataIndex":"ip","itemId":"ipCol"},"children":[],"type":"column","expanded":false},{"configs":{"text":"创建时间","width":"130","dataIndex":"createDate","itemId":"createDateCol"},"children":[],"type":"column","expanded":false},{"configs":{"text":"最后访问时间","width":"130","dataIndex":"lastAccessDate","itemId":"lastAccessDateCol"},"children":[],"type":"column","expanded":false},{"configs":{"text":"终端信息","autoWrap":"true","dataIndex":"userAgent","itemId":"userAgentCol","flex":"1"},"children":[],"type":"column","expanded":false},{"configs":{"showInMenu":"false","menuDisabled":"true","width":"30","itemId":"agentIconCol","renderer":"return app.agentRender(record);"},"children":[],"type":"column","expanded":false}],"type":"array","expanded":true}],"type":"grid","expanded":true}],"type":"viewport","expanded":true}],"type":"module","expanded":true}],"iconCls":"web_icon"}