mirror of
https://github.com/rustfs/console.git
synced 2026-08-28 19:47:21 +08:00
fix: remove unsupported tier providers (#144)
This commit is contained in:
@@ -26,10 +26,6 @@ function getConfig(row: TierRow): TierConfig | undefined {
|
||||
return row.s3
|
||||
case "aliyun":
|
||||
return row.aliyun
|
||||
case "tencent":
|
||||
return row.tencent
|
||||
case "huaweicloud":
|
||||
return row.huaweicloud
|
||||
case "azure":
|
||||
return row.azure
|
||||
case "gcs":
|
||||
|
||||
@@ -23,13 +23,6 @@ const TYPE_OPTIONS = [
|
||||
{ labelKey: "Minio", value: "minio", icon: "/svg/minio.svg", descKey: "External MinIO tier" },
|
||||
{ labelKey: "AWS S3", value: "s3", icon: "/svg/aws.svg", descKey: "Standard AWS S3 tier" },
|
||||
{ labelKey: "Aliyun OSS", value: "aliyun", icon: "/svg/aliyun.svg", descKey: "Alibaba Cloud Object Storage Service" },
|
||||
{ labelKey: "Tencent COS", value: "tencent", icon: "/svg/tenxunyun.svg", descKey: "Tencent Cloud Object Storage" },
|
||||
{
|
||||
labelKey: "Huawei OBS",
|
||||
value: "huaweicloud",
|
||||
icon: "/svg/huaweiyun.svg",
|
||||
descKey: "Huawei Cloud Object Storage Service",
|
||||
},
|
||||
{ labelKey: "Azure Blob", value: "azure", icon: "/svg/azure.svg", descKey: "Microsoft Azure Blob Storage" },
|
||||
{ labelKey: "Google Cloud Storage", value: "gcs", icon: "/svg/google.svg", descKey: "Google Cloud Storage" },
|
||||
{ labelKey: "Cloudflare R2", value: "r2", icon: "/svg/cloudflare.svg", descKey: "Cloudflare R2 Storage" },
|
||||
|
||||
+4
-3
@@ -18,14 +18,14 @@ export interface TierRow {
|
||||
minio?: TierConfig
|
||||
s3?: TierConfig
|
||||
aliyun?: TierConfig
|
||||
tencent?: TierConfig
|
||||
huaweicloud?: TierConfig
|
||||
azure?: TierConfig
|
||||
gcs?: TierConfig
|
||||
r2?: TierConfig
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
const UNSUPPORTED_TIER_TYPES = new Set(["huaweicloud", "tencent"])
|
||||
|
||||
export function useTiers() {
|
||||
const api = useApi()
|
||||
|
||||
@@ -44,7 +44,8 @@ export function useTiers() {
|
||||
)
|
||||
|
||||
const listTiers = useCallback(async () => {
|
||||
return api.get("/tier") as Promise<TierRow[]>
|
||||
const tiers = (await api.get("/tier")) as TierRow[] | undefined
|
||||
return (tiers ?? []).filter((tier) => !UNSUPPORTED_TIER_TYPES.has(tier.type))
|
||||
}, [api])
|
||||
|
||||
const removeTiers = useCallback(
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<svg t="1744879150545" class="icon" viewBox="0 0 1382 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5020" width="200" height="200"><path d="M587.001106 0.138043a236.743057 236.743057 0 0 0-179.455379 83.9299c-70.263683 96.629819-19.187921 232.739822 19.187921 310.319763s210.791049 355.32165 217.141009 361.671609 12.837962 6.488002 12.837961 0 19.049879-413.437584 6.34996-510.757616A1387.742249 1387.742249 0 0 0 587.001106 0.138043z m-376.856296 187.185764c-12.837962 0-102.289566 96.629819-115.127527 180.973847s31.88784 148.671879 134.177406 219.625775C337.834215 665.365328 587.001106 800.785117 593.627151 794.849286c6.211917-12.976004-95.801564-193.259639-185.391211-329.645727S222.84473 187.323807 210.14481 187.323807z m31.887841 827.151254c76.613642 32.301968 197.953087-45.277972 229.840927-64.603937l89.589647-64.603936-434.558102 12.837962a331.992451 331.992451 0 0 0 115.127528 116.369911z m12.699919-355.32165C178.118927 620.225398 18.541683 529.807495 12.053681 529.807495s-31.88784 116.369911 19.187921 200.437854 147.015368 110.434079 191.603128 116.369911c51.213804 6.34996 345.106498 6.34996 345.106497 0-6.488002-6.626045-236.605015-148.809922-313.218657-187.461849zM970.345404 83.9299A237.295228 237.295228 0 0 0 791.580238 0.138043a1026.622809 1026.622809 0 0 0-70.263683 239.089781c-12.837962 96.629819 6.34996 510.757617 6.349959 510.757617 0 6.34996 6.211917 6.34996 12.699919 0s185.253168-291.269884 217.141009-362.22378 82.825559-207.063899 12.837962-303.693718z m402.532218 445.877595c-6.34996 0-165.651119 90.417902-242.816931 129.345916S823.468078 840.127258 817.118119 846.61526c0 6.34996 293.892693 6.34996 345.106497 0 44.725802-6.488002 140.527366-32.440011 191.603128-116.369911 44.725802-84.067943 19.187921-200.437854 19.187921-200.437854zM906.43168 949.871124c31.88784 19.464006 153.365328 96.629819 229.97897 64.603937a266.008088 266.008088 0 0 0 114.851443-122.857914l-434.42006-12.837961zM1283.840146 368.297654c-6.211917-84.067943-102.289566-180.973847-114.989485-180.973847s-121.339445 142.183877-204.441089 277.879752S778.604233 781.873281 785.092236 794.849286s255.516851-129.345915 364.018333-207.063899c102.289566-70.953896 140.665408-129.207873 134.177407-219.625775z" fill="#EA020A" p-id="5021"></path></svg>
|
||||
|
Before Width: | Height: | Size: 2.2 KiB |
@@ -1 +0,0 @@
|
||||
<svg t="1744879012827" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2958" width="200" height="200"><path d="M753.066667 516.266667c-12.8-17.066667-27.733333-23.466667-51.2-29.866667-6.4-2.133333-27.733333-2.133333-32-2.133333 0 0-6.4 2.133333-10.666667 4.266666-6.4 2.133333-10.666667 4.266667-17.066667 6.4-8.533333 4.266667-25.6 17.066667-27.733333 19.2-2.133333 2.133333-4.266667 6.4-8.533333 8.533334-8.533333 6.4-59.733333 57.6-74.666667 70.4l-38.4 38.4c-17.066667 17.066667-29.866667 29.866667-29.866667 32 0 2.133333 194.133333 2.133333 217.6 0 8.533333 0 17.066667-2.133333 25.6-2.133334 17.066667-4.266667 34.133333-14.933333 46.933334-32 6.4-8.533333 10.666667-17.066667 14.933333-29.866666 2.133333-8.533333 4.266667-12.8 2.133333-27.733334 2.133333-23.466667-4.266667-38.4-17.066666-55.466666zM832 106.666667H192C145.066667 106.666667 106.666667 145.066667 106.666667 192v640c0 46.933333 38.4 85.333333 85.333333 85.333333h640c46.933333 0 85.333333-38.4 85.333333-85.333333V192c0-46.933333-38.4-85.333333-85.333333-85.333333z m-53.333333 580.266666c-10.666667 8.533333-23.466667 17.066667-29.866667 19.2-2.133333 0-4.266667 2.133333-6.4 2.133334-2.133333 2.133333-23.466667 6.4-36.266667 10.666666-10.666667 2.133333-27.733333 2.133333-194.133333 2.133334-198.4 0-189.866667 0-215.466667-6.4-21.333333-6.4-42.666667-19.2-59.733333-36.266667-29.866667-27.733333-42.666667-64-42.666667-104.533333 0-14.933333 2.133333-29.866667 6.4-44.8 6.4-17.066667 8.533333-23.466667 27.733334-49.066667 4.266667-4.266667 23.466667-21.333333 29.866666-27.733333 10.666667-6.4 44.8-21.333333 51.2-21.333334 4.266667 0 6.4-4.266667 8.533334-10.666666 6.4-21.333333 8.533333-25.6 12.8-40.533334 10.666667-25.6 29.866667-51.2 53.333333-70.4 4.266667-4.266667 8.533333-6.4 12.8-10.666666 2.133333-2.133333 4.266667-2.133333 6.4-4.266667 17.066667-12.8 53.333333-27.733333 78.933333-29.866667 27.733333-4.266667 59.733333-2.133333 81.066667 6.4 17.066667 4.266667 21.333333 6.4 23.466667 8.533334 4.266667 2.133333 10.666667 4.266667 14.933333 6.4 19.2 8.533333 42.666667 27.733333 55.466667 42.666666 10.666667 12.8 23.466667 27.733333 25.6 34.133334 0 2.133333 2.133333 4.266667 4.266666 6.4 2.133333 2.133333 4.266667 6.4 4.266667 10.666666 0 2.133333 2.133333 6.4 4.266667 10.666667 4.266667 8.533333 4.266667 8.533333-19.2 10.666667-10.666667 0-23.466667 2.133333-27.733334 2.133333-2.133333 0-6.4 2.133333-8.533333 2.133333 0 0-4.266667-4.266667-6.4-10.666666-6.4-12.8-19.2-25.6-29.866667-36.266667-17.066667-14.933333-34.133333-23.466667-59.733333-29.866667-12.8-8.533333-17.066667-8.533333-32-8.533333-12.8 0-21.333333 0-27.733333 2.133333-4.266667 2.133333-10.666667 2.133333-12.8 4.266667-17.066667 4.266667-38.4 17.066667-53.333334 29.866667-14.933333 14.933333-25.6 27.733333-32 42.666666-4.266667 6.4-12.8 29.866667-10.666666 32 0 0 6.4 4.266667 12.8 6.4 14.933333 4.266667 27.733333 12.8 40.533333 21.333334 12.8 8.533333 34.133333 27.733333 36.266667 29.866666 4.266667 4.266667 10.666667 8.533333 14.933333 12.8 6.4 6.4 12.8 10.666667 12.8 12.8 0 0-6.4 8.533333-14.933333 17.066667-19.2 17.066667-23.466667 21.333333-25.6 21.333333 0 0-4.266667-4.266667-10.666667-6.4-4.266667-4.266667-10.666667-10.666667-14.933333-12.8-4.266667-2.133333-10.666667-8.533333-14.933334-12.8-23.466667-21.333333-49.066667-34.133333-72.533333-34.133333-19.2 0-44.8 8.533333-57.6 21.333333-12.8 10.666667-25.6 29.866667-29.866667 46.933334-2.133333 10.666667-2.133333 34.133333 0 44.8 8.533333 34.133333 36.266667 57.6 70.4 64 10.666667 2.133333 21.333333 2.133333 32 2.133333h21.333334l10.666666-10.666667 23.466667-23.466666c40.533333-38.4 81.066667-76.8 119.466667-115.2 19.2-19.2 51.2-49.066667 68.266666-61.866667 8.533333-6.4 23.466667-14.933333 32-17.066667 4.266667-2.133333 8.533333-4.266667 12.8-4.266666 10.666667-4.266667 25.6-6.4 49.066667-4.266667 8.533333 0 14.933333 0 23.466667 2.133333 6.4 2.133333 29.866667 10.666667 32 10.666667 2.133333 2.133333 4.266667 2.133333 6.4 2.133333 6.4 2.133333 14.933333 8.533333 27.733333 19.2 12.8 10.666667 19.2 17.066667 23.466667 25.6 2.133333 2.133333 4.266667 6.4 6.4 8.533334 2.133333 2.133333 12.8 23.466667 12.8 25.6 0 2.133333 0 4.266667 2.133333 6.4 4.266667 6.4 8.533333 36.266667 8.533333 46.933333-2.133333 40.533333-23.466667 83.2-55.466666 110.933333z" fill="#44a4f8" p-id="2959"></path></svg>
|
||||
|
Before Width: | Height: | Size: 4.3 KiB |
@@ -0,0 +1,19 @@
|
||||
import test from "node:test"
|
||||
import assert from "node:assert/strict"
|
||||
import fs from "node:fs"
|
||||
|
||||
test("tier UI no longer offers Huawei or Tencent storage support", () => {
|
||||
const newFormSource = fs.readFileSync("components/tiers/new-form.tsx", "utf8")
|
||||
const pageSource = fs.readFileSync("app/(dashboard)/tiers/page.tsx", "utf8")
|
||||
const hookSource = fs.readFileSync("hooks/use-tiers.ts", "utf8")
|
||||
|
||||
assert.equal(newFormSource.includes("Huawei OBS"), false)
|
||||
assert.equal(newFormSource.includes("huaweiyun.svg"), false)
|
||||
assert.equal(newFormSource.includes("Tencent COS"), false)
|
||||
assert.equal(newFormSource.includes("tenxunyun.svg"), false)
|
||||
assert.equal(pageSource.includes("row.huaweicloud"), false)
|
||||
assert.equal(pageSource.includes("row.tencent"), false)
|
||||
assert.equal(hookSource.includes("huaweicloud?: TierConfig"), false)
|
||||
assert.equal(hookSource.includes("tencent?: TierConfig"), false)
|
||||
assert.equal(hookSource.includes('UNSUPPORTED_TIER_TYPES = new Set(["huaweicloud", "tencent"])'), true)
|
||||
})
|
||||
Reference in New Issue
Block a user