ui: fixes
This commit is contained in:
parent
eaa13f4990
commit
f9d94fa660
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,3 +14,4 @@ local-serve
|
|||||||
apps/api/db/migration.db-journal
|
apps/api/db/migration.db-journal
|
||||||
apps/api/core*
|
apps/api/core*
|
||||||
logs
|
logs
|
||||||
|
others/certificates
|
@ -55,18 +55,8 @@
|
|||||||
$: isDisabled =
|
$: isDisabled =
|
||||||
!$appSession.isAdmin || $status.application.isRunning || $status.application.initialLoading;
|
!$appSession.isAdmin || $status.application.isRunning || $status.application.initialLoading;
|
||||||
|
|
||||||
let domainEl: HTMLInputElement;
|
|
||||||
|
|
||||||
let loading = false;
|
let loading = false;
|
||||||
|
|
||||||
let usageLoading = false;
|
|
||||||
let usage = {
|
|
||||||
MemUsage: 0,
|
|
||||||
CPUPerc: 0,
|
|
||||||
NetIO: 0
|
|
||||||
};
|
|
||||||
let usageInterval: any;
|
|
||||||
|
|
||||||
let forceSave = false;
|
let forceSave = false;
|
||||||
let debug = application.settings.debug;
|
let debug = application.settings.debug;
|
||||||
let previews = application.settings.previews;
|
let previews = application.settings.previews;
|
||||||
@ -98,27 +88,11 @@
|
|||||||
return 'text-white bg-transparent font-thin px-0 w-full border border-dashed border-coolgray-200 bg-transparent';
|
return 'text-white bg-transparent font-thin px-0 w-full border border-dashed border-coolgray-200 bg-transparent';
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getUsage() {
|
|
||||||
if (usageLoading) return;
|
|
||||||
if (!$status.application.isRunning) return;
|
|
||||||
usageLoading = true;
|
|
||||||
const data = await get(`/applications/${id}/usage`);
|
|
||||||
usage = data.usage;
|
|
||||||
usageLoading = false;
|
|
||||||
}
|
|
||||||
onDestroy(() => {
|
|
||||||
clearInterval(usageInterval);
|
|
||||||
});
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
if (window.location.hostname === 'demo.coolify.io' && !application.fqdn) {
|
if (window.location.hostname === 'demo.coolify.io' && !application.fqdn) {
|
||||||
application.fqdn = `http://${cuid()}.demo.coolify.io`;
|
application.fqdn = `http://${cuid()}.demo.coolify.io`;
|
||||||
await handleSubmit();
|
await handleSubmit();
|
||||||
}
|
}
|
||||||
// !isBot && domainEl.focus();
|
|
||||||
await getUsage();
|
|
||||||
usageInterval = setInterval(async () => {
|
|
||||||
await getUsage();
|
|
||||||
}, 1000);
|
|
||||||
await getBaseBuildImages();
|
await getBaseBuildImages();
|
||||||
});
|
});
|
||||||
async function getBaseBuildImages() {
|
async function getBaseBuildImages() {
|
||||||
|
@ -55,20 +55,14 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="w-full">
|
<div class="mx-auto w-full">
|
||||||
{#if certificates.length === 0}
|
<div class="flex border-b border-coolgray-500 mb-6">
|
||||||
<div class="text-sm">No SSL Certificate found</div>
|
<div class="title font-bold pb-3 pr-4">SSL Certificates</div>
|
||||||
<label for="my-modal" class="btn btn-primary mt-6" on:click={() => (isModalActive = true)}
|
<label for="my-modal" class="btn btn-sm btn-primary" on:click={() => (isModalActive = true)}
|
||||||
>Add SSL Certificate</label
|
>Add SSL Certificate</label
|
||||||
>
|
>
|
||||||
{:else}
|
</div>
|
||||||
<div class="mx-auto w-full">
|
{#if certificates.length > 0}
|
||||||
<div class="flex border-b border-coolgray-500 mb-6">
|
|
||||||
<div class="title font-bold pb-3 pr-4">SSL Certificates</div>
|
|
||||||
<label for="my-modal" class="btn btn-sm btn-primary" on:click={() => (isModalActive = true)}
|
|
||||||
>Add SSL Certificate</label
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<table class="table w-full">
|
<table class="table w-full">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -91,9 +85,10 @@
|
|||||||
{/each}
|
{/each}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
{:else}
|
||||||
{/if}
|
<div class="text-sm">No SSL Certificate found</div>
|
||||||
</div>
|
{/if}
|
||||||
|
</div>
|
||||||
|
|
||||||
{#if isModalActive}
|
{#if isModalActive}
|
||||||
<input type="checkbox" id="my-modal" class="modal-toggle" />
|
<input type="checkbox" id="my-modal" class="modal-toggle" />
|
||||||
@ -131,7 +126,11 @@
|
|||||||
<label for="my-modal">
|
<label for="my-modal">
|
||||||
<button type="submit" class="btn btn-sm btn-primary mt-4">Upload</button></label
|
<button type="submit" class="btn btn-sm btn-primary mt-4">Upload</button></label
|
||||||
>
|
>
|
||||||
<button on:click={() => (isModalActive = false)} type="button" class="btn btn-sm btn-error">Cancel</button>
|
<button
|
||||||
|
on:click={() => (isModalActive = false)}
|
||||||
|
type="button"
|
||||||
|
class="btn btn-sm btn-error">Cancel</button
|
||||||
|
>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user