Skip to content

Commit

Permalink
X
Browse files Browse the repository at this point in the history
  • Loading branch information
mewim committed Feb 1, 2024
1 parent 3b5d051 commit 117ab0b
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 161 deletions.
2 changes: 1 addition & 1 deletion datasets.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"repository": "https://github.com/kuzudb/kuzu",
"commitHash": "41e469268a00b8245001cf735c9db5005fa89a46",
"commitHash": "83e28e4eba40594835156903f0a2826fcd2e865c",
"datasetsRoot": "dataset",
"datasets": [
{
Expand Down
129 changes: 45 additions & 84 deletions src/components/MainLayout.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
<template>
<div>
<nav
ref="navbar"
class="navbar navbar-expand-lg navbar-dark bg-dark"
>
<nav ref="navbar" class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container">
<a
class="navbar-brand"
href="https://kuzudb.com"
target="_blank"
>
<img
src="/img/kuzu-logo-inverse.png"
alt="Kuzu Logo"
class="navbar__logo"
>
<a class="navbar-brand" href="https://kuzudb.com" target="_blank">
<img src="/img/kuzu-logo-inverse.png" alt="Kuzu Logo" class="navbar__logo" />
</a>
<button
class="navbar-toggler"
Expand All @@ -26,80 +15,49 @@
<span class="navbar-toggler-icon" />
</button>
<div class="collapse navbar-collapse navbar__buttons">
<ul
v-if="modeStore.isReadOnly"
class="navbar-nav me-auto"
>
<ul v-if="modeStore.isReadOnly" class="navbar-nav me-auto">
<li class="nav-item">
<span
class="badge bg-primary"
@click="accessModeModal.show()"
>Read-only Mode</span>
<span class="badge bg-primary" @click="accessModeModal.show()"
>Read-only Mode</span
>
</li>
</ul>
<ul
v-if="modeStore.isDemo"
class="navbar-nav me-auto"
>
<ul v-if="modeStore.isDemo" class="navbar-nav me-auto">
<li class="nav-item">
<span
class="badge bg-primary"
@click="accessModeModal.show()"
>Demo Mode</span>
<span class="badge bg-primary" @click="accessModeModal.show()"
>Demo Mode</span
>
</li>
</ul>
<ul class="navbar-nav ms-auto">
<li :class="['nav-item', { active: showShell }]">
<a
class="nav-link"
href="#"
@click="toggleShell()"
>
<a class="nav-link" href="#" @click="toggleShell()">
<i class="fa-solid fa-terminal" />
Shell
</a>
</li>
<li :class="['nav-item', { active: showSchema }]">
<a
class="nav-link"
href="#"
@click="toggleSchema()"
>
<a class="nav-link" href="#" @click="toggleSchema()">
<i class="fa-solid fa-circle-nodes" />
Schema
</a>
</li>
<li
v-if="!modeStore.isDemo"
:class="['nav-item', { active: showLoader }]"
>
<a
class="nav-link"
href="#"
@click="toggleLoader()"
>
<li v-if="!modeStore.isDemo" :class="['nav-item', { active: showLoader }]">
<a class="nav-link" href="#" @click="toggleLoader()">
<i class="fa-solid fa-database" />
Datasets
</a>
</li>

<li class="nav-item">
<a
class="nav-link"
href="#"
@click="showSettingsModal()"
>
<a class="nav-link" href="#" @click="showSettingsModal()">
<i class="fa-solid fa-cog" />
Settings
</a>
</li>

<li class="nav-item">
<a
class="nav-link"
href="https://kuzudb.com/docusaurus/"
target="_blank"
>
<a class="nav-link" href="https://kuzudb.com/docusaurus/" target="_blank">
<i class="fa-solid fa-book" />
Docs
</a>
Expand Down Expand Up @@ -132,11 +90,7 @@
:navbar-height="navbarHeight"
@reload-schema="reloadSchema"
/>
<SettingsMainView
v-if="showSettings"
ref="settings"
:schema="schema"
/>
<SettingsMainView v-if="showSettings" ref="settings" :schema="schema" />
<DatasetMainView
v-show="showLoader"
:schema="schema"
Expand All @@ -145,20 +99,11 @@
/>
</div>

<div
ref="modal"
class="modal"
tabindex="-1"
>
<div ref="modal" class="modal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div
v-if="modeStore.isDemo"
class="modal-header"
>
<h5 class="modal-title">
Welcome to KùzuExplorer!
</h5>
<div v-if="modeStore.isDemo" class="modal-header">
<h5 class="modal-title">Welcome to KùzuExplorer!</h5>
</div>
<div class="modal-body">
<p v-if="modeStore.isDemo">
Expand All @@ -168,9 +113,10 @@
</a>
scale factor 0.1 dataset. Please run KùzuExplorer locally to load a
different dataset (see the
<a href="https://kuzudb.com/docusaurus/kuzuexplorer/"> documentation here</a>).
<br>
<br>
<a href="https://kuzudb.com/docusaurus/kuzuexplorer/"> documentation here</a
>).
<br />
<br />
You can visualize the schema of LDBC SNB in the Schema tab and execute
interactive Cypher queries in the Shell tab.
</p>
Expand All @@ -182,11 +128,7 @@
</p>
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-primary"
@click="accessModeModal.hide()"
>
<button type="button" class="btn btn-primary" @click="accessModeModal.hide()">
OK
</button>
</div>
Expand Down Expand Up @@ -260,6 +202,25 @@ export default {
r.group = relGroupsMap[r.name];
}
});
const rdfMap = {};
this.schema.rdf.forEach((r) => {
r.nodes.forEach((n) => {
rdfMap[n] = r.name;
});
r.rels.forEach((rel) => {
rdfMap[rel] = r.name;
});
});
this.schema.nodeTables.forEach((n) => {
if (rdfMap[n.name]) {
n.rdf = rdfMap[n.name];
}
});
this.schema.relTables.forEach((r) => {
if (rdfMap[r.name]) {
r.rdf = rdfMap[r.name];
}
});
},
async getMode() {
const response = await Axios.get("/api/mode");
Expand Down
Loading

0 comments on commit 117ab0b

Please sign in to comment.