add mobile plugin and other refactors (#396)

Co-authored-by: sealday <sealday@gmail.com>
Reviewed-on: daoyoucloud/tachycode#396
This commit is contained in:
sealday 2024-03-17 04:20:33 +08:00
parent 24471c7fbe
commit cd62e83403
240 changed files with 391 additions and 1085 deletions

109
main.mjs
View File

@ -1,109 +0,0 @@
const data = {
uid: '3jiixjqak8v',
collection: 'records',
measures: [
{
field: ['items', 'count'],
aggregation: 'sum',
alias: 'items.count',
},
],
dimensions: [
{
field: ['items', 'product_id'],
},
{
field: ['movement'],
},
],
filter: {
$and: [
{
date: {
$dateBetween: [new Date('2024-02-29T16:00:00.000Z'), new Date('2024-03-31T15:59:59.999Z')],
},
},
],
},
orders: [],
};
// const result = await fetch("https://shcx.daoyoucloud.com/api/charts:query", {
// "headers": {
// "accept": "application/json, text/plain, */*",
// "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
// "authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjQsImlhdCI6MTcxMDMxNDA2MywiZXhwIjoxNzEwOTE4ODYzfQ.aLc66wn-egDk_VOoackTph0kghLAquqp-Hdr1qN9gdU",
// "content-type": "application/json",
// "sec-ch-ua": "\"Chromium\";v=\"122\", \"Not(A:Brand\";v=\"24\", \"Microsoft Edge\";v=\"122\"",
// "sec-ch-ua-mobile": "?0",
// "sec-ch-ua-platform": "\"macOS\"",
// "sec-fetch-dest": "empty",
// "sec-fetch-mode": "cors",
// "sec-fetch-site": "same-origin",
// "x-authenticator": "basic",
// "x-hostname": "shcx.daoyoucloud.com",
// "x-locale": "zh-CN",
// "x-role": "admin",
// "x-timezone": "+08:00",
// "x-with-acl-meta": "true",
// "Referer": "https://shcx.daoyoucloud.com/admin/sujj53fixe7?",
// "Referrer-Policy": "strict-origin-when-cross-origin"
// },
// "body": JSON.stringify(data),
// "method": "POST"
// });
// {
// "uid": "9bismho25ro",
// "collection": "view_record_items",
// "measures": Array[5],
// "dimensions": Array[3],
// "filter": {
// "$and": [
// {
// "$and": [
// {
// "record": {
// "date": {
// "$dateBetween": [
// "2024-02-29T16:00:00.000Z",
// "2024-03-31T15:59:59.999Z"
// ]
// }
// }
// }
// ]
// }
// ]
// },
// "orders": [
// ]
// }
const result = await fetch('http://127.0.0.1:15000/api/charts:query', {
headers: {
accept: 'application/json, text/plain, */*',
'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
authorization:
'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjQsImlhdCI6MTcxMDQyNDM2NywiZXhwIjoxNzExMDI5MTY3fQ.6XqA8aTAHwkr9UDRjPgQey2c3_pwxfJZJ8gdDn4NxJc',
'content-type': 'application/json',
'sec-ch-ua': '"Chromium";v="122", "Not(A:Brand";v="24", "Microsoft Edge";v="122"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"macOS"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'x-authenticator': 'basic',
'x-hostname': '127.0.0.1',
'x-locale': 'zh-CN',
'x-role': 'root',
'x-timezone': '+08:00',
'x-with-acl-meta': 'true',
Referer: 'http://127.0.0.1:15000/admin/dihuq9gj0cl',
'Referrer-Policy': 'strict-origin-when-cross-origin',
},
body: JSON.stringify(data),
method: 'POST',
});
console.log(await result.json());

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
àRCopyright 1990-2009 Adobe Systems Incorporated.
All rights reserved.
See ./LICENSEáCNS2-H

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
àRCopyright 1990-2009 Adobe Systems Incorporated.
All rights reserved.
See ./LICENSEá ETen-B5-H` ^

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,4 @@
àRCopyright 1990-2009 Adobe Systems Incorporated.
All rights reserved.
See ./LICENSE!!<21>º]aX!!]`<60>21<32>> <09>p <0B>z<EFBFBD>$]<06>"Rd<E2809A>-Uƒ7<C692>*4„%<25>+ „Z „{<7B>/%…<<3C>9K…b<E280A6>1]†.<2E>" ‰`]‡,<2C>"]ˆ
<EFBFBD>"]ˆh<CB86>"]‰F<E280B0>"]Š$<24>"]<02>"]`<60>"]Œ><3E>"]<5D><1C>"]<5D>z<EFBFBD>"]ŽX<C5BD>"]<5D>6<EFBFBD>"]<5D><14>"]<5D>r<EFBFBD>"]P<E28098>"].<2E>"]“ <0C>"]“j<E2809C>"]”H<E2809D>"]•&<26>"]<04>"]b<E28093>"]—@<40>"]˜<1E>"]˜|<7C>"]™Z<E284A2>"]š8<C5A1>"]<16>"]t<E280BA>"]œR<C593>"]<5D>0<EFBFBD>"]ž<0E>"]žl<C5BE>"]ŸJ<C5B8>"] (<28>"]¡<06>"]¡d<C2A1>"]¢B<C2A2>"]£ <20>"X£~<7E>']¤W<C2A4>"]¥5<C2A5>"]¦<13>"]¦q<C2A6>"]§O<C2A7>"]¨-<2D>"]© <0B>"]©i<C2A9>"]ªG<C2AA>"]«%<25>"]¬<03>"]¬a<C2AC>"]­?<3F>"]®<1D>"]®{<7B>"]¯Y<C2AF>"]°7<C2B0>"]±<15>"]±s<C2B1>"]²Q<C2B2>"]³/<2F>"]´ <0A>"]´k<C2B4>"]µI<C2B5>"]¶'<27>"]·<05>"]·c<C2B7>"]¸A<C2B8>"]¹<1F>"]¹}<7D>"]º[<5B>"]»9

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More