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
77 lines
2.0 KiB
Svelte
77 lines
2.0 KiB
Svelte
<script>
|
|
import {fade, slide} from "svelte/transition";
|
|
import {api, strings} from "../js/stores";
|
|
import Notification from "../components/Notification.svelte";
|
|
|
|
export let notification;
|
|
|
|
let expanded = true;
|
|
|
|
/**
|
|
* Handles Dismiss All Errors for item click.
|
|
*
|
|
* @param {string} tool_key
|
|
* @param {Object} item
|
|
*
|
|
* @return {Promise<void>}
|
|
*/
|
|
async function dismissAll( tool_key, item ) {
|
|
await api.delete( "tools", {
|
|
id: tool_key,
|
|
blog_id: item.blog_id,
|
|
source_type: item.source_type,
|
|
source_id: item.source_id
|
|
} );
|
|
}
|
|
|
|
/**
|
|
* Handles Dismiss Individual Error for item click.
|
|
*
|
|
* @param {string} tool_key
|
|
* @param {Object} item
|
|
* @param {number} index
|
|
*
|
|
* @return {Promise<void>}
|
|
*/
|
|
async function dismissError( tool_key, item, index ) {
|
|
await api.delete( "tools", {
|
|
id: tool_key,
|
|
blog_id: item.blog_id,
|
|
source_type: item.source_type,
|
|
source_id: item.source_id,
|
|
errors: index
|
|
} );
|
|
}
|
|
</script>
|
|
|
|
{#if notification.hasOwnProperty( "class" ) && notification.class === "tool-error" && notification.hasOwnProperty( "errors" )}
|
|
<Notification notification={notification} expandable bind:expanded>
|
|
<svelte:fragment slot="details">
|
|
{#if expanded}
|
|
<div class="details" transition:slide>
|
|
{#each notification.errors.details as item, index}
|
|
<div class="item" transition:fade>
|
|
<div class="summary">
|
|
<div class="title">
|
|
{(index + 1) + ". " + item.source_type_name}
|
|
<a href={item.edit_url.url}>#{item.source_id}</a>
|
|
</div>
|
|
<button class="dismiss" on:click|preventDefault={() => dismissAll(notification.errors.tool_key, item)}>{$strings.dismiss}</button>
|
|
</div>
|
|
<ul class="detail">
|
|
{#each item.messages as message, index}
|
|
<li>{@html message}</li>
|
|
{/each}
|
|
</ul>
|
|
</div>
|
|
{/each}
|
|
</div>
|
|
{/if}
|
|
</svelte:fragment>
|
|
</Notification>
|
|
{:else}
|
|
<Notification notification={notification}>
|
|
<slot/>
|
|
</Notification>
|
|
{/if}
|