mirror of
https://github.com/ivabus/gui
synced 2025-06-07 15:50:27 +03:00
Merge branch 'main' of github.com:teaxyz/gui into github-oauth
This commit is contained in:
commit
b0e0b90334
13 changed files with 311 additions and 89 deletions
2
.github/notify-slack.js
vendored
2
.github/notify-slack.js
vendored
|
@ -8,7 +8,7 @@ async function main() {
|
|||
type: 'section',
|
||||
text: {
|
||||
type: 'mrkdwn',
|
||||
text: `NEW BUILD FOR ${process.env.PLATFORM} <${process.env.DOWNLOAD_URL}|download ${process.env.VERSION || ''}>`
|
||||
text: `NEW BUILD FOR ${process.env.PLATFORM} <${process.env.DOWNLOAD_URL}|download ${process.env.EXT || 'bin'} ${process.env.VERSION || ''}>`
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
77
.github/workflows/ci.yml
vendored
77
.github/workflows/ci.yml
vendored
|
@ -107,7 +107,8 @@ jobs:
|
|||
with:
|
||||
message-id: preview-comment-${{needs.changes.outputs.preview_folder}}
|
||||
message: |
|
||||
**preview is at**: [https://${{steps.preview_setup.outputs.domain}}](https://${{steps.preview_setup.outputs.domain}})
|
||||
**preview is at**:
|
||||
<a href="https://${{steps.preview_setup.outputs.domain}}" target="_blank">here</a>
|
||||
```bash
|
||||
https://${{steps.preview_setup.outputs.domain}}
|
||||
```
|
||||
|
@ -122,34 +123,40 @@ jobs:
|
|||
platform:
|
||||
- os: macos-11
|
||||
name: darwin+x86-64
|
||||
id: mac_latest
|
||||
- os: ubuntu-latest
|
||||
name: linux+x86-64
|
||||
id: linux
|
||||
- os: [self-hosted, macOS, ARM64]
|
||||
name: darwin+aarch64
|
||||
id: mac_m1
|
||||
# - os: [self-hosted, linux, ARM64]
|
||||
# name: linux+aarch64
|
||||
container: ${{ matrix.platform.container }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 18
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: pnpm-lock.yaml
|
||||
- name: install Rust stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
- name: install app dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: install dependencies (ubuntu only)
|
||||
if: matrix.platform.name == 'linux+x86-64'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf pkg-config
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
# The prefix cache key, this can be changed to start a new cache manually.
|
||||
|
@ -157,8 +164,6 @@ jobs:
|
|||
prefix-key: ${{ matrix.platform.name }}
|
||||
shared-key: ci
|
||||
cache-targets: false
|
||||
- name: install app dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Cache Tauri Target
|
||||
uses: actions/cache@v3
|
||||
|
@ -182,8 +187,28 @@ jobs:
|
|||
echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT
|
||||
echo "extension=$EXTENSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: test build tauri
|
||||
run: pnpm --filter gui tauri build
|
||||
- name: test build tauri for MacOS
|
||||
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||
# FROM: https://tauri.app/v1/guides/distribution/sign-macos
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }}
|
||||
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
run: pnpm build:gui
|
||||
|
||||
- name: test build tauri for Linux
|
||||
if: matrix.platform.name == 'linux+x86-64'
|
||||
# TODO: https://tauri.app/v1/guides/distribution/sign-linux
|
||||
run: pnpm build:gui
|
||||
|
||||
- name: zip .app for MacOS
|
||||
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||
run: |
|
||||
cd ./modules/gui/src-tauri/target/release/bundle/macos/ && zip -r tea.zip tea.app
|
||||
|
||||
- uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
|
@ -198,15 +223,43 @@ jobs:
|
|||
extension: ${{ steps.build_platform.outputs.extension }}
|
||||
run: |
|
||||
aws s3 cp "./modules/gui/src-tauri/target/release/bundle/$extension/tea_0.1.0_$platform.$extension" \
|
||||
"s3://preview.gui.tea.xyz/$prefix/gui_$platform.$extension"
|
||||
"s3://preview.gui.tea.xyz/$prefix/tea_$platform.$extension"
|
||||
|
||||
- name: comment install
|
||||
- name: cp package zip for MacOS
|
||||
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||
env:
|
||||
prefix: ${{ needs.changes.outputs.preview_folder }}
|
||||
platform: ${{ steps.build_platform.outputs.build_platform }}
|
||||
run: |
|
||||
aws s3 cp ./modules/gui/src-tauri/target/release/bundle/macos/tea.zip "s3://preview.gui.tea.xyz/$prefix/tea_$platform.zip"
|
||||
|
||||
- name: comment install for Linux
|
||||
if: matrix.platform.name == 'linux+x86-64'
|
||||
uses: mshick/add-pr-comment@v2
|
||||
with:
|
||||
message-id: ${{ matrix.platform.name }}-comment
|
||||
message-id: ${{ matrix.platform.id }}-comment
|
||||
message: |
|
||||
**installer for ${{ matrix.platform.name }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{steps.build_platform.outputs.build_platform}}.${{steps.build_platform.outputs.extension}})
|
||||
**installer for Linux ${{ matrix.platform.name }} is at**:
|
||||
<a href="http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{steps.build_platform.outputs.build_platform}}.${{steps.build_platform.outputs.extension}}" target="_blank">here</a>
|
||||
|
||||
```bash
|
||||
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{ steps.build_platform.outputs.build_platform }}.${{ steps.build_platform.outputs.extension }}
|
||||
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{ steps.build_platform.outputs.build_platform }}.${{ steps.build_platform.outputs.extension }}
|
||||
```
|
||||
copy-paste into a browser to download
|
||||
|
||||
- name: comment install for MacOS
|
||||
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||
uses: mshick/add-pr-comment@v2
|
||||
with:
|
||||
message-id: ${{ matrix.platform.id }}-comment
|
||||
message: |
|
||||
**installers for MacOS ${{ matrix.platform.name }} is at**:
|
||||
<a href="http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{steps.build_platform.outputs.build_platform}}.zip" target="_blank">.zip</a>
|
||||
or
|
||||
<a href="http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{steps.build_platform.outputs.build_platform}}.dmg" target="_blank">.dmg</a>
|
||||
|
||||
```bash
|
||||
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{ steps.build_platform.outputs.build_platform }}.zip
|
||||
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{ steps.build_platform.outputs.build_platform }}.dmg
|
||||
```
|
||||
copy-paste into a browser to download
|
42
.github/workflows/main.yml
vendored
42
.github/workflows/main.yml
vendored
|
@ -113,8 +113,23 @@ jobs:
|
|||
restore-keys: |
|
||||
${{ matrix.platform.name }}-build-target-prod
|
||||
|
||||
- name: test build tauri
|
||||
run: pnpm --filter gui tauri build
|
||||
- name: test build tauri for MacOS
|
||||
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||
# FROM: https://tauri.app/v1/guides/distribution/sign-macos
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }}
|
||||
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
run: pnpm build:gui
|
||||
|
||||
- name: test build tauri for Linux
|
||||
if: matrix.platform.name == 'linux+x86-64'
|
||||
# TODO: https://tauri.app/v1/guides/distribution/sign-linux
|
||||
run: pnpm build:gui
|
||||
|
||||
- name: Get current unix ts - seconds
|
||||
id: date
|
||||
|
@ -138,6 +153,11 @@ jobs:
|
|||
echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT
|
||||
echo "extension=$EXTENSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: zip .app for MacOS
|
||||
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||
run: |
|
||||
cd ./modules/gui/src-tauri/target/release/bundle/macos/ && zip -r tea.zip tea.app
|
||||
|
||||
- name: cp package images from prod to gui bucket
|
||||
env:
|
||||
platform: ${{ steps.build_platform.outputs.build_platform }}
|
||||
|
@ -147,9 +167,27 @@ jobs:
|
|||
aws s3 cp "./modules/gui/src-tauri/target/release/bundle/$extension/tea_0.1.0_$platform.$extension" \
|
||||
"s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}_$platform.$extension"
|
||||
|
||||
- name: cp package zip for MacOS
|
||||
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||
env:
|
||||
platform: ${{ steps.build_platform.outputs.build_platform }}
|
||||
build_platform: ${{ matrix.platform.name }}
|
||||
run: |
|
||||
aws s3 cp ./modules/gui/src-tauri/target/release/bundle/macos/tea.zip "s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}_$platform.zip"
|
||||
|
||||
- name: Slack Notification
|
||||
run: ./.github/notify-slack.js
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||
PLATFORM: ${{ matrix.platform.name }}
|
||||
EXT: ${{ steps.build_platform.outputs.extension }}
|
||||
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_${{ steps.date.outputs.unix_seconds }}_${{ steps.build_platform.outputs.build_platform }}.${{ steps.build_platform.outputs.extension }}
|
||||
|
||||
- name: Slack Notification for .app Mac
|
||||
run: ./.github/notify-slack.js
|
||||
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||
PLATFORM: ${{ matrix.platform.name }}
|
||||
EXT: .zip(.app)
|
||||
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_${{ steps.date.outputs.unix_seconds }}_${{ steps.build_platform.outputs.build_platform }}.zip
|
||||
|
|
46
.github/workflows/release.yml
vendored
46
.github/workflows/release.yml
vendored
|
@ -70,8 +70,23 @@ jobs:
|
|||
restore-keys: |
|
||||
${{ matrix.platform.name }}-build-target-prod
|
||||
|
||||
- name: test build tauri
|
||||
run: pnpm --filter gui tauri build
|
||||
- name: test build tauri for MacOS
|
||||
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||
# FROM: https://tauri.app/v1/guides/distribution/sign-macos
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }}
|
||||
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
run: pnpm build:gui
|
||||
|
||||
- name: test build tauri for Linux
|
||||
if: matrix.platform.name == 'linux+x86-64'
|
||||
# TODO: https://tauri.app/v1/guides/distribution/sign-linux
|
||||
run: pnpm build:gui
|
||||
|
||||
- name: Get current unix ts - seconds
|
||||
id: date
|
||||
|
@ -98,10 +113,37 @@ jobs:
|
|||
aws s3 cp "./modules/gui/src-tauri/target/release/bundle/$extension/tea_0.1.0_$platform.$extension" \
|
||||
"s3://preview.gui.tea.xyz/release/tea_gui_$tag_$platform.$extension"
|
||||
|
||||
- name: zip .app for MacOS
|
||||
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||
run: |
|
||||
cd ./modules/gui/src-tauri/target/release/bundle/macos/ && zip -r tea.zip tea.app
|
||||
|
||||
- name: publish .zip(.app) for MacOS
|
||||
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||
env:
|
||||
platform: ${{ steps.build_platform.outputs.build_platform }}
|
||||
extension: ${{ steps.build_platform.outputs.extension }}
|
||||
tag: ${{ steps.tag.outputs.tag }}
|
||||
run: |
|
||||
aws s3 cp "./modules/gui/src-tauri/target/release/bundle/macos/tea.zip" \
|
||||
"s3://preview.gui.tea.xyz/release/tea_gui_latest_$platform.zip"
|
||||
aws s3 cp "./modules/gui/src-tauri/target/release/bundle/macos/tea.zip" \
|
||||
"s3://preview.gui.tea.xyz/release/tea_gui_$tag_$platform.zip"
|
||||
- name: Slack Notification
|
||||
run: ./.github/notify-slack.js
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||
PLATFORM: ${{ matrix.platform.name }}
|
||||
VERSION: ${{steps.tag.outputs.tag}}
|
||||
EXT: ${{ steps.build_platform.outputs.extension }}
|
||||
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_gui_${{steps.tag.outputs.tag}}_${{steps.build_platform.outputs.build_platform}}.${{ steps.build_platform.outputs.extension }}
|
||||
|
||||
- name: Slack Notification for .app Mac
|
||||
run: ./.github/notify-slack.js
|
||||
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||
PLATFORM: ${{ matrix.platform.name }}
|
||||
VERSION: ${{steps.tag.outputs.tag}}
|
||||
EXT: .zip(.app)
|
||||
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_gui_${{steps.tag.outputs.tag}}_${{steps.build_platform.outputs.build_platform}}.zip
|
||||
|
|
|
@ -30,6 +30,7 @@ $ pnpm web:gui
|
|||
```
|
||||
# Build
|
||||
```sh
|
||||
pnpm install
|
||||
pnpm build:gui
|
||||
```
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"http": {
|
||||
"all": true,
|
||||
"request": true,
|
||||
"scope": ["https://api.tea.xyz/v1/*", "https://github.com/*", "http://localhost:3000/v1/*"]
|
||||
"scope": ["https://api.tea.xyz/v1/*", "https://github.com/*", "http://localhost:3000/v1/*", "https://app.tea.xyz/*"]
|
||||
},
|
||||
"shell": {
|
||||
"all": true,
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
<script lang="ts">
|
||||
import '$appcss';
|
||||
import '@tea/ui/icons/icons.css';
|
||||
import type { Package } from '@tea/ui/types';
|
||||
import type { Package, Bottle } from '@tea/ui/types';
|
||||
import Button from '@tea/ui/Button/Button.svelte';
|
||||
import StarRating from '@tea/ui/StarRating/StarRating.svelte';
|
||||
import Bottles from '@tea/ui/Bottles/Bottles.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { getPackageBottles } from '@api';
|
||||
|
||||
export let pkg: Package;
|
||||
|
||||
let bottles: Bottle[] = [];
|
||||
let packageRating = 0;
|
||||
let copyButtonText = 'COPY';
|
||||
const copyValue = `sh <(curl tea.xyz ) +${pkg.full_name}`;
|
||||
|
@ -15,6 +18,14 @@
|
|||
copyButtonText = 'COPIED!';
|
||||
navigator.clipboard.writeText(copyValue);
|
||||
};
|
||||
|
||||
onMount(async () => {
|
||||
try {
|
||||
bottles = await getPackageBottles(pkg.full_name);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<section class="mt-4 border border-gray bg-black">
|
||||
|
@ -33,6 +44,9 @@
|
|||
<p class="mt-4 font-sono text-sm">{pkg.desc}</p>
|
||||
</article>
|
||||
</header>
|
||||
<section>
|
||||
<Bottles {bottles} />
|
||||
</section>
|
||||
<footer class="flex h-20 border-t border-gray text-white">
|
||||
<input class="click-copy flex-grow bg-black pl-4" disabled value={copyValue} />
|
||||
<Button class="w-16 border-0 border-l-2 text-sm" onClick={onCopy}>{copyButtonText}</Button>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* TODO:
|
||||
* * make cors work with api.tea.xyz/v1
|
||||
*/
|
||||
import type { Package, Review, AirtablePost } from '@tea/ui/types';
|
||||
import type { Package, Review, AirtablePost, Bottle } from '@tea/ui/types';
|
||||
import type { GUIPackage, Course, Category } from '../types';
|
||||
import { PackageStates } from '../types';
|
||||
import { loremIpsum } from 'lorem-ipsum';
|
||||
|
@ -341,3 +341,16 @@ export async function getDeviceAuth(): Promise<any> {
|
|||
key: 'xxx'
|
||||
};
|
||||
}
|
||||
|
||||
export async function getPackageBottles(name: string): Promise<Bottle[]> {
|
||||
return [
|
||||
{ name, platform: 'darwin', arch: 'aarch64', version: '3.39.4' },
|
||||
{ name, platform: 'darwin', arch: 'aarch64', version: '3.40.0' },
|
||||
{ name, platform: 'darwin', arch: 'x86-64', version: '3.39.4' },
|
||||
{ name, platform: 'darwin', arch: 'x86-64', version: '3.40.0' },
|
||||
{ name, platform: 'linux', arch: 'aarch64', version: '3.39.4' },
|
||||
{ name, platform: 'linux', arch: 'aarch64', version: '3.40.0' },
|
||||
{ name, platform: 'linux', arch: 'x86-64', version: '3.39.4' },
|
||||
{ name, platform: 'linux', arch: 'x86-64', version: '3.40.0' }
|
||||
];
|
||||
}
|
||||
|
|
|
@ -14,8 +14,10 @@ import { getClient } from '@tauri-apps/api/http';
|
|||
// import { invoke } from '@tauri-apps/api';
|
||||
import { Command } from '@tauri-apps/api/shell';
|
||||
import { readDir, BaseDirectory } from '@tauri-apps/api/fs';
|
||||
import type { Package, Review, AirtablePost, User } from '@tea/ui/types';
|
||||
|
||||
import type { Package, Review, AirtablePost, User, Bottle } from '@tea/ui/types';
|
||||
import type { GUIPackage, Course, Category, AuthStatus } from '../types';
|
||||
|
||||
import * as mock from './mock';
|
||||
import { PackageStates } from '../types';
|
||||
|
||||
|
@ -176,5 +178,13 @@ type DeviceAuth = {
|
|||
export async function getDeviceAuth(): Promise<DeviceAuth> {
|
||||
const deviceId = 'xyxz123';
|
||||
const data = await get<DeviceAuth>(`/auth/device/${deviceId}`);
|
||||
}
|
||||
|
||||
export async function getPackageBottles(packageName: string): Promise<Bottle[]> {
|
||||
console.log('getting bottles for ', packageName);
|
||||
const client = await getClient();
|
||||
const uri = join('https://app.tea.xyz/api/bottles/', packageName);
|
||||
const { data } = await client.get<Bottle[]>(uri.toString());
|
||||
console.log('got bottles', data);
|
||||
return data;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,3 @@
|
|||
<News />
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
|
47
modules/ui/src/Bottles/Bottles.svelte
Normal file
47
modules/ui/src/Bottles/Bottles.svelte
Normal file
|
@ -0,0 +1,47 @@
|
|||
<script lang="ts">
|
||||
import type { Bottle } from '../types';
|
||||
export let bottles: Bottle[];
|
||||
|
||||
let versions: string[] = [];
|
||||
let available: Set<string>;
|
||||
|
||||
$: versions = [...new Set(bottles.map((b) => b.version))];
|
||||
$: available = new Set(bottles.map((b) => `${b.platform}-${b.arch}`));
|
||||
</script>
|
||||
|
||||
<div class="my-4 w-full p-2">
|
||||
<div>
|
||||
<h4 class="mb-4 text-lg text-primary">
|
||||
{versions.length} version{versions.length === 1 ? '' : 's'} bottled
|
||||
</h4>
|
||||
</div>
|
||||
<table class="w-full table-auto border border-gray font-sono">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="border border-gray px-2 py-4">version</th>
|
||||
<th class="border border-gray px-2 py-4">darwin-aarch64</th>
|
||||
<th class="border border-gray px-2 py-4">darwin-x86-64</th>
|
||||
<th class="border border-gray px-2 py-4">linux-aarch64</th>
|
||||
<th class="border border-gray px-2 py-4">linux-x86-64</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each versions as version}
|
||||
<tr>
|
||||
<th class="border border-gray px-2 py-4 text-left">{version}</th>
|
||||
<td class="border border-gray px-2 py-4"
|
||||
>{available.has('darwin-aarch64') ? '✅' : '❌'}</td
|
||||
>
|
||||
<td class="border border-gray px-2 py-4"
|
||||
>{available.has('darwin-x86-64') ? '✅' : '❌'}</td
|
||||
>
|
||||
<td class="border border-gray px-2 py-4"
|
||||
>{available.has('linux-aarch64') ? '✅' : '❌'}</td
|
||||
>
|
||||
<td class="border border-gray px-2 py-4">{available.has('linux-x86-64') ? '✅' : '❌'}</td
|
||||
>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
|
@ -43,3 +43,10 @@ export type User = {
|
|||
country?: string;
|
||||
wallet?: string;
|
||||
};
|
||||
|
||||
export type Bottle = {
|
||||
name: string;
|
||||
platform: string;
|
||||
arch: string;
|
||||
version: string;
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"release": "sh ./.github/update-latest-binary.sh",
|
||||
"build:gui": "pnpm --filter gui exec tauri build",
|
||||
"build:gui": "pnpm --filter gui exec tauri build --verbose",
|
||||
"dev:gui": "pnpm --filter gui exec tauri dev",
|
||||
"web:gui": "BUILD_FOR=preview pnpm --filter gui dev"
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue