debug key
This commit is contained in:
@@ -12,6 +12,7 @@ export const types = {
|
|||||||
// common actions
|
// common actions
|
||||||
GET_HTTP_HEADER: "GET_HTTP_HEADER",
|
GET_HTTP_HEADER: "GET_HTTP_HEADER",
|
||||||
CHANGE_APP_STATUS: "CHANGE_APP_STATUS",
|
CHANGE_APP_STATUS: "CHANGE_APP_STATUS",
|
||||||
|
CHANGE_LOCAL_SETTINGS: "CHANGE_LOCAL_SETTINGS",
|
||||||
|
|
||||||
// appData actions
|
// appData actions
|
||||||
ADD_MAIN_INDEX: "ADD_MAIN_INDEX",
|
ADD_MAIN_INDEX: "ADD_MAIN_INDEX",
|
||||||
|
|||||||
@@ -7,6 +7,11 @@ export const changeAppStatus = (status) => ({
|
|||||||
payload: status,
|
payload: status,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const changeLocalSettings = (status) => ({
|
||||||
|
type: types.CHANGE_LOCAL_SETTINGS,
|
||||||
|
payload: status
|
||||||
|
});
|
||||||
|
|
||||||
export const getHttpHeaderForServiceRequest = onComplete => (dispatch, getState) => {
|
export const getHttpHeaderForServiceRequest = onComplete => (dispatch, getState) => {
|
||||||
console.log('getHttpHeaderForServiceRequest ');
|
console.log('getHttpHeaderForServiceRequest ');
|
||||||
lunaSend.getHttpHeaderForServiceRequest({
|
lunaSend.getHttpHeaderForServiceRequest({
|
||||||
@@ -42,7 +47,7 @@ export const getHttpHeaderForServiceRequest = onComplete => (dispatch, getState)
|
|||||||
const version = res["X-Device-Netcast-Platform-Version"] || "";
|
const version = res["X-Device-Netcast-Platform-Version"] || "";
|
||||||
convertedRes["os_ver"] = version;
|
convertedRes["os_ver"] = version;
|
||||||
dispatch({ type: types.GET_HTTP_HEADER, payload: convertedRes });
|
dispatch({ type: types.GET_HTTP_HEADER, payload: convertedRes });
|
||||||
dispatch(changeAppStatus({webOSVersion: version.substring(0,version.lastIndexOf('.'))}));
|
dispatch(changeAppStatus({webOSVersion: version.substring(0,version.lastIndexOf('.')), serverHOST: res["HOST"]}));
|
||||||
},
|
},
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.log("getHttpHeaderForServiceRequest fail",err);
|
console.log("getHttpHeaderForServiceRequest fail",err);
|
||||||
|
|||||||
@@ -103,7 +103,8 @@ export const TAxios = (
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const executeRequest = (accessToken, httpHeader) => {
|
const executeRequest = (accessToken, getState) => {
|
||||||
|
const httpHeader = getState().common.httpHeader;
|
||||||
const AUTHORIZATION = { headers: {...httpHeader} };
|
const AUTHORIZATION = { headers: {...httpHeader} };
|
||||||
|
|
||||||
if (accessToken) {
|
if (accessToken) {
|
||||||
@@ -111,8 +112,12 @@ export const TAxios = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (typeof window === "object") {
|
if (typeof window === "object") {
|
||||||
let url = Array.isArray(baseUrl) ? getUrl(baseUrl[0]) : getUrl(baseUrl);
|
let url = Array.isArray(baseUrl) ? getUrl(getState, baseUrl[0]) : getUrl(getState, baseUrl);
|
||||||
|
|
||||||
|
if(!url){
|
||||||
|
//todo error page
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (type === "get") {
|
if (type === "get") {
|
||||||
const _urlparams = HelperMethods.createQueryString(urlParams);
|
const _urlparams = HelperMethods.createQueryString(urlParams);
|
||||||
url += url ? `?${_urlparams}` : "";
|
url += url ? `?${_urlparams}` : "";
|
||||||
@@ -146,12 +151,13 @@ export const TAxios = (
|
|||||||
checkAccessToken().then((accessToken) => {
|
checkAccessToken().then((accessToken) => {
|
||||||
if (!noTokenRefresh) {
|
if (!noTokenRefresh) {
|
||||||
tokenRefresh(dispatch, getState)
|
tokenRefresh(dispatch, getState)
|
||||||
.then(() => executeRequest(accessToken, getState().common.httpHeader))
|
.then(() => executeRequest(accessToken, getState))
|
||||||
.catch(() => {
|
.catch((e) => {
|
||||||
/* 토큰 갱신 실패 처리 */
|
/* 토큰 갱신 실패 처리 */
|
||||||
|
console.error('tokenRefresh error', e);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
executeRequest(accessToken, getState().common.httpHeader);
|
executeRequest(accessToken, getState);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export const SHOPTIME_BASE_URL = "https://qt3-aic.lgshopsvc.lgappstv.com/";
|
// export const SHOPTIME_BASE_URL = "https://qt3-aic.lgshopsvc.lgappstv.com/";
|
||||||
|
export const SHOPTIME_BASE_URL = ".lgshopsvc.lgappstv.com/";
|
||||||
|
|
||||||
export const URLS = {
|
export const URLS = {
|
||||||
//device controller
|
//device controller
|
||||||
@@ -50,7 +51,52 @@ export const URLS = {
|
|||||||
//event controller
|
//event controller
|
||||||
GET_WELCOME_EVENT_INFO: "/lgsp/v1/event/event.lge",
|
GET_WELCOME_EVENT_INFO: "/lgsp/v1/event/event.lge",
|
||||||
};
|
};
|
||||||
|
const getRicCode = (country, ricCodeSetting) =>{
|
||||||
export const getUrl = (endStr) => {
|
if(ricCodeSetting !== 'system'){
|
||||||
return SHOPTIME_BASE_URL + endStr;
|
return ricCodeSetting;
|
||||||
|
}
|
||||||
|
if (country == "US") {
|
||||||
|
return "aic";
|
||||||
|
} else if (country == "DE" || country == "GB") {
|
||||||
|
return "eic";
|
||||||
|
} else if (country == "RU") {
|
||||||
|
return "ruc";
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
export const getUrl = (getState, endStr) => {
|
||||||
|
const serverHOST = getState().common.appStatus.serverHOST;
|
||||||
|
const {serverType, ricCodeSetting} = getState().localSettings;
|
||||||
|
if(!serverHOST){
|
||||||
|
console.error('getUrl: Not supported. Host is missing');
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
let sdpURL = serverHOST.split(".")[0];
|
||||||
|
let countryCode = "", ricCode="";
|
||||||
|
if (sdpURL.indexOf("-") > 0) {
|
||||||
|
countryCode = sdpURL.split("-")[1];
|
||||||
|
} else {
|
||||||
|
countryCode = sdpURL;
|
||||||
|
}
|
||||||
|
ricCode = getRicCode(countryCode, ricCodeSetting);
|
||||||
|
if(!ricCode){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
sdpURL = sdpURL.toLowerCase();
|
||||||
|
if(serverType !== 'system'){
|
||||||
|
sdpURL = serverType;
|
||||||
|
}
|
||||||
|
let newUrl = "";
|
||||||
|
if (sdpURL.indexOf("qt2") >= 0) {
|
||||||
|
// dev
|
||||||
|
newUrl = "https://qt3-" + ricCode + SHOPTIME_BASE_URL;
|
||||||
|
//"https://qt3-aic.lgshopsvc.lgappstv.com/";
|
||||||
|
} else if (sdpURL.indexOf("qt") >= 0) {
|
||||||
|
// Qa - cdn
|
||||||
|
newUrl = "https://qt-" + ricCode + SHOPTIME_BASE_URL;
|
||||||
|
} else {
|
||||||
|
// Prod
|
||||||
|
newUrl = "https://" + ricCode + SHOPTIME_BASE_URL;
|
||||||
|
}
|
||||||
|
return newUrl + endStr;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ export default function TabLayout({ topPanelName, onTabActivated }) {
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "Category":
|
case "Category":
|
||||||
result = data?.homeCategory.map((item) => ({
|
result = data?.homeCategory && data.homeCategory.map((item) => ({
|
||||||
id: item.lgCatCd,
|
id: item.lgCatCd,
|
||||||
title: item.lgCatNm,
|
title: item.lgCatNm,
|
||||||
target: [
|
target: [
|
||||||
@@ -188,13 +188,13 @@ export default function TabLayout({ topPanelName, onTabActivated }) {
|
|||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
case "GNB":
|
case "GNB":
|
||||||
result = data?.gnb.map((item) => ({
|
result = data?.gnb && data.gnb.map((item) => ({
|
||||||
title: item.menuNm,
|
title: item.menuNm,
|
||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "Featured Brands":
|
case "Featured Brands":
|
||||||
result = data?.shortFeaturedBrands.map((item) => ({
|
result = data?.shortFeaturedBrands && data.shortFeaturedBrands.map((item) => ({
|
||||||
Id: item.patnrId,
|
Id: item.patnrId,
|
||||||
path: item.patncLogoPath,
|
path: item.patncLogoPath,
|
||||||
target: [
|
target: [
|
||||||
@@ -206,7 +206,7 @@ export default function TabLayout({ topPanelName, onTabActivated }) {
|
|||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
case "My Page":
|
case "My Page":
|
||||||
result = data?.mypage.map((item) => ({
|
result = data?.mypage && data.mypage.map((item) => ({
|
||||||
title: item.menuNm,
|
title: item.menuNm,
|
||||||
target: [
|
target: [
|
||||||
{
|
{
|
||||||
|
|||||||
40
com.twin.app.shoptime/src/hooks/useDebugKey.js
Normal file
40
com.twin.app.shoptime/src/hooks/useDebugKey.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
import { useRef, useCallback, useEffect } from "react";
|
||||||
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
import * as Config from "../utils/Config";
|
||||||
|
import { on, off } from "@enact/core/dispatcher";
|
||||||
|
import { pushPanel } from "../actions/panelActions";
|
||||||
|
|
||||||
|
const useDebugKey = ({isLandingPage=false}) => {
|
||||||
|
const panels = useSelector((state) => state.panels.panels);
|
||||||
|
const debugKey = useRef([]);
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
|
const handleKeydown = useCallback(
|
||||||
|
(ev) => {
|
||||||
|
if (isLandingPage && panels && panels.length > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (ev && ev.key >= 0 && ev.key <= 9) {
|
||||||
|
if (debugKey.current.length >= Config.DEBUG_KEY.length) {
|
||||||
|
debugKey.current.shift();
|
||||||
|
}
|
||||||
|
debugKey.current.push(String(ev.key));
|
||||||
|
if (debugKey.current.join("") === Config.DEBUG_KEY) {
|
||||||
|
debugKey.current = [];
|
||||||
|
dispatch(pushPanel({ name: Config.panel_names.DEBUG_PANEL, panelInfo: {} }));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[panels, dispatch, isLandingPage]
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
on("keydown", handleKeydown);
|
||||||
|
return () => {
|
||||||
|
off("keydown", handleKeydown);
|
||||||
|
};
|
||||||
|
}, [handleKeydown]);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
export default useDebugKey;
|
||||||
@@ -62,6 +62,7 @@ export const getHttpHeaderForServiceRequest = ({onSuccess, onFailure, onComplete
|
|||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
onSuccess({
|
onSuccess({
|
||||||
|
"HOST": "US.nextlgsdp.com",
|
||||||
"Authorization": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJuZXh0bGdzZHAuY29tIiwiYXVkIjoibmV4dGxnc2RwLmNvbSIsImlhdCI6MTcwNzc4NTUyNSwiZXhwIjoxNzA3NzkyNzI1LCJtYWNBZGRyZXNzIjoiZWVkMDQ2NjdiNjUzOWU3YmQxMDA1OTljYjBkYTI5ZjRjZTgyZGZlOGZkNzIzMDAxZGVmMjg4NWRkNWZiODRmNWNiMzZlM2QwNzYzNWZjZGJjYWNjNGVjMzI5NWIwNjZjOTMwNmNmNDI1ZGQzMmQ2MDMxMjc1NWNkOTIyNjEwMzcifQ.vqPdYGnN46diesDBLzA4UhACCJVdIycLs7wZu9M55Hc",
|
"Authorization": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJuZXh0bGdzZHAuY29tIiwiYXVkIjoibmV4dGxnc2RwLmNvbSIsImlhdCI6MTcwNzc4NTUyNSwiZXhwIjoxNzA3NzkyNzI1LCJtYWNBZGRyZXNzIjoiZWVkMDQ2NjdiNjUzOWU3YmQxMDA1OTljYjBkYTI5ZjRjZTgyZGZlOGZkNzIzMDAxZGVmMjg4NWRkNWZiODRmNWNiMzZlM2QwNzYzNWZjZGJjYWNjNGVjMzI5NWIwNjZjOTMwNmNmNDI1ZGQzMmQ2MDMxMjc1NWNkOTIyNjEwMzcifQ.vqPdYGnN46diesDBLzA4UhACCJVdIycLs7wZu9M55Hc",
|
||||||
"X-Authentication": "MkOLvUocrJ69RH/iV1ZABJhjR2g=",
|
"X-Authentication": "MkOLvUocrJ69RH/iV1ZABJhjR2g=",
|
||||||
"X-Device-ID": "OemUY5qbPITZv96QKlxrtcqT6ypeX6us2qANLng3/0QCUhv2mecK1UDTMYb/hjpjey9dC/kFycc/5R8u+oK56JIWyYC4V278z64YDPKbDXIsd+eECvyf+Rdm8BneIUPM",
|
"X-Device-ID": "OemUY5qbPITZv96QKlxrtcqT6ypeX6us2qANLng3/0QCUhv2mecK1UDTMYb/hjpjey9dC/kFycc/5R8u+oK56JIWyYC4V278z64YDPKbDXIsd+eECvyf+Rdm8BneIUPM",
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ const initialState = {
|
|||||||
showLoadingPanel: { show: true, type: "launching" },
|
showLoadingPanel: { show: true, type: "launching" },
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
webOSVersion:"", //"5.0", "9.0" ...
|
webOSVersion:"", //"5.0", "9.0" ...
|
||||||
|
serverHOST: "", //"US.nextlgsdp.com",
|
||||||
cursorVisible: false
|
cursorVisible: false
|
||||||
},
|
},
|
||||||
httpHeader: null
|
httpHeader: null
|
||||||
|
|||||||
32
com.twin.app.shoptime/src/reducers/localSettingsReducer.js
Normal file
32
com.twin.app.shoptime/src/reducers/localSettingsReducer.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import { types } from "../actions/actionTypes";
|
||||||
|
import { readLocalStorage, writeLocalStorage } from "../utils/helperMethods";
|
||||||
|
import * as Config from "../utils/Config";
|
||||||
|
|
||||||
|
const initialLocalSettings = {
|
||||||
|
serverType: Config.DEFAULT_SERVERTYPE,
|
||||||
|
ricCodeSetting: Config.DEFAULT_RIC_CODE
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateInitialLocalSettings = () => {
|
||||||
|
const data = readLocalStorage('localSettings',initialLocalSettings);
|
||||||
|
if( Object.keys(data).length !== Object.keys(initialLocalSettings).length){
|
||||||
|
writeLocalStorage('localSettings', initialLocalSettings);
|
||||||
|
return initialLocalSettings;
|
||||||
|
}else{
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const localSettingsReducer = (state = updateInitialLocalSettings(), action) => {
|
||||||
|
switch (action.type) {
|
||||||
|
case types.CHANGE_LOCAL_SETTINGS: {
|
||||||
|
const newState = Object.assign({}, state, action.payload);
|
||||||
|
writeLocalStorage('localSettings', newState);
|
||||||
|
return newState;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default localSettingsReducer;
|
||||||
@@ -6,10 +6,11 @@ const initialState = {
|
|||||||
isModalOpen: false,
|
isModalOpen: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// last one will be on top
|
||||||
const forceTopPanels = [
|
const forceTopPanels = [
|
||||||
panel_names.ERROR_PANEL,
|
panel_names.ERROR_PANEL,
|
||||||
panel_names.DEBUG_PANEL,
|
|
||||||
panel_names.INTRO_PANEL,
|
panel_names.INTRO_PANEL,
|
||||||
|
panel_names.DEBUG_PANEL,
|
||||||
];
|
];
|
||||||
|
|
||||||
export const panelsReducer = (state = initialState, action) => {
|
export const panelsReducer = (state = initialState, action) => {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import thunk from "redux-thunk";
|
|||||||
import { appDataReducer } from "../reducers/appDataReducer";
|
import { appDataReducer } from "../reducers/appDataReducer";
|
||||||
import { brandReducer } from "../reducers/brandReducer";
|
import { brandReducer } from "../reducers/brandReducer";
|
||||||
import { commonReducer } from "../reducers/commonReducer";
|
import { commonReducer } from "../reducers/commonReducer";
|
||||||
|
import { localSettingsReducer } from "../reducers/localSettingsReducer";
|
||||||
import { deviceReducer } from "../reducers/deviceReducer";
|
import { deviceReducer } from "../reducers/deviceReducer";
|
||||||
import { eventReducer } from "../reducers/eventReducer";
|
import { eventReducer } from "../reducers/eventReducer";
|
||||||
import { homeReducer } from "../reducers/homeReducer";
|
import { homeReducer } from "../reducers/homeReducer";
|
||||||
@@ -18,6 +19,7 @@ const rootReducer = combineReducers({
|
|||||||
panels: panelsReducer,
|
panels: panelsReducer,
|
||||||
device: deviceReducer,
|
device: deviceReducer,
|
||||||
common: commonReducer,
|
common: commonReducer,
|
||||||
|
localSettings: localSettingsReducer,
|
||||||
appData: appDataReducer,
|
appData: appDataReducer,
|
||||||
home: homeReducer,
|
home: homeReducer,
|
||||||
brand: brandReducer,
|
brand: brandReducer,
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ export const DEBUG_KEY = "5286";
|
|||||||
export const TESTPANEL_KEY = "5325";
|
export const TESTPANEL_KEY = "5325";
|
||||||
export const SFT_TEST = "5555";
|
export const SFT_TEST = "5555";
|
||||||
export const SFT_TEST2 = "6666";
|
export const SFT_TEST2 = "6666";
|
||||||
export const ACTIVITY_SCENERY = "8282";
|
export const DEFAULT_SERVERTYPE = "qt2"; //system, qt2, qt, prd
|
||||||
|
export const DEFAULT_RIC_CODE = 'aic'; //system, aic, eic, ruc
|
||||||
export const panel_names = {
|
export const panel_names = {
|
||||||
INTRO_PANEL: "intropanel",
|
INTRO_PANEL: "intropanel",
|
||||||
HOME_PANEL: "homepanel",
|
HOME_PANEL: "homepanel",
|
||||||
|
|||||||
@@ -122,3 +122,17 @@ export const clearLaunchParams = () => {
|
|||||||
localLaunchParams = {};
|
localLaunchParams = {};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const readLocalStorage = (key, defaultValue) => {
|
||||||
|
const value = typeof window === 'object' && window.localStorage.getItem(key);
|
||||||
|
if (!value && defaultValue !== undefined) {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
return value === 'undefined' ? null : JSON.parse(value);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const writeLocalStorage = (key, value) => {
|
||||||
|
if (typeof window === 'object') {
|
||||||
|
window.localStorage.setItem(key, JSON.stringify(value));
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,5 +1,84 @@
|
|||||||
|
import React, { useCallback, useMemo } from "react";
|
||||||
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator";
|
||||||
|
import RadioItem from '@enact/sandstone/RadioItem';
|
||||||
|
import css from "./DebugPanel.module.less";
|
||||||
import TPanel from "../../components/TPanel/TPanel";
|
import TPanel from "../../components/TPanel/TPanel";
|
||||||
|
import THeader from "../../components/THeader/THeader";
|
||||||
|
import appinfo from '../../../webos-meta/appinfo.json';
|
||||||
|
import TScroller from "../../components/TScroller/TScroller";
|
||||||
|
import { changeLocalSettings } from "../../actions/commonActions";
|
||||||
|
|
||||||
|
const Container = SpotlightContainerDecorator({ enterTo: "last-focused" }, "div");
|
||||||
|
|
||||||
export default function DebugPanel() {
|
export default function DebugPanel() {
|
||||||
return <TPanel>Debug</TPanel>;
|
const dispatch = useDispatch();
|
||||||
|
const appStatus = useSelector((state) => state.common.appStatus);
|
||||||
|
const httpHeader = useSelector((state) => state.common.httpHeader);
|
||||||
|
const localSettings = useSelector((state) => state.localSettings);
|
||||||
|
const infos = useMemo(() => {
|
||||||
|
let v = [];
|
||||||
|
v.push({title: 'Version(App)', value: appinfo.version});
|
||||||
|
v.push({title: 'WebOS', value: appStatus.webOSVersion+"("+httpHeader?.os_ver+")"});
|
||||||
|
v.push({title: ' ', value: ' '});
|
||||||
|
return v;
|
||||||
|
}, [appStatus, httpHeader]);
|
||||||
|
|
||||||
|
const onChangeServer = useCallback((type) => () => {
|
||||||
|
if(type === localSettings.serverType){
|
||||||
|
return;
|
||||||
|
}else{
|
||||||
|
dispatch(changeLocalSettings({ serverType: type, ricCodeSetting: 'system' }));
|
||||||
|
}
|
||||||
|
}, [dispatch, localSettings]);
|
||||||
|
|
||||||
|
const onChangeServerRic = useCallback((type) => () => {
|
||||||
|
dispatch(changeLocalSettings({ ricCodeSetting: type }));
|
||||||
|
if(typeof window === 'object'){
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
}, [dispatch, localSettings]);
|
||||||
|
|
||||||
|
const disabledRic = useMemo(()=>{
|
||||||
|
return false;//localSettings.serverType !== 'prd';
|
||||||
|
},[localSettings]);
|
||||||
|
|
||||||
|
return <TPanel isTabActivated={false}>
|
||||||
|
<THeader title="Debug"/>
|
||||||
|
{infos.map((item, index) =>
|
||||||
|
{return(
|
||||||
|
<div className={css.titleArea} key={"info"+index}>
|
||||||
|
<div className={css.titleBox}>
|
||||||
|
<div className={css.text}>{item.title}</div>
|
||||||
|
</div>
|
||||||
|
<div className={css.textArea}>
|
||||||
|
<div className={css.text}>{item.value}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
<TScroller className={css.scroller}>
|
||||||
|
<Container className={css.settingLayer}>
|
||||||
|
<Container className={css.titleArea}>
|
||||||
|
<div className={css.switchs}>
|
||||||
|
<span className={css.switchTitle}>{'Server'}</span>
|
||||||
|
<RadioItem className={css.switch} selected={localSettings.serverType === 'system'} onClick={onChangeServer('system')}>system</RadioItem>
|
||||||
|
<RadioItem className={css.switch} selected={localSettings.serverType === 'qt2'} onClick={onChangeServer('qt2')}>qt2(qt3)</RadioItem>
|
||||||
|
<RadioItem className={css.switch} selected={localSettings.serverType === 'qt'} onClick={onChangeServer('qt')}>qt</RadioItem>
|
||||||
|
<RadioItem className={css.switch} selected={localSettings.serverType === 'prd'} onClick={onChangeServer('prd')}>prd</RadioItem>
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
|
<Container className={css.titleArea}>
|
||||||
|
<div className={css.switchs}>
|
||||||
|
<span className={css.switchTitle}>{'RicCode(Reboot)'}</span>
|
||||||
|
<RadioItem className={css.switch} disabled={disabledRic} selected={localSettings.ricCodeSetting === 'system'} onClick={onChangeServerRic('system')}>system</RadioItem>
|
||||||
|
<RadioItem className={css.switch} disabled={disabledRic} selected={localSettings.ricCodeSetting === 'aic'} onClick={onChangeServerRic('aic')}>aic</RadioItem>
|
||||||
|
<RadioItem className={css.switch} disabled={disabledRic} selected={localSettings.ricCodeSetting === 'eic'} onClick={onChangeServerRic('eic')}>eic</RadioItem>
|
||||||
|
<RadioItem className={css.switch} disabled={disabledRic} selected={localSettings.ricCodeSetting === 'ruc'} onClick={onChangeServerRic('ruc')}>ruc</RadioItem>
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
|
</Container>
|
||||||
|
</TScroller>
|
||||||
|
</TPanel>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
.scroller{
|
||||||
|
height:650px;
|
||||||
|
}
|
||||||
|
.settingLayer{
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
padding-bottom: 30px;
|
||||||
|
}
|
||||||
|
.titleArea {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
color: black;
|
||||||
|
font-size: 28px;
|
||||||
|
.titleBox {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 420px;
|
||||||
|
height: auto;
|
||||||
|
left: 75px;
|
||||||
|
top: 0rem;
|
||||||
|
.text {
|
||||||
|
position: relative;
|
||||||
|
top: 0rem;
|
||||||
|
text-align: start;
|
||||||
|
margin-top: 13px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.textArea {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 1000px;
|
||||||
|
height: auto;
|
||||||
|
left: 60px;
|
||||||
|
background-color: rgba(174, 0, 255, 0.0);
|
||||||
|
.text {
|
||||||
|
position: relative;
|
||||||
|
color: rgb(252, 252, 252);
|
||||||
|
text-align: start;
|
||||||
|
margin-top: 13px;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
position: relative;
|
||||||
|
width:100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 36px;
|
||||||
|
font-weight: 'bold';
|
||||||
|
}
|
||||||
|
.switchs {
|
||||||
|
position: relative;
|
||||||
|
display: inline-flex;
|
||||||
|
width: 100%;
|
||||||
|
.switchTitle {
|
||||||
|
position: relative;
|
||||||
|
width: 660px;
|
||||||
|
height: 72px;
|
||||||
|
line-height: 72px;
|
||||||
|
margin-left: 75px;
|
||||||
|
font-size: 30px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: black;
|
||||||
|
background-color: bisque;
|
||||||
|
}
|
||||||
|
.switch{
|
||||||
|
width: 250px;
|
||||||
|
color: black;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
import React from "react";
|
||||||
import TPanel from "../../components/TPanel/TPanel";
|
import TPanel from "../../components/TPanel/TPanel";
|
||||||
|
import useDebugKey from '../../hooks/useDebugKey';
|
||||||
export default function ErrorPanel() {
|
export default function ErrorPanel() {
|
||||||
|
useDebugKey({});
|
||||||
return <TPanel>Error</TPanel>;
|
return <TPanel>Error</TPanel>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ import HomeOnSale from '../HomePanel/HomeOnSale/HomeOnSale';
|
|||||||
import css from '../HomePanel/HomePanel.module.less';
|
import css from '../HomePanel/HomePanel.module.less';
|
||||||
import PopularShow from '../HomePanel/PopularShow/PopularShow';
|
import PopularShow from '../HomePanel/PopularShow/PopularShow';
|
||||||
import SubCategory from '../HomePanel/SubCategory/SubCategory';
|
import SubCategory from '../HomePanel/SubCategory/SubCategory';
|
||||||
|
import useDebugKey from '../../hooks/useDebugKey';
|
||||||
|
|
||||||
export default function HomePanel() {
|
export default function HomePanel() {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
useDebugKey({isLandingPage: true});
|
||||||
const homeLayoutInfo = useSelector((state) => state.home.layoutData);
|
const homeLayoutInfo = useSelector((state) => state.home.layoutData);
|
||||||
const homeTopDisplayInfos = useSelector(
|
const homeTopDisplayInfos = useSelector(
|
||||||
(state) => state.home.mainContentsData.homeTopDisplayInfos
|
(state) => state.home.mainContentsData.homeTopDisplayInfos
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import TPopUp from "../../components/TPopUp/TPopUp";
|
|||||||
import * as Config from "../../utils/Config";
|
import * as Config from "../../utils/Config";
|
||||||
import { $L } from "../../utils/helperMethods";
|
import { $L } from "../../utils/helperMethods";
|
||||||
import css from "./IntroPanel.module.less";
|
import css from "./IntroPanel.module.less";
|
||||||
|
import useDebugKey from '../../hooks/useDebugKey';
|
||||||
|
|
||||||
const Container = SpotlightContainerDecorator(
|
const Container = SpotlightContainerDecorator(
|
||||||
{ enterTo: "last-focused" },
|
{ enterTo: "last-focused" },
|
||||||
@@ -21,6 +22,7 @@ const Container = SpotlightContainerDecorator(
|
|||||||
|
|
||||||
export default function IntroPanel({ children, ...rest }) {
|
export default function IntroPanel({ children, ...rest }) {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
useDebugKey({});
|
||||||
const termsData = useSelector((state) => state.home.termsData);
|
const termsData = useSelector((state) => state.home.termsData);
|
||||||
|
|
||||||
const [showExitButton, setShowExitButton] = useState(false);
|
const [showExitButton, setShowExitButton] = useState(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user