Compare commits

..

No commits in common. "230bbcf7f00b335ccc36cf0239da892f3b9c525f" and "8dc1aa01540197eb80535742b83c859176e36e3f" have entirely different histories.

3 changed files with 4 additions and 32 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "nazhua", "name": "nazhua",
"version": "0.6.5", "version": "0.6.4",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@ -2,7 +2,6 @@
<div <div
v-if="option" v-if="option"
class="line-box" class="line-box"
:style="boxStyle"
> >
<v-chart <v-chart
ref="chartRef" ref="chartRef"
@ -50,13 +49,6 @@ const option = computed(() => {
} }
return null; return null;
}); });
const boxStyle = computed(() => {
const style = {};
if (props.size > 0) {
style.height = `${props.size}px`;
}
return style;
});
function handleResize() { function handleResize() {
chartRef.value?.resize?.(); chartRef.value?.resize?.();

View File

@ -2,10 +2,6 @@
<dot-dot-box <dot-dot-box
v-if="monitorData.length" v-if="monitorData.length"
class="server-monitor-group" class="server-monitor-group"
:class="{
'chart-type--multi': config.nazhua.monitorChartTypeToggle && monitorChartType === 'multi',
'chart-type--single': config.nazhua.monitorChartTypeToggle && monitorChartType === 'single',
}"
padding="16px 20px" padding="16px 20px"
> >
<div class="module-head-group"> <div class="module-head-group">
@ -130,7 +126,6 @@
<line-chart <line-chart
:date-list="monitorChartData.dateList" :date-list="monitorChartData.dateList"
:value-list="[monitorChartData.valueList[index]]" :value-list="[monitorChartData.valueList[index]]"
:size="240"
/> />
</div> </div>
</div> </div>
@ -239,21 +234,13 @@ const minutes = [{
label: '24小时', label: '24小时',
value: 1440, value: 1440,
}]; }];
const localData = { const refreshData = ref(true);
peakShaving: window.localStorage.getItem('nazhua_monitor_peak_shaving'), const peakShaving = ref(false);
refreshData: window.localStorage.getItem('nazhua_monitor_refresh_data'),
chartType: window.localStorage.getItem('nazhua_monitor_chart_type'),
};
const peakShaving = validate.isSet(localData.peakShaving) ? ref(localData.peakShaving) : ref(false);
const refreshData = validate.isSet(localData.refreshData) ? ref(localData.refreshData) : ref(true);
const showCates = ref({}); const showCates = ref({});
const monitorData = ref([]); const monitorData = ref([]);
const longPressTimer = ref(null); const longPressTimer = ref(null);
const chartType = validate.isSet(localData.chartType) const chartType = ref(config.nazhua.monitorChartType === 'single' ? 'single' : 'multi');
? ref(localData.chartType)
: ref(config.nazhua.monitorChartType === 'single' ? 'single' : 'multi');
const monitorChartType = computed(() => { const monitorChartType = computed(() => {
if (config.nazhua.monitorChartTypeToggle) { if (config.nazhua.monitorChartTypeToggle) {
return chartType.value; return chartType.value;
@ -394,17 +381,14 @@ const monitorChartData = computed(() => {
function switchPeakShaving() { function switchPeakShaving() {
peakShaving.value = !peakShaving.value; peakShaving.value = !peakShaving.value;
window.localStorage.setItem('nazhua_monitor_peak_shaving', peakShaving.value);
} }
function switchRefresh() { function switchRefresh() {
refreshData.value = !refreshData.value; refreshData.value = !refreshData.value;
window.localStorage.setItem('nazhua_monitor_refresh_data', refreshData.value);
} }
function switchChartType() { function switchChartType() {
chartType.value = chartType.value === 'single' ? 'multi' : 'single'; chartType.value = chartType.value === 'single' ? 'multi' : 'single';
window.localStorage.setItem('nazhua_monitor_chart_type', chartType.value);
} }
function toggleMinute(value) { function toggleMinute(value) {
@ -494,10 +478,6 @@ onUnmounted(() => {
.server-monitor-group { .server-monitor-group {
--line-chart-size: 300px; --line-chart-size: 300px;
&.chart-type--single {
--line-chart-size: 240px;
}
.monitor-cate-item { .monitor-cate-item {
--cate-item-height: 28px; --cate-item-height: 28px;
--cate-item-font-size: 14px; --cate-item-font-size: 14px;