environment.ts 591 B

12345678910111213141516171819202122232425262728293031
  1. import type { ModelBase } from '@/api/curd'
  2. import Curd from '@/api/curd'
  3. import http from '@/lib/http'
  4. export interface Environment extends ModelBase {
  5. name: string
  6. url: string
  7. token: string
  8. status?: boolean
  9. }
  10. export interface Node {
  11. id: number
  12. name: string
  13. token: string
  14. response_at?: Date
  15. }
  16. class EnvironmentCurd extends Curd<Environment> {
  17. constructor() {
  18. super('/environments')
  19. }
  20. load_from_settings() {
  21. return http.post(`${this.baseUrl}/load_from_settings`)
  22. }
  23. }
  24. const environment: EnvironmentCurd = new EnvironmentCurd()
  25. export default environment