Fix error popup when canceling a sharing action
Fix navigator not reloading when saving an edited file Remove dead links Remove references to Patreon
This commit is contained in:
@@ -93,15 +93,11 @@ const share = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const nav_share = async (url: string) => {
|
const nav_share = async (url: string) => {
|
||||||
try {
|
await navigator.share({
|
||||||
await navigator.share({
|
title: base.name,
|
||||||
title: base.name,
|
text: "I would like to share '" + base.name + "' with you",
|
||||||
text: "I would like to share '" + base.name + "' with you",
|
url: url,
|
||||||
url: url,
|
})
|
||||||
})
|
|
||||||
} catch(err) {
|
|
||||||
alert("navigator share not available: "+ err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { branding_from_props } from "./Branding";
|
|||||||
import FileOptions from "./FileOptions.svelte";
|
import FileOptions from "./FileOptions.svelte";
|
||||||
import SharingOptions from "./SharingOptions.svelte";
|
import SharingOptions from "./SharingOptions.svelte";
|
||||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||||
import { loading_finish, loading_start } from "lib/Loading";
|
import { loading_run } from "lib/Loading";
|
||||||
|
|
||||||
let file: FSNode = $state({} as FSNode)
|
let file: FSNode = $state({} as FSNode)
|
||||||
let options: NodeOptions = $state({} as NodeOptions)
|
let options: NodeOptions = $state({} as NodeOptions)
|
||||||
@@ -72,23 +72,22 @@ const save = async (e: SubmitEvent) => {
|
|||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
console.debug("Saving file", file.path)
|
console.debug("Saving file", file.path)
|
||||||
|
|
||||||
let new_file: FSNode
|
|
||||||
try {
|
try {
|
||||||
loading_start()
|
await loading_run(async () => {
|
||||||
options.branding_enabled = JSON.stringify(branding_enabled)
|
options.branding_enabled = JSON.stringify(branding_enabled)
|
||||||
|
|
||||||
new_file = await fs_update(file.path, options)
|
await fs_update(file.path, options)
|
||||||
|
|
||||||
if (new_name !== file.name) {
|
// If the file name has changed we need to call fs_rename. This is a
|
||||||
let parent = file.path.slice(0, -file.name.length)
|
// separate operation because a rename also moves the file
|
||||||
console.log("Moving", file.path, "to", parent+new_name)
|
if (new_name !== file.name) {
|
||||||
|
let parent = file.path.slice(0, -file.name.length)
|
||||||
|
console.log("Moving", file.path, "to", parent+new_name)
|
||||||
|
|
||||||
await fs_rename(file.path, parent+new_name)
|
await fs_rename(file.path, parent+new_name)
|
||||||
file.path = parent+new_name
|
file.path = parent+new_name
|
||||||
|
}
|
||||||
new_file.name = new_name
|
})
|
||||||
new_file.path = file.path
|
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.message) {
|
if (err.message) {
|
||||||
alert(err.message)
|
alert(err.message)
|
||||||
@@ -97,11 +96,11 @@ const save = async (e: SubmitEvent) => {
|
|||||||
alert(err)
|
alert(err)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
} finally {
|
|
||||||
loading_finish()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (open_after_edit) {
|
// The navigate call will be debounced if the new path is equal to the
|
||||||
|
// current path. So we call reload() instead if that's the case
|
||||||
|
if (open_after_edit && $nav.base.path !== file.path) {
|
||||||
nav.navigate(file.path, false)
|
nav.navigate(file.path, false)
|
||||||
} else {
|
} else {
|
||||||
nav.reload()
|
nav.reload()
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ export const fs_get_node = async (path: string) => {
|
|||||||
// - shared, boolean. If true the node will receive a public ID
|
// - shared, boolean. If true the node will receive a public ID
|
||||||
//
|
//
|
||||||
// Returns the modified filesystem node object
|
// Returns the modified filesystem node object
|
||||||
export const fs_update = async (path: string, opts: NodeOptions) => {
|
export const fs_update = async (path: string, opts: NodeOptions): Promise<FSNode> => {
|
||||||
const form = new FormData()
|
const form = new FormData()
|
||||||
form.append("action", "update")
|
form.append("action", "update")
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ let frac = $derived(used / total)
|
|||||||
{#if $user !== null && $user.monthly_transfer_cap > 0}
|
{#if $user !== null && $user.monthly_transfer_cap > 0}
|
||||||
<p>
|
<p>
|
||||||
You have a billshock limit configured. <a
|
You have a billshock limit configured. <a
|
||||||
href="/user/sharing/bandwidth">increase or disable the limit</a> to
|
href="/user/sharing">increase or disable the limit</a> to
|
||||||
continue sharing files.
|
continue sharing files.
|
||||||
</p>
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -59,7 +59,7 @@ let frac = $derived(used / total)
|
|||||||
{#if $user !== null && $user.monthly_transfer_cap > 0}
|
{#if $user !== null && $user.monthly_transfer_cap > 0}
|
||||||
<p>
|
<p>
|
||||||
You have a billshock limit configured. <a
|
You have a billshock limit configured. <a
|
||||||
href="/user/sharing/bandwidth">increase or disable the limit</a> to
|
href="/user/sharing">increase or disable the limit</a> to
|
||||||
continue sharing files.
|
continue sharing files.
|
||||||
</p>
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { user } from "lib/UserStore";
|
|||||||
import { put_user } from "lib/NovaAPI";
|
import { put_user } from "lib/NovaAPI";
|
||||||
|
|
||||||
let subscription: string = $state($user === null ? "" : $user.subscription.id)
|
let subscription: string = $state($user === null ? "" : $user.subscription.id)
|
||||||
let subscription_type: string = $state($user === null ? "" : $user.subscription.type)
|
|
||||||
let success_message: SuccessMessage = $state()
|
let success_message: SuccessMessage = $state()
|
||||||
|
|
||||||
const update = async (plan: string) => {
|
const update = async (plan: string) => {
|
||||||
@@ -71,13 +70,6 @@ const update = async (plan: string) => {
|
|||||||
<p>
|
<p>
|
||||||
Here you can switch between different subscription plans.
|
Here you can switch between different subscription plans.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
The Patreon subscription is managed by Patreon. Nova cannot modify
|
|
||||||
or end your subsciption. If you would like to cancel your Patreon plan
|
|
||||||
you can do that <a
|
|
||||||
href="https://www.patreon.com/settings/memberships/nova"
|
|
||||||
target="_blank">on Patreon</a>.
|
|
||||||
</p>
|
|
||||||
<p>
|
<p>
|
||||||
The Prepaid subscription is charged daily based on usage. When you reach
|
The Prepaid subscription is charged daily based on usage. When you reach
|
||||||
negative balance the subscription will automatically end. You need at
|
negative balance the subscription will automatically end. You need at
|
||||||
@@ -91,41 +83,6 @@ const update = async (plan: string) => {
|
|||||||
<SuccessMessage bind:this={success_message}/>
|
<SuccessMessage bind:this={success_message}/>
|
||||||
|
|
||||||
<div class="feat_table">
|
<div class="feat_table">
|
||||||
<div>
|
|
||||||
<div class="feat_label" class:feat_highlight={subscription_type === "patreon"}>
|
|
||||||
Patreon<br/>
|
|
||||||
{#if subscription_type === "patreon"}
|
|
||||||
Currently active<br/>
|
|
||||||
<a class="button" href="https://www.patreon.com/settings/memberships/nova" target="_blank">
|
|
||||||
<i class="icon">settings</i>
|
|
||||||
Manage
|
|
||||||
</a>
|
|
||||||
{:else}
|
|
||||||
<a class="button" href="/api/patreon_auth/start">
|
|
||||||
<i class="icon">add_link</i>
|
|
||||||
Link Patreon
|
|
||||||
</a>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
<div class="feat_normal round_tr" class:feat_highlight={subscription_type === "patreon"}>
|
|
||||||
<p>
|
|
||||||
This subscription is managed by Patreon. You will need to <a
|
|
||||||
href="https://www.patreon.com/nova/membership"
|
|
||||||
target="_blank">purchase a plan on Patreon</a> before you
|
|
||||||
can activate this subscription. After your purchase you can
|
|
||||||
click the "Link Patreon" button and your account will be
|
|
||||||
upgraded.
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>€4 per month</li>
|
|
||||||
<li>No storage limit for file sharing</li>
|
|
||||||
<li>4 TB transfer limit (higher plans available)</li>
|
|
||||||
<li>Access to the <a href="/filesystem">filesystem</a></li>
|
|
||||||
<li>2 TB filesytem storage limit (higher plans available)</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class="feat_label" class:feat_highlight={subscription === "prepaid"}>
|
<div class="feat_label" class:feat_highlight={subscription === "prepaid"}>
|
||||||
Prepaid<br/>
|
Prepaid<br/>
|
||||||
@@ -141,11 +98,7 @@ const update = async (plan: string) => {
|
|||||||
<div class="feat_normal round_tr" class:feat_highlight={subscription === "prepaid"}>
|
<div class="feat_normal round_tr" class:feat_highlight={subscription === "prepaid"}>
|
||||||
<p>
|
<p>
|
||||||
You will need a positive account balance to activate this
|
You will need a positive account balance to activate this
|
||||||
plan. If you currently have a Patreon subscription active,
|
plan. The plan deactivates when your credit runs out.
|
||||||
then enabling prepaid will not cancel that subscription. You
|
|
||||||
can end your subscription <a
|
|
||||||
href="https://www.patreon.com/settings/memberships/nova"
|
|
||||||
target="_blank">on Patreon.com</a>.
|
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
@@ -157,12 +110,12 @@ const update = async (plan: string) => {
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
€1 per TB for data transfer (with <a
|
€1 per TB for data transfer (with <a
|
||||||
href="/user/sharing/bandwidth">hotlinking</a>
|
href="/user/sharing">hotlinking</a>
|
||||||
enabled)
|
enabled)
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
File <a href="/user/sharing/embedding">embedding
|
File <a href="/user/sharing">embedding control</a>
|
||||||
control</a> options
|
options
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -177,8 +130,8 @@ const update = async (plan: string) => {
|
|||||||
</div>
|
</div>
|
||||||
<div class="feat_normal round_br" class:feat_highlight={subscription === ""}>
|
<div class="feat_normal round_br" class:feat_highlight={subscription === ""}>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Standard free plan, files expire after 120 days.</li>
|
<li>Storage limit: 50 GB</li>
|
||||||
<li>Download limit of 6 GB per day</li>
|
<li>Download limit: 50 GB per 30 days (sliding window)</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -58,6 +58,6 @@ onMount(async () => {
|
|||||||
<br/><br/>
|
<br/><br/>
|
||||||
|
|
||||||
Egress used (30 days):
|
Egress used (30 days):
|
||||||
(<a href="/user/sharing/bandwidth">set custom limit</a>)
|
(<a href="/user/sharing">set custom limit</a>)
|
||||||
<HotlinkProgressBar used={transfer_used} total={transfer_cap}></HotlinkProgressBar>
|
<HotlinkProgressBar used={transfer_used} total={transfer_cap}></HotlinkProgressBar>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user