diff --git a/apps/renderer/src/pages/(main)/(layer)/(subview)/rsshub/index.tsx b/apps/renderer/src/pages/(main)/(layer)/(subview)/rsshub/index.tsx
index a3230e99c..f97d304b3 100644
--- a/apps/renderer/src/pages/(main)/(layer)/(subview)/rsshub/index.tsx
+++ b/apps/renderer/src/pages/(main)/(layer)/(subview)/rsshub/index.tsx
@@ -36,6 +36,7 @@ export function Component() {
function List({ data }: { data?: RSSHubModel[] }) {
const { t } = useTranslation("settings")
const me = whoami()
+ const status = useAuthQuery(Queries.rsshub.status())
return (
@@ -78,18 +79,17 @@ function List({ data }: { data?: RSSHubModel[] }) {
*
Unlimited
-
-
-
+ {!status?.data?.usage?.rsshubId && }
+ {!!status?.data?.usage?.rsshubId && }
- {data?.map((instance, index) => {
+ {data?.map((instance) => {
return (
{(() => {
const flag: string[] = []
- if (index === 0) {
+ if (status?.data?.usage?.rsshubId === instance.id) {
flag.push("In use")
}
if (instance.ownerUserId === me?.id) {
@@ -115,8 +115,12 @@ function List({ data }: { data?: RSSHubModel[] }) {
{instance.userLimit || t("rsshub.table.unlimited")}
- {index === 0 && }
- {index !== 0 && }
+ {status?.data?.usage?.rsshubId === instance.id && (
+
+ )}
+ {status?.data?.usage?.rsshubId !== instance.id && (
+
+ )}
{me?.id === instance.ownerUserId && (
)}
diff --git a/apps/renderer/src/queries/rsshub.ts b/apps/renderer/src/queries/rsshub.ts
index d2c0d3fbe..bb51308b9 100644
--- a/apps/renderer/src/queries/rsshub.ts
+++ b/apps/renderer/src/queries/rsshub.ts
@@ -2,6 +2,7 @@ import { useMutation } from "@tanstack/react-query"
import { apiClient } from "~/lib/api-fetch"
import { defineQuery } from "~/lib/defineQuery"
+import { userActions } from "~/store/user"
import type { MutationBaseProps } from "./types"
@@ -48,6 +49,14 @@ export const rsshub = {
list: () =>
defineQuery(["rsshub", "list"], async () => {
const res = await apiClient.rsshub.list.$get()
+ userActions.upsert(res.data.map((item) => item.owner).filter((item) => item !== null))
+
+ return res.data
+ }),
+
+ status: () =>
+ defineQuery(["rsshub", "status"], async () => {
+ const res = await apiClient.rsshub.status.$get()
return res.data
}),
}
diff --git a/locales/settings/en.json b/locales/settings/en.json
index 606ab21de..dc3954a9d 100644
--- a/locales/settings/en.json
+++ b/locales/settings/en.json
@@ -283,7 +283,7 @@
"rsshub.table.edit": "Edit",
"rsshub.table.inuse": "In Use",
"rsshub.table.owner": "Owner",
- "rsshub.table.price": "Price",
+ "rsshub.table.price": "Monthly Price",
"rsshub.table.unlimited": "Unlimited",
"rsshub.table.use": "Use",
"rsshub.table.userCount": "User Count",
diff --git a/packages/shared/src/hono.ts b/packages/shared/src/hono.ts
index 8ad921c63..c4b002b1f 100644
--- a/packages/shared/src/hono.ts
+++ b/packages/shared/src/hono.ts
@@ -4161,15 +4161,15 @@ declare const invitationsOpenAPISchema: zod.ZodObject<{
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
code: string;
createdAt: string | null;
+ usedAt: string | null;
fromUserId: string;
toUserId: string | null;
- usedAt: string | null;
}, {
code: string;
createdAt: string | null;
+ usedAt: string | null;
fromUserId: string;
toUserId: string | null;
- usedAt: string | null;
}>;
declare const invitationsRelations: drizzle_orm.Relations<"invitations", {
users: drizzle_orm.One<"user", false>;
@@ -4963,40 +4963,6 @@ declare const rsshubUsage: drizzle_orm_pg_core.PgTableWithColumns<{
identity: undefined;
generated: undefined;
}, {}, {}>;
- hash: drizzle_orm_pg_core.PgColumn<{
- name: "hash";
- tableName: "rsshub_usage";
- dataType: "string";
- columnType: "PgText";
- data: string;
- driverParam: string;
- notNull: false;
- hasDefault: false;
- isPrimaryKey: false;
- isAutoincrement: false;
- hasRuntimeDefault: false;
- enumValues: [string, ...string[]];
- baseColumn: never;
- identity: undefined;
- generated: undefined;
- }, {}, {}>;
- expiresAt: drizzle_orm_pg_core.PgColumn<{
- name: "expires_at";
- tableName: "rsshub_usage";
- dataType: "date";
- columnType: "PgTimestamp";
- data: Date;
- driverParam: string;
- notNull: false;
- hasDefault: false;
- isPrimaryKey: false;
- isAutoincrement: false;
- hasRuntimeDefault: false;
- enumValues: undefined;
- baseColumn: never;
- identity: undefined;
- generated: undefined;
- }, {}, {}>;
};
dialect: "pg";
}>;
@@ -5004,20 +4970,14 @@ declare const rsshubUsageOpenAPISchema: zod.ZodObject<{
id: zod.ZodString;
rsshubId: zod.ZodString;
userId: zod.ZodString;
- hash: zod.ZodNullable;
- expiresAt: zod.ZodNullable;
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
id: string;
userId: string;
- hash: string | null;
rsshubId: string;
- expiresAt: string | null;
}, {
id: string;
userId: string;
- hash: string | null;
rsshubId: string;
- expiresAt: string | null;
}>;
declare const rsshubUsageRelations: drizzle_orm.Relations<"rsshub_usage", {
rsshub: drizzle_orm.One<"rsshub", true>;
@@ -6220,6 +6180,23 @@ declare const transactions: drizzle_orm_pg_core.PgTableWithColumns<{
identity: undefined;
generated: undefined;
}, {}, {}>;
+ toRSSHubId: drizzle_orm_pg_core.PgColumn<{
+ name: "to_rsshub_id";
+ tableName: "transactions";
+ dataType: "string";
+ columnType: "PgText";
+ data: string;
+ driverParam: string;
+ notNull: false;
+ hasDefault: false;
+ isPrimaryKey: false;
+ isAutoincrement: false;
+ hasRuntimeDefault: false;
+ enumValues: [string, ...string[]];
+ baseColumn: never;
+ identity: undefined;
+ generated: undefined;
+ }, {}, {}>;
powerToken: drizzle_orm_pg_core.PgColumn<{
name: "power_token";
tableName: "transactions";
@@ -6299,6 +6276,7 @@ declare const transactionsOpenAPISchema: zod.ZodObject<{
toFeedId: zod.ZodNullable;
toListId: zod.ZodNullable;
toEntryId: zod.ZodNullable;
+ toRSSHubId: zod.ZodNullable;
powerToken: zod.ZodString;
tax: zod.ZodString;
createdAt: zod.ZodString;
@@ -6313,6 +6291,7 @@ declare const transactionsOpenAPISchema: zod.ZodObject<{
toFeedId: string | null;
toListId: string | null;
toEntryId: string | null;
+ toRSSHubId: string | null;
tax: string;
comment: string | null;
}, {
@@ -6325,6 +6304,7 @@ declare const transactionsOpenAPISchema: zod.ZodObject<{
toFeedId: string | null;
toListId: string | null;
toEntryId: string | null;
+ toRSSHubId: string | null;
tax: string;
comment: string | null;
}>;
@@ -6585,6 +6565,47 @@ declare const boosts: drizzle_orm_pg_core.PgTableWithColumns<{
};
dialect: "pg";
}>;
+declare const rsshubPurchase: drizzle_orm_pg_core.PgTableWithColumns<{
+ name: "rsshub_purchase";
+ schema: undefined;
+ columns: {
+ hash: drizzle_orm_pg_core.PgColumn<{
+ name: "hash";
+ tableName: "rsshub_purchase";
+ dataType: "string";
+ columnType: "PgText";
+ data: string;
+ driverParam: string;
+ notNull: true;
+ hasDefault: false;
+ isPrimaryKey: true;
+ isAutoincrement: false;
+ hasRuntimeDefault: false;
+ enumValues: [string, ...string[]];
+ baseColumn: never;
+ identity: undefined;
+ generated: undefined;
+ }, {}, {}>;
+ expiresAt: drizzle_orm_pg_core.PgColumn<{
+ name: "expires_at";
+ tableName: "rsshub_purchase";
+ dataType: "date";
+ columnType: "PgTimestamp";
+ data: Date;
+ driverParam: string;
+ notNull: true;
+ hasDefault: false;
+ isPrimaryKey: false;
+ isAutoincrement: false;
+ hasRuntimeDefault: false;
+ enumValues: undefined;
+ baseColumn: never;
+ identity: undefined;
+ generated: undefined;
+ }, {}, {}>;
+ };
+ dialect: "pg";
+}>;
declare const auth: {
handler: (request: Request) => Promise;
@@ -7438,6 +7459,7 @@ declare const auth: {
createdAt: Date;
updatedAt: Date;
};
+ token: string;
redirect: boolean;
url: string | undefined;
}>;
@@ -9475,9 +9497,9 @@ declare const auth: {
invitation: {
code: string;
createdAt: Date | null;
+ usedAt: Date | null;
fromUserId: string;
toUserId: string | null;
- usedAt: Date | null;
} | undefined;
role: "user" | "trial";
} | null>;
@@ -9643,9 +9665,9 @@ declare const auth: {
invitation: {
code: string;
createdAt: Date | null;
+ usedAt: Date | null;
fromUserId: string;
toUserId: string | null;
- usedAt: Date | null;
} | undefined;
role: "user" | "trial";
} | null>;
@@ -11077,8 +11099,8 @@ declare const _routes: hono_hono_base.HonoBase, "/">;
type AppType = typeof _routes;
-export { type ActionsModel, type AirdropActivity, type AppType, type AttachmentsModel, type AuthSession, type AuthUser, CommonEntryFields, type ConditionItem, type DetailModel, type EntriesModel, type EntryReadHistoriesModel, type ExtraModel, type FeedModel, type MediaModel, type MessagingData, MessagingType, type SettingsModel, account, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, activityEnum, airdrops, airdropsOpenAPISchema, attachmentsZodSchema, authPlugins, boosts, collections, collectionsOpenAPISchema, collectionsRelations, detailModelSchema, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, extraZodSchema, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsOpenAPISchema, feedsRelations, inboxHandleSchema, inboxes, inboxesEntries, inboxesEntriesInsertOpenAPISchema, type inboxesEntriesModel, inboxesEntriesOpenAPISchema, inboxesEntriesRelations, inboxesOpenAPISchema, inboxesRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, levels, levelsOpenAPISchema, levelsRelations, lists, listsOpenAPISchema, listsRelations, listsSubscriptions, listsSubscriptionsOpenAPISchema, listsSubscriptionsRelations, listsTimeline, listsTimelineOpenAPISchema, listsTimelineRelations, lower, mediaZodSchema, messaging, messagingOpenAPISchema, messagingRelations, rsshub, rsshubOpenAPISchema, rsshubUsage, rsshubUsageOpenAPISchema, rsshubUsageRelations, session, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, user, users, usersOpenApiSchema, usersRelations, verification, wallets, walletsOpenAPISchema, walletsRelations };
+export { type ActionsModel, type AirdropActivity, type AppType, type AttachmentsModel, type AuthSession, type AuthUser, CommonEntryFields, type ConditionItem, type DetailModel, type EntriesModel, type EntryReadHistoriesModel, type ExtraModel, type FeedModel, type MediaModel, type MessagingData, MessagingType, type SettingsModel, account, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, activityEnum, airdrops, airdropsOpenAPISchema, attachmentsZodSchema, authPlugins, boosts, collections, collectionsOpenAPISchema, collectionsRelations, detailModelSchema, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, extraZodSchema, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsOpenAPISchema, feedsRelations, inboxHandleSchema, inboxes, inboxesEntries, inboxesEntriesInsertOpenAPISchema, type inboxesEntriesModel, inboxesEntriesOpenAPISchema, inboxesEntriesRelations, inboxesOpenAPISchema, inboxesRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, levels, levelsOpenAPISchema, levelsRelations, lists, listsOpenAPISchema, listsRelations, listsSubscriptions, listsSubscriptionsOpenAPISchema, listsSubscriptionsRelations, listsTimeline, listsTimelineOpenAPISchema, listsTimelineRelations, lower, mediaZodSchema, messaging, messagingOpenAPISchema, messagingRelations, rsshub, rsshubOpenAPISchema, rsshubPurchase, rsshubUsage, rsshubUsageOpenAPISchema, rsshubUsageRelations, session, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, user, users, usersOpenApiSchema, usersRelations, verification, wallets, walletsOpenAPISchema, walletsRelations };