403Webshell
Server IP : 193.146.211.90  /  Your IP : 10.85.6.55
Web Server : Apache
System : Linux wordpress-gti-69dcdb54f7-n4wdq 6.11.8-arch1-2 #1 SMP PREEMPT_DYNAMIC Fri, 15 Nov 2024 15:35:07 +0000 x86_64
User : 1001 ( 1001)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /bitnami/wordpress/wp-content/plugins/presto-player/src/admin/settings/pages/parts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /bitnami/wordpress/wp-content/plugins/presto-player/src/admin/settings/pages/parts/EmailExport.js
const { __ } = wp.i18n;
const {
  Button,
  Panel,
  PanelBody,
  Flex,
  FlexBlock,
  Notice,
  Spinner,
} = wp.components;
const { useState, useEffect } = wp.element;

export default () => {
  const [step, setStep] = useState(0);
  const [progress, setProgress] = useState(0);
  const [error, setError] = useState("");
  const [url, setURL] = useState(0);

  const exportEmails = async () => {
    setError("");
    try {
      const {
        percentage,
        step: currentStep,
        url: fetchedURL,
      } = await wp.apiFetch({
        path: "/presto-player/v1/email/export",
        method: "post",
        data: {
          step,
        },
      });

      setStep(currentStep);
      setProgress(percentage);
      setURL(fetchedURL);
    } catch (e) {
      setProgress(0);
      setError(e?.message || __("Something went wrong", "presto-player"));
    }
  };

  useEffect(() => {
    if (step && step != "done") {
      exportEmails();
    }
  }, [step]);

  useEffect(() => {
    if (url) {
      window.open(url);
    }
  }, [url]);

  return (
    <Panel>
      <PanelBody
        title={
          <Flex>
            <FlexBlock>{__("Other", "presto-player")}</FlexBlock>
          </Flex>
        }
        initialOpen={false}
      >
        <h2>{__("Manual Export", "presto-player")}</h2>
        <p>
          {__(
            "Using a service not listed here? You can export contacts and manually upload them to a service.",
            "presto-player"
          )}
        </p>
        {error && (
          <Notice
            className="presto-notice"
            status="error"
            onRemove={() => setError("")}
          >
            {error}
          </Notice>
        )}
        <Flex align="center" justify="flex-start">
          <Button
            isPrimary
            onClick={(e) => {
              setStep(1);
              setProgress(1);
              e.preventDefault();
            }}
          >
            {__("Download CSV File", "presto-player")}
          </Button>
          {!!progress && (
            <div
              style={{
                display: "flex",
                alignItems: "center",
              }}
            >
              <Spinner style={{ marginTop: 0 }} />
              <span>Exporting... {progress}% Complete</span>
            </div>
          )}
        </Flex>
      </PanelBody>
    </Panel>
  );
};

Youez - 2016 - github.com/yon3zu
LinuXploit