Compare commits
2 Commits
7528b36c48
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9462cfbbfe | |||
| ba9f74afd5 |
@@ -0,0 +1,28 @@
|
|||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
# Runs on the forgerunner host: bundled Docker CLI + mounted /var/run/docker.sock.
|
||||||
|
runs-on: host
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Log in to Gitea Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: registry.alwisp.com
|
||||||
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and Push
|
||||||
|
run: |
|
||||||
|
# gitea.repository is already "owner/repo" (e.g. jason/breedr).
|
||||||
|
IMAGE="registry.alwisp.com/${{ gitea.repository }}"
|
||||||
|
docker build -t "${IMAGE}:latest" .
|
||||||
|
docker push "${IMAGE}:latest"
|
||||||
@@ -33,6 +33,7 @@ export function Btn({
|
|||||||
children,
|
children,
|
||||||
variant = "primary",
|
variant = "primary",
|
||||||
type = "button",
|
type = "button",
|
||||||
|
size,
|
||||||
disabled,
|
disabled,
|
||||||
onClick,
|
onClick,
|
||||||
style,
|
style,
|
||||||
@@ -40,6 +41,7 @@ export function Btn({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
variant?: "primary" | "danger" | "ghost";
|
variant?: "primary" | "danger" | "ghost";
|
||||||
type?: "button" | "submit" | "reset";
|
type?: "button" | "submit" | "reset";
|
||||||
|
size?: "sm";
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
style?: React.CSSProperties;
|
style?: React.CSSProperties;
|
||||||
@@ -47,9 +49,9 @@ export function Btn({
|
|||||||
const base: React.CSSProperties = {
|
const base: React.CSSProperties = {
|
||||||
border: "none",
|
border: "none",
|
||||||
borderRadius: "var(--radius)",
|
borderRadius: "var(--radius)",
|
||||||
padding: "8px 16px",
|
padding: size === "sm" ? "4px 10px" : "8px 16px",
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
fontSize: 13,
|
fontSize: size === "sm" ? 12 : 13,
|
||||||
cursor: disabled ? "not-allowed" : "pointer",
|
cursor: disabled ? "not-allowed" : "pointer",
|
||||||
opacity: disabled ? 0.6 : 1,
|
opacity: disabled ? 0.6 : 1,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ function emptyProduct() {
|
|||||||
return { name: "", sku: "", price: "", categoryId: "", taxId: "", description: "" };
|
return { name: "", sku: "", price: "", categoryId: "", taxId: "", description: "" };
|
||||||
}
|
}
|
||||||
|
|
||||||
function f(key: string, set: React.Dispatch<React.SetStateAction<Record<string, string>>>) {
|
function f<T extends Record<string, string>>(key: keyof T, set: React.Dispatch<React.SetStateAction<T>>) {
|
||||||
return (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) =>
|
return (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) =>
|
||||||
set((prev) => ({ ...prev, [key]: e.target.value }));
|
set((prev) => ({ ...prev, [key]: e.target.value }));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export default function UsersPage() {
|
|||||||
|
|
||||||
const openEdit = (user: User) => {
|
const openEdit = (user: User) => {
|
||||||
setSelected(user);
|
setSelected(user);
|
||||||
setForm({ name: user.name, email: user.email, password: "", roleId: user.role.id });
|
setForm({ name: user.name, email: user.email, password: "", roleId: user.role.id, vendorId: user.vendor?.id ?? "" });
|
||||||
setError("");
|
setError("");
|
||||||
setModal("edit");
|
setModal("edit");
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user