!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/wincloud_gateway/node_modules/strapi-admin/admin/src/components/HeaderSearch/   drwxr-xr-x
Free 13.14 GB of 57.97 GB (22.66%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     index.js (2.48 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { upperFirst } from 'lodash';
import { useHistory } from 'react-router-dom';
import { useIntl } from 'react-intl';
import { useQuery } from 'strapi-helper-plugin';
import StyledHeaderSearch from './HeaderSearch';

const HeaderSearch = ({ label, queryParameter }) => {
  const { formatMessage } = useIntl();
  const query = useQuery();
  const searchValue = query.get(queryParameter) || '';
  const [value, setValue] = useState(searchValue);
  const { push } = useHistory();
  const displayedLabel =
    typeof label === 'object'
      ? formatMessage({ ...label, defaultMessage: label.defaultMessage || label.id })
      : label;
  const capitalizedLabel = upperFirst(displayedLabel);

  useEffect(() => {
    if (searchValue === '') {
      // Synchronise the search
      handleClear();
    }
  }, [searchValue]);

  useEffect(() => {
    const handler = setTimeout(() => {
      let currentSearch = query;

      if (value) {
        // Create a new search in order to remove the filters
        currentSearch = new URLSearchParams('');

        // Keep the previous params _sort, pageSize, page
        const pageSize = query.get('pageSize');
        const page = query.get('page');
        const _sort = query.get('_sort');

        if (page) {
          currentSearch.set('page', page);
        }

        if (pageSize) {
          currentSearch.set('pageSize', pageSize);
        }

        if (_sort) {
          currentSearch.set('_sort', _sort);
        }

        currentSearch.set(queryParameter, encodeURIComponent(value));
      } else {
        currentSearch.delete(queryParameter);
      }

      push({ search: currentSearch.toString() });
    }, 300);

    return () => clearTimeout(handler);
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, [value]);

  const handleChange = ({ target: { value } }) => {
    setValue(value);
  };

  const handleClear = () => {
    setValue('');
  };

  return (
    <StyledHeaderSearch
      label={capitalizedLabel}
      name={queryParameter}
      value={value}
      onChange={handleChange}
      onClear={handleClear}
    />
  );
};

HeaderSearch.defaultProps = {
  queryParameter: '_q',
};

HeaderSearch.propTypes = {
  label: PropTypes.oneOfType([
    PropTypes.string,
    PropTypes.shape({
      id: PropTypes.string.isRequired,
      defaultMessage: PropTypes.string,
    }),
  ]).isRequired,
  queryParameter: PropTypes.string,
};

export default HeaderSearch;

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0092 ]--