diff --git a/frontend/src/views/app-store/installed/detail/index.vue b/frontend/src/views/app-store/installed/detail/index.vue
index b563741a4..31622e51e 100644
--- a/frontend/src/views/app-store/installed/detail/index.vue
+++ b/frontend/src/views/app-store/installed/detail/index.vue
@@ -67,7 +67,11 @@
{{ $t('app.allowPortHelper') }}
-
+
{{ $t('app.cpuCore') }}
- {{ $t('container.limitHelper') }}
+
+ {{ $t('container.limitHelper', [limits.cpu]) }} {{ $t('commons.units.core') }}
+
-
+
-
+
- {{ $t('container.limitHelper') }}
+
+ {{ $t('container.limitHelper', [limits.memory]) }} {{ paramModel.memoryUnit }}B
+
@@ -137,6 +154,8 @@ import { Codemirror } from 'vue-codemirror';
import { javascript } from '@codemirror/lang-javascript';
import { oneDark } from '@codemirror/theme-one-dark';
import { getLanguage } from '@/utils/util';
+import { Container } from '@/api/interface/container';
+import { loadResourceLimit } from '@/api/modules/container';
const extensions = [javascript(), oneDark];
@@ -163,13 +182,32 @@ const paramModel = ref({
});
const rules = reactive({
params: {},
- cpuQuota: [Rules.requiredInput, checkNumberRange(0, 999)],
- memoryLimit: [Rules.requiredInput, checkNumberRange(0, 9999999999)],
containerName: [Rules.containerName],
});
const submitModel = ref({});
+const oldMemory = ref(0);
+const limits = ref({
+ cpu: null as number,
+ memory: null as number,
+});
+
+const changeUnit = () => {
+ if (paramModel.value.memoryUnit == 'M') {
+ limits.value.memory = oldMemory.value;
+ } else {
+ limits.value.memory = Number((oldMemory.value / 1024).toFixed(2));
+ }
+};
+
+const loadLimit = async () => {
+ const res = await loadResourceLimit();
+ limits.value = res.data;
+ limits.value.memory = Number((limits.value.memory / 1024 / 1024).toFixed(2));
+ oldMemory.value = limits.value.memory;
+};
const acceptParams = async (props: ParamProps) => {
+ loadLimit();
submitModel.value.installId = props.id;
params.value = [];
paramData.value.id = props.id;