export namespace HttpProtocol {
  export const DefaultHttpPort = 80;
  export const RequestUploadFile = "/upload_file";
  export const RequestPathUpdateDBBackupFile = "/common/update_db_backup_file";
  export const RequestPathDBBackup = "/db_backup";
  export const RequestPathListFile = "/list_file";
  export const RequestPathCreateDirectory = "/create_directory";
  export const RequestPathCheckFileSupport = "/check_file_support";
  export const RequestPathGetWebscoketPort = "/get_websocket_port";
  export const RequestPathGetAllPort = "/get_all_port";
  export const RequestPathDeleteFile = "/delete_file";
  export const RequestPathRenameFile = "/rename_file";
  export const RequestCheckModeIndex = "/check_mode_index";

  export const HttpUploadTypeNormal = "U_T_Normal";
  export const UploadTypeBackgroundImage = "U_T_BACKGROUND_IMAGE";
  export const UploadTypeMedia = "U_T_MEDIA";
  export const UploadTypeDatabase = "U_T_DATABASE";
  export const UploadTypeRootFS = "U_T_ROOT_FS";
  export const UploadTypeSoftware = "U_T_SOFTWARE";

  export const kHeaderXFileLength = "X-File-Length";
  export const kHeaderXFileMD5 = "X-File-MD5";
  export const kHeaderXProductName = "X-Product-Name";
  const kHeaderDefaultValueXProductName = "LED_PLAYER";

  export const getProductName = ($store: any): String => {
    if ($store && $store.state && $store.state.product_name) {
      return $store.state.product_name;
    }
    return kHeaderDefaultValueXProductName;
  };
}
