示例#1
0
def update_payload(data):
    log("socketio:update_payload", "req received")

    resp = payload.update_payload(payload_id=data.get('PayloadId'),
                                  enabled=False,
                                  visible=False)
    emit('payloadUpdated', resp, broadcast=True)
示例#2
0
文件: payload.py 项目: s3b4stian/API
 def delete(self, payload_id):
     results = payload.update_payload(payload_id,
                                      enabled=False,
                                      visible=False)
     if not results['Success']:
         response_code = 400
     else:
         response_code = 200
     return jsonify(results, response_code)
示例#3
0
文件: payload.py 项目: s3b4stian/API
 def put(self, payload_id):
     args = payload_parser.parse_args()
     return jsonify(
         payload.update_payload(payload_id=payload_id,
                                jitter=args.get('Jitter'),
                                interval=args.get('BeaconInterval'),
                                expiration_date=args.get('ExpirationDate'),
                                enabled=args.get('Enabled'),
                                visible=args.get('Visible')))
示例#4
0
def update_payload(data):
    log("socketio:update_payload", "req received")
    print(data)
    resp = payload.update_payload(payload_id=data.get('Id'),
                                  jitter=data.get("Jitter"),
                                  interval=data.get("Interval"),
                                  enabled=data.get("Enabled"),
                                  visible=data.get("Visible"))
    print(resp)
    emit('payloadUpdated', resp, broadcast=True)