-
Commission Rate
-
- {{ `Updated at ${format.toDay(props.commission?.update_time, 'short')}` }}
+
+
Commission Rate
+
+ {{ `Updated at ${format.toDay(props.commission?.update_time, 'short')}` }}
+
+
+
+
+
+
+
+
24h: ±{{ change }}%
+
+
+
+
-
-
-
-
-
-
-
24h: ±{{ change }}%
-
-
-
-
-
diff --git a/src/components/charts/DonutChart.vue b/src/components/charts/DonutChart.vue
index 164bae0a..3907848b 100644
--- a/src/components/charts/DonutChart.vue
+++ b/src/components/charts/DonutChart.vue
@@ -1,24 +1,26 @@
-
+
-
-
+
+
diff --git a/src/components/charts/apexChartConfig.ts b/src/components/charts/apexChartConfig.ts
index f1b3b4bb..42c91f63 100644
--- a/src/components/charts/apexChartConfig.ts
+++ b/src/components/charts/apexChartConfig.ts
@@ -1,38 +1,191 @@
-import type { ThemeInstance } from 'vuetify';
-import { hexToRgb } from '@/plugins/vuetify/@layouts/utils';
import numeral from 'numeral';
-// 👉 Colors variables
-const colorVariables = (
- themeColors: ThemeInstance['themes']['value']['colors']
-) => {
- const themeSecondaryTextColor = `rgba(${hexToRgb(
- themeColors.colors['on-surface']
- )},${themeColors.variables['medium-emphasis-opacity']})`;
- const themeDisabledTextColor = `rgba(${hexToRgb(
- themeColors.colors['on-surface']
- )},${themeColors.variables['disabled-opacity']})`;
- const themeBorderColor = `rgba(${hexToRgb(
- String(themeColors.variables['border-color'])
- )},${themeColors.variables['border-opacity']})`;
- const themePrimaryTextColor = `rgba(${hexToRgb(
- themeColors.colors['on-surface']
- )},${themeColors.variables['high-emphasis-opacity']})`;
-
+const themeColors = (theme: string) => {
+ if (theme === 'light') {
+ return {
+ dark: false,
+ colors: {
+ background: '#F7F7F9',
+ surface: '#FFFFFF',
+ 'surface-variant': '#424242',
+ 'on-surface-variant': '#EEEEEE',
+ primary: '#666CFF',
+ 'primary-darken-1': '#3700B3',
+ secondary: '#6D788D',
+ 'secondary-darken-1': '#018786',
+ error: '#FF4D49',
+ info: '#26C6F9',
+ success: '#72E128',
+ warning: '#FDB528',
+ 'on-primary': '#fff',
+ 'on-secondary': '#fff',
+ 'on-success': '#fff',
+ 'on-info': '#fff',
+ 'on-warning': '#fff',
+ 'on-background': '#4c4e64',
+ 'on-surface': '#4c4e64',
+ 'perfect-scrollbar-thumb': '#DBDADE',
+ 'snackbar-background': '#212121',
+ 'tooltip-background': '#262732',
+ 'alert-background': '#F7F7F9',
+ 'grey-50': '#FAFAFA',
+ 'grey-100': '#F4F5FA',
+ 'grey-200': '#F5F5F7',
+ 'grey-300': '#E0E0E0',
+ 'grey-400': '#BDBDBD',
+ 'grey-500': '#9E9E9E',
+ 'grey-600': '#757575',
+ 'grey-700': '#616161',
+ 'grey-800': '#424242',
+ 'grey-900': '#212121',
+ 'on-primary-darken-1': '#fff',
+ 'on-secondary-darken-1': '#fff',
+ 'on-error': '#fff',
+ 'on-perfect-scrollbar-thumb': '#000',
+ 'on-snackbar-background': '#fff',
+ 'on-tooltip-background': '#fff',
+ 'on-alert-background': '#000',
+ 'on-grey-50': '#000',
+ 'on-grey-100': '#000',
+ 'on-grey-200': '#000',
+ 'on-grey-300': '#000',
+ 'on-grey-400': '#000',
+ 'on-grey-500': '#fff',
+ 'on-grey-600': '#fff',
+ 'on-grey-700': '#fff',
+ 'on-grey-800': '#fff',
+ 'on-grey-900': '#fff',
+ },
+ variables: {
+ 'border-color': '#4c4e64',
+ 'border-opacity': 0.12,
+ 'high-emphasis-opacity': 0.87,
+ 'medium-emphasis-opacity': 0.6,
+ 'disabled-opacity': 0.38,
+ 'idle-opacity': 0.04,
+ 'hover-opacity': 0.05,
+ 'focus-opacity': 0.12,
+ 'selected-opacity': 0.08,
+ 'activated-opacity': 0.12,
+ 'pressed-opacity': 0.12,
+ 'dragged-opacity': 0.08,
+ 'theme-kbd': '#212529',
+ 'theme-on-kbd': '#FFFFFF',
+ 'theme-code': '#F5F5F5',
+ 'theme-on-code': '#000000',
+ 'code-color': '#d400ff',
+ 'overlay-scrim-background': '#4C4E64',
+ 'overlay-scrim-opacity': 0.5,
+ 'shadow-key-umbra-opacity': 'rgba(var(--v-theme-on-surface), 0.08)',
+ 'shadow-key-penumbra-opacity': 'rgba(var(--v-theme-on-surface), 0.05)',
+ 'shadow-key-ambient-opacity': 'rgba(var(--v-theme-on-surface), 0.03)',
+ },
+ };
+ }
return {
- themeSecondaryTextColor,
- themeDisabledTextColor,
- themeBorderColor,
- themePrimaryTextColor,
+ dark: true,
+ colors: {
+ background: '#282A42',
+ surface: '#30334E',
+ 'surface-variant': '#BDBDBD',
+ 'on-surface-variant': '#424242',
+ primary: '#666CFF',
+ 'primary-darken-1': '#3700B3',
+ secondary: '#6D788D',
+ 'secondary-darken-1': '#03DAC5',
+ error: '#FF4D49',
+ info: '#26C6F9',
+ success: '#72E128',
+ warning: '#FDB528',
+ 'on-primary': '#fff',
+ 'on-secondary': '#fff',
+ 'on-success': '#fff',
+ 'on-info': '#fff',
+ 'on-warning': '#fff',
+ 'on-background': '#eaeaff',
+ 'on-surface': '#eaeaff',
+ 'perfect-scrollbar-thumb': '#4A5072',
+ 'snackbar-background': '#F5F5F5',
+ 'on-snackbar-background': '#30334E',
+ 'tooltip-background': '#464A65',
+ 'alert-background': '#282A42',
+ 'grey-50': '#2A2E42',
+ 'grey-100': '#41435c',
+ 'grey-200': '#3A3E5B',
+ 'grey-300': '#5E6692',
+ 'grey-400': '#7983BB',
+ 'grey-500': '#8692D0',
+ 'grey-600': '#AAB3DE',
+ 'grey-700': '#B6BEE3',
+ 'grey-800': '#CFD3EC',
+ 'grey-900': '#E7E9F6',
+ 'on-primary-darken-1': '#fff',
+ 'on-secondary-darken-1': '#000',
+ 'on-error': '#fff',
+ 'on-perfect-scrollbar-thumb': '#fff',
+ 'on-tooltip-background': '#fff',
+ 'on-alert-background': '#fff',
+ 'on-grey-50': '#fff',
+ 'on-grey-100': '#fff',
+ 'on-grey-200': '#fff',
+ 'on-grey-300': '#fff',
+ 'on-grey-400': '#fff',
+ 'on-grey-500': '#fff',
+ 'on-grey-600': '#000',
+ 'on-grey-700': '#000',
+ 'on-grey-800': '#000',
+ 'on-grey-900': '#000',
+ },
+ variables: {
+ 'border-color': '#eaeaff',
+ 'border-opacity': 0.12,
+ 'high-emphasis-opacity': 0.87,
+ 'medium-emphasis-opacity': 0.6,
+ 'disabled-opacity': 0.38,
+ 'idle-opacity': 0.1,
+ 'hover-opacity': 0.05,
+ 'focus-opacity': 0.12,
+ 'selected-opacity': 0.08,
+ 'activated-opacity': 0.12,
+ 'pressed-opacity': 0.16,
+ 'dragged-opacity': 0.08,
+ 'theme-kbd': '#212529',
+ 'theme-on-kbd': '#FFFFFF',
+ 'theme-code': '#343434',
+ 'theme-on-code': '#CCCCCC',
+ 'code-color': '#d400ff',
+ 'overlay-scrim-background': '#101121',
+ 'overlay-scrim-opacity': 0.6,
+ 'shadow-key-umbra-opacity': 'rgba(20, 21, 33, 0.08)',
+ 'shadow-key-penumbra-opacity': 'rgba(20, 21, 33, 0.05)',
+ 'shadow-key-ambient-opacity': 'rgba(20, 21, 33, 0.03)',
+ },
+ };
+};
+// 👉 Colors variables
+const colorVariables = (theme: string) => {
+ if (theme === 'light') {
+ return {
+ themeSecondaryTextColor: 'rgba(76,78,100,0.6)',
+ themeDisabledTextColor: 'rgba(76,78,100,0.38)',
+ themeBorderColor: 'rgba(76,78,100,0.12)',
+ themePrimaryTextColor: 'rgba(76,78,100,0.87)',
+ };
+ }
+ return {
+ themeSecondaryTextColor: 'rgba(234,234,255,0.6)',
+ themeDisabledTextColor: 'rgba(234,234,255,0.38)',
+ themeBorderColor: 'rgba(234,234,255,0.12)',
+ themePrimaryTextColor: 'rgba(234,234,255,0.87)',
};
};
/// Price Chart config
export const getMarketPriceChartConfig = (
- themeColors: ThemeInstance['themes']['value']['colors'],
+ theme: string,
categories: string[]
) => {
const { themeSecondaryTextColor, themeBorderColor, themeDisabledTextColor } =
- colorVariables(themeColors);
+ colorVariables(theme);
return {
chart: {
@@ -66,7 +219,7 @@ export const getMarketPriceChartConfig = (
},
},
- colors: [themeColors.colors.primary],
+ colors: [themeColors(theme).colors.primary],
fill: {
opacity: 0.5,
type: 'gradient',
@@ -102,338 +255,8 @@ export const getMarketPriceChartConfig = (
},
};
};
-
-/// default config
-
-export const getScatterChartConfig = (
- themeColors: ThemeInstance['themes']['value']['colors']
-) => {
- const scatterColors = {
- series1: '#ff9f43',
- series2: '#7367f0',
- series3: '#28c76f',
- };
-
- const { themeSecondaryTextColor, themeBorderColor, themeDisabledTextColor } =
- colorVariables(themeColors);
-
- return {
- chart: {
- parentHeightOffset: 0,
- toolbar: { show: false },
- zoom: {
- type: 'xy',
- enabled: true,
- },
- },
- legend: {
- position: 'top',
- horizontalAlign: 'left',
- markers: { offsetX: -3 },
-
- labels: { colors: themeSecondaryTextColor },
- itemMargin: {
- vertical: 3,
- horizontal: 10,
- },
- },
- colors: [
- scatterColors.series1,
- scatterColors.series2,
- scatterColors.series3,
- ],
- grid: {
- borderColor: themeBorderColor,
- xaxis: {
- lines: { show: true },
- },
- },
- yaxis: {
- labels: {
- style: { colors: themeDisabledTextColor },
- },
- },
- xaxis: {
- tickAmount: 10,
- axisBorder: { show: false },
-
- axisTicks: { color: themeBorderColor },
- crosshairs: {
- stroke: { color: themeBorderColor },
- },
- labels: {
- style: { colors: themeDisabledTextColor },
- formatter: (val: string) => parseFloat(val).toFixed(1),
- },
- },
- };
-};
-export const getLineChartSimpleConfig = (
- themeColors: ThemeInstance['themes']['value']['colors']
-) => {
- const { themeBorderColor, themeDisabledTextColor } =
- colorVariables(themeColors);
-
- return {
- chart: {
- parentHeightOffset: 0,
- zoom: { enabled: false },
- toolbar: { show: false },
- },
- colors: ['#ff9f43'],
- stroke: { curve: 'straight' },
- dataLabels: { enabled: false },
- markers: {
- strokeWidth: 7,
- strokeOpacity: 1,
- colors: ['#ff9f43'],
- strokeColors: ['#fff'],
- },
- grid: {
- padding: { top: -10 },
-
- borderColor: themeBorderColor,
- xaxis: {
- lines: { show: true },
- },
- },
- tooltip: {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- custom(data: any) {
- return `
- ${data.series[data.seriesIndex][data.dataPointIndex]}%
-
`;
- },
- },
- yaxis: {
- labels: {
- style: { colors: themeDisabledTextColor },
- },
- },
- xaxis: {
- axisBorder: { show: false },
-
- axisTicks: { color: themeBorderColor },
- crosshairs: {
- stroke: { color: themeBorderColor },
- },
- labels: {
- style: { colors: themeDisabledTextColor },
- },
- categories: [
- '7/12',
- '8/12',
- '9/12',
- '10/12',
- '11/12',
- '12/12',
- '13/12',
- '14/12',
- '15/12',
- '16/12',
- '17/12',
- '18/12',
- '19/12',
- '20/12',
- '21/12',
- ],
- },
- };
-};
-
-export const getBarChartConfig = (
- themeColors: ThemeInstance['themes']['value']['colors']
-) => {
- const { themeBorderColor, themeDisabledTextColor } =
- colorVariables(themeColors);
-
- return {
- chart: {
- parentHeightOffset: 0,
- toolbar: { show: false },
- },
- colors: ['#00cfe8'],
- dataLabels: { enabled: false },
- plotOptions: {
- bar: {
- borderRadius: 8,
- barHeight: '30%',
- horizontal: true,
- startingShape: 'rounded',
- },
- },
- grid: {
- borderColor: themeBorderColor,
- xaxis: {
- lines: { show: false },
- },
- padding: {
- top: -10,
- },
- },
- yaxis: {
- labels: {
- style: { colors: themeDisabledTextColor },
- },
- },
- xaxis: {
- axisBorder: { show: false },
- axisTicks: { color: themeBorderColor },
- categories: [
- 'MON, 11',
- 'THU, 14',
- 'FRI, 15',
- 'MON, 18',
- 'WED, 20',
- 'FRI, 21',
- 'MON, 23',
- ],
- labels: {
- style: { colors: themeDisabledTextColor },
- },
- },
- };
-};
-
-export const getCandlestickChartConfig = (
- themeColors: ThemeInstance['themes']['value']['colors']
-) => {
- const candlestickColors = {
- series1: '#28c76f',
- series2: '#ea5455',
- };
-
- const { themeBorderColor, themeDisabledTextColor } =
- colorVariables(themeColors);
-
- return {
- chart: {
- parentHeightOffset: 0,
- toolbar: { show: false },
- },
- plotOptions: {
- bar: { columnWidth: '40%' },
- candlestick: {
- colors: {
- upward: candlestickColors.series1,
- downward: candlestickColors.series2,
- },
- },
- },
- grid: {
- padding: { top: -10 },
- borderColor: themeBorderColor,
- xaxis: {
- lines: { show: true },
- },
- },
- yaxis: {
- tooltip: { enabled: true },
- crosshairs: {
- stroke: { color: themeBorderColor },
- },
- labels: {
- style: { colors: themeDisabledTextColor },
- },
- },
- xaxis: {
- type: 'datetime',
- axisBorder: { show: false },
- axisTicks: { color: themeBorderColor },
- crosshairs: {
- stroke: { color: themeBorderColor },
- },
- labels: {
- style: { colors: themeDisabledTextColor },
- },
- },
- };
-};
-export const getRadialBarChartConfig = (
- themeColors: ThemeInstance['themes']['value']['colors']
-) => {
- const radialBarColors = {
- series1: '#fdd835',
- series2: '#32baff',
- series3: '#00d4bd',
- series4: '#7367f0',
- series5: '#FFA1A1',
- };
-
- const { themeSecondaryTextColor, themePrimaryTextColor } =
- colorVariables(themeColors);
-
- return {
- stroke: { lineCap: 'round' },
- labels: ['Comments', 'Replies', 'Shares'],
- legend: {
- show: true,
- position: 'bottom',
- labels: {
- colors: themeSecondaryTextColor,
- },
- markers: {
- offsetX: -3,
- },
- itemMargin: {
- vertical: 3,
- horizontal: 10,
- },
- },
- colors: [
- radialBarColors.series1,
- radialBarColors.series2,
- radialBarColors.series4,
- ],
- plotOptions: {
- radialBar: {
- hollow: { size: '30%' },
- track: {
- margin: 15,
- background: themeColors.colors['grey-100'],
- },
- dataLabels: {
- name: {
- fontSize: '2rem',
- },
- value: {
- fontSize: '1rem',
- color: themeSecondaryTextColor,
- },
- total: {
- show: true,
- fontWeight: 400,
- label: 'Comments',
- fontSize: '1.125rem',
-
- color: themePrimaryTextColor,
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- formatter(w: {
- globals: { seriesTotals: any[]; series: string | any[] };
- }) {
- const totalValue =
- w.globals.seriesTotals.reduce((a: number, b: number) => {
- return a + b;
- }, 0) / w.globals.series.length;
-
- if (totalValue % 1 === 0) return `${totalValue}%`;
- else return `${totalValue.toFixed(2)}%`;
- },
- },
- },
- },
- },
- grid: {
- padding: {
- top: -35,
- bottom: -30,
- },
- },
- };
-};
-
export const getDonutChartConfig = (
- themeColors: ThemeInstance['themes']['value']['colors'],
+ theme: string,
labels: string[]
) => {
const donutColors = {
@@ -445,7 +268,7 @@ export const getDonutChartConfig = (
};
const { themeSecondaryTextColor, themePrimaryTextColor } =
- colorVariables(themeColors);
+ colorVariables(theme);
return {
stroke: { width: 0 },
@@ -535,340 +358,3 @@ export const getDonutChartConfig = (
};
};
-export const getAreaChartSplineConfig = (
- themeColors: ThemeInstance['themes']['value']['colors']
-) => {
- const areaColors = {
- series3: '#e0cffe',
- series2: '#b992fe',
- series1: '#ab7efd',
- };
-
- const { themeSecondaryTextColor, themeBorderColor, themeDisabledTextColor } =
- colorVariables(themeColors);
-
- return {
- chart: {
- parentHeightOffset: 0,
- toolbar: { show: false },
- },
- tooltip: { shared: false },
- dataLabels: { enabled: false },
- stroke: {
- show: false,
- curve: 'straight',
- },
- legend: {
- position: 'top',
- horizontalAlign: 'left',
-
- labels: { colors: themeSecondaryTextColor },
- markers: {
- offsetY: 1,
- offsetX: -3,
- },
- itemMargin: {
- vertical: 3,
- horizontal: 10,
- },
- },
-
- colors: [areaColors.series3, areaColors.series2, areaColors.series1],
- fill: {
- opacity: 1,
- type: 'solid',
- },
- grid: {
- show: true,
- borderColor: themeBorderColor,
- xaxis: {
- lines: { show: true },
- },
- },
- yaxis: {
- labels: {
- style: { colors: themeDisabledTextColor },
- },
- },
- xaxis: {
- axisBorder: { show: false },
-
- axisTicks: { color: themeBorderColor },
- crosshairs: {
- stroke: { color: themeBorderColor },
- },
- labels: {
- style: { colors: themeDisabledTextColor },
- },
- categories: [
- '7/12',
- '8/12',
- '9/12',
- '10/12',
- '11/12',
- '12/12',
- '13/12',
- '14/12',
- '15/12',
- '16/12',
- '17/12',
- '18/12',
- '19/12',
- ],
- },
- };
-};
-
-export const getColumnChartConfig = (
- themeColors: ThemeInstance['themes']['value']['colors']
-) => {
- const columnColors = {
- series1: '#826af9',
- series2: '#d2b0ff',
- bg: '#f8d3ff',
- };
-
- const { themeSecondaryTextColor, themeBorderColor, themeDisabledTextColor } =
- colorVariables(themeColors);
-
- return {
- chart: {
- offsetX: -10,
- stacked: true,
- parentHeightOffset: 0,
- toolbar: { show: false },
- },
- fill: { opacity: 1 },
- dataLabels: { enabled: false },
-
- colors: [columnColors.series1, columnColors.series2],
- legend: {
- position: 'top',
- horizontalAlign: 'left',
-
- labels: { colors: themeSecondaryTextColor },
- markers: {
- offsetY: 1,
- offsetX: -3,
- },
- itemMargin: {
- vertical: 3,
- horizontal: 10,
- },
- },
- stroke: {
- show: true,
- colors: ['transparent'],
- },
- plotOptions: {
- bar: {
- columnWidth: '15%',
- colors: {
- backgroundBarRadius: 10,
-
- backgroundBarColors: [
- columnColors.bg,
- columnColors.bg,
- columnColors.bg,
- columnColors.bg,
- columnColors.bg,
- ],
- },
- },
- },
- grid: {
- borderColor: themeBorderColor,
- xaxis: {
- lines: { show: true },
- },
- },
- yaxis: {
- labels: {
- style: { colors: themeDisabledTextColor },
- },
- },
- xaxis: {
- axisBorder: { show: false },
-
- axisTicks: { color: themeBorderColor },
- categories: [
- '7/12',
- '8/12',
- '9/12',
- '10/12',
- '11/12',
- '12/12',
- '13/12',
- '14/12',
- '15/12',
- ],
- crosshairs: {
- stroke: { color: themeBorderColor },
- },
- labels: {
- style: { colors: themeDisabledTextColor },
- },
- },
- responsive: [
- {
- breakpoint: 600,
- options: {
- plotOptions: {
- bar: {
- columnWidth: '35%',
- },
- },
- },
- },
- ],
- };
-};
-
-export const getHeatMapChartConfig = (
- themeColors: ThemeInstance['themes']['value']['colors']
-) => {
- const { themeSecondaryTextColor, themeDisabledTextColor } =
- colorVariables(themeColors);
-
- return {
- chart: {
- parentHeightOffset: 0,
- toolbar: { show: false },
- },
- dataLabels: { enabled: false },
- stroke: {
- colors: [themeColors.colors.surface],
- },
- legend: {
- position: 'bottom',
- labels: {
- colors: themeSecondaryTextColor,
- },
- markers: {
- offsetY: 0,
- offsetX: -3,
- },
- itemMargin: {
- vertical: 3,
- horizontal: 10,
- },
- },
- plotOptions: {
- heatmap: {
- enableShades: false,
- colorScale: {
- ranges: [
- { to: 10, from: 0, name: '0-10', color: '#b9b3f8' },
- { to: 20, from: 11, name: '10-20', color: '#aba4f6' },
- { to: 30, from: 21, name: '20-30', color: '#9d95f5' },
- { to: 40, from: 31, name: '30-40', color: '#8f85f3' },
- { to: 50, from: 41, name: '40-50', color: '#8176f2' },
- { to: 60, from: 51, name: '50-60', color: '#7367f0' },
- ],
- },
- },
- },
- grid: {
- padding: { top: -20 },
- },
- yaxis: {
- labels: {
- style: {
- colors: themeDisabledTextColor,
- },
- },
- },
- xaxis: {
- labels: { show: false },
- axisTicks: { show: false },
- axisBorder: { show: false },
- },
- };
-};
-
-export const getRadarChartConfig = (
- themeColors: ThemeInstance['themes']['value']['colors']
-) => {
- const radarColors = {
- series1: '#9b88fa',
- series2: '#ffa1a1',
- };
-
- const { themeSecondaryTextColor, themeBorderColor, themeDisabledTextColor } =
- colorVariables(themeColors);
-
- return {
- chart: {
- parentHeightOffset: 0,
- toolbar: { show: false },
- dropShadow: {
- top: 1,
- blur: 8,
- left: 1,
- opacity: 0.2,
- enabled: false,
- },
- },
- markers: { size: 0 },
- fill: { opacity: [1, 0.8] },
- colors: [radarColors.series1, radarColors.series2],
- stroke: {
- width: 0,
- show: false,
- },
- legend: {
- labels: {
- colors: themeSecondaryTextColor,
- },
- markers: {
- offsetX: -3,
- },
- itemMargin: {
- vertical: 3,
- horizontal: 10,
- },
- },
- plotOptions: {
- radar: {
- polygons: {
- strokeColors: themeBorderColor,
- connectorColors: themeBorderColor,
- },
- },
- },
- grid: {
- show: false,
- padding: {
- top: -20,
- bottom: -20,
- },
- },
- yaxis: { show: false },
- xaxis: {
- categories: [
- 'Battery',
- 'Brand',
- 'Camera',
- 'Memory',
- 'Storage',
- 'Display',
- 'OS',
- 'Price',
- ],
- labels: {
- style: {
- colors: [
- themeDisabledTextColor,
- themeDisabledTextColor,
- themeDisabledTextColor,
- themeDisabledTextColor,
- themeDisabledTextColor,
- themeDisabledTextColor,
- themeDisabledTextColor,
- themeDisabledTextColor,
- ],
- },
- },
- },
- };
-};
diff --git a/src/components/dynamic/ArrayObjectElement.vue b/src/components/dynamic/ArrayObjectElement.vue
index c693525a..697722c3 100644
--- a/src/components/dynamic/ArrayObjectElement.vue
+++ b/src/components/dynamic/ArrayObjectElement.vue
@@ -18,13 +18,15 @@ const header = computed(() => {
});
-
-
+
@@ -44,7 +46,7 @@ const header = computed(() => {
-
+
diff --git a/src/layouts/blank.vue b/src/layouts/blank.vue
index f12f1787..d4a2c527 100644
--- a/src/layouts/blank.vue
+++ b/src/layouts/blank.vue
@@ -1,13 +1,7 @@
-
-
-
-
-
-
- Ping.pub
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item?.title }}
-
-
- {{ item?.badgeContent }}
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/layouts/components/NavBarI18n.vue b/src/layouts/components/NavBarI18n.vue
index 1b802f74..f52d50ac 100644
--- a/src/layouts/components/NavBarI18n.vue
+++ b/src/layouts/components/NavBarI18n.vue
@@ -1,26 +1,62 @@
-
+
diff --git a/src/layouts/components/NavBarNotifications.vue b/src/layouts/components/NavBarNotifications.vue
deleted file mode 100644
index cfb91ac3..00000000
--- a/src/layouts/components/NavBarNotifications.vue
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
diff --git a/src/layouts/components/NavbarThemeSwitcher.vue b/src/layouts/components/NavbarThemeSwitcher.vue
index ca167080..dca49ed1 100644
--- a/src/layouts/components/NavbarThemeSwitcher.vue
+++ b/src/layouts/components/NavbarThemeSwitcher.vue
@@ -1,23 +1,48 @@
-
-
-
+
+
+
+
+
diff --git a/src/layouts/default.vue b/src/layouts/default.vue
index 56790461..fa74d6ef 100644
--- a/src/layouts/default.vue
+++ b/src/layouts/default.vue
@@ -1,12 +1,7 @@
-
+
diff --git a/src/main.ts b/src/main.ts
index 64d1539b..0b70257b 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,41 +1,31 @@
-/* eslint-disable import/order */
import 'ping-widget';
-import '@/plugins/vuetify/@iconify/icons-bundle';
import App from '@/App.vue';
-import layoutsPlugin from '@/plugins/vuetify/layouts';
-import vuetify from '@/plugins/vuetify';
import i18n from '@/plugins/i18n';
-import { loadFonts } from '@/plugins/vuetify/webfontloader';
-import '@/plugins/vuetify/@core/scss/template/index.scss';
-import '@/plugins/vuetify/styles/styles.scss';
import '@/style.css';
import { createApp, ref } from 'vue';
import { createPinia } from 'pinia';
import LazyLoad from 'lazy-load-vue3';
-// import router from "@/plugins/vuetify/router";
+
import router from './router';
import { useBaseStore } from './stores/useBaseStore';
-loadFonts();
-
// Create vue app
const app = createApp(App);
// Use plugins
app.use(i18n);
-app.use(vuetify);
app.use(createPinia());
-app.use(layoutsPlugin);
app.use(router);
app.use(LazyLoad, { component: true });
// Mount vue app
app.mount('#app');
// fetch latest block every 6s
-const blockStore = useBaseStore()
-const requestCounter = ref(0)
+const blockStore = useBaseStore();
+const requestCounter = ref(0);
setInterval(() => {
- requestCounter.value += 1
- if(requestCounter.value < 5) { // max allowed request
- blockStore.fetchLatest().finally(() => requestCounter.value -= 1)
- }
-}, 6000)
+ requestCounter.value += 1;
+ if (requestCounter.value < 5) {
+ // max allowed request
+ blockStore.fetchLatest().finally(() => (requestCounter.value -= 1));
+ }
+}, 6000);
diff --git a/src/modules/[chain]/account/[address].vue b/src/modules/[chain]/account/[address].vue
index 47172326..f3687a17 100644
--- a/src/modules/[chain]/account/[address].vue
+++ b/src/modules/[chain]/account/[address].vue
@@ -458,7 +458,7 @@ loadAccount(props.address);
v.height
}}
-
+
{{ v.txhash }}
diff --git a/src/modules/[chain]/block/index.vue b/src/modules/[chain]/block/index.vue
index f5df5ca9..ea81220b 100644
--- a/src/modules/[chain]/block/index.vue
+++ b/src/modules/[chain]/block/index.vue
@@ -10,93 +10,82 @@ const base = useBaseStore()
const format = useFormatter();
const list = computed(() => {
- // const recents = base.recents
- // return recents.sort((a, b) => (Number(b.block.header.height) - Number(a.block.header.height)))
- return base.recents
+ // const recents = base.recents
+ // return recents.sort((a, b) => (Number(b.block.header.height) - Number(a.block.header.height)))
+ return base.recents
})
-
-
+
+
-
-
-
-
-
- {{ item.block.header.height }}
-
-
- {{ format.toDay(item.block?.header?.time, 'from') }}
-
-
-
-
-
+
-
-
-
-
- Height
- Hash
- Messages
- Fees
-
-
-
-
-
- {{ item.height }}
-
- {{
- item.hash
- }}
-
- {{ format.messages(item.tx.body.messages) }}
- {{ format.formatTokens(item.tx.authInfo.fee?.amount) }}
-
-
-
-
-
-
-
-
-
Only show txs in recent blocks
-
+
+
+
+ {{ item.block.header.height }}
+
+
+ {{ format.toDay(item.block?.header?.time, 'from') }}
+
+
+
+
+
+
+
+
+
+
+ Height
+ Hash
+ Messages
+ Fees
+
+
+
+
+
+ {{ item.height }}
+
+
+ {{
+ item.hash
+ }}
+
+ {{ format.messages(item.tx.body.messages) }}
+ {{ format.formatTokens(item.tx.authInfo.fee?.amount) }}
+
+
+
+
+
+
+
+
+
+
+
Only show txs in recent blocks
+
+
+
-
-
diff --git a/src/modules/[chain]/cosmwasm/[code_id]/contracts.vue b/src/modules/[chain]/cosmwasm/[code_id]/contracts.vue
index 5d98cf1c..ed64392b 100644
--- a/src/modules/[chain]/cosmwasm/[code_id]/contracts.vue
+++ b/src/modules/[chain]/cosmwasm/[code_id]/contracts.vue
@@ -2,12 +2,11 @@
import { useWasmStore } from '../WasmStore';
import { ref } from 'vue';
import type {
- ContractInfo,
- PaginabledContractStates,
- PaginabledContracts,
+ ContractInfo,
+ PaginabledContractStates,
+ PaginabledContracts,
} from '../types';
import DynamicComponent from '@/components/dynamic/DynamicComponent.vue';
-import type { CustomInputContent } from '@/plugins/vuetify/@core/types';
import { useFormatter, useTxDialog } from '@/stores';
import PaginationBar from '@/components/PaginationBar.vue';
import { PageRequest } from '@/types';
@@ -19,84 +18,82 @@ const response = ref({} as PaginabledContracts);
const wasmStore = useWasmStore();
function loadContract(pageNum: number) {
- const pr = new PageRequest()
- pr.setPage(pageNum)
- wasmStore.wasmClient.getWasmCodeContracts(props.code_id, pr).then((x) => {
- response.value = x;
- });
+ const pr = new PageRequest()
+ pr.setPage(pageNum)
+ wasmStore.wasmClient.getWasmCodeContracts(props.code_id, pr).then((x) => {
+ response.value = x;
+ });
}
loadContract(1)
const dialog = useTxDialog()
const format = useFormatter();
const infoDialog = ref(false);
-const stateDialog = ref(false);
-const queryDialog = ref(false);
const info = ref({} as ContractInfo);
const state = ref({} as PaginabledContractStates);
const selected = ref('');
function showInfo(address: string) {
- wasmStore.wasmClient.getWasmContracts(address).then((x) => {
- info.value = x.contract_info;
- });
+ wasmStore.wasmClient.getWasmContracts(address).then((x) => {
+ info.value = x.contract_info;
+ });
}
function showState(address: string) {
- selected.value = address
- pageload(1)
+ selected.value = address
+ pageload(1)
}
function pageload(p: number) {
- pageRequest.value.setPage(p)
- wasmStore.wasmClient.getWasmContractStates(selected.value, pageRequest.value).then((x) => {
- state.value = x;
- });
+ pageRequest.value.setPage(p)
+ wasmStore.wasmClient.getWasmContractStates(selected.value, pageRequest.value).then((x) => {
+ state.value = x;
+ });
}
function showQuery(address: string) {
- selected.value = address;
- query.value = '';
- result.value = '';
+ selected.value = address;
+ query.value = '';
+ result.value = '';
}
function queryContract() {
- try {
- if (selectedRadio.value === 'raw') {
- wasmStore.wasmClient
- .getWasmContractRawQuery(selected.value, query.value)
- .then((x) => {
- result.value = JSON.stringify(x);
- })
- .catch((err) => {
- result.value = JSON.stringify(err);
- });
- } else {
- wasmStore.wasmClient
- .getWasmContractSmartQuery(selected.value, query.value)
- .then((x) => {
- result.value = JSON.stringify(x);
- })
- .catch((err) => {
- result.value = JSON.stringify(err);
- });
+ try {
+ if (selectedRadio.value === 'raw') {
+ wasmStore.wasmClient
+ .getWasmContractRawQuery(selected.value, query.value)
+ .then((x) => {
+ result.value = JSON.stringify(x);
+ })
+ .catch((err) => {
+ result.value = JSON.stringify(err);
+ });
+ } else {
+ wasmStore.wasmClient
+ .getWasmContractSmartQuery(selected.value, query.value)
+ .then((x) => {
+ result.value = JSON.stringify(x);
+ })
+ .catch((err) => {
+ result.value = JSON.stringify(err);
+ });
+ }
+ } catch (err) {
+ result.value = JSON.stringify(err); // not works for now
}
- } catch (err) {
- result.value = JSON.stringify(err); // not works for now
- }
- // TODO, show error in the result.
+ // TODO, show error in the result.
}
-const radioContent: CustomInputContent[] = [
- {
- title: 'Raw Query',
- desc: 'Return raw result',
- value: 'raw',
- },
- {
- title: 'Smart Query',
- desc: 'Return structure result if possible',
- value: 'smart',
- },
+const radioContent = [
+ {
+ title: 'Raw Query',
+ desc: 'Return raw result',
+ value: 'raw',
+ },
+ {
+ title: 'Smart Query',
+ desc: 'Return structure result if possible',
+ value: 'smart',
+ },
];
const selectedRadio = ref('raw');
@@ -104,165 +101,130 @@ const query = ref('');
const result = ref('');
-
-
-
- Contract List of Code: {{ props.code_id }}
-
-
-
-
-
- Contract List
- Actions
-
-
-
-
- {{ v }}
-
- contract
+
+
+
+ Contract List of Code: {{ props.code_id }}
+
+
+
+
+
+ Contract List
+ Actions
+
+
+
+
+ {{ v }}
+
+ contract
-
- States
-
-
- Query
-
-
- Execute
-
-
-
-
-
-
-
-
Instantiate Contract
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ format.hexToString(v.key) }}
-
-
- {{ format.base64ToString(v.value) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
Instantiate
+ Contract
-
-
-
-
-
-
- Query Contract
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ format.hexToString(v.key) }}
+
+
+ {{ format.base64ToString(v.value) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Query Contract
+
+
+
+
+
-
-
+
diff --git a/src/modules/[chain]/cosmwasm/index.vue b/src/modules/[chain]/cosmwasm/index.vue
index a8e07f62..b1b31c2d 100644
--- a/src/modules/[chain]/cosmwasm/index.vue
+++ b/src/modules/[chain]/cosmwasm/index.vue
@@ -15,60 +15,52 @@ const wasmStore = useWasmStore();
const dialog = useTxDialog()
function pageload(pageNum: number) {
- pageRequest.value.setPage(pageNum)
- wasmStore.wasmClient.getWasmCodeList(pageRequest.value).then((x) => {
- codes.value = x;
- });
+ pageRequest.value.setPage(pageNum)
+ wasmStore.wasmClient.getWasmCodeList(pageRequest.value).then((x) => {
+ codes.value = x;
+ });
}
pageload(1)
-
-
Cosmos Wasm Smart Contracts
-
-
-
-
- Code Id
- Code Hash
- Creator
- Permissions
-
-
-
-
- {{ v.code_id }}
-
-
- {{ v.data_hash }}
-
-
- {{ v.creator }}
-
- {{ v.instantiate_permission?.permission }}
- {{ v.instantiate_permission?.address }}
- {{ v.instantiate_permission.addresses.join(', ') }}
-
-
-
-
-
-
-
Upload Smart Contract
-
+
+
Cosmos Wasm Smart Contracts
+
+
+
+
+ Code Id
+ Code Hash
+ Creator
+ Permissions
+
+
+
+
+ {{ v.code_id }}
+
+
+ {{ v.data_hash }}
+
+
+ {{ v.creator }}
+
+ {{ v.instantiate_permission?.permission }}
+ {{ v.instantiate_permission?.address }}
+ {{ v.instantiate_permission.addresses.join(', ') }}
+
+
+
+
+
+
+
Upload
+ Smart
+ Contract
+
+
-
diff --git a/src/modules/[chain]/gov/[proposal_id].vue b/src/modules/[chain]/gov/[proposal_id].vue
index c3d5f4fe..8ad69f50 100644
--- a/src/modules/[chain]/gov/[proposal_id].vue
+++ b/src/modules/[chain]/gov/[proposal_id].vue
@@ -9,7 +9,7 @@ import {
useTxDialog,
} from '@/stores';
import {
-PageRequest,
+ PageRequest,
type GovProposal,
type GovVote,
type PaginatedProposalDeposit,
@@ -17,7 +17,7 @@ PageRequest,
} from '@/types';
import { ref, reactive } from 'vue';
import Countdown from '@/components/Countdown.vue';
-import PaginationBar from '@/components/PaginationBar.vue'
+import PaginationBar from '@/components/PaginationBar.vue';
import { fromBech32, toHex } from '@cosmjs/encoding';
const props = defineProps(['proposal_id', 'chain']);
@@ -57,8 +57,8 @@ const deposit = ref({} as PaginatedProposalDeposit);
store.fetchProposalDeposits(props.proposal_id).then((x) => (deposit.value = x));
const votes = ref({} as GovVote[]);
-const pageRequest = ref(new PageRequest())
-const pageResponse = ref({} as Pagination)
+const pageRequest = ref(new PageRequest());
+const pageResponse = ref({} as Pagination);
store.fetchProposalVotes(props.proposal_id).then((x) => {
votes.value = x.votes;
@@ -152,20 +152,20 @@ const processList = computed(() => {
});
function showValidatorName(voter: string) {
- const {data} = fromBech32(voter)
- const hex = toHex(data)
- const v = stakingStore.validators.find( x => toHex(fromBech32(x.operator_address).data) === hex)
- return v? v.description.moniker : voter
+ const { data } = fromBech32(voter);
+ const hex = toHex(data);
+ const v = stakingStore.validators.find(
+ (x) => toHex(fromBech32(x.operator_address).data) === hex
+ );
+ return v ? v.description.moniker : voter;
}
function pageload(p: number) {
- pageRequest.value.setPage(p)
- store
- .fetchProposalVotes(props.proposal_id, pageRequest.value)
- .then((x) => {
- votes.value = x.votes;
- pageResponse.value = x.pagination;
- });
+ pageRequest.value.setPage(p);
+ store.fetchProposalVotes(props.proposal_id, pageRequest.value).then((x) => {
+ votes.value = x.votes;
+ pageResponse.value = x.pagination;
+ });
}
@@ -209,7 +209,9 @@ function pageload(p: number) {
-
+
Timeline
@@ -341,12 +341,16 @@ function pageload(p: number) {
'text-gray-400': item.option === 'VOTE_OPTION_ABSTAIN',
}"
>
- {{ String(item.option).replace("VOTE_OPTION_", "") }}
+ {{ String(item.option).replace('VOTE_OPTION_', '') }}
-
+
diff --git a/src/modules/[chain]/gov/index.vue b/src/modules/[chain]/gov/index.vue
index 49e77eb3..6c977120 100644
--- a/src/modules/[chain]/gov/index.vue
+++ b/src/modules/[chain]/gov/index.vue
@@ -10,51 +10,37 @@ const store = useGovStore();
const pageRequest = ref(new PageRequest())
onMounted(() => {
- store.fetchProposals('2').then((x) => {
- if (x?.proposals?.length === 0) {
- tab.value = '3';
- store.fetchProposals('3');
- }
- store.fetchProposals('3');
- store.fetchProposals('4');
- });
+ store.fetchProposals('2').then((x) => {
+ if (x?.proposals?.length === 0) {
+ tab.value = '3';
+ store.fetchProposals('3');
+ }
+ store.fetchProposals('3');
+ store.fetchProposals('4');
+ });
});
const changeTab = (val: '2' | '3' | '4') => {
- tab.value = val;
+ tab.value = val;
};
function page(p: number) {
- pageRequest.value.setPage(p)
- store.fetchProposals(tab.value, pageRequest.value)
+ pageRequest.value.setPage(p)
+ store.fetchProposals(tab.value, pageRequest.value)
}
-
-
{
diff --git a/src/modules/[chain]/index.vue b/src/modules/[chain]/index.vue
index b5deedb9..d26249e0 100644
--- a/src/modules/[chain]/index.vue
+++ b/src/modules/[chain]/index.vue
@@ -9,7 +9,7 @@ import {
useTxDialog,
useWalletStore,
useStakingStore,
-useParamStore,
+ useParamStore,
} from '@/stores';
import { onMounted, ref } from 'vue';
import { useIndexModule } from './indexStore';
@@ -99,10 +99,7 @@ const color = computed(() => {
-
+
@@ -112,37 +109,26 @@ const color = computed(() => {
Rank:
-
+
#{{ coinInfo.market_cap_rank }}
-
+
+ class="bg-gray-100 dark:bg-[#384059] flex items-center justify-between px-4 py-2 cursor-pointer rounded">
-
+
{{ ticker?.market?.name || '' }}
@@ -153,9 +139,7 @@ const color = computed(() => {
-
+
${{ ticker.converted_last.usd }}
@@ -165,18 +149,10 @@ const color = computed(() => {