Skip to content

Commit

Permalink
chore: Update jarvis-api dependency to version 0.0.2-alpha.11. Replac…
Browse files Browse the repository at this point in the history
…e git-skyline extension storage from localStorage to jarvis storage.
  • Loading branch information
HuakunShen committed Jun 1, 2024
1 parent 8d85c8b commit 379f850
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 42 deletions.
2 changes: 1 addition & 1 deletion extensions/git-skyline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@vueuse/core": "^10.9.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"jarvis-api": "0.0.2-alpha.6",
"jarvis-api": "0.0.2-alpha.11",
"lucide-vue-next": "^0.378.0",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.1",
Expand Down
17 changes: 14 additions & 3 deletions extensions/git-skyline/src/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@ import { onMounted, ref } from "vue";
import ContextMenu from "./components/context-menu.vue";
import { useAppState } from "./lib/store";
import { router } from "./lib/router";
import { window } from "jarvis-api/ui";
import { JarvisStore, window } from "jarvis-api/ui";
import { cn } from "@/lib/utils";
import Card from "./components/ui/card/Card.vue";
const store = new JarvisStore();
const appState = useAppState();
const showInstructions = ref(true);
onMounted(() => {
onMounted(async () => {
await store.load();
const url = await store.get("gitSkylineUrl");
if (url && typeof url === "string") {
appState.setUrl(url);
}
if (!appState.gitSkylineUrl) {
router.push("/setting");
}
Expand All @@ -31,7 +39,10 @@ onMounted(() => {
</div>
<div class="h-screen flex flex-col">
<div :class="cn('h-32 z-50')" data-tauri-drag-region>
<div v-if="showInstructions" class="w-full h-full flex justify-center items-center border border-red-400">
<div
v-if="showInstructions"
class="w-full h-full flex justify-center items-center border border-red-400"
>
<h1 class="text-3xl z-0 select-none">
Left Click and Drag this region to move this window
</h1>
Expand Down
23 changes: 15 additions & 8 deletions extensions/git-skyline/src/SettingPage.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script setup lang="ts">
import * as z from "zod";
import { onMounted, ref } from "vue";
import { onMounted, ref, watch } from "vue";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Button } from "@/components/ui/button";
import { toast } from "@/components/ui/toast";
import { InfoIcon } from "lucide-vue-next";
import { window } from "jarvis-api/ui";
import { window, JarvisStore } from "jarvis-api/ui";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import {
Card,
Expand All @@ -19,7 +19,14 @@ import {
import { useAppState } from "./lib/store";
import { router } from "./lib/router";
onMounted(() => {
const store = new JarvisStore();
onMounted(async () => {
await store.load();
const url = await store.get("gitSkylineUrl");
if (url && typeof url === "string") {
appState.setUrl(url);
}
document.addEventListener("keydown", (e) => {
if (e.key === "Escape") {
window.destroyWindow();
Expand All @@ -32,7 +39,7 @@ function onSubmit(e: Event) {
e.preventDefault();
}
const url = ref("");
function updateUrl() {
async function updateUrl() {
const parse = z.string().url().safeParse(url.value);
if (parse.error) {
toast({
Expand All @@ -42,6 +49,8 @@ function updateUrl() {
});
} else {
appState.setUrl(url.value);
await store.set("gitSkylineUrl", url.value);
await store.save();
toast({
title: "URL Set",
});
Expand Down Expand Up @@ -83,10 +92,8 @@ function updateUrl() {
<Button class="px-1" variant="link">https://git-skyline.huakun.tech</Button>,
enter your Username. A 3D model will be generated. Click on
<strong>Embed Page</strong> button in the top right corner to generate a embed
URL, and paste it here.

Or use this url with your GitHub username: `https://git-skyline.huakun.tech/contribution/github/{githubUsername}/embed?enableZoom=true&autoRotate=true`

URL, and paste it here. Or use this url with your GitHub username:
`https://git-skyline.huakun.tech/contribution/github/{githubUsername}/embed?enableZoom=true&autoRotate=true`
</span>
</PopoverContent>
</Popover>
Expand Down
1 change: 0 additions & 1 deletion extensions/git-skyline/src/lib/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ export const useAppState = defineStore("jarvisExtGitSkylineAppState", {
this.settingOpen = open;
},
},
persist: true,
});
2 changes: 1 addition & 1 deletion extensions/ip-info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@vueuse/core": "^10.9.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"jarvis-api": "0.0.2-alpha.1",
"jarvis-api": "0.0.2-alpha.11",
"radix-vue": "^1.8.0",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
Expand Down
66 changes: 38 additions & 28 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 379f850

Please sign in to comment.