Bugfixes:
- Loading screen on Github reconfiguration. - Fix Github App name in case on space is in the name.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "coolify",
|
"name": "coolify",
|
||||||
"description": "An open-source, hassle-free, self-hostable Heroku & Netlify alternative.",
|
"description": "An open-source, hassle-free, self-hostable Heroku & Netlify alternative.",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "standard",
|
"lint": "standard",
|
||||||
|
@@ -11,11 +11,22 @@
|
|||||||
|
|
||||||
let loading = {
|
let loading = {
|
||||||
branches: false,
|
branches: false,
|
||||||
|
github: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
let branches = [];
|
let branches = [];
|
||||||
let repositories = [];
|
let repositories = [];
|
||||||
|
|
||||||
|
function dashify(str, options) {
|
||||||
|
if (typeof str !== "string") return str
|
||||||
|
return str
|
||||||
|
.trim()
|
||||||
|
.replace(/\W/g, m => (/[À-ž]/.test(m) ? m : "-"))
|
||||||
|
.replace(/^-+|-+$/g, "")
|
||||||
|
.replace(/-{2,}/g, m => (options && options.condense ? "-" : m))
|
||||||
|
.toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
async function loadBranches() {
|
async function loadBranches() {
|
||||||
loading.branches = true;
|
loading.branches = true;
|
||||||
const selectedRepository = repositories.find(
|
const selectedRepository = repositories.find(
|
||||||
@@ -62,14 +73,15 @@
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
loading.github = false;
|
||||||
}
|
}
|
||||||
function modifyGithubAppConfig() {
|
function modifyGithubAppConfig() {
|
||||||
const left = screen.width / 2 - 1020 / 2;
|
const left = screen.width / 2 - 1020 / 2;
|
||||||
const top = screen.height / 2 - 618 / 2;
|
const top = screen.height / 2 - 618 / 2;
|
||||||
const newWindow = open(
|
const newWindow = open(
|
||||||
`https://github.com/apps/${
|
`https://github.com/apps/${dashify(
|
||||||
import.meta.env.VITE_GITHUB_APP_NAME
|
import.meta.env.VITE_GITHUB_APP_NAME,
|
||||||
}/installations/new`,
|
)}/installations/new`,
|
||||||
"Install App",
|
"Install App",
|
||||||
"resizable=1, scrollbars=1, fullscreen=0, height=1000, width=1020,top=" +
|
"resizable=1, scrollbars=1, fullscreen=0, height=1000, width=1020,top=" +
|
||||||
top +
|
top +
|
||||||
@@ -80,6 +92,7 @@
|
|||||||
const timer = setInterval(async () => {
|
const timer = setInterval(async () => {
|
||||||
if (newWindow.closed) {
|
if (newWindow.closed) {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
|
loading.github = true;
|
||||||
if (!$isActive("/application/new")) {
|
if (!$isActive("/application/new")) {
|
||||||
try {
|
try {
|
||||||
const config = await $fetch(`/api/v1/config`, {
|
const config = await $fetch(`/api/v1/config`, {
|
||||||
@@ -111,6 +124,9 @@
|
|||||||
{#await loadGithub()}
|
{#await loadGithub()}
|
||||||
<Loading />
|
<Loading />
|
||||||
{:then}
|
{:then}
|
||||||
|
{#if loading.github}
|
||||||
|
<Loading />
|
||||||
|
{:else}
|
||||||
<div
|
<div
|
||||||
class="text-center space-y-2 max-w-4xl mx-auto px-6"
|
class="text-center space-y-2 max-w-4xl mx-auto px-6"
|
||||||
in:fade="{{ duration: 100 }}"
|
in:fade="{{ duration: 100 }}"
|
||||||
@@ -128,6 +144,7 @@
|
|||||||
<Tabs />
|
<Tabs />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
{/await}
|
{/await}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<button
|
<button
|
||||||
class="button col-span-1 ml-2 bg-warmGray-800 hover:bg-warmGray-700 text-white"
|
class="button col-span-1 ml-2 bg-warmGray-800 hover:bg-warmGray-700 text-white py-2"
|
||||||
on:click="{modifyGithubAppConfig}">Add repositories on Github</button
|
on:click="{modifyGithubAppConfig}">Add repositories on Github</button
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
|
Reference in New Issue
Block a user