---
import Layout from '~/layouts/PageLayout.astro';
import Note from '~/components/widgets/Note.astro';
import Prices from '~/components/widgets/Pricing.astro';
import FAQs from '~/components/widgets/FAQs.astro';
import Steps from '~/components/widgets/Steps.astro';
import CallToAction from '~/components/widgets/CallToAction.astro';

const metadata = {
  title: 'RustDesk 定價 - 自託管遠端桌面伺服器方案',
  description: '為您的組織選擇合適的 RustDesk 自託管方案。提供免費開源方案。企業版 Pro 方案具有進階功能。',
  keywords: 'rustdesk價格, 自託管遠端桌面價格, 遠端桌面伺服器成本, 開源遠端存取價格, 企業遠端桌面方案',
  author: 'RustDesk Team',
};
---

<script>
  import Swal from 'sweetalert2';
  import 'sweetalert2/dist/sweetalert2.min.css';
  window['gotoBuy'] = function (redirectUrl) {
    Swal.fire({
      title: '請確認',
      html: `<p style="text-align:left">您確定要前往購買頁面嗎？<br><br>請注意，您購買的<b style="font-size: 2em">不是</b><span style="text-decoration:line-through">SaaS（軟體即服務）</span>訂閱。<br><br>相反，這是一個<b style="font-size: 2em">自託管</b>解決方案的授權，需要您在自己的伺服器上部署（雲端伺服器，如AWS EC2、Azure VM、Vultr VPS等，或您的本地伺服器）。<br><br>如果您不了解什麼是自託管，請<b style="font-size: 2em">不要</b>購買。`,
      icon: 'question',
      showCancelButton: true,
      confirmButtonText: '是',
      cancelButtonText: '否',
    }).then((result) => {
      if (result.isConfirmed) {
        Swal.fire({
          title: '請確認',
          html: `請注意，我們<span class="text-3xl font-bold">不提供</span><span class="text-3xl font-bold">退款</span>。我們強烈建議您在考慮購買我們的Pro計劃之前，<span class="underline font-bold">先試用我們的免費自託管計劃</span>。您仍然想要繼續嗎？`,
          showCancelButton: true,
          confirmButtonText: '是',
          cancelButtonText: '否',
        }).then((result) => {
          if (result.isConfirmed) {
            try {
              const url = new URL(redirectUrl);
              const pageParams = new URLSearchParams(window.location.search);
              pageParams.forEach((value, key) => {
                if (!url.searchParams.has(key)) url.searchParams.append(key, value);
              });
              window.open(url.toString(), '_blank');
            } catch (e) {
              const qs = window.location.search ? (redirectUrl.includes('?') ? '&' : '?') + window.location.search.slice(1) : '';
              window.open(redirectUrl + qs, '_blank');
            }
          }
        });
      }
    });
  };
</script>

<Layout metadata={metadata} i18n>
  <Note
    title="注意"
    subtitle='此定價適用於<span class="text-xl text-blue-500">自託管</span>解決方案，<span class="text-3xl font-extrabold">不是</span><span class="line-through text-xl text-blue-500">SaaS</span>訂閱。'
  />

  <Prices
    title='我們的<span class="text-5xl text-blue-500">自託管</span>解決方案價格'
    subtitle="只為您所需付費"
    prices={[
      {
        title: '免費',
        subtitle: '免費自託管計劃',
        price: '0 <span class="text-sm">/月</span>',
        period: '開源且免費',
        items: [
          {
            description: '在線狀態',
          },
          {
            description: '社區支持',
          },
        ],
        callToAction: {
          target: '_blank',
          text: '開始使用',
          href: 'https://rustdesk.com/docs/en/self-host/rustdesk-server-oss/',
        },
      },
      {
        title: '個人',
        subtitle: '個人自託管<span class="font-bold">專業版</span>計劃',
        price: '9.90 <span class="text-sm">/月</span>',
        period: '年付',
        items: [
          {
            description:
              '<a class="underline" target="_blank" href="https://github.com/rustdesk/rustdesk/wiki/FAQ#login-users">1位登入用戶 <span class="inline-flex items-center justify-center w-4 h-4 text-xs font-bold text-white bg-red-500 rounded-full hover:bg-red-600 cursor-help ml-1" title="Click for more information">?</span></a>',
          },
          {
            description:
              '<a class="underline" target="_blank" href="https://github.com/rustdesk/rustdesk/wiki/FAQ#managed-devices">20台管理設備 <span class="inline-flex items-center justify-center w-4 h-4 text-xs font-bold text-white bg-red-500 rounded-full hover:bg-red-600 cursor-help ml-1" title="Click for more information">?</span></a>',
          },
          {
            description:
              '<a class="underline text-red-500 font-bold" target="_blank" href="https://github.com/rustdesk/rustdesk/wiki/FAQ#concurrent-connections">無限並發連接</a>',
          },
          {
            description:
              '<a class="underline" target="_blank" href="https://rustdesk.com/docs/en/self-host/rustdesk-server-pro/2fa/">雙因素認證</a>',
          },
          {
            description:
              '<a class="underline" target="_blank" href="https://rustdesk.com/docs/en/self-host/rustdesk-server-pro/console/">網頁控制台</a>',
          },
          {
            description: '地址簿',
          },
          {
            description: '審計日誌',
          },
          {
            description: '更改ID',
          },
          {
            description:
              '<a class="underline" target="_blank" href="https://rustdesk.com/docs/en/self-host/rustdesk-server-pro/permissions/">訪問控制</a>',
          },
          {
            description:
              '<a class="underline" target="_blank" href="https://rustdesk.com/docs/en/self-host/rustdesk-server-pro/strategy/">集中設置</a>',
          },
          {
            description:
              '<a class="underline" target="_blank" href="https://rustdesk.com/docs/en/self-host/rustdesk-server-pro/relay/">分佈式中繼伺服器</a>',
          },
        ],
        callToAction: {
          text: '立即購買',
          onclick: 'gotoBuy("https://rustdesk.com/api/lic/stripe/checkout?type=Individual")',
          variant: 'primary',
        },
      },
      {
        title: '基本',
        subtitle: '基本自託管<span class="font-bold">專業版</span>計劃',
        price: '19.90 <span class="text-sm">/月</span>',
        period: '年付',
        items: [
          {
            description: '<span class="font-bold text-red-500">個人計劃的所有功能</span>',
            icon: 'tabler:checks',
          },
          {
            description:
              '<a class="underline" target="_blank" href="https://github.com/rustdesk/rustdesk/wiki/FAQ#login-users">10位登入用戶</a>',
          },
          {
            description:
              '<a class="underline" target="_blank" href="https://github.com/rustdesk/rustdesk/wiki/FAQ#managed-devices">100台管理設備</a>',
          },
          {
            description:
              '<a class="underline" target="_blank" href="https://rustdesk.com/docs/en/self-host/rustdesk-server-pro/oidc/">OIDC（單點登錄）</a>',
          },
          {
            description:
              '<a class="underline" target="_blank" href="https://rustdesk.com/docs/en/self-host/rustdesk-server-pro/ldap/">LDAP整合</a>',
          },
          {
            description:
              '<a class="underline" target="_blank" href="https://rustdesk.com/docs/en/self-host/rustdesk-server-pro/permissions/#cross-group-settings">跨組訪問</a>',
          },
          {
            description:
              '<a class="underline text-blue-500 font-bold" target="_blank" href="https://rustdesk.com/docs/en/self-host/client-configuration/#1-custom-client-generator-pro-only">自定義客戶端生成器</a>',
          },
          {
            description:
              '<a class="underline" target="_blank" href="https://github.com/rustdesk/rustdesk/wiki/FAQ#how-to-make-rustdesk-work-properly-in-restricted-network-with-80443-only">WebSocket</a>',
          },
        ],
        callToAction: {
          text: '立即購買',
          onclick: 'gotoBuy("https://rustdesk.com/api/lic/stripe/checkout?type=Basic")',
        },
        hasRibbon: true,
        ribbonTitle: '熱門',
      },
      {
        title: '自定義',
        subtitle: '自定義<span class="font-bold">專業版</span>計劃',
        price: '<span id="cprice">19.90</span> <span class="text-sm">/月</span>',
        period: '年付',
        items: [
          {
            description: '<span class="font-bold text-red-500">基本計劃的所有功能</span>',
            icon: 'tabler:checks',
          },
          {
            description: '每增加一位用戶1美元',
          },
          {
            description: '每增加一台設備0.1美元',
          },
        ],
        content: `
<form class="flex flex-col space-y-3 mx-3 min-w-[200px]">
  <label for="users" class="text-left font-bold">登入用戶數量：</label>
  <input class="bg-white text-black rounded-md border border-gray-300 py-1 px-2 w-24 h-10" type="number" id="users" name="users" value="10" min="10" max="500" step="10">
  <input type="range" id="usersSlider" class="slider" name="usersRange" value="10" min="10" max="500" step="10">
  <label for="devices" class="text-left font-bold">管理設備數量：</label>
  <input class="bg-white text-black rounded-md border border-gray-300 py-1 px-2 w-24 h-10" type="number" id="devices" name="devices" value="100" min="100" max="5000" step="100">
  <input type="range" id="devicesSlider" class="slider" name="devicesRange" value="100" min="100" max="5000" step="100">
</form>
<br>
`,
        callToAction: {
          text: '立即購買',
          onclick: 'submit()',
          variant: 'primary',
        },
      },
    ]}
  />

  <Prices
    prices={[
      {
        title: '自定義 V2',
        subtitle: '自定義<span class="font-bold">專業版</span>計劃，限制並發連接',
        price: '<span id="cprice2">19.90</span> <span class="text-sm">/月</span>',
        period: '年付',
        items: [
          {
            description: `<span class="font-bold">基本自託管計劃的所有功能<span class="underline font-normal">但限制並發連接，超出的管理設備不會被禁用</span></span>`,
            icon: 'tabler:checks',
          },
          {
            description: '每個並發連接可無限制的並發會話（在標籤頁或單獨窗口中）',
          },
          {
            description: '每增加一位用戶1美元',
          },
          {
            description: '每增加一台設備0.1美元',
          },
          {
            description: '每增加一個並發連接20美元',
          },
        ],
        id: 'custom2',
        content: `
<form class="flex flex-col space-y-3 mx-3">
  <label for="users2" class="text-left font-bold">登入用戶數量：</label>
  <input class="bg-white text-black rounded-md border border-gray-300 py-1 px-2 w-24 h-10" type="number" id="users2" name="users2" value="10" min="10" max="500" step="10">
  <input type="range" id="usersSlider2" class="slider" name="usersRange2" value="10" min="10" max="500" step="10">
  <label for="devices2" class="text-left font-bold">管理設備數量：</label>
  <input class="bg-white text-black rounded-md border border-gray-300 py-1 px-2 w-24 h-10" type="number" id="devices2" name="devices2" value="100" min="100" max="5000" step="100">
  <input type="range" id="devicesSlider2" class="slider" name="devicesRange2" value="100" min="100" max="5000" step="100">
  <label for="conns" class="text-left font-bold">並發連接數量：</label>
  <input class="bg-white text-black rounded-md border border-gray-300 py-1 px-2 w-24 h-10" type="number" id="conns" name="conns" value="1" min="1" max="50" step="1">
  <input type="range" id="connsSlider" class="slider" name="connsRange" value="1" min="1" max="50" step="1">
</form>
<br>
`,
        callToAction: {
          text: '立即購買',
          onclick: 'submit2()',
          variant: 'primary',
        },
      },
    ]}
  />

  <CallToAction
    actions={[
      {
        text: 'sales@rustdesk.com',
        href: 'mailto:sales@rustdesk.com',
        target: '_blank',
        icon: 'tabler:mail',
      },
    ]}
  >
    <Fragment slot="title">聯繫我們了解更大規模的計劃和詢問</Fragment>
  </CallToAction>

  <Steps
    title="從計劃到生產的引導之旅"
    tagline="簡化流程"
    isReversed={true}
    items={[
      {
        title: '安裝 RustDesk Server Pro',
        icon: 'tabler:number-1',
        description:
          '<code>bash <(wget -qO- https://get.docker.com)<br>wget rustdesk.com/pro.yml -O compose.yml<br>docker compose up -d</code>',
      },
      {
        title: '探索計劃並選擇一個計劃',
        icon: 'tabler:number-2',
      },
      {
        title: '輸入電子郵件和付款詳情',
        icon: 'tabler:number-3',
      },
      {
        title: '通過您輸入的電子郵件獲取許可證密鑰',
        icon: 'tabler:number-4',
      },
      {
        title: '在 RustDesk Server Pro 的網頁控制台中輸入許可證密鑰',
        icon: 'tabler:number-5',
      },
      {
        title: '準備就緒！',
        icon: 'tabler:check',
        description:
          '詳細說明請參考我們的<a class="underline" target="_blank" href="https://rustdesk.com/docs/en/self-host/rustdesk-server-pro/license/">文檔</a>。',
      },
    ]}
    image={{
      src: '~/assets/images/steps.jpg',
      alt: '步驟圖片',
    }}
  />

  <FAQs
    title="價格常見問題"
    subtitle="選擇正確的計劃很重要，我們在這裡回答您的問題。如果您對我們的價格選項有疑問，您來對地方了。"
    columns={1}
    items={[
      {
        title: '這些計劃是否包含客戶支持？',
        description:
          '當然，所有付費計劃都包括訪問我們專門的客戶支持，以協助您解決任何疑問或問題。',
      },
      {
        title: '是否有試用許可證？',
        description: '請<a class="underline" href="mailto:sales@rustdesk.com">聯繫我們</a>',
      },
      {
        title: '如何升級我的計劃？',
        description:
          '當然可以！您可以隨時輕鬆地<a class="underline" target="_blank" href="https://rustdesk.com/docs/en/self-host/rustdesk-server-pro/license/#renewupgrade-license">升級您的計劃</a>，以找到最適合您不斷變化需求的計劃。',
      },
      {
        title: '您接受哪些付款方式？',
        description:
          '我們接受主要信用卡和在線支付方式，以確保便捷和安全的交易過程。如果您想通過銀行轉賬付款，請<a class="underline" href="mailto:sales@rustdesk.com">聯繫我們</a>；您將被收取額外的銀行處理費，我們會在收到銀行的離線付款後發送許可證密鑰給您；這需要3~5個工作日。',
      },
      {
        title: '除了顯示的費用外，還有其他隱藏費用嗎？',
        description:
          '沒有，費用涵蓋了每個計劃下列出的所有功能。沒有隱藏費用或額外收費。',
      },
      {
        title: '您有月付選項嗎？',
        description:
          '沒有，我們只提供年付計劃。我們不會自動續訂；您將在許可證到期前14天收到一封電子郵件，提醒您續訂許可證。',
      },
      {
        title: '您對非營利組織或教育機構有折扣嗎？',
        description: '目前還沒有。我們鼓勵您使用免費計劃。',
      },
      {
        title: '您的條款是什麼？',
        description:
          '請查看這個<a class="underline" target="_blank" href="https://github.com/rustdesk/rustdesk-server-pro/blob/main/terms">條款</a>',
      },
      {
        title:
          '對於臨時支持案例怎麼辦？我們有一些設備需要偶爾支持，但不需要無人值守訪問。',
        description:
          '我們提供這個<a class="underline" target="_blank" href="https://github.com/rustdesk/rustdesk-server-pro/discussions/182#discussioncomment-10083053">解決方案</a>',
      },
    ]}
  />
</Layout>
