perf: short log file href

This commit is contained in:
lisonge 2024-05-09 21:30:36 +08:00
parent 9b17aaac77
commit 072cbead58
3 changed files with 8 additions and 3 deletions

View File

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

View File

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

View File

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