frontend: rework i18n and replace all superagent calls with pankow fetcher
This commit is contained in:
@@ -48,9 +48,7 @@
|
||||
|
||||
<script>
|
||||
|
||||
import superagent from 'superagent';
|
||||
|
||||
import { Button, Dialog, FileUploader, InputDialog, MainLayout, TopBar } from 'pankow';
|
||||
import { fetcher, Button, Dialog, FileUploader, InputDialog, MainLayout, TopBar } from 'pankow';
|
||||
|
||||
import '@xterm/xterm/css/xterm.css';
|
||||
import { Terminal } from '@xterm/xterm';
|
||||
@@ -117,7 +115,7 @@ export default {
|
||||
if (!downloadFileName) return;
|
||||
|
||||
try {
|
||||
const result = await superagent.head(`${this.apiOrigin}/api/v1/apps/${this.id}/download`).query({
|
||||
await fetcher.head(`${this.apiOrigin}/api/v1/apps/${this.id}/download`, {
|
||||
file: downloadFileName,
|
||||
access_token: this.accessToken
|
||||
});
|
||||
@@ -199,7 +197,7 @@ export default {
|
||||
|
||||
let execId;
|
||||
try {
|
||||
const result = await superagent.post(`${this.apiOrigin}/api/v1/apps/${this.id}/exec`).query({ access_token: this.accessToken }).send({ cmd: [ '/bin/bash' ], tty: true, lang: 'C.UTF-8' });
|
||||
const result = await fetcher.post(`${this.apiOrigin}/api/v1/apps/${this.id}/exec`, { cmd: [ '/bin/bash' ], tty: true, lang: 'C.UTF-8' }, { access_token: this.accessToken });
|
||||
execId = result.body.id;
|
||||
} catch (error) {
|
||||
console.error('Cannot create socket.', error);
|
||||
|
||||
Reference in New Issue
Block a user