Skip to content

Commit 1f638b4

Browse files
author
Jicheng Lu
committed
refine styling
1 parent 1a2518c commit 1f638b4

File tree

6 files changed

+26
-9
lines changed

6 files changed

+26
-9
lines changed

src/lib/common/LoadingToComplete.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818

1919
{#if isComplete}
2020
<div class="alert-container">
21-
<Alert class="success">
21+
<Alert color="success">
2222
<div>{successText}</div>
2323
</Alert>
2424
</div>
2525
{/if}
2626

2727
{#if isError}
2828
<div class="alert-container">
29-
<Alert class="error">
29+
<Alert color="danger">
3030
<div>{errorText}</div>
3131
</Alert>
3232
</div>

src/lib/scss/custom/components/_alert.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
z-index: 8888;
77

88
.alert {
9-
color: white;
109
text-align: center;
1110
}
1211

src/lib/scss/custom/pages/_chat.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
}
208208
}
209209

210-
.button-group-container {
210+
.plain-option-container {
211211
display: flex;
212212
flex-wrap: wrap;
213213

@@ -230,7 +230,7 @@
230230
}
231231
}
232232

233-
.card-group-container {
233+
.complex-option-container {
234234
display: flex;
235235
flex-wrap: wrap;
236236
gap: 5px;

src/routes/chat/[agentId]/[conversationId]/richContent/rc-complex-options.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
</script>
6767
6868
{#if cards.length > 0}
69-
<div class="card-group-container">
69+
<div class="complex-option-container">
7070
{#each cards as card, idx (idx)}
7171
<Card class="card-element">
7272
<CardBody>

src/routes/chat/[agentId]/[conversationId]/richContent/rc-plain-options.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
{/if}
132132
133133
{#if plainOptions.length > 0}
134-
<div class="button-group-container">
134+
<div class="plain-option-container">
135135
{#each plainOptions as option, index}
136136
<button
137137
class={`btn btn-sm m-1 ${option.is_secondary ? 'btn-outline-secondary': 'btn-outline-primary'}`}

src/routes/page/mongodb/+page.svelte

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,31 @@
55
import { refreshAgents } from '$lib/services/agent-service';
66
import LoadingToComplete from '$lib/common/LoadingToComplete.svelte';
77
import { _ } from 'svelte-i18n';
8+
import Swal from 'sweetalert2/dist/sweetalert2.js';
9+
import "sweetalert2/src/sweetalert2.scss";
810
911
let isLoading = false;
1012
let isComplete = false;
1113
let isError = false;
1214
const duration = 3000;
1315
16+
function readyToRefresh() {
17+
// @ts-ignore
18+
Swal.fire({
19+
title: 'Are you sure?',
20+
text: "You will migrate all agents data to mongoDb.",
21+
icon: 'warning',
22+
showCancelButton: true,
23+
confirmButtonText: 'Yes',
24+
cancelButtonText: 'No'
25+
// @ts-ignore
26+
}).then((result) => {
27+
if (result.value) {
28+
refreshAgentData();
29+
}
30+
});
31+
}
32+
1433
const refreshAgentData = () => {
1534
isLoading = true;
1635
refreshAgents().then(res => {
@@ -28,14 +47,13 @@
2847
}, duration);
2948
});
3049
};
31-
3250
</script>
3351

3452
<HeadTitle title="MongoDB" />
3553
<Breadcrumb title="MongoDB" pagetitle="{$_('Setting')}" />
3654
<LoadingToComplete isLoading={isLoading} isComplete={isComplete} isError={isError} />
3755

3856
<h3>{$_('Migrate agents from file repository to MongoDB')}</h3>
39-
<Button color="primary" on:click={() => refreshAgentData()} disabled={isLoading}>
57+
<Button color="primary" on:click={() => readyToRefresh()} disabled={isLoading}>
4058
<i class="bx bx-copy" /> {$_('Start Migration')}
4159
</Button>

0 commit comments

Comments
 (0)