Skip to content

Commit

Permalink
perf: short log file href
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed May 9, 2024
1 parent 9b17aaa commit 072cbea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/src/main/kotlin/li/songe/gkd/data/GithubPoliciesAsset.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package li.songe.gkd.data

import kotlinx.serialization.Serializable
import li.songe.gkd.util.FILE_SHORT_URL

@Serializable
data class GithubPoliciesAsset(
val id: Int,
val href: String,
)
) {
val shortHref: String
get() = FILE_SHORT_URL + id
}
4 changes: 2 additions & 2 deletions app/src/main/kotlin/li/songe/gkd/ui/home/SettingsPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ fun useSettingsPage(): ScaffoldExt {

is LoadStatus.Success -> {
AlertDialog(title = { Text(text = "上传完成") }, text = {
Text(text = uploadStatusVal.result.href)
Text(text = uploadStatusVal.result.shortHref)
}, onDismissRequest = {}, dismissButton = {
TextButton(onClick = {
vm.uploadStatusFlow.value = null
Expand All @@ -300,7 +300,7 @@ fun useSettingsPage(): ScaffoldExt {
}
}, confirmButton = {
TextButton(onClick = {
ClipboardUtils.copyText(uploadStatusVal.result.href)
ClipboardUtils.copyText(uploadStatusVal.result.shortHref)
toast("复制成功")
vm.uploadStatusFlow.value = null
}) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/kotlin/li/songe/gkd/util/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import li.songe.gkd.BuildConfig
const val VOLUME_CHANGED_ACTION = "android.media.VOLUME_CHANGED_ACTION"

const val FILE_UPLOAD_URL = "https://u.gkd.li/"
const val FILE_SHORT_URL = "https://f.gkd.li/"
const val IMPORT_BASE_URL = "https://i.gkd.li/i/"

const val UPDATE_URL = "https://registry.npmmirror.com/@gkd-kit/app/latest/files/index.json"
Expand Down

0 comments on commit 072cbea

Please sign in to comment.