Skip to content

Commit

Permalink
feat(server): add laf web site settings (#1523)
Browse files Browse the repository at this point in the history
* feat(server): add web site settings

* change link format

* refactor
  • Loading branch information
HUAHUAI23 authored Sep 11, 2023
1 parent 4ef265c commit a3d8fc1
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
42 changes: 41 additions & 1 deletion server/src/initializer/initializer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
AuthProvider,
AuthProviderState,
} from 'src/authentication/entities/auth-provider'
import { Setting } from 'src/setting/entities/setting'
import { Setting, SettingKey } from 'src/setting/entities/setting'

@Injectable()
export class InitializerService {
Expand Down Expand Up @@ -380,6 +380,46 @@ export class InitializerService {
},
})

await this.db.collection<Setting>('Setting').insertMany([
{
public: true,
key: SettingKey.AiPilotUrl,
value: 'https://htr4n1.laf.run/laf-gpt',
desc: 'ai pilot url',
},
{
public: true,
key: SettingKey.LafForumUrl,
value: 'https://forum.laf.run',
desc: 'laf forum url',
},
{
public: true,
key: SettingKey.LafBusinessUrl,
value: 'https://www.wenjuan.com/s/I36ZNbl',
desc: 'laf business url',
},
{
public: true,
key: SettingKey.LafDiscordUrl,
value:
'https://discord.com/channels/1061659231599738901/1098516786170839050',
desc: 'laf discord url',
},
{
public: true,
key: SettingKey.LafWeChatUrl,
value: 'https://w4mci7-images.oss.laf.run/wechat.png',
desc: 'laf wechat url',
},
{
public: true,
key: SettingKey.LafStatusUrl,
value: 'https://hnpsxzqqtavv.cloud.sealos.cn/status/laf',
desc: 'laf status url',
},
])

this.logger.verbose('Created default settings')
}
}
7 changes: 6 additions & 1 deletion server/src/setting/entities/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ export enum SettingKey {
InvitationProfit = 'invitation_profit',
IdVerify = 'id_verify',

AIPilotApiUrl = 'ai_pilot_api_url',
AiPilotUrl = 'ai_pilot_url',
LafForumUrl = 'laf_forum_url',
LafBusinessUrl = 'laf_business_url',
LafDiscordUrl = 'laf_discord_url',
LafWeChatUrl = 'laf_wechat_url',
LafStatusUrl = 'laf_status_url',
}

export class Setting {
Expand Down

0 comments on commit a3d8fc1

Please sign in to comment.