upgrade.ts 638 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { http } from '@uozi-admin/request'
  2. export interface RuntimeInfo {
  3. name: string
  4. os: string
  5. arch: string
  6. ex_path: string
  7. cur_version: Info
  8. in_docker: boolean
  9. }
  10. interface Info {
  11. version: string
  12. build_id: number
  13. total_build: number
  14. short_hash: string
  15. }
  16. export interface ReleaseInfo extends RuntimeInfo {
  17. html_url: string
  18. published_at: string
  19. body: string
  20. }
  21. const upgrade = {
  22. get_latest_release(channel: string) {
  23. return http.get('/upgrade/release', {
  24. params: {
  25. channel,
  26. },
  27. })
  28. },
  29. current_version() {
  30. return http.get('/upgrade/current')
  31. },
  32. }
  33. export default upgrade