feat: display platform agent status and version
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -77,6 +77,9 @@ model ProvisionedDevice {
|
|||||||
kernel String?
|
kernel String?
|
||||||
distro String?
|
distro String?
|
||||||
device Json?
|
device Json?
|
||||||
|
agentVersion String? @map("agent_version")
|
||||||
|
agentUpdatedAt DateTime? @map("agent_updated_at") @db.Timestamptz(3)
|
||||||
|
agentLastSeenAt DateTime? @map("agent_last_seen_at") @db.Timestamptz(3)
|
||||||
installedAt DateTime @default(now()) @map("installed_at") @db.Timestamptz(3)
|
installedAt DateTime @default(now()) @map("installed_at") @db.Timestamptz(3)
|
||||||
lastProvisionedAt DateTime @default(now()) @map("last_provisioned_at") @db.Timestamptz(3)
|
lastProvisionedAt DateTime @default(now()) @map("last_provisioned_at") @db.Timestamptz(3)
|
||||||
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(3)
|
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(3)
|
||||||
@@ -85,6 +88,7 @@ model ProvisionedDevice {
|
|||||||
@@unique([accountEmail, tailscaleHostname])
|
@@unique([accountEmail, tailscaleHostname])
|
||||||
@@index([accountEmail])
|
@@index([accountEmail])
|
||||||
@@index([tailscaleHostname])
|
@@index([tailscaleHostname])
|
||||||
|
@@index([agentLastSeenAt])
|
||||||
@@map("provisioned_devices")
|
@@map("provisioned_devices")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
BadRequestException,
|
||||||
BadGatewayException,
|
BadGatewayException,
|
||||||
Injectable,
|
Injectable,
|
||||||
UnauthorizedException,
|
UnauthorizedException,
|
||||||
@@ -118,6 +119,10 @@ export class GiteaService {
|
|||||||
params.set('page', String(page));
|
params.set('page', String(page));
|
||||||
if (query.sha) {
|
if (query.sha) {
|
||||||
params.set('sha', query.sha);
|
params.set('sha', query.sha);
|
||||||
|
const { branches } = await this.listBranches(owner, repo) as { branches: Array<{ name?: string }> };
|
||||||
|
if (!branches.some((branch) => branch.name === query.sha)) {
|
||||||
|
throw new BadRequestException('해당 브랜치가 없습니다.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (query.since) {
|
if (query.since) {
|
||||||
params.set('since', query.since);
|
params.set('since', query.since);
|
||||||
|
|||||||
Reference in New Issue
Block a user