feat: add S3-compatible storage provider (MinIO, Ceph, R2, etc.)
Adds a new 'S3-Compatible Storage' provider that works with any
S3-API-compatible object storage service, including MinIO, Ceph,
Cloudflare R2, Backblaze B2, and others.
Changes:
- New provider class: classes/providers/storage/s3-compatible-provider.php
- Provider key: s3compatible
- Reads user-configured endpoint URL from settings
- Uses path-style URL access (required by most S3-compatible services)
- Supports credentials via AS3CF_S3COMPAT_ACCESS_KEY_ID /
AS3CF_S3COMPAT_SECRET_ACCESS_KEY wp-config.php constants
- Disables AWS-specific features (Block Public Access, Object Ownership)
- New provider SVG icons (s3compatible.svg, -link.svg, -round.svg)
- Registered provider in main plugin class with endpoint setting support
- Updated StorageProviderSubPage to show endpoint URL input for S3-compatible
- Built pro settings bundle with rollup (Svelte 4.2.19)
- Added package.json and updated rollup.config.mjs for pro-only builds
2026-03-03 12:30:18 +01:00
|
|
|
<script>
|
2026-03-03 12:57:35 +01:00
|
|
|
import {bucket_writable, counts, strings} from "../js/stores";
|
|
|
|
|
import {offloadRemainingWithCount, running, tools} from "./stores";
|
feat: add S3-compatible storage provider (MinIO, Ceph, R2, etc.)
Adds a new 'S3-Compatible Storage' provider that works with any
S3-API-compatible object storage service, including MinIO, Ceph,
Cloudflare R2, Backblaze B2, and others.
Changes:
- New provider class: classes/providers/storage/s3-compatible-provider.php
- Provider key: s3compatible
- Reads user-configured endpoint URL from settings
- Uses path-style URL access (required by most S3-compatible services)
- Supports credentials via AS3CF_S3COMPAT_ACCESS_KEY_ID /
AS3CF_S3COMPAT_SECRET_ACCESS_KEY wp-config.php constants
- Disables AWS-specific features (Block Public Access, Object Ownership)
- New provider SVG icons (s3compatible.svg, -link.svg, -round.svg)
- Registered provider in main plugin class with endpoint setting support
- Updated StorageProviderSubPage to show endpoint URL input for S3-compatible
- Built pro settings bundle with rollup (Svelte 4.2.19)
- Added package.json and updated rollup.config.mjs for pro-only builds
2026-03-03 12:30:18 +01:00
|
|
|
import Nav from "../components/Nav.svelte";
|
|
|
|
|
import OffloadStatus from "../components/OffloadStatus.svelte";
|
|
|
|
|
import ToolRunningStatus from "./ToolRunningStatus.svelte";
|
|
|
|
|
import OffloadStatusFlyout from "../components/OffloadStatusFlyout.svelte";
|
|
|
|
|
import PanelRow from "../components/PanelRow.svelte";
|
|
|
|
|
import Button from "../components/Button.svelte";
|
|
|
|
|
|
|
|
|
|
let flyoutButton;
|
|
|
|
|
let expanded = false;
|
|
|
|
|
let hasFocus = false;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get a message describing why the offload remaining button is disabled, if it is.
|
|
|
|
|
*
|
|
|
|
|
* @param {Object} counts
|
|
|
|
|
*
|
|
|
|
|
* @return {string}
|
|
|
|
|
*/
|
2026-03-03 12:57:35 +01:00
|
|
|
function getOffloadRemainingDisabledMessage( counts ) {
|
feat: add S3-compatible storage provider (MinIO, Ceph, R2, etc.)
Adds a new 'S3-Compatible Storage' provider that works with any
S3-API-compatible object storage service, including MinIO, Ceph,
Cloudflare R2, Backblaze B2, and others.
Changes:
- New provider class: classes/providers/storage/s3-compatible-provider.php
- Provider key: s3compatible
- Reads user-configured endpoint URL from settings
- Uses path-style URL access (required by most S3-compatible services)
- Supports credentials via AS3CF_S3COMPAT_ACCESS_KEY_ID /
AS3CF_S3COMPAT_SECRET_ACCESS_KEY wp-config.php constants
- Disables AWS-specific features (Block Public Access, Object Ownership)
- New provider SVG icons (s3compatible.svg, -link.svg, -round.svg)
- Registered provider in main plugin class with endpoint setting support
- Updated StorageProviderSubPage to show endpoint URL input for S3-compatible
- Built pro settings bundle with rollup (Svelte 4.2.19)
- Added package.json and updated rollup.config.mjs for pro-only builds
2026-03-03 12:30:18 +01:00
|
|
|
if ( counts.total < 1 ) {
|
|
|
|
|
return $strings.no_media;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( counts.not_offloaded < 1 ) {
|
|
|
|
|
return $strings.all_media_offloaded;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( ! $bucket_writable ) {
|
|
|
|
|
return $strings.disabled_tool_bucket_access;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-03 12:57:35 +01:00
|
|
|
$: offloadRemainingDisabledMessage = getOffloadRemainingDisabledMessage( $counts );
|
feat: add S3-compatible storage provider (MinIO, Ceph, R2, etc.)
Adds a new 'S3-Compatible Storage' provider that works with any
S3-API-compatible object storage service, including MinIO, Ceph,
Cloudflare R2, Backblaze B2, and others.
Changes:
- New provider class: classes/providers/storage/s3-compatible-provider.php
- Provider key: s3compatible
- Reads user-configured endpoint URL from settings
- Uses path-style URL access (required by most S3-compatible services)
- Supports credentials via AS3CF_S3COMPAT_ACCESS_KEY_ID /
AS3CF_S3COMPAT_SECRET_ACCESS_KEY wp-config.php constants
- Disables AWS-specific features (Block Public Access, Object Ownership)
- New provider SVG icons (s3compatible.svg, -link.svg, -round.svg)
- Registered provider in main plugin class with endpoint setting support
- Updated StorageProviderSubPage to show endpoint URL input for S3-compatible
- Built pro settings bundle with rollup (Svelte 4.2.19)
- Added package.json and updated rollup.config.mjs for pro-only builds
2026-03-03 12:30:18 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Close the flyout panel and kick off the offloader.
|
|
|
|
|
*
|
|
|
|
|
* The panel is closed so that it does not pop back open without focus on completion.
|
|
|
|
|
*/
|
|
|
|
|
function startOffload() {
|
|
|
|
|
expanded = false;
|
|
|
|
|
tools.start( $tools.uploader );
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<Nav>
|
|
|
|
|
{#if !!$running}
|
|
|
|
|
<ToolRunningStatus/>
|
|
|
|
|
{:else}
|
|
|
|
|
<OffloadStatus bind:flyoutButton bind:expanded bind:hasFocus>
|
|
|
|
|
<svelte:fragment slot="flyout">
|
|
|
|
|
<OffloadStatusFlyout bind:expanded bind:hasFocus bind:buttonRef={flyoutButton}>
|
|
|
|
|
<svelte:fragment slot="footer">
|
|
|
|
|
<PanelRow footer class="offload-remaining">
|
|
|
|
|
<Button
|
|
|
|
|
primary
|
|
|
|
|
disabled={offloadRemainingDisabledMessage}
|
|
|
|
|
title={offloadRemainingDisabledMessage}
|
|
|
|
|
on:click={startOffload}
|
|
|
|
|
>
|
|
|
|
|
{$offloadRemainingWithCount}
|
|
|
|
|
</Button>
|
|
|
|
|
</PanelRow>
|
|
|
|
|
</svelte:fragment>
|
|
|
|
|
</OffloadStatusFlyout>
|
|
|
|
|
</svelte:fragment>
|
|
|
|
|
</OffloadStatus>
|
|
|
|
|
{/if}
|
|
|
|
|
</Nav>
|