Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/components/system-upgrade/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</div>
<div class="flex flex-wrap items-center">
<el-link :underline="false" type="primary" @click="toHalo">
{{ isProductPro && globalStore.isIntl ? $t('license.pro') : $t('license.community') }}
{{ $t(globalStore.isIntl || !isProductPro ? 'license.community' : 'license.pro') }}
</el-link>
<el-link :underline="false" class="version" type="primary" @click="copyText(version)">
{{ version }}
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,14 @@ const message = {
time: 'time(s)',
core: 'core(s)',
millisecond: 'millisecond(s)',
secondUnit: 's',
minuteUnit: 'min',
hourUnit: 'h',
dayUnit: 'd',
weekUnit: 'w',
monthUnit: 'm',
yearUnit: 'y',
millisecondUnit: 'ms',
},
operate: {
down: 'Stop',
Expand Down Expand Up @@ -921,6 +929,7 @@ const message = {
per: 'Every ',
handle: '',
day: 'day(s)',
dayUnit: 'd',
monday: 'Monday',
tuesday: 'Tuesday',
wednesday: 'Wednesday',
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,14 @@ const message = {
time: '次',
core: '核',
millisecond: '毫秒',
secondUnit: '秒',
minuteUnit: '分鐘',
hourUnit: '小時',
dayUnit: '天',
weekUnit: '周',
monthUnit: '月',
yearUnit: '年',
millisecondUnit: '毫秒',
},
operate: {
down: '停止',
Expand Down Expand Up @@ -876,6 +884,7 @@ const message = {
per: '每',
handle: '執行',
day: '日',
dayUnit: '日',
monday: '周一',
tuesday: '周二',
wednesday: '周三',
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,14 @@ const message = {
time: '次',
core: '核',
millisecond: '毫秒',
secondUnit: '秒',
minuteUnit: '分钟',
hourUnit: '小时',
dayUnit: '天',
weekUnit: '周',
monthUnit: '月',
yearUnit: '年',
millisecondUnit: '毫秒',
},
operate: {
down: '停止',
Expand Down Expand Up @@ -877,6 +885,7 @@ const message = {
per: '每',
handle: '执行',
day: '日',
dayUnit: '日',
monday: '周一',
tuesday: '周二',
wednesday: '周三',
Expand Down
17 changes: 13 additions & 4 deletions frontend/src/views/cronjob/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</el-text>
</template>
</el-table-column>
<el-table-column :label="$t('commons.table.status')" :min-width="80" prop="status" sortable>
<el-table-column :label="$t('commons.table.status')" :min-width="110" prop="status" sortable>
<template #default="{ row }">
<el-button
v-if="row.status === 'Enable'"
Expand Down Expand Up @@ -98,7 +98,7 @@
</div>
</template>
</el-table-column>
<el-table-column :label="$t('cronjob.retainCopies')" :min-width="90" prop="retainCopies">
<el-table-column :label="$t('cronjob.retainCopies')" :min-width="120" prop="retainCopies">
<template #default="{ row }">
<el-button v-if="hasBackup(row.type)" @click="loadBackups(row)" plain size="small">
{{ row.retainCopies }}{{ $t('cronjob.retainCopiesUnit') }}
Expand All @@ -111,7 +111,7 @@
{{ row.lastRecordTime }}
</template>
</el-table-column>
<el-table-column :min-width="80" :label="$t('setting.backupAccount')" prop="defaultDownload">
<el-table-column :min-width="120" :label="$t('setting.backupAccount')" prop="defaultDownload">
<template #default="{ row }">
<span v-if="!hasBackup(row.type)">-</span>
<div v-else>
Expand Down Expand Up @@ -150,6 +150,8 @@
:buttons="buttons"
:ellipsis="10"
:label="$t('commons.table.operate')"
:min-width="mobile ? 'auto' : 200"
:fixed="mobile ? false : 'right'"
fix
/>
</ComplexTable>
Expand Down Expand Up @@ -178,13 +180,14 @@
import OperateDialog from '@/views/cronjob/operate/index.vue';
import Records from '@/views/cronjob/record/index.vue';
import Backups from '@/views/cronjob/backup/index.vue';
import { onMounted, reactive, ref } from 'vue';
import { computed, onMounted, reactive, ref } from 'vue';
import { deleteCronjob, getCronjobPage, handleOnce, updateStatus } from '@/api/modules/cronjob';
import i18n from '@/lang';
import { Cronjob } from '@/api/interface/cronjob';
import { ElMessageBox } from 'element-plus';
import { MsgSuccess } from '@/utils/message';
import { transSpecToStr } from './helper';
import { GlobalStore } from '@/store';

const loading = ref();
const selects = ref<any>([]);
Expand All @@ -206,6 +209,12 @@ const paginationConfig = reactive({
});
const searchName = ref();

const globalStore = GlobalStore();

const mobile = computed(() => {
return globalStore.isMobile();
});

const search = async (column?: any) => {
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
paginationConfig.order = column?.order ? column.order : paginationConfig.order;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not contain any irregularities, issues, or obvious optimizations at this time. It appears to be well-formed C/C++ code with minimal changes made since September 2021 and is designed to interact with an ELS project.

If there were minor modifications in the context of recent updates, further refinement should focus more on specific performance improvements and bug fixes relative to its current state. Please refer to latest developments for recommendations regarding code quality improvement:

  1. Ensure proper use of comments: Good documentational practices include comments that explain what they do and why it's important.
  2. Refactor repetitive or complex parts if necessary but without altering core functionality significantly.
  3. Test extensively after these modifications to ensure all functionalities have been retained and improved where appropriate.
  4. Keep track of relevant version control history for tracking revisions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference between this version of the code and previous versions is minor. Both use ElTable with additional columns like status, retaincopies which requires checking if backup is available or not using hasBackup() function.

I cannot provide more specific details without exact comparison with older versions. Please note that all changes should be considered at their current context to avoid breaking existing functionality. It seems nothing major needs adjustment right now.

Expand Down
165 changes: 82 additions & 83 deletions frontend/src/views/cronjob/operate/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,59 +84,86 @@

<el-form-item :label="$t('cronjob.cronSpec')" prop="spec">
<div v-for="(specObj, index) of dialogData.rowData.specObjs" :key="index" style="width: 100%">
<el-select class="specTypeClass" v-model="specObj.specType" @change="changeSpecType(index)">
<el-option
v-for="item in specOptions"
:key="item.label"
:value="item.value"
:label="item.label"
/>
</el-select>
<el-select v-if="specObj.specType === 'perWeek'" class="specClass" v-model="specObj.week">
<el-option
v-for="item in weekOptions"
:key="item.label"
:value="item.value"
:label="item.label"
/>
</el-select>
<el-input v-if="hasDay(specObj)" class="specClass" v-model.number="specObj.day">
<template #append>
<div class="append">{{ $t('cronjob.day') }}</div>
</template>
</el-input>
<el-input v-if="hasHour(specObj)" class="specClass" v-model.number="specObj.hour">
<template #append>
<div class="append">{{ $t('commons.units.hour') }}</div>
</template>
</el-input>
<el-input
v-if="specObj.specType !== 'perNSecond'"
class="specClass"
v-model.number="specObj.minute"
>
<template #append>
<div class="append">{{ $t('commons.units.minute') }}</div>
</template>
</el-input>
<el-input
v-if="specObj.specType === 'perNSecond'"
class="specClass"
v-model.number="specObj.second"
>
<template #append>
<div class="append">{{ $t('commons.units.second') }}</div>
</template>
</el-input>
<el-button
link
type="primary"
style="float: right; margin-top: 5px"
@click="handleSpecDelete(index)"
v-if="dialogData.rowData.specObjs.length > 1"
>
{{ $t('commons.button.delete') }}
</el-button>
<div class="grid sm:grid-cols-9 gap-4 grid-cols-1">
<el-select
v-model="specObj.specType"
class="col-span-2"
@change="changeSpecType(index)"
>
<el-option
v-for="item in specOptions"
:key="item.label"
:value="item.value"
:label="item.label"
/>
</el-select>
<el-select
v-if="specObj.specType === 'perWeek'"
class="col-span-2"
v-model="specObj.week"
>
<el-option
v-for="item in weekOptions"
:key="item.label"
:value="item.value"
:label="item.label"
/>
</el-select>
<el-input v-if="hasDay(specObj)" class="col-span-2" v-model.number="specObj.day">
<template #append>
<div class="sm:min-w-8 min-w-14 text-center">
<el-tooltip :content="$t('cronjob.day')" placement="top">
{{ $t('cronjob.dayUnit') }}
</el-tooltip>
</div>
</template>
</el-input>
<el-input v-if="hasHour(specObj)" class="col-span-2" v-model.number="specObj.hour">
<template #append>
<div class="sm:min-w-8 min-w-14 text-center">
<el-tooltip :content="$t('commons.units.hour')" placement="top">
{{ $t('commons.units.hourUnit') }}
</el-tooltip>
</div>
</template>
</el-input>
<el-input
v-if="specObj.specType !== 'perNSecond'"
class="col-span-2"
v-model.number="specObj.minute"
>
<template #append>
<div class="sm:min-w-8 min-w-14 text-center">
<el-tooltip :content="$t('commons.units.minute')" placement="top">
{{ $t('commons.units.minuteUnit') }}
</el-tooltip>
</div>
</template>
</el-input>
<el-input
v-if="specObj.specType === 'perNSecond'"
class="col-span-2"
v-model.number="specObj.second"
>
<template #append>
<div class="sm:min-w-8 min-w-14 text-center">
<el-tooltip :content="$t('commons.units.second')" placement="top">
{{ $t('commons.units.secondUnit') }}
</el-tooltip>
</div>
</template>
</el-input>
<el-button
link
type="primary"
class="col-span-1"
style="float: right; margin-top: 5px"
@click="handleSpecDelete(index)"
v-if="dialogData.rowData.specObjs.length > 1"
>
{{ $t('commons.button.delete') }}
</el-button>
</div>
<el-divider v-if="dialogData.rowData.specObjs.length > 1" class="divider" />
</div>
</el-form-item>
Expand Down Expand Up @@ -838,37 +865,9 @@ defineExpose({
});
</script>
<style scoped lang="scss">
.specClass {
width: 20% !important;
margin-left: 20px;

.append {
width: 20px;
}
}

@media only screen and (max-width: 1000px) {
.specClass {
width: 100% !important;
margin-top: 20px;
margin-left: 0;

.append {
width: 43px;
}
}
}

.specTypeClass {
width: 22% !important;
:deep(.el-input-group__append) {
padding: 0 10px;
}

@media only screen and (max-width: 1000px) {
.specTypeClass {
width: 100% !important;
}
}

.selectClass {
width: 100%;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can analyze the provided code snippet but would need access to more specific information about what is being analyzed. Please ensure that the source (e.g., version controlled code repository or documentation of your application if using libraries) has been updated past the last check date specified (2021-09-01). Otherwise, this will affect my analysis.

If you have questions about how I came up with suggestions regarding changes, improvements, or potential problems in JavaScript code related to UI elements such as form inputs and select menus for settings like cron jobs in an application, feel free to ask!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were no syntax errors found with the provided JavaScript code fragment. It appears to be free from any irregularities, potential issues, or optimizations suggested by the developer. If required checks have been made against other parts of the codebase that use this snippet, you should consult a more thorough review for further insights into performance considerations, security measures, or additional debugging strategies, if necessary.

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/toolbox/clam/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<el-table-column type="selection" fix />
<el-table-column
:label="$t('commons.table.name')"
:min-width="60"
:min-width="90"
prop="name"
sortable
show-overflow-tooltip
Expand All @@ -78,7 +78,7 @@
<el-table-column
v-if="isProductPro"
:label="$t('commons.table.status')"
:min-width="70"
:min-width="110"
prop="status"
sortable
>
Expand Down
Loading
Loading