mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 14:56:59 +08:00
demo
This commit is contained in:
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"pins" : [
|
||||||
|
{
|
||||||
|
"identity" : "networkimage",
|
||||||
|
"kind" : "remoteSourceControl",
|
||||||
|
"location" : "https://github.com/gonzalezreal/NetworkImage",
|
||||||
|
"state" : {
|
||||||
|
"revision" : "2849f5323265386e200484b0d0f896e73c3411b9",
|
||||||
|
"version" : "6.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"identity" : "swift-cmark",
|
||||||
|
"kind" : "remoteSourceControl",
|
||||||
|
"location" : "https://github.com/swiftlang/swift-cmark",
|
||||||
|
"state" : {
|
||||||
|
"revision" : "3ccff77b2dc5b96b77db3da0d68d28068593fa53",
|
||||||
|
"version" : "0.5.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"identity" : "swift-markdown-ui",
|
||||||
|
"kind" : "remoteSourceControl",
|
||||||
|
"location" : "https://github.com/gonzalezreal/swift-markdown-ui",
|
||||||
|
"state" : {
|
||||||
|
"revision" : "5f613358148239d0292c0cef674a3c2314737f9e",
|
||||||
|
"version" : "2.4.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version" : 2
|
||||||
|
}
|
||||||
@@ -54,48 +54,77 @@ class ChatTableView: UIView {
|
|||||||
extension ChatTableView {
|
extension ChatTableView {
|
||||||
func putMockData() {
|
func putMockData() {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.dataSource = [
|
let json: [String: Any] = ["query": """
|
||||||
.init(type: .chat, object: ChatCell.ViewModel(
|
{
|
||||||
participant: .system,
|
currentUser {
|
||||||
markdownDocument: "Welcome to Intelligents"
|
email
|
||||||
)),
|
name
|
||||||
.init(type: .chat, object: ChatCell.ViewModel(
|
}
|
||||||
participant: .user,
|
}
|
||||||
markdownDocument: "Please summarize this article for me"
|
""", "variables": [:]]
|
||||||
)),
|
|
||||||
.init(type: .chat, object: ChatCell.ViewModel(
|
|
||||||
participant: .assistant,
|
|
||||||
markdownDocument: ###"""
|
|
||||||
**Activation Code Usage Limits**
|
|
||||||
|
|
||||||
A single activation code can be used on multiple devices.
|
let jsonData = try? JSONSerialization.data(withJSONObject: json)
|
||||||
|
|
||||||
**Note:** A single activation code is intended for use on a reasonable number of devices by one user.
|
let url = URL(string: "http://localhost:3010/graphql")!
|
||||||
|
|
||||||
Excessive activation requests may result in the activation code being banned. Any bans are subject to manual review and are operated by staff.
|
var request = URLRequest(url: url)
|
||||||
|
request.httpMethod = "POST"
|
||||||
`The limit is up to 5 devices per year or 10 activation requests within the same period.`
|
request.allHTTPHeaderFields = [
|
||||||
"""###
|
"content-type": "application/json"
|
||||||
)),
|
|
||||||
.init(type: .chat, object: ChatCell.ViewModel(
|
|
||||||
participant: .user,
|
|
||||||
markdownDocument: ###"""
|
|
||||||
**Download Axchange from the App Store**
|
|
||||||
|
|
||||||
You can download Axchange from the App Store:
|
|
||||||
|
|
||||||
- [https://apps.apple.com/app/axchange-adb-file-transfer/id6737504944](https://apps.apple.com/app/axchange-adb-file-transfer/id6737504944)
|
|
||||||
|
|
||||||
The version downloaded this way does not require activation to use.
|
|
||||||
"""###
|
|
||||||
)),
|
|
||||||
.init(type: .chat, object: ChatCell.ViewModel(
|
|
||||||
participant: .assistant,
|
|
||||||
markdownDocument: "GOOD"
|
|
||||||
)),
|
|
||||||
]
|
]
|
||||||
|
request.httpBody = jsonData
|
||||||
|
|
||||||
self.tableView.reloadData()
|
let task = URLSession.shared.dataTask(with: request) { (data, response, error) in
|
||||||
|
if let error = error {
|
||||||
|
print(error)
|
||||||
|
} else if let data = data {
|
||||||
|
let str = String(data: data, encoding: .utf8)
|
||||||
|
self.dataSource = [
|
||||||
|
.init(type: .chat, object: ChatCell.ViewModel(
|
||||||
|
participant: .system,
|
||||||
|
markdownDocument: "Welcome to Intelligents" + str!
|
||||||
|
)),
|
||||||
|
.init(type: .chat, object: ChatCell.ViewModel(
|
||||||
|
participant: .user,
|
||||||
|
markdownDocument: "Please summarize this article for me"
|
||||||
|
)),
|
||||||
|
.init(type: .chat, object: ChatCell.ViewModel(
|
||||||
|
participant: .assistant,
|
||||||
|
markdownDocument: ###"""
|
||||||
|
**Activation Code Usage Limits**
|
||||||
|
|
||||||
|
A single activation code can be used on multiple devices.
|
||||||
|
|
||||||
|
**Note:** A single activation code is intended for use on a reasonable number of devices by one user.
|
||||||
|
|
||||||
|
Excessive activation requests may result in the activation code being banned. Any bans are subject to manual review and are operated by staff.
|
||||||
|
|
||||||
|
`The limit is up to 5 devices per year or 10 activation requests within the same period.`
|
||||||
|
"""###
|
||||||
|
)),
|
||||||
|
.init(type: .chat, object: ChatCell.ViewModel(
|
||||||
|
participant: .user,
|
||||||
|
markdownDocument: ###"""
|
||||||
|
**Download Axchange from the App Store**
|
||||||
|
|
||||||
|
You can download Axchange from the App Store:
|
||||||
|
|
||||||
|
- [https://apps.apple.com/app/axchange-adb-file-transfer/id6737504944](https://apps.apple.com/app/axchange-adb-file-transfer/id6737504944)
|
||||||
|
|
||||||
|
The version downloaded this way does not require activation to use.
|
||||||
|
"""###
|
||||||
|
)),
|
||||||
|
.init(type: .chat, object: ChatCell.ViewModel(
|
||||||
|
participant: .assistant,
|
||||||
|
markdownDocument: "GOOD"
|
||||||
|
)),
|
||||||
|
]
|
||||||
|
|
||||||
|
self.tableView.reloadData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task.resume()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,4 +44,4 @@ SPEC CHECKSUMS:
|
|||||||
|
|
||||||
PODFILE CHECKSUM: 1b0d3fe81862c0e9ce712ddd0c5a0accd0097698
|
PODFILE CHECKSUM: 1b0d3fe81862c0e9ce712ddd0c5a0accd0097698
|
||||||
|
|
||||||
COCOAPODS: 1.16.2
|
COCOAPODS: 1.15.2
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const config: CapacitorConfig = {
|
|||||||
path: '.',
|
path: '.',
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
url: 'http://localhost:8080',
|
// url: 'http://localhost:8080',
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
CapacitorCookies: {
|
CapacitorCookies: {
|
||||||
|
|||||||
Reference in New Issue
Block a user