import { defineStore } from 'pinia';

export const airPortStore = defineStore({
  id: 'airport',
  state: () => ({
    airport: {
      sn: null,
      camera_index: '165-0-7',
      video_index: 'normal-0',
      video_id: '8UUXN5400A079H/165-0-7/normal-0',
    },
    uav: {
      sn: null,
      camera_index: '99-0-0',
      video_index: 'normal-0',
      video_id: '1581F8HGX254V00A0BUY/99-0-0/normal-0',
    },
    liveInfo: {
      // rtmp: 'rtmp://175.27.168.120:6019/live/',
      // url: 'http://175.27.168.120:6012/live/',
      rtmp: 'rtmp://box.wisestcity.com:1935/live/',
      url: 'http://box.wisestcity.com:8081/live/',
    },
  }),
  getters: {
    getAirport(state) {
      return state.airport;
    },
    getUAV(state) {
      return state.uav;
    },
    getLiveInfo(state) {
      return state.liveInfo;
    },
  },
  actions: {
    setAirPort(item: any, value: any) {
      this.airport[item] = value;
    },
    setUAV(item: any, value: any) {
      this.uav[item] = value;
    },
  },
});
