自定义stf录屏页面

作者: 许一沐 | 来源:发表于2017-03-10 20:57 被阅读284次

自动登录之后选择一个可用设备,并选用此设备跳转到录屏页面

经过这10天的磨练,前端stf这块基本有个比较清晰的脉络了

只需在 openstf\res\app\device-list\index.js 中将代码修改成如下:

//引入 Json转流组件
var oboe = require('oboe')
module.exports = angular.module('device-list', [
  require('angular-xeditable').name,
  require('stf/device').name,
  require('stf/user/group').name,
  require('stf/control').name,
  require('stf/common-ui').name,
  require('stf/settings').name,
  require('./column').name,
  require('./details').name,
  require('./empty').name,
  require('./icons').name,
  require('./stats').name,
  require('./customize').name,
  require('./search').name
])
  .config(['$routeProvider', function($routeProvider) {
    
  }])
  .run(function(editableOptions) {
    //获取所有设备列表
    var isSelect = false;
    function selectFreeDevices(device)
    {
      console.log("找到可用设备: ", device)
      location.replace('#!/toohamster/' + device.serial)
    }

    oboe('/api/v1/devices').on('start', function(json){
          console.warn('开始查找')
        }).on('done', function(json){
          console.warn('结束调用')
          if (!isSelect)
          {
            console.warn('没有找到可用设备')
            alert('没有找到可用设备')
          }
        })
        .node('devices[*]', function(data) {          
          if (isSelect) return ;
          data.usable = data.present && data.status === 3 && data.ready && (!data.owner || data.using)
          if (!data.usable || !data.owner) {
            data.using = false
          }
          console.log("查找设备 ..", data)
          if (data.usable)
          {
            isSelect = true;
            selectFreeDevices(data)          
          }

        })
  })
demo.png

关于 录屏页面的自定义就留在下章来总结了

相关文章

  • 自定义stf录屏页面

    自动登录之后选择一个可用设备,并选用此设备跳转到录屏页面 经过这10天的磨练,前端stf这块基本有个比较清晰的脉络...

  • stf二次开发--初级篇

    背景   项目有一个web系统,需要接入STF.但是直接访问STF网站的首页,会跳转到STF登录页面。现在希望绕过...

  • iOS 录屏开发

    录屏模块使用逻辑: 初始化录屏 开始用就完事了 实际开发应用 一. 初始化录屏为了能在刚进到页面的时候就弹出权限提...

  • iOS 录屏和截屏监听

    iOS 录屏和截屏监听--记录一下笔记 源起 最近公司应用安全检查,在用户登录页面要防止截屏和录屏导致用户名密码等...

  • Mac上制作gif动画

    1、安装mac版QQ 2、使用commond + control + A 进入切图,录屏页面 3、选择屏幕,选择录...

  • STF系列之一--STF 实时显示设备截图功能源码分析

    当我使用STF时,最震惊的是,它怎么做到设备和前端页面设备模块操作上的同步。之前看STF 框架之 minicap ...

  • Flutter携程APP总结

    功能展示 首页实现 搜索页面实现 旅拍页面 DAO 采坑 启动屏 自定义Widget 打包 功能展示 DAO 采坑...

  • JLScreenRecord 超简单集成的录屏框架,只需两行代码

    # JLScreenRecord ios screenRecord 只需两行代码就能集成超简单自定义程度高的录屏框...

  • iOS 模拟器截图和录屏

    截图 打开模拟器 选择需要截屏的页面 按Command+S键进行截屏,截屏文件一般存储在当前桌面 录屏 打开模拟器...

  • 电脑录屏软件

    迅捷屏幕录像工具 录屏高手 录屏大师 转转大师录屏 录大咖 金丹录屏大师 爱伯 备注:本文章软件不齐全

网友评论

    本文标题:自定义stf录屏页面

    本文链接:https://www.haomeiwen.com/subject/rfmogttx.html