Updates api path to /api
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
|
||||
async function postGithubDownload(url: string) {
|
||||
try {
|
||||
const apiResponse = await fetch('/rest/downloadUpdate', {
|
||||
const apiResponse = await fetch('/api/downloadUpdate', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
async function validateUser(userdata: userProfile) {
|
||||
try {
|
||||
const response = await fetch('/rest/verifyAuthorization', {
|
||||
const response = await fetch('/api/verifyAuthorization', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + userdata.bearer_token,
|
||||
|
||||
@@ -28,7 +28,7 @@ const loadModelFiles = async () => {
|
||||
export const load = async ({ fetch }) => {
|
||||
await registerFetchIntercept();
|
||||
await loadModelFiles();
|
||||
const result = await fetch('/rest/features');
|
||||
const result = await fetch('/api/features');
|
||||
const features = await result.json();
|
||||
return {
|
||||
features,
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
async function getMQTTStatus() {
|
||||
try {
|
||||
const response = await fetch('/rest/mqttStatus', {
|
||||
const response = await fetch('/api/mqttStatus', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
async function getMQTTSettings() {
|
||||
try {
|
||||
const response = await fetch('/rest/mqttSettings', {
|
||||
const response = await fetch('/api/mqttSettings', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
async function postMQTTSettings(data: MQTTSettings) {
|
||||
try {
|
||||
const response = await fetch('/rest/mqttSettings', {
|
||||
const response = await fetch('/api/mqttSettings', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
async function getBrokerSettings() {
|
||||
try {
|
||||
const response = await fetch('/rest/brokerSettings', {
|
||||
const response = await fetch('/api/brokerSettings', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
async function postBrokerSettings() {
|
||||
try {
|
||||
const response = await fetch('/rest/brokerSettings', {
|
||||
const response = await fetch('/api/brokerSettings', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
async function getNTPStatus() {
|
||||
try {
|
||||
const response = await fetch('/rest/ntpStatus', {
|
||||
const response = await fetch('/api/ntpStatus', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
async function getNTPSettings() {
|
||||
try {
|
||||
const response = await fetch('/rest/ntpSettings', {
|
||||
const response = await fetch('/api/ntpSettings', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
async function postNTPSettings(data: NTPSettings) {
|
||||
try {
|
||||
const response = await fetch('/rest/ntpSettings', {
|
||||
const response = await fetch('/api/ntpSettings', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
async function signInUser(data: SignInData) {
|
||||
try {
|
||||
const response = await fetch('/rest/signIn', {
|
||||
const response = await fetch('/api/signIn', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
import MdiMoonAndStars from '~icons/mdi/moon-and-stars';
|
||||
|
||||
async function postSleep() {
|
||||
const response = await fetch('/rest/sleep', {
|
||||
const response = await fetch('/api/sleep', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic'
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
async function getSystemStatus() {
|
||||
try {
|
||||
const response = await fetch('/rest/systemStatus', {
|
||||
const response = await fetch('/api/systemStatus', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
@@ -53,7 +53,7 @@
|
||||
(systemInformation = { ...systemInformation, ...data });
|
||||
|
||||
async function postRestart() {
|
||||
const response = await fetch('/rest/restart', {
|
||||
const response = await fetch('/api/restart', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic'
|
||||
@@ -77,7 +77,7 @@
|
||||
}
|
||||
|
||||
async function postFactoryReset() {
|
||||
const response = await fetch('/rest/factoryReset', {
|
||||
const response = await fetch('/api/factoryReset', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic'
|
||||
@@ -101,7 +101,7 @@
|
||||
}
|
||||
|
||||
async function postSleep() {
|
||||
const response = await fetch('/rest/sleep', {
|
||||
const response = await fetch('/api/sleep', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic'
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
async function postGithubDownload(url: string) {
|
||||
try {
|
||||
const apiResponse = await fetch('/rest/downloadUpdate', {
|
||||
const apiResponse = await fetch('/api/downloadUpdate', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
try {
|
||||
const formData = new FormData();
|
||||
formData.append('file', files[0]);
|
||||
const response = await fetch('/rest/uploadFirmware', {
|
||||
const response = await fetch('/api/uploadFirmware', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic'
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
async function getSecuritySettings() {
|
||||
try {
|
||||
const response = await fetch('/rest/securitySettings', {
|
||||
const response = await fetch('/api/securitySettings', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
async function postSecuritySettings(data: SecuritySettings) {
|
||||
try {
|
||||
const response = await fetch('/rest/securitySettings', {
|
||||
const response = await fetch('/api/securitySettings', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
async function validateUser(userdata: userProfile) {
|
||||
try {
|
||||
const response = await fetch('/rest/verifyAuthorization', {
|
||||
const response = await fetch('/api/verifyAuthorization', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + userdata.bearer_token,
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
async function getAPStatus() {
|
||||
try {
|
||||
const response = await fetch('/rest/apStatus', {
|
||||
const response = await fetch('/api/apStatus', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
async function getAPSettings() {
|
||||
try {
|
||||
const response = await fetch('/rest/apSettings', {
|
||||
const response = await fetch('/api/apSettings', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
async function postAPSettings(data: ApSettings) {
|
||||
try {
|
||||
const response = await fetch('/rest/apSettings', {
|
||||
const response = await fetch('/api/apSettings', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
async function scanNetworks() {
|
||||
scanActive = true;
|
||||
const scan = await fetch('/rest/scanNetworks', {
|
||||
const scan = await fetch('/api/scanNetworks', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
@@ -50,7 +50,7 @@
|
||||
}
|
||||
|
||||
async function pollingResults() {
|
||||
const response = await fetch('/rest/listNetworks', {
|
||||
const response = await fetch('/api/listNetworks', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
async function getWifiStatus() {
|
||||
try {
|
||||
const response = await fetch('/rest/wifiStatus', {
|
||||
const response = await fetch('/api/wifiStatus', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
async function getWifiSettings() {
|
||||
try {
|
||||
const response = await fetch('/rest/wifiSettings', {
|
||||
const response = await fetch('/api/wifiSettings', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
@@ -113,7 +113,7 @@
|
||||
|
||||
async function postWiFiSettings(data: WifiSettings) {
|
||||
try {
|
||||
const response = await fetch('/rest/wifiSettings', {
|
||||
const response = await fetch('/api/wifiSettings', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: $page.data.features.security ? 'Bearer ' + $user.bearer_token : 'Basic',
|
||||
|
||||
Reference in New Issue
Block a user