mirror of
https://github.com/khairul169/garage-webui.git
synced 2025-10-14 23:09:32 +07:00
Delete all related to object lock
This commit is contained in:
parent
2f86d52dac
commit
e9efea9309
@ -1,8 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"khairul169/garage-webui/utils"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"net/url"
|
||||
@ -10,6 +13,16 @@ import (
|
||||
)
|
||||
|
||||
func ProxyHandler(w http.ResponseWriter, r *http.Request) {
|
||||
// Log CreateBucket requests
|
||||
if strings.Contains(r.URL.Path, "CreateBucket") && r.Method == "POST" {
|
||||
body, err := io.ReadAll(r.Body)
|
||||
if err == nil {
|
||||
log.Printf("CreateBucket request body: %s", string(body))
|
||||
// Restore body for proxy
|
||||
r.Body = io.NopCloser(bytes.NewReader(body))
|
||||
}
|
||||
}
|
||||
|
||||
target, err := url.Parse(utils.Garage.GetAdminEndpoint())
|
||||
if err != nil {
|
||||
utils.ResponseError(w, err)
|
||||
|
@ -14,9 +14,16 @@ const BucketCard = ({ data }: Props) => {
|
||||
<div className="flex flex-row items-start gap-x-3 col-span-2">
|
||||
<ArchiveIcon size={28} className="shrink-0" />
|
||||
|
||||
<p className="text-xl font-medium truncate">
|
||||
{data.aliases?.join(", ")}
|
||||
</p>
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex flex-row items-center gap-2">
|
||||
<p className="text-xl font-medium truncate">
|
||||
{data.aliases?.join(", ")}
|
||||
</p>
|
||||
{data.websiteAccess && (
|
||||
<div className="badge badge-sm badge-primary">Website</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
@ -29,7 +29,7 @@ export const useCreateBucket = (
|
||||
options?: UseMutationOptions<any, Error, CreateBucketSchema>
|
||||
) => {
|
||||
return useMutation({
|
||||
mutationFn: (body) => api.post("/v2/CreateBucket", { body }),
|
||||
mutationFn: (body) => api.post("/v2/CreateBucket", body),
|
||||
...options,
|
||||
});
|
||||
};
|
||||
|
@ -1,20 +1,18 @@
|
||||
import { useDenyKey } from "../hooks";
|
||||
import { Card, Checkbox, Table } from "react-daisyui";
|
||||
import Button from "@/components/ui/button";
|
||||
import { Trash, Shield, Lock, Settings } from "lucide-react";
|
||||
import { Trash, Shield } from "lucide-react";
|
||||
import AllowKeyDialog from "./allow-key-dialog";
|
||||
import { useMemo, useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { handleError } from "@/lib/utils";
|
||||
import { useBucketContext } from "../context";
|
||||
import KeyPermissionsEditor from "@/components/s3-permissions/key-permissions-editor";
|
||||
import ObjectLockingManager from "@/components/s3-permissions/object-locking-manager";
|
||||
|
||||
const PermissionsTab = () => {
|
||||
const { bucket, refetch } = useBucketContext();
|
||||
const [selectedKey, setSelectedKey] = useState<{accessKeyId: string, name: string} | null>(null);
|
||||
const [showKeyEditor, setShowKeyEditor] = useState(false);
|
||||
const [showObjectLocking, setShowObjectLocking] = useState(false);
|
||||
|
||||
const denyKey = useDenyKey(bucket.id, {
|
||||
onSuccess: () => {
|
||||
@ -55,13 +53,6 @@ const PermissionsTab = () => {
|
||||
<Card className="card-body">
|
||||
<div className="flex flex-row items-center gap-2">
|
||||
<Card.Title className="flex-1 truncate">Access Keys</Card.Title>
|
||||
<Button
|
||||
icon={Lock}
|
||||
onClick={() => setShowObjectLocking(true)}
|
||||
className="btn-outline btn-sm"
|
||||
>
|
||||
Object Lock
|
||||
</Button>
|
||||
<AllowKeyDialog currentKeys={keys?.map((key) => key.accessKeyId)} />
|
||||
</div>
|
||||
|
||||
@ -140,15 +131,6 @@ const PermissionsTab = () => {
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Object Locking Manager Modal */}
|
||||
{showObjectLocking && (
|
||||
<ObjectLockingManager
|
||||
bucketId={bucket.id}
|
||||
bucketName={bucket.globalAliases?.[0] || bucket.id}
|
||||
isOpen={showObjectLocking}
|
||||
onClose={() => setShowObjectLocking(false)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user