mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-26 14:16:07 +02:00
update frontend env
* Switch from yarn to plain npm * Update all package dependencies * Start to port to new APIs
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { expiringCacheExchange } from './cache-exchange.js'
|
||||
import { initClient } from '@urql/svelte'
|
||||
import { Client, fetchExchange } from '@urql/svelte';
|
||||
import { setContext, getContext, hasContext, onDestroy, tick } from 'svelte'
|
||||
import { dedupExchange, fetchExchange } from '@urql/core'
|
||||
import { readable } from 'svelte/store'
|
||||
|
||||
/*
|
||||
@@ -19,7 +18,7 @@ export function init(extraInitQuery = '') {
|
||||
? getContext('jwt')
|
||||
: getContext('cc-config')['jwt']
|
||||
|
||||
const client = initClient({
|
||||
const client = new Client({
|
||||
url: `${window.location.origin}/query`,
|
||||
fetchOptions: jwt != null
|
||||
? { headers: { 'Authorization': `Bearer ${jwt}` } } : {},
|
||||
@@ -162,9 +161,9 @@ export function fuzzySearchTags(term, tags) {
|
||||
|
||||
return results.sort((a, b) => {
|
||||
if (a.type < b.type) return -1
|
||||
if (a.type > b.type) return 1
|
||||
if (a.type > b.type) return 1
|
||||
if (a.name < b.name) return -1
|
||||
if (a.name > b.name) return 1
|
||||
if (a.name > b.name) return 1
|
||||
return 0
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user