fixes
This commit is contained in:
@@ -62,10 +62,10 @@ export function checkIfDeploymentEnabledApplications(isAdmin: boolean, applicati
|
||||
(application.buildPack === 'compose') ||
|
||||
(application.fqdn || application.settings.isBot) &&
|
||||
((application.gitSource &&
|
||||
application.repository &&
|
||||
application.buildPack) || application.simpleDockerfile) &&
|
||||
application.repository &&
|
||||
application.buildPack) || application.simpleDockerfile) &&
|
||||
application.destinationDocker
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
export function checkIfDeploymentEnabledServices(isAdmin: boolean, service: any) {
|
||||
@@ -82,6 +82,7 @@ export const status: Writable<any> = writable({
|
||||
statuses: [],
|
||||
overallStatus: 'stopped',
|
||||
loading: false,
|
||||
restarting: false,
|
||||
initialLoading: true
|
||||
},
|
||||
service: {
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
}
|
||||
}
|
||||
async function getStatus() {
|
||||
if ($status.application.loading && stopping) return;
|
||||
if (($status.application.loading && stopping) || $status.application.restarting === true) return;
|
||||
$status.application.loading = true;
|
||||
const data = await get(`/applications/${id}/status`);
|
||||
|
||||
@@ -185,26 +185,6 @@
|
||||
if ($status.application.statuses.length === 0) {
|
||||
$status.application.overallStatus = 'stopped';
|
||||
} else {
|
||||
// if ($status.application.statuses.length !== numberOfApplications) {
|
||||
// $status.application.overallStatus = 'degraded';
|
||||
// } else {
|
||||
// for (const oneStatus of $status.application.statuses) {
|
||||
// if (oneStatus.status.isExited || oneStatus.status.isRestarting) {
|
||||
// $status.application.overallStatus = 'degraded';
|
||||
// break;
|
||||
// }
|
||||
// if (oneStatus.status.isRunning) {
|
||||
// $status.application.overallStatus = 'healthy';
|
||||
// }
|
||||
// if (
|
||||
// !oneStatus.status.isExited &&
|
||||
// !oneStatus.status.isRestarting &&
|
||||
// !oneStatus.status.isRunning
|
||||
// ) {
|
||||
// $status.application.overallStatus = 'stopped';
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
for (const oneStatus of $status.application.statuses) {
|
||||
if (oneStatus.status.isExited || oneStatus.status.isRestarting) {
|
||||
$status.application.overallStatus = 'degraded';
|
||||
|
||||
@@ -53,13 +53,11 @@
|
||||
import { saveForm } from './utils';
|
||||
|
||||
const { id } = $page.params;
|
||||
|
||||
$: isDisabled =
|
||||
!$appSession.isAdmin ||
|
||||
$status.application.overallStatus === 'degraded' ||
|
||||
$status.application.overallStatus === 'healthy' ||
|
||||
$status.application.initialLoading;
|
||||
|
||||
$isDeploymentEnabled = checkIfDeploymentEnabledApplications($appSession.isAdmin, application);
|
||||
let statues: any = {};
|
||||
let loading = {
|
||||
@@ -274,12 +272,13 @@
|
||||
$isDeploymentEnabled = checkIfDeploymentEnabledApplications($appSession.isAdmin, application);
|
||||
|
||||
forceSave = false;
|
||||
|
||||
toast &&
|
||||
if (toast) {
|
||||
addToast({
|
||||
message: 'Configuration saved.',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
|
||||
if (application.fqdn && application.fqdn.startsWith('https')) {
|
||||
isHttps = true;
|
||||
} else {
|
||||
@@ -514,7 +513,6 @@
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 items-center">
|
||||
<label for="repository">Git commit</label>
|
||||
<div class="flex gap-2">
|
||||
@@ -601,7 +599,7 @@
|
||||
name="dockerRegistryImageName"
|
||||
id="dockerRegistryImageName"
|
||||
readonly={isDisabled}
|
||||
disabled={isDisabled}
|
||||
disabled={isDisabled}
|
||||
class="w-full"
|
||||
placeholder="e.g. coollabsio/myimage (tag will be commit sha) or coollabsio/myimage:tag"
|
||||
bind:value={application.dockerRegistryImageName}
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
try {
|
||||
$status.application.initialLoading = true;
|
||||
$status.application.loading = true;
|
||||
$status.application.restarting = true;
|
||||
await post(`/applications/${id}/restart`, { imageId: remoteImage });
|
||||
addToast({
|
||||
type: 'success',
|
||||
@@ -67,6 +68,7 @@
|
||||
} finally {
|
||||
$status.application.initialLoading = false;
|
||||
$status.application.loading = false;
|
||||
$status.application.restarting = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user