This commit is contained in:
EYHN
2024-12-16 16:01:17 +08:00
parent 1c685fb5a4
commit 9774d133e3
4 changed files with 100 additions and 39 deletions

View File

@@ -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
}

View File

@@ -54,48 +54,77 @@ class ChatTableView: UIView {
extension ChatTableView {
func putMockData() {
DispatchQueue.main.async {
self.dataSource = [
.init(type: .chat, object: ChatCell.ViewModel(
participant: .system,
markdownDocument: "Welcome to Intelligents"
)),
.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**
let json: [String: Any] = ["query": """
{
currentUser {
email
name
}
}
""", "variables": [:]]
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.
`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"
)),
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.allHTTPHeaderFields = [
"content-type": "application/json"
]
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()
}
}
}

View File

@@ -44,4 +44,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 1b0d3fe81862c0e9ce712ddd0c5a0accd0097698
COCOAPODS: 1.16.2
COCOAPODS: 1.15.2

View File

@@ -9,7 +9,7 @@ const config: CapacitorConfig = {
path: '.',
},
server: {
url: 'http://localhost:8080',
// url: 'http://localhost:8080',
},
plugins: {
CapacitorCookies: {