Skip to content

Commit

Permalink
add card
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrectRoadH committed Aug 6, 2024
1 parent 750fc4b commit a2a2ce7
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 8 deletions.
12 changes: 4 additions & 8 deletions service/ysk.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,10 @@ func (s *YSKService) Start() {
return
}

err = s.UpsertYSKCard(context.Background(), utils.ApplicationInstallProgress.WithProgress("Installing Jellyfin", 20))
if err != nil {
logger.Error("failed to upsert ysk card", zap.Error(err))
}
err = s.UpsertYSKCard(context.Background(), utils.DiskInsertNotice)
if err != nil {
logger.Error("failed to upsert ysk card", zap.Error(err))
}
s.UpsertYSKCard(context.Background(), utils.ApplicationInstallProgress.WithProgress("Installing Jellyfin", 20))
s.UpsertYSKCard(context.Background(), utils.DiskInsertNotice)
s.UpsertYSKCard(context.Background(), utils.ZimaOSFileManagementNotice)
s.UpsertYSKCard(context.Background(), utils.ZimaOSRemoteAccessNotice)

go func() {
for {
Expand Down
54 changes: 54 additions & 0 deletions utils/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,60 @@ var (
},
}

ZimaOSRemoteAccessNotice = ysk.YSKCard{
Id: "long-notice:remote:access",
CardType: ysk.CardTypeLongNote,
RenderType: ysk.RenderTypeCardIconTextNotice,
Content: ysk.YSKCardContent{
TitleIcon: "ZimaOS-Logo",
TitleText: "远程访问",
BodyProgress: nil,
BodyIconWithText: &ysk.YSKCardIconWithText{
Icon: "remote access",
Description: "通过远程访问,您可以随时随地访问您的个人主机。",
},
BodyList: nil,
FooterActions: []ysk.YSKCardFooterAction{
{
Side: "Right",
Style: "primary",
Text: "learn more",
MessageBus: ysk.YSKCardMessageBusAction{
Key: "open:remote:access",
Payload: "{'type':'remote'}",
},
},
},
},
}

ZimaOSFileManagementNotice = ysk.YSKCard{
Id: "long-notice:file:management",
CardType: ysk.CardTypeLongNote,
RenderType: ysk.RenderTypeCardIconTextNotice,
Content: ysk.YSKCardContent{
TitleIcon: "ZimaOS-Logo",
TitleText: "文件管理",
BodyProgress: nil,
BodyIconWithText: &ysk.YSKCardIconWithText{
Icon: "file management",
Description: "使用Files来管理分散的数据,包括备份、 云存储、 NAS 或本地网络中的其他个人数据。",
},
BodyList: nil,
FooterActions: []ysk.YSKCardFooterAction{
{
Side: "Right",
Style: "primary",
Text: "learn more",
MessageBus: ysk.YSKCardMessageBusAction{
Key: "open:file:management",
Payload: "{'type':'file'}",
},
},
},
},
}

ApplicationUpdateNotice = ysk.YSKCard{
Id: "short-notice:application:update",
CardType: ysk.CardTypeShortNote,
Expand Down

0 comments on commit a2a2ce7

Please sign in to comment.