Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Change activity log level "WARNING" to "WARN"

天舟fcbc49053972
diff --git a/api/activity.go b/api/activity.go
index 196b4e0566..990c4994ea 100644
--- a/api/activity.go
+++ b/api/activity.go
@@ -57,17 +57,17 @@ func (e ActivityType) String() string {
type ActivityLevel string
const (
- ACTIVITY_INFO ActivityLevel = "INFO"
- ACTIVITY_WARNING ActivityLevel = "WARNING"
- ACTIVITY_ERROR ActivityLevel = "ERROR"
+ ACTIVITY_INFO ActivityLevel = "INFO"
+ ACTIVITY_WARN ActivityLevel = "WARN"
+ ACTIVITY_ERROR ActivityLevel = "ERROR"
)
func (e ActivityLevel) String() string {
switch e {
case ACTIVITY_INFO:
return "INFO"
- case ACTIVITY_WARNING:
- return "WARNING"
+ case ACTIVITY_WARN:
+ return "WARN"
case ACTIVITY_ERROR:
return "ERROR"
}
diff --git a/frontend/src/components/ActivityTable.vue b/frontend/src/components/ActivityTable.vue
index 21bb3d4a54..fae97ebe15 100644
--- a/frontend/src/components/ActivityTable.vue
+++ b/frontend/src/components/ActivityTable.vue
@@ -36,7 +36,7 @@
></path>
</svg>
</template>
- <template v-else-if="activity.level === `WARNING`">
+ <template v-else-if="activity.level === `WARN`">
<svg
class="text-warning"
fill="none"
diff --git a/frontend/src/components/InboxList.vue b/frontend/src/components/InboxList.vue
index 8cd31551bc..464c20331d 100644
--- a/frontend/src/components/InboxList.vue
+++ b/frontend/src/components/InboxList.vue
@@ -33,7 +33,7 @@
>
</template>
<span> {{ actionSentence(inbox.activity) }}</span>
- <template v-if="inbox.activity.level == 'WARNING'">
+ <template v-if="inbox.activity.level == 'WARN'">
<svg
class="ml-1 h-6 w-6 text-warning"
xmlns="http://www.w3.org/2000/svg"
diff --git a/frontend/src/types/activity.ts b/frontend/src/types/activity.ts
index adc315633d..3402a76a98 100644
--- a/frontend/src/types/activity.ts
+++ b/frontend/src/types/activity.ts
@@ -25,7 +25,7 @@ export type ActivityType =
| MemberActivityType
| ProjectActivityType;
-export type ActivityLevel = "INFO" | "WARNING" | "ERROR";
+export type ActivityLevel = "INFO" | "WARN" | "ERROR";
export type ActionIssueCreatePayload = {
issueName: string;
diff --git a/server/webhook.go b/server/webhook.go
index e615ade473..5f8adb4cec 100644
--- a/server/webhook.go
+++ b/server/webhook.go
@@ -119,7 +119,7 @@ func (s *Server) registerWebhookRoutes(g *echo.Group) {
CreatorId: api.SYSTEM_BOT_ID,
ContainerId: repository.ProjectId,
Type: api.ActivityProjectRepositoryPush,
- Level: api.ACTIVITY_WARNING,
+ Level: api.ACTIVITY_WARN,
Payload: string(bytes),
}
_, err = s.ActivityManager.CreateActivity(context.Background(), activityCreate, &ActivityMeta{})
diff --git a/store/migration/10001__init_schema.sql b/store/migration/10001__init_schema.sql
index 18ac1989be..dc0ab3da0a 100644
--- a/store/migration/10001__init_schema.sql
+++ b/store/migration/10001__init_schema.sql
@@ -907,7 +907,7 @@ CREATE TABLE activity (
updated_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
container_id INTEGER NOT NULL CHECK (container_id != 0),
`type` TEXT NOT NULL CHECK (`type` LIKE 'bb.%'),
- `level` TEXT NOT NULL CHECK (`level` IN ('INFO', 'WARNING', 'ERROR')),
+ `level` TEXT NOT NULL CHECK (`level` IN ('INFO', 'WARN', 'ERROR')),
`comment` TEXT NOT NULL DEFAULT '',
payload TEXT NOT NULL DEFAULT ''
);