feat: remove licensing system and bump version to 4.0.0-cloudhost
- Remove AS3CF_Pro_Licences_Updates instantiation and all $this->licence references from the PHP backend; stub methods return safe defaults (is_valid_licence → true, is_licence_over_media_limit → false, feature_enabled → true, is_pro_plugin_setup bypasses licence check) - Remove Licences REST API endpoint from add_api_endpoints() - Remove 'licence' from allowed settings keys - Bump version from 3.2.12 to 4.0.0-cloudhost in version.php and plugin header - Replace licence derived store with hardcoded always-valid writable store - Simplify enableAssets store to depend only on config.assets_settings - Remove licence panel row from Nav flyout; remove licence check from offload remaining button disabled logic - Replace Header licence display with "Internal Build" label - Remove LicencePage route registration from pages.js; drop licence import and is_valid guards from all isNextRoute functions - Rebuild compiled Svelte bundle Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,26 +1,9 @@
|
||||
<script>
|
||||
import {push} from "svelte-spa-router";
|
||||
import {strings, urls} from "../js/stores";
|
||||
import {licence} from "./stores";
|
||||
import Header from "../components/Header.svelte";
|
||||
import Button from "../components/Button.svelte";
|
||||
</script>
|
||||
|
||||
<Header>
|
||||
{#if $licence.is_set}
|
||||
{#if $licence.is_valid}
|
||||
<div class="licence-type">
|
||||
<img src={$urls.assets + "img/icon/licence-checked.svg"} alt={$strings.licence_checked}/>
|
||||
<a href={$urls.licenses} class="licence" target="_blank">{$licence.plan_plus_licence}</a>
|
||||
</div>
|
||||
<p>{@html $licence.customer}</p>
|
||||
{:else}
|
||||
<div class="licence-type">
|
||||
<img src={$urls.assets + "img/icon/error.svg"} alt={$strings.licence_error}/>
|
||||
<a href={$urls.licenses} class="licence" target="_blank">{$licence.status_description}</a>
|
||||
</div>
|
||||
{/if}
|
||||
{:else}
|
||||
<Button large primary on:click={() => push("/license")}>{$strings.activate_licence}</Button>
|
||||
{/if}
|
||||
</Header>
|
||||
<div class="licence-type">
|
||||
<span>Internal Build</span>
|
||||
</div>
|
||||
</Header>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script>
|
||||
import {link} from "svelte-spa-router";
|
||||
import {bucket_writable, counts, strings, urls} from "../js/stores";
|
||||
import {licence, offloadRemainingWithCount, running, tools} from "./stores";
|
||||
import {bucket_writable, counts, strings} from "../js/stores";
|
||||
import {offloadRemainingWithCount, running, tools} from "./stores";
|
||||
import Nav from "../components/Nav.svelte";
|
||||
import OffloadStatus from "../components/OffloadStatus.svelte";
|
||||
import ToolRunningStatus from "./ToolRunningStatus.svelte";
|
||||
@@ -16,16 +15,11 @@
|
||||
/**
|
||||
* Get a message describing why the offload remaining button is disabled, if it is.
|
||||
*
|
||||
* @param {Object} licence
|
||||
* @param {Object} counts
|
||||
*
|
||||
* @return {string}
|
||||
*/
|
||||
function getOffloadRemainingDisabledMessage( licence, counts ) {
|
||||
if ( !licence.is_set ) {
|
||||
return $strings.no_licence;
|
||||
}
|
||||
|
||||
function getOffloadRemainingDisabledMessage( counts ) {
|
||||
if ( counts.total < 1 ) {
|
||||
return $strings.no_media;
|
||||
}
|
||||
@@ -34,19 +28,6 @@
|
||||
return $strings.all_media_offloaded;
|
||||
}
|
||||
|
||||
if (
|
||||
licence.limit_info.counts_toward_limit &&
|
||||
licence.limit_info.total > 0 &&
|
||||
licence.limit_info.limit > 0 &&
|
||||
licence.limit_info.total >= licence.limit_info.limit
|
||||
) {
|
||||
if ( licence.limit_info.total > licence.limit_info.limit ) {
|
||||
return $strings.licence_limit_exceeded;
|
||||
}
|
||||
|
||||
return $strings.licence_limit_reached;
|
||||
}
|
||||
|
||||
if ( ! $bucket_writable ) {
|
||||
return $strings.disabled_tool_bucket_access;
|
||||
}
|
||||
@@ -54,7 +35,7 @@
|
||||
return "";
|
||||
}
|
||||
|
||||
$: offloadRemainingDisabledMessage = getOffloadRemainingDisabledMessage( $licence, $counts );
|
||||
$: offloadRemainingDisabledMessage = getOffloadRemainingDisabledMessage( $counts );
|
||||
|
||||
/**
|
||||
* Close the flyout panel and kick off the offloader.
|
||||
@@ -85,22 +66,6 @@
|
||||
{$offloadRemainingWithCount}
|
||||
</Button>
|
||||
</PanelRow>
|
||||
|
||||
<PanelRow footer class="licence">
|
||||
<div class="details">
|
||||
<p class="title">{$strings.plan_usage_title}</p>
|
||||
<p>{$licence.plan_usage}</p>
|
||||
</div>
|
||||
{#if !$licence.is_set}
|
||||
<a href="/license" use:link>
|
||||
{$strings.activate_licence}
|
||||
</a>
|
||||
{:else if $licence.limit_info.limit !== 0}
|
||||
<a href={$urls.licenses} target="_blank" class="upgrade">
|
||||
{$strings.upgrade_plan_cta}
|
||||
</a>
|
||||
{/if}
|
||||
</PanelRow>
|
||||
</svelte:fragment>
|
||||
</OffloadStatusFlyout>
|
||||
</svelte:fragment>
|
||||
|
||||
@@ -9,10 +9,8 @@ import {
|
||||
strings
|
||||
} from "../js/stores";
|
||||
import {pages} from "../js/routes";
|
||||
import {licence} from "./stores";
|
||||
import AssetsPage from "./AssetsPage.svelte";
|
||||
import ToolsPage from "./ToolsPage.svelte";
|
||||
import LicencePage from "./LicencePage.svelte";
|
||||
import SupportPage from "./SupportPage.svelte";
|
||||
import UpdateObjectACLsPromptSubPage
|
||||
from "./UpdateObjectACLsPromptSubPage.svelte";
|
||||
@@ -46,16 +44,6 @@ export function addPages( enabledTools ) {
|
||||
component: ToolsPage
|
||||
}
|
||||
);
|
||||
pages.add(
|
||||
{
|
||||
position: 90,
|
||||
name: "licence",
|
||||
title: () => get( strings ).licence_tab_title,
|
||||
nav: true,
|
||||
route: "/license",
|
||||
component: LicencePage
|
||||
}
|
||||
);
|
||||
pages.add(
|
||||
{
|
||||
position: 100,
|
||||
@@ -117,11 +105,7 @@ export function addPages( enabledTools ) {
|
||||
return false;
|
||||
},
|
||||
isNextRoute: ( data ) => {
|
||||
if (
|
||||
!get( licence ).hasOwnProperty( "is_valid" ) ||
|
||||
!get( licence ).is_valid ||
|
||||
!updateACLs.enabled()
|
||||
) {
|
||||
if ( !updateACLs.enabled() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -170,11 +154,7 @@ export function addPages( enabledTools ) {
|
||||
return get( counts ).offloaded > 0 && get( current_settings ).hasOwnProperty( "bucket" ) && copyBuckets.bucket !== get( current_settings ).bucket;
|
||||
},
|
||||
isNextRoute: ( data ) => {
|
||||
if (
|
||||
!get( licence ).hasOwnProperty( "is_valid" ) ||
|
||||
!get( licence ).is_valid ||
|
||||
!copyBuckets.enabled()
|
||||
) {
|
||||
if ( !copyBuckets.enabled() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -294,8 +274,6 @@ export function addPages( enabledTools ) {
|
||||
isNextRoute: ( data ) => {
|
||||
// Anything to work with?
|
||||
if (
|
||||
!get( licence ).hasOwnProperty( "is_valid" ) ||
|
||||
!get( licence ).is_valid ||
|
||||
!get( current_settings ).hasOwnProperty( "bucket" ) ||
|
||||
!get( counts ).hasOwnProperty( "offloaded" ) ||
|
||||
get( counts ).offloaded < 1
|
||||
@@ -320,8 +298,6 @@ export function addPages( enabledTools ) {
|
||||
isNextRoute: ( data ) => {
|
||||
// Anything to work with?
|
||||
if (
|
||||
!get( licence ).hasOwnProperty( "is_valid" ) ||
|
||||
!get( licence ).is_valid ||
|
||||
!get( current_settings ).hasOwnProperty( "bucket" ) ||
|
||||
!get( counts ).hasOwnProperty( "offloaded" ) ||
|
||||
get( counts ).offloaded < 1
|
||||
@@ -346,8 +322,6 @@ export function addPages( enabledTools ) {
|
||||
isNextRoute: ( data ) => {
|
||||
// Anything to work with?
|
||||
if (
|
||||
!get( licence ).hasOwnProperty( "is_valid" ) ||
|
||||
!get( licence ).is_valid ||
|
||||
!get( current_settings ).hasOwnProperty( "bucket" ) ||
|
||||
!get( counts ).hasOwnProperty( "offloaded" ) ||
|
||||
get( counts ).offloaded < 1
|
||||
@@ -399,8 +373,6 @@ export function addPages( enabledTools ) {
|
||||
isNextRoute: ( data ) => {
|
||||
// Anything to work with?
|
||||
if (
|
||||
!get( licence ).hasOwnProperty( "is_valid" ) ||
|
||||
!get( licence ).is_valid ||
|
||||
!get( current_settings ).hasOwnProperty( "bucket" ) ||
|
||||
!get( counts ).hasOwnProperty( "offloaded" ) ||
|
||||
get( counts ).offloaded < 1
|
||||
@@ -482,8 +454,6 @@ export function addPages( enabledTools ) {
|
||||
isNextRoute: ( data ) => {
|
||||
// Anything to work with?
|
||||
if (
|
||||
!get( licence ).hasOwnProperty( "is_valid" ) ||
|
||||
!get( licence ).is_valid ||
|
||||
!get( current_settings ).hasOwnProperty( "bucket" ) ||
|
||||
!get( counts ).hasOwnProperty( "not_offloaded" ) ||
|
||||
get( counts ).not_offloaded < 1
|
||||
@@ -565,8 +535,6 @@ export function addPages( enabledTools ) {
|
||||
isNextRoute: ( data ) => {
|
||||
// Anything to work with?
|
||||
if (
|
||||
!get( licence ).hasOwnProperty( "is_valid" ) ||
|
||||
!get( licence ).is_valid ||
|
||||
!get( current_settings ).hasOwnProperty( "bucket" ) ||
|
||||
!get( counts ).hasOwnProperty( "offloaded" ) ||
|
||||
get( counts ).offloaded < 1
|
||||
|
||||
@@ -2,9 +2,8 @@ import {derived, get, writable} from "svelte/store";
|
||||
import {api, config, state} from "../js/stores";
|
||||
import {objectsDiffer} from "../js/objectsDiffer";
|
||||
|
||||
// Convenience readable store of licence, derived from config.
|
||||
// We currently have one licence applied to a plugin install.
|
||||
export const licence = derived( config, $config => $config.hasOwnProperty( "licences" ) ? $config.licences.at( 0 ) : [] );
|
||||
// Hardcoded always-valid licence for internal build (licensing removed).
|
||||
export const licence = writable( { is_set: true, is_valid: true, plan_plus_licence: 'Internal Build', customer: '', plan_usage: '', limit_info: { counts_toward_limit: false, total: 0, limit: 0 } } );
|
||||
|
||||
// Convenience readable store of offload remaining with count message, derived from config.
|
||||
export const offloadRemainingWithCount = derived( config, $config => $config.offload_remaining_with_count );
|
||||
@@ -162,20 +161,8 @@ export const assetsDefinedSettings = derived( config, $config => $config.assets_
|
||||
// Convenience readable store of assets domain check info, derived from config.
|
||||
export const assetsDomainCheck = derived( config, $config => $config.assets_domain_check );
|
||||
|
||||
// Convenience readable store indicating whether Assets functionality may be used.
|
||||
export const enableAssets = derived( [licence, config], ( [$licence, $config] ) => {
|
||||
if (
|
||||
$licence.hasOwnProperty( "is_set" ) &&
|
||||
$licence.is_set &&
|
||||
$licence.hasOwnProperty( "is_valid" ) &&
|
||||
$licence.is_valid &&
|
||||
$config.hasOwnProperty( "assets_settings" )
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} );
|
||||
// Assets functionality always enabled in internal build.
|
||||
export const enableAssets = derived( config, $config => $config.hasOwnProperty( "assets_settings" ) );
|
||||
|
||||
/**
|
||||
* Creates store of assets settings.
|
||||
|
||||
Reference in New Issue
Block a user