1
0
Fork 0
This commit is contained in:
Raymonf 2024-04-08 23:42:34 -04:00
parent 3493ff2c19
commit 09b4dcbea9
7 changed files with 29 additions and 32 deletions

View File

@ -17,7 +17,7 @@ class Image implements ColumnInfo {
displayName = " "
renderer = coverRenderer
getter(item:TricksterItem):(string|number) {
return item.image ? item.image : ""
return item.item_image ? item.item_image : ""
}
}
@ -207,7 +207,7 @@ class Compound implements ColumnInfo {
}
const compFilter= (item:TricksterItem): boolean => {
return (item.item_desc.toLowerCase().includes("compound item"))
return (item.item_comment.toLowerCase().includes("compound item"))
}
@ -379,7 +379,7 @@ class Desc implements ColumnInfo {
displayName = "desc"
renderer = descRenderer
getter(item:TricksterItem):(string|number){
return item.item_desc
return item.item_comment
}
}
function descRenderer(instance:any, td:any, row:any, col:any, prop:any, value:any, cellProperties:any) {

View File

@ -46,7 +46,8 @@ export class LTOApiv0 implements LTOApi {
if(char_path.startsWith(":")) {
char_path = char_path.replace(":","")
}
return this.s.request("GET", `item-manager/items/account/${char_path}`,undefined).then((ans:AxiosResponse)=>{
let type = char_path.includes("/") ? "char" : "account"
return this.s.request("GET", `v2/item-manager/items/${type}/${char_path}`,undefined).then((ans:AxiosResponse)=>{
const o = ans.data
log.debug("GetInventory", o)
let name = "bank"
@ -70,6 +71,7 @@ export class LTOApiv0 implements LTOApi {
galders,
items: Object.fromEntries((Object.entries(o.items) as any).map(([k, v]: [string, TricksterItem]):[string, TricksterItem]=>{
v.unique_id = Number(k)
console.log(k, v)
return [k, v]
})),
} as TricksterInventory

View File

@ -117,9 +117,9 @@ export class InvalidOrder extends Order{
}
export interface BasicResponse {
status: number
status: string
data: any
msg?: string
message?: string
}
@ -153,14 +153,14 @@ export class InternalXfer extends BasicOrder{
this.mark("WORKING")
return api.BankAction<InternalXferRequest, InternalXferResponse>("internal-xfer-item",this.originalRequest)
.then((x:InternalXferResponse)=>{
if(x.status == 200){
if(x.status === 'success'){
this.originalResponse = x
this.stage = 1
this.mark("SUCCESS")
const origin_item = r.invs.value.get(this.details?.origin_path!)!.items[this.details?.item_uid!]!
origin_item.item_count = origin_item.item_count - this.details?.count!
}else{
throw x.msg
throw x.message
}
})
.catch((e)=>{
@ -207,14 +207,14 @@ export class BankItem extends BasicOrder{
return api.BankAction<BankItemRequest, BankItemResponse>("bank-item",this.originalRequest)
.then((x)=>{
debug("BankItem",x)
if(x.status == 200){
if(x.status === 'success'){
this.stage = 1
this.originalResponse = x
this.mark("SUCCESS")
const origin_item = r.invs.value.get(this.details?.origin_path!)!.items[this.details?.item_uid!]!
origin_item.item_count = origin_item.item_count - this.details?.count!
}else {
throw x.msg ? x.msg : "unknown error"
throw x.message ? x.message : "unknown error"
}
})
.catch((e)=>{
@ -272,7 +272,7 @@ export class PrivateMarket extends BasicOrder{
return api.BankAction<PrivateMarketRequest, PrivateMarketResponse>("sell-item",this.originalRequest)
.then((x)=>{
debug("PrivateMarket",x)
if(x.status == 200){
if(x.status === 'success'){
this.stage = 1
this.originalResponse = x
this.mark("SUCCESS")
@ -284,7 +284,7 @@ export class PrivateMarket extends BasicOrder{
}catch(e){
}
}else {
throw x.msg ? x.msg : "unknown error"
throw x.message ? x.message : "unknown error"
}
})
.catch((e)=>{
@ -364,7 +364,7 @@ export class MarketMove extends PrivateMarket {
.then((x)=>{
debug("MarketMove",x)
this.moveResponse = x
if(x.status == 200){
if(x.status === 'success'){
this.moveStage = 1
this.moveState = "SUCCESS"
this.newUid = x.item_uid
@ -440,7 +440,7 @@ export class MarketMoveToChar extends MarketMove {
.then((x)=>{
debug("MarketMoveToChar",x)
this.charResponse = x
if(x.status == 200){
if(x.status === 'success'){
this.charStage = 1
this.charState = "SUCCESS"
}else {

View File

@ -122,9 +122,9 @@ export class OrderSender {
return notFound
}
const [account, name] = splitPath(target.path)
if(account != origin.path) {
/*if(account != origin.path) {
return new MarketMoveToChar(this.transformInternalOrder(o))
}
}*/
return new InternalXfer(this.transformInternalOrder(o))
}
user_to_bank(o:OrderDetails): Order{
@ -134,9 +134,9 @@ export class OrderSender {
return notFound
}
const [account, name] = splitPath(origin.path)
if(account != target.path) {
/*if(account != target.path) {
return new MarketMove(this.transformInternalOrder(o))
}
}*/
return new BankItem(this.transformInternalOrder(o))
}
user_to_user(o:OrderDetails): Order{
@ -145,7 +145,8 @@ export class OrderSender {
if(!(origin && target)) {
return notFound
}
return new MarketMoveToChar(this.transformInternalOrder(o))
// return new MarketMoveToChar(this.transformInternalOrder(o))
return new InternalXfer(this.transformInternalOrder(o))
}
private transformInternalOrder(o:OrderDetails):TxnDetails {

View File

@ -80,7 +80,7 @@ class Image implements ColumnInfo {
displayName = " "
renderer = coverRenderer
getter(item:TricksterItem):(string|number) {
return item.image ? item.image : ""
return item.item_image ? item.item_image : ""
}
}
@ -255,7 +255,7 @@ class Compound implements ColumnInfo {
}
const compFilter= (item:TricksterItem): boolean => {
return (item.item_desc.toLowerCase().includes("compound item"))
return (item.item_comment.toLowerCase().includes("compound item"))
}
@ -427,7 +427,7 @@ class Desc implements ColumnInfo {
displayName = "desc"
renderer = descRenderer
getter(item:TricksterItem):(string|number){
return item.item_desc
return item.item_comment
}
}
function descRenderer(instance:any, td:any, row:any, col:any, prop:any, value:any, cellProperties:any) {

View File

@ -6,7 +6,7 @@ import { getCookie, removeCookie } from "typescript-cookie";
export const SITE_ROOT = "/lifeto/"
export const API_ROOT = "api/lifeto/"
export const BANK_ROOT = "item-manager-action/"
export const BANK_ROOT = "api/lifeto/v2/item-manager/"
export const MARKET_ROOT = "marketplace-api/"
const login_endpoint = (name:string)=>{

View File

@ -1,24 +1,18 @@
export interface ItemExpireTime {
text: string
us: string
}
export interface TricksterItem {
unique_id: number;
item_name: string;
item_id: number;
item_count: number;
item_desc: string;
item_comment: string;
item_use: string;
item_slots?: number;
item_min_level?: number;
is_equip?: boolean;
is_drill?: boolean;
item_expire_time?: ItemExpireTime;
item_expire_time?: string;
refine_level?: number;
refine_type?: number;
refine_state?: number;
image?: string;
item_image?: string;
stats?: {[key: string]:any}
}