Skip to content

Commit

Permalink
add download button
Browse files Browse the repository at this point in the history
  • Loading branch information
arjanfrans committed Mar 19, 2024
1 parent 3c80a33 commit 66ceb00
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 41 deletions.
40 changes: 2 additions & 38 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,6 @@ env:


jobs:
cxt:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Build
run: |
npm ci
npm run build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
# Upload dist directory
name: 'wbsc-ticker-chrome-extension'
path: './dist/cxt/'

web:
runs-on: ubuntu-latest
permissions:
Expand All @@ -47,9 +18,6 @@ jobs:
matrix:
node-version: [20.x]

needs:
- cxt

steps:
- uses: actions/checkout@v3

Expand All @@ -58,16 +26,12 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- uses: actions/download-artifact@master
with:
name: 'wbsc-ticker-chrome-extension'
path: './cxt'

- name: Build
run: |
cd cxt && zip -r -q wbsc-ticker-cxt.zip . * && mv wbsc-ticker-cxt.zip ./dist/web/ && cd -
ls
npm ci
npm run build
zip -r -q wbsc-ticker-cxt.zip ./dist/cxt/* && mv wbsc-ticker-cxt.zip ./dist/web/
npm run build:web
- name: Setup Pages
uses: actions/configure-pages@v3
Expand Down
11 changes: 8 additions & 3 deletions src/web/login-container.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import './login-container.css'
import "./login-container.css";
import { setComponent } from "../framework";
import { LoginComponent } from "./login-component";

Expand All @@ -13,13 +13,18 @@ export class LoginContainer extends HTMLElement {
super();

this.innerHTML = this.render();
this.style.marginInline = '24px';
this.style.marginInline = "24px";

const loginComponent = new LoginComponent(defaultCredentials, async (username, password) => {
return await handleLogin(username, password);
});

(this.querySelector('#login-form-container') as HTMLDivElement).append(loginComponent);
(this.querySelector("#login-form-container") as HTMLDivElement).append(loginComponent);
const downloadCxtButton = this.querySelector("#download-cxt-button") as HTMLButtonElement;

downloadCxtButton.addEventListener("click", () => {
window.open("./wbsc-ticker-cxt.zip");
});
}

private render(): string {
Expand Down

0 comments on commit 66ceb00

Please sign in to comment.