Skip to content

Commit 17d8b42

Browse files
committed
feat: quick start in studio at first run
1 parent 6336686 commit 17d8b42

3 files changed

Lines changed: 141 additions & 1 deletion

File tree

studio/src/main/resources/static/css/studio.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3846,6 +3846,53 @@ div.dt-search {
38463846
}
38473847
}
38483848

3849+
/* Quick Start Panel */
3850+
.quick-start-card {
3851+
cursor: pointer;
3852+
transition: border-color 0.2s, box-shadow 0.2s;
3853+
border: 1px solid var(--border-ddd, #dee2e6);
3854+
}
3855+
3856+
.quick-start-card:hover {
3857+
border-color: #00aeee;
3858+
box-shadow: 0 2px 8px rgba(0, 174, 238, 0.15);
3859+
}
3860+
3861+
.quick-start-divider {
3862+
text-align: center;
3863+
margin-bottom: 24px;
3864+
position: relative;
3865+
}
3866+
3867+
.quick-start-divider::before {
3868+
content: "";
3869+
position: absolute;
3870+
top: 50%;
3871+
left: 0;
3872+
right: 0;
3873+
border-top: 1px solid var(--border-ddd, #dee2e6);
3874+
}
3875+
3876+
.quick-start-divider span {
3877+
background: var(--bg-page, #fff);
3878+
padding: 0 16px;
3879+
position: relative;
3880+
color: var(--text-secondary, #aaa);
3881+
font-size: 0.85rem;
3882+
}
3883+
3884+
#quickStartOverlay {
3885+
display: none;
3886+
position: absolute;
3887+
inset: 0;
3888+
background: var(--bg-page, rgba(255, 255, 255, 0.97));
3889+
z-index: 10;
3890+
align-items: center;
3891+
justify-content: center;
3892+
flex-direction: column;
3893+
text-align: center;
3894+
}
3895+
38493896
/* Ultra-compact: even smaller at very short heights */
38503897
@media (max-height: 580px) {
38513898
#tabs .nav-item a.vertical-tab {

studio/src/main/resources/static/index.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,22 @@
272272
</div>
273273

274274
<div class="col-11">
275-
<div class="tab-content">
275+
<div id="quickStartPanel" style="display:none; height: 100%; overflow-y: auto; position: relative;">
276+
<div style="max-width: 880px; margin: 0 auto; padding: 48px 24px;">
277+
<div style="text-align: center; margin-bottom: 36px;">
278+
<i class="fa fa-rocket" style="font-size: 2.5rem; color: #00aeee; margin-bottom: 12px; display: block;"></i>
279+
<h3 style="font-weight: 600; margin-bottom: 8px;">Get Started with ArcadeDB</h3>
280+
<p style="color: var(--text-secondary, #888); margin-bottom: 20px;">No databases found. Create an empty one or import a sample dataset with one click.</p>
281+
<button class="btn db-action-btn" onclick="createDatabase()" style="padding: 8px 24px; font-size: 0.95rem;">
282+
<i class="fa fa-plus"></i> Create Empty Database
283+
</button>
284+
</div>
285+
<div class="quick-start-divider"><span>or import a sample dataset</span></div>
286+
<div id="quickStartDatasets" class="row g-3"></div>
287+
</div>
288+
<div id="quickStartOverlay"></div>
289+
</div>
290+
<div class="tab-content" id="mainTabContent">
276291
${include:query.html} ${include:database.html} ${include:timeseries.html} ${include:server.html} ${include:profiler.html} ${include:security.html} ${include:cluster.html} ${include:ai.html} ${include:api.html} ${include:resources.html} ${include:settings.html}
277292
</div>
278293
</div>

studio/src/main/resources/static/js/studio-database.js

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,11 @@ function updateDatabases(callback, preferSelected) {
401401
$("#studioPanel").show();
402402
console.log("UI updated - login page hidden, studio panel shown");
403403

404+
if (databases.length === 0)
405+
showQuickStart();
406+
else
407+
hideQuickStart();
408+
404409
// These operations should not block login completion
405410
try {
406411
displaySchema();
@@ -504,6 +509,79 @@ function createDatabase() {
504509
});
505510
}
506511

512+
// ===== Quick Start Panel (shown when no databases exist) =====
513+
514+
var sampleDatasets = [
515+
{ name: "OpenBeer", desc: "Beers, breweries, categories and styles", icon: "fa-beer-mug-empty" },
516+
{ name: "GratefulDeadConcerts", desc: "Grateful Dead concerts and songs", icon: "fa-music" },
517+
{ name: "MovieRatings", desc: "Movies with viewer ratings", icon: "fa-film" },
518+
{ name: "Tolkien-Arda", desc: "Tolkien's Middle-earth universe", icon: "fa-hat-wizard" },
519+
{ name: "Whisky", desc: "Whisky distilleries and brands", icon: "fa-whiskey-glass" },
520+
{ name: "demodb", desc: "General-purpose demo database", icon: "fa-database" }
521+
];
522+
523+
function showQuickStart() {
524+
var html = "";
525+
for (var i = 0; i < sampleDatasets.length; i++) {
526+
var ds = sampleDatasets[i];
527+
html += '<div class="col-md-4">' +
528+
'<div class="card quick-start-card" onclick="importSampleDatabase(\'' + ds.name + '\')">' +
529+
'<div class="card-body text-center" style="padding: 20px 16px;">' +
530+
'<i class="fa ' + ds.icon + '" style="font-size: 2rem; color: #00aeee; margin-bottom: 10px; display: block;"></i>' +
531+
'<div style="font-weight: 600; font-size: 0.95rem; margin-bottom: 4px;">' + ds.name + '</div>' +
532+
'<div class="text-muted" style="font-size: 0.8rem;">' + ds.desc + '</div>' +
533+
'</div>' +
534+
'</div>' +
535+
'</div>';
536+
}
537+
$("#quickStartDatasets").html(html);
538+
$("#quickStartOverlay").hide();
539+
$("#quickStartPanel").show();
540+
$("#mainTabContent").hide();
541+
}
542+
543+
function hideQuickStart() {
544+
$("#quickStartOverlay").hide();
545+
$("#quickStartPanel").hide();
546+
$("#mainTabContent").show();
547+
}
548+
549+
function importSampleDatabase(name) {
550+
var url = "https://github.com/ArcadeData/arcadedb-datasets/raw/main/orientdb/" + name + ".gz";
551+
552+
$("#quickStartOverlay").html(
553+
'<div class="spinner-border text-primary" style="width: 3rem; height: 3rem;"></div>' +
554+
'<h5 style="margin-top: 16px; font-weight: 600;">Importing ' + escapeHtml(name) + '...</h5>' +
555+
'<p style="color: var(--text-secondary, #888);">Creating database and downloading dataset. This may take a moment.</p>'
556+
).css("display", "flex");
557+
558+
jQuery.ajax({
559+
type: "POST",
560+
url: "api/v1/server",
561+
data: JSON.stringify({ command: "create database " + name }),
562+
contentType: "application/json",
563+
beforeSend: function(xhr) { xhr.setRequestHeader("Authorization", globalCredentials); }
564+
}).done(function() {
565+
jQuery.ajax({
566+
type: "POST",
567+
url: "api/v1/command/" + encodeURIComponent(name),
568+
data: JSON.stringify({ language: "sql", command: "IMPORT DATABASE " + url }),
569+
contentType: "application/json",
570+
timeout: 300000,
571+
beforeSend: function(xhr) { xhr.setRequestHeader("Authorization", globalCredentials); }
572+
}).done(function() {
573+
globalNotify("Success", name + " imported successfully!", "success");
574+
updateDatabases(null, name);
575+
}).fail(function(jqXHR) {
576+
globalNotifyError(jqXHR.responseText);
577+
$("#quickStartOverlay").hide();
578+
});
579+
}).fail(function(jqXHR) {
580+
globalNotifyError(jqXHR.responseText);
581+
$("#quickStartOverlay").hide();
582+
});
583+
}
584+
507585
function dropDatabase() {
508586
let database = escapeHtml(getCurrentDatabase());
509587
if (database == "") {

0 commit comments

Comments
 (0)