Skip to content

Commit

Permalink
move jarvis-api version from workspace:* to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
HuakunShen committed May 23, 2024
1 parent d6773ee commit bafc30a
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 35 deletions.
2 changes: 1 addition & 1 deletion extension-templates/jarvis-ext-nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"postinstall": "nuxt prepare"
},
"dependencies": {
"jarvis-api": "workspace:*",
"jarvis-api": "latest",
"@radix-icons/vue": "^1.0.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion extension-templates/jarvis-ext-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"jarvis-api": "workspace:*",
"jarvis-api": "latest",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-slot": "^1.0.2",
Expand Down
2 changes: 1 addition & 1 deletion extension-templates/jarvis-ext-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"vite": "^5.2.0"
},
"dependencies": {
"jarvis-api": "workspace:*",
"jarvis-api": "latest",
"bits-ui": "^0.21.7",
"clsx": "^2.1.1",
"mode-watcher": "^0.3.0",
Expand Down
2 changes: 1 addition & 1 deletion extension-templates/jarvis-ext-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"jarvis-api": "workspace:*",
"jarvis-api": "latest",
"@radix-icons/vue": "^1.0.0",
"@vueuse/core": "^10.9.0",
"class-variance-authority": "^0.7.0",
Expand Down
2 changes: 1 addition & 1 deletion extensions/download-twitter-video/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"dependencies": {
"@hookform/resolvers": "^3.4.0",
"jarvis-api": "workspace:*",
"jarvis-api": "latest",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.0.2",
Expand Down
2 changes: 1 addition & 1 deletion extensions/jwt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"vite": "^5.2.0"
},
"dependencies": {
"jarvis-api": "workspace:*",
"jarvis-api": "latest",
"bits-ui": "^0.21.7",
"clsx": "^2.1.1",
"cmdk-sv": "^0.0.17",
Expand Down
6 changes: 3 additions & 3 deletions extensions/myip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"axios": "^1.6.8",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"jarvis-api": "latest",
"radix-vue": "^1.8.0",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
"vue": "^3.4.21",
"zod": "^3.23.7",
"jarvis-api": "workspace:*"
"zod": "^3.23.8"
},
"jarvis": {
"identifier": "tech.huakun.jarvis-qrcode-ext",
Expand Down Expand Up @@ -60,8 +60,8 @@
"npm-run-all2": "^6.1.2",
"postcss": "^8.4.38",
"run-p": "^0.0.0",
"tauri-plugin-clipboard-api": "workspace:*",
"tailwindcss": "^3.4.3",
"tauri-plugin-clipboard-api": "^0.7.0-beta.0",
"typescript": "~5.4.0",
"vite": "^5.2.8",
"vue-tsc": "^2.0.11"
Expand Down
133 changes: 109 additions & 24 deletions extensions/myip/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import { onMounted, ref } from "vue";
import axios from "axios";
import { z } from "zod";
import { clipboard } from "@jarvis/api/ui";
import { clipboard } from "jarvis-api/ui";
import { BaseJarvisExtension } from "jarvis-api";
import { useColorMode } from "@vueuse/core";
import { Icon } from "@iconify/vue";
import {
Expand Down Expand Up @@ -52,7 +53,9 @@ const ipSearchTerm = ref<string>("");
const mode = useColorMode();
function searchIp(ipv4?: string) {
const apiUrl = `http://ip-api.com/json${ipv4 ? "/" + ipv4 : ""}?fields=status,message,continent,country,countryCode,region,regionName,city,district,zip,lat,lon,timezone,offset,currency,isp,org,as,asname,reverse,proxy,hosting,query`;
const apiUrl = `http://ip-api.com/json${
ipv4 ? "/" + ipv4 : ""
}?fields=status,message,continent,country,countryCode,region,regionName,city,district,zip,lat,lon,timezone,offset,currency,isp,org,as,asname,reverse,proxy,hosting,query`;
return axios
.get(apiUrl)
.then((response) => {
Expand Down Expand Up @@ -90,7 +93,11 @@ function onSelect(content: any) {
function onIpSearch(e: Event) {
e.preventDefault();
// check regex of ipSearchTerm must be IPv4
if (/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(ipSearchTerm.value)) {
if (
/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(
ipSearchTerm.value
)
) {
return searchIp(ipSearchTerm.value);
}
}
Expand All @@ -103,26 +110,48 @@ function onIpSearch(e: Event) {
<!-- <ModeToggle /> -->
<Command class="rounded-lg border-none shadow-md text-xl">
<div class="flex gap-1.5 px-2">
<span class="grow"><CommandInput placeholder="Type to search..." class="" /></span>
<form class="flex w-full items-center gap-1.5 max-w-xs" @submit="onIpSearch">
<Input id="IP Address" type="text" placeholder="IP Address" v-model="ipSearchTerm" />
<span class="grow"
><CommandInput placeholder="Type to search..." class=""
/></span>
<form
class="flex w-full items-center gap-1.5 max-w-xs"
@submit="onIpSearch"
>
<Input
id="IP Address"
type="text"
placeholder="IP Address"
v-model="ipSearchTerm"
/>
<Button type="submit" variant="outline">Search</Button>
</form>
</div>
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup v-if="ip" heading="IP Info">
<CommandItem value="Public IP" class="space-x-3" @select="() => onSelect(ip!.query)">
<CommandItem
value="Public IP"
class="space-x-3"
@select="() => onSelect(ip!.query)"
>
<Icon icon="mdi:web" class="w-4 h-4" />
<span class="font-bold">Public IPv4</span>
<span class="text-muted-foreground">{{ ip.query }}</span>
</CommandItem>
<CommandItem value="continent" class="space-x-3" @select="() => onSelect(ip!.continent)">
<CommandItem
value="continent"
class="space-x-3"
@select="() => onSelect(ip!.continent)"
>
<Icon icon="mdi:earth" class="w-4 h-4" />
<span class="font-bold">Continent</span>
<span class="text-muted-foreground">{{ ip.continent }}</span>
</CommandItem>
<CommandItem value="country" class="space-x-3" @select="() => onSelect(ip!.country)">
<CommandItem
value="country"
class="space-x-3"
@select="() => onSelect(ip!.country)"
>
<Icon icon="gis:search-country" class="w-4 h-4" />
<span class="font-bold">Country</span>
<span class="text-muted-foreground">{{ ip.country }}</span>
Expand All @@ -136,7 +165,11 @@ function onIpSearch(e: Event) {
<span class="font-bold">Country Code</span>
<span class="text-muted-foreground">{{ ip.countryCode }}</span>
</CommandItem>
<CommandItem value="region" class="space-x-3" @select="() => onSelect(ip!.region)">
<CommandItem
value="region"
class="space-x-3"
@select="() => onSelect(ip!.region)"
>
<Icon icon="mdi:web" class="w-4 h-4" />
<span class="font-bold">Region</span>
<span class="text-muted-foreground">{{ ip.region }}</span>
Expand All @@ -150,17 +183,29 @@ function onIpSearch(e: Event) {
<span class="font-bold">Region Name</span>
<span class="text-muted-foreground">{{ ip.regionName }}</span>
</CommandItem>
<CommandItem value="city" class="space-x-3" @select="() => onSelect(ip!.city)">
<CommandItem
value="city"
class="space-x-3"
@select="() => onSelect(ip!.city)"
>
<Icon icon="solar:city-bold" class="w-4 h-4" />
<span class="font-bold">City</span>
<span class="text-muted-foreground">{{ ip.city }}</span>
</CommandItem>
<CommandItem value="district" class="space-x-3" @select="() => onSelect(ip!.district)">
<CommandItem
value="district"
class="space-x-3"
@select="() => onSelect(ip!.district)"
>
<Icon icon="oui:vis-map-region" class="w-4 h-4" />
<span class="font-bold">District</span>
<span class="text-muted-foreground">{{ ip.district }}</span>
</CommandItem>
<CommandItem value="zip" class="space-x-3" @select="() => onSelect(ip!.zip)">
<CommandItem
value="zip"
class="space-x-3"
@select="() => onSelect(ip!.zip)"
>
<Icon icon="tabler:zip" class="w-4 h-4" />
<span class="font-bold">ZIP</span>
<span class="text-muted-foreground">{{ ip.zip }}</span>
Expand All @@ -172,9 +217,15 @@ function onIpSearch(e: Event) {
>
<Icon icon="pepicons-pop:map" class="w-4 h-4" />
<span class="font-bold">GeoCoordinates</span>
<span class="text-muted-foreground">{{ ip.lat }}, {{ ip.lon }}</span>
<span class="text-muted-foreground"
>{{ ip.lat }}, {{ ip.lon }}</span
>
</CommandItem>
<CommandItem value="timezone" class="space-x-3" @select="() => onSelect(ip!.timezone)">
<CommandItem
value="timezone"
class="space-x-3"
@select="() => onSelect(ip!.timezone)"
>
<Icon icon="mdi:timezone" class="w-4 h-4" />
<span class="font-bold">Timezone</span>
<span class="text-muted-foreground">{{ ip.timezone }}</span>
Expand All @@ -186,44 +237,78 @@ function onIpSearch(e: Event) {
>
<Icon icon="mdi:clock" class="w-4 h-4" />
<span class="font-bold">Offset</span>
<span class="text-muted-foreground">{{ ip.offset / 3600 }} hrs</span>
<span class="text-muted-foreground"
>{{ ip.offset / 3600 }} hrs</span
>
</CommandItem>
<CommandItem value="currency" class="space-x-3" @select="() => onSelect(ip!.currency)">
<CommandItem
value="currency"
class="space-x-3"
@select="() => onSelect(ip!.currency)"
>
<Icon icon="simple-icons:bitcoinsv" class="w-4 h-4" />
<span class="font-bold">Currency</span>
<span class="text-muted-foreground">{{ ip.currency }}</span>
</CommandItem>
<CommandItem value="isp" class="space-x-3" @select="() => onSelect(ip!.isp)">
<CommandItem
value="isp"
class="space-x-3"
@select="() => onSelect(ip!.isp)"
>
<Icon icon="carbon:container-services" class="w-4 h-4" />
<span class="font-bold">ISP</span>
<span class="text-muted-foreground">{{ ip.isp }}</span>
</CommandItem>
<CommandItem value="org" class="space-x-3" @select="() => onSelect(ip!.org)">
<CommandItem
value="org"
class="space-x-3"
@select="() => onSelect(ip!.org)"
>
<Icon icon="clarity:organization-solid" class="w-4 h-4" />
<span class="font-bold">Org</span>
<span class="text-muted-foreground">{{ ip.org }}</span>
</CommandItem>
<CommandItem value="as" class="space-x-3" @select="() => onSelect(ip!.as)">
<CommandItem
value="as"
class="space-x-3"
@select="() => onSelect(ip!.as)"
>
<Icon icon="carbon:container-services" class="w-4 h-4" />
<span class="font-bold">AS Number</span>
<span class="text-muted-foreground">{{ ip.as }}</span>
</CommandItem>
<CommandItem value="asname" class="space-x-3" @select="() => onSelect(ip!.asname)">
<CommandItem
value="asname"
class="space-x-3"
@select="() => onSelect(ip!.asname)"
>
<Icon icon="carbon:container-services" class="w-4 h-4" />
<span class="font-bold">AS Name</span>
<span class="text-muted-foreground">{{ ip.asname }}</span>
</CommandItem>
<CommandItem value="reverse" class="space-x-3" @select="() => onSelect(ip!.reverse)">
<CommandItem
value="reverse"
class="space-x-3"
@select="() => onSelect(ip!.reverse)"
>
<Icon icon="material-symbols:dns" class="w-4 h-4" />
<span class="font-bold">Reverse DNS</span>
<span class="text-muted-foreground">{{ ip.reverse }}</span>
</CommandItem>
<CommandItem value="proxy" class="space-x-3" @select="() => onSelect(ip!.proxy)">
<CommandItem
value="proxy"
class="space-x-3"
@select="() => onSelect(ip!.proxy)"
>
<Icon icon="mdi:proxy" class="w-4 h-4" />
<span class="font-bold">Proxy, VPN or Tor exit Address</span>
<span class="text-muted-foreground">{{ ip.proxy }}</span>
</CommandItem>
<CommandItem value="hosting" class="space-x-3" @select="() => onSelect(ip!.hosting)">
<CommandItem
value="hosting"
class="space-x-3"
@select="() => onSelect(ip!.hosting)"
>
<Icon icon="clarity:host-solid" class="w-4 h-4" />
<span class="font-bold">Hosting, colocated or data center</span>
<span class="text-muted-foreground">{{ ip.hosting }}</span>
Expand Down
2 changes: 1 addition & 1 deletion extensions/qrcode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"vite": "^5.2.0"
},
"dependencies": {
"jarvis-api": "workspace:*",
"jarvis-api": "latest",
"bits-ui": "^0.21.7",
"clsx": "^2.1.1",
"easyqrcodejs": "^4.6.1",
Expand Down
2 changes: 1 addition & 1 deletion extensions/vscode-project-manager/inline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"module": "index.ts",
"type": "module",
"dependencies": {
"jarvis-api": "workspace:*",
"jarvis-api": "latest",
"zod": "^3.23.8"
},
"devDependencies": {
Expand Down

0 comments on commit bafc30a

Please sign in to comment.