add apache htaccess
This commit is contained in:
parent
f0ca5baf15
commit
0ed79810da
|
@ -0,0 +1,8 @@
|
||||||
|
RewriteEngine On
|
||||||
|
|
||||||
|
RewriteCond %{HTTPS} off
|
||||||
|
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
|
||||||
|
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule . index.html [L]
|
|
@ -3,13 +3,12 @@ import Input from './Common/Input.svelte';
|
||||||
import InputWrappper from './Common/InputWrappper.svelte';
|
import InputWrappper from './Common/InputWrappper.svelte';
|
||||||
import Loading from './Common/Loading.svelte';
|
import Loading from './Common/Loading.svelte';
|
||||||
import SOffline from './Common/SOffline.svelte';
|
import SOffline from './Common/SOffline.svelte';
|
||||||
import Link from './Common/Link.svelte';
|
|
||||||
import Sortable from './Common/Sortable.svelte';
|
import Sortable from './Common/Sortable.svelte';
|
||||||
import Radio from './Common/Radio.svelte';
|
import Radio from './Common/Radio.svelte';
|
||||||
import Checkbox from './Common/Checkbox.svelte';
|
import Checkbox from './Common/Checkbox.svelte';
|
||||||
import Switch from './Common/Switch.svelte';
|
import Switch from './Common/Switch.svelte';
|
||||||
import Select from './Common/Select.svelte';
|
import Select from './Common/Select.svelte';
|
||||||
|
|
||||||
import { Body, Html, PwaInstaller } from './Common/Meta';
|
export { Body, Html, PwaInstaller } from './Common/Meta';
|
||||||
|
|
||||||
export { Button, Input, InputWrappper, Loading, SOffline, Body, Html, PwaInstaller, Link, Sortable, Switch, Radio, Checkbox, Select };
|
export { Button, Input, InputWrappper, Loading, SOffline, Sortable, Switch, Radio, Checkbox, Select };
|
||||||
|
|
|
@ -1,13 +1,32 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let href: string = null
|
import { link } from '$lib/router'
|
||||||
|
|
||||||
|
export let href: string | null = null
|
||||||
|
|
||||||
let className = ''
|
let className = ''
|
||||||
export { className as class }
|
export { className as class }
|
||||||
|
|
||||||
|
const isValidHttpUrl = (string) => {
|
||||||
|
let url: URL
|
||||||
|
try {
|
||||||
|
url = new URL(string)
|
||||||
|
} catch (_) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return url.protocol === 'http:' || url.protocol === 'https:'
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if href !== null}
|
{#if href}
|
||||||
<a {href} class={className}>
|
{#if isValidHttpUrl(href)}
|
||||||
<slot />
|
<a {href} class={className}>
|
||||||
</a>
|
<slot />
|
||||||
|
</a>
|
||||||
|
{:else}
|
||||||
|
<a {href} class={className} use:link>
|
||||||
|
<slot />
|
||||||
|
</a>
|
||||||
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
<button class={className} on:click>
|
<button class={className} on:click>
|
||||||
<slot />
|
<slot />
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
<script lang="ts">
|
|
||||||
import { link } from '$lib/router'
|
|
||||||
|
|
||||||
export let href: string | null = null
|
|
||||||
|
|
||||||
let className = ''
|
|
||||||
export { className as class }
|
|
||||||
|
|
||||||
const isValidHttpUrl = (string) => {
|
|
||||||
let url: URL
|
|
||||||
try {
|
|
||||||
url = new URL(string)
|
|
||||||
} catch (_) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return url.protocol === 'http:' || url.protocol === 'https:'
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{#if href}
|
|
||||||
{#if isValidHttpUrl(href)}
|
|
||||||
<a {href} class={className}>
|
|
||||||
<slot />
|
|
||||||
</a>
|
|
||||||
{:else}
|
|
||||||
<a {href} class={className} use:link>
|
|
||||||
<slot />
|
|
||||||
</a>
|
|
||||||
{/if}
|
|
||||||
{:else}
|
|
||||||
<button class={className} on:click>
|
|
||||||
<slot />
|
|
||||||
</button>
|
|
||||||
{/if}
|
|
Loading…
Reference in New Issue