Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: change some column width #7385

Merged
merged 1 commit into from
Dec 17, 2024
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
20 changes: 10 additions & 10 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ const message = {
goInstall: 'Go to install',
source: 'Source',
isDelete: 'Deleted',
permission: 'Change permissions',
permission: 'Permissions',
permissionForIP: 'IP',
permissionAll: 'All of them(%)',
databaseConnInfo: 'View connection info',
Expand All @@ -431,7 +431,7 @@ const message = {
remoteHelper: 'Multiple IP comma-delimited, example: 172.16.10.111, 172.16.10.112',
remoteConnHelper:
'Remote connection to MySQL as user root may have security risks. Therefore, perform this operation with caution.',
changePassword: 'Change password',
changePassword: 'Password',
changePasswordHelper:
'The database has been associated with an application. Changing the password will change the database password of the application at the same time. The change takes effect after the application restarts.',

Expand Down Expand Up @@ -799,7 +799,7 @@ const message = {
apps: 'App Store',
local: 'Local',
createCompose: 'Create',
composeDirectory: 'Compose directory',
composeDirectory: 'Directory',
template: 'Template',
composeTemplate: 'Compose template | Compose templates',
createComposeTemplate: 'Create',
Expand Down Expand Up @@ -1209,7 +1209,7 @@ const message = {
role: 'Permissions',
info: 'View attributes',
linkFile: 'Soft link',
terminal: 'Open terminal',
terminal: 'Terminal',
batchoperation: 'batch operation',
shareList: 'Share list',
zip: 'Compressed',
Expand Down Expand Up @@ -2102,7 +2102,7 @@ const message = {
disabled: 'Stopped',
startProxy: 'This will start reverse proxy. Do you want to continue?',
stopProxy: 'This will stop the reverse proxy. Do you want to continue?',
sourceFile: 'View source',
sourceFile: 'Source',
proxyHelper1: 'When accessing this directory, the content of the target URL will be returned and displayed.',
proxyPassHelper: 'The target URL must be valid and accessible.',
proxyHostHelper: 'Pass the domain name in the request header to the proxy server.',
Expand Down Expand Up @@ -2237,14 +2237,14 @@ const message = {
err: 'Error',
value: 'record value',
dnsResolveHelper: 'Please go to the DNS resolution service provider to add the following resolution records:',
detail: 'View details',
detail: 'Details',
msg: 'Information',
ssl: 'Certificate',
key: 'Private key',
startDate: 'Effective time',
organization: 'issuing organization',
renewConfirm: 'This will renew a new certificate for domain name {0}. Do you want to continue?',
autoRenew: 'Automatic renewal',
autoRenew: 'Auto-Renew',
autoRenewHelper: 'Automatically renew 30 days before expiration',
renewSuccess: 'Renewal successful',
renewWebsite:
Expand Down Expand Up @@ -2435,7 +2435,7 @@ const message = {
},
process: {
pid: 'Process ID',
ppid: 'Parent process ID',
ppid: 'Parent PID',
numThreads: 'Threads',
memory: 'Memory',
diskRead: 'Disk read',
Expand Down Expand Up @@ -2465,7 +2465,7 @@ const message = {
laddr: 'Source address/port',
raddr: 'Destination address/port',
stopProcess: 'End',
viewDetails: 'View details',
viewDetails: 'Details',
stopProcessWarn: 'Are you sure you want to end this process (PID:{0})?',
processName: 'Process name',
},
Expand All @@ -2480,7 +2480,7 @@ const message = {
user: 'User',
command: 'Command',
dir: 'Directory',
numprocs: 'Number of process',
numprocs: 'Num. of process',
initWarn:
'This will modify "files" value in "[include"] section in the main configuration file. The directory of other configuration file will be: "{1Panel installation directory}/1panel/tools/supervisord/supervisor.d/".',
operatorHelper: 'Operation {1} will be performed on {0}, continue? ',
Copy link
Member

Choose a reason for hiding this comment

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

Review of Code Differences

Key Changes:

  1. Permission and Password Strings:

    • permission was changed from "Change permissions" to "Permissions".
    • changePassword was changed from "Change password" to "Password".
  2. Other Minor Updates:

    • Various string updates related to "IP", "template", and file paths were made to ensure consistency and clarity.
  3. Proximity Helper Messages:

    • Updated helper messages for the proxy setup, ensuring consistency and accuracy.
  4. Additional Error Details:

    • Added detail views (view details) where appropriate.
  5. Renew Certificate Logic:

    • Corrected the logic for automatic renewal by updating comments and variable names ("autoRenew" to "Auto-Renew").

Potential Issues:

  • Consistency across strings may still need refinement to maintain consistency globally within the product.

Recommendations:

  1. Consistent String Naming: Ensure all similar phrases follow consistent naming patterns across the entire resource bundle.
  2. Documentation Improvements: Consider adding more documentation or comments on error messages and actions to improve usability for support personnel.
  3. Further Localization Testing: Conduct localized testing to ensure that translations do not introduce cultural nuances that might negatively impact user experience.

Summary

The reviewed changes mainly aim at maintaining consistent language usage throughout the resources while correcting typos. These modifications should help enhance overall clarity and maintainability.

Expand Down
17 changes: 12 additions & 5 deletions frontend/src/views/container/compose/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
</el-text>
</template>
</el-table-column>
<el-table-column :label="$t('container.from')" prop="createdBy" min-width="80" fix>
<el-table-column :label="$t('container.from')" prop="createdBy" min-width="120" fix>
<template #default="{ row }">
<span v-if="row.createdBy === ''">{{ $t('container.local') }}</span>
<span v-if="row.createdBy === 'Apps'">{{ $t('container.apps') }}</span>
<span v-if="row.createdBy === '1Panel'">1Panel</span>
</template>
</el-table-column>
<el-table-column :label="$t('container.composeDirectory')" min-width="80" fix>
<el-table-column :label="$t('container.composeDirectory')" min-width="100" fix>
<template #default="{ row }">
<el-button type="primary" link @click="toComposeFolder(row)">
<el-icon>
Expand All @@ -64,19 +64,20 @@
</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('container.containerStatus')" min-width="80" fix>
<el-table-column :label="$t('container.containerStatus')" min-width="200" fix>
<template #default="scope">
<div>
{{ getContainerStatus(scope.row.containers) }}
</div>
</template>
</el-table-column>
<el-table-column :label="$t('commons.table.createdAt')" prop="createdAt" min-width="80" fix />
<el-table-column :label="$t('commons.table.createdAt')" prop="createdAt" min-width="180" fix />
<fu-table-operations
width="200px"
:ellipsis="10"
:buttons="buttons"
:label="$t('commons.table.operate')"
:fixed="mobile ? false : 'right'"
fix
/>
</ComplexTable>
Expand All @@ -90,7 +91,7 @@
</template>

<script lang="ts" setup>
import { reactive, onMounted, ref } from 'vue';
import { reactive, onMounted, ref, computed } from 'vue';
import EditDialog from '@/views/container/compose/edit/index.vue';
import CreateDialog from '@/views/container/compose/create/index.vue';
import DeleteDialog from '@/views/container/compose/delete/index.vue';
Expand All @@ -99,6 +100,12 @@ import { loadContainerLog, loadDockerStatus, searchCompose } from '@/api/modules
import i18n from '@/lang';
import { Container } from '@/api/interface/container';
import router from '@/routers';
import { GlobalStore } from '@/store';
const globalStore = GlobalStore();

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

const data = ref();
const selects = ref<any>([]);
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 significant irregularities or major issues but can be optimized and improved:

Improvements

  1. Refactor computed for Mobile Detection:
    Extracting mobile detection logic into a computed property (mobile) makes the component cleaner and more maintainable.

    const mobile = computed(() => globalStore.isMobile());
  2. Type Definition Update in ref Initialization:
    Ensure that the initial value of data is correctly typed as an array of objects, typically related to containers.

    const data = ref<Container[]>([]);
  3. Potential Bug in loadContainers Usage:
    There is no definition provided for loadContainers function, which should take parameters like filters or other criteria to fetch container data. It might need proper error handling or default behavior if called without arguments.

    // Assuming loadContainers is defined somewhere below based on your API calls.
    const loadContainers = (filters?: object) => {
        // Your implementation here
    };

Potential Suggestions for Refactoring

  1. Separation of Concerns:
    Consider separating the creation of dialogs (like .editDialog, etc.) from the main table component. This could improve modularity and make it easier to manage different components within the same area.

  2. Optimize Table Columns:
    Ensure there are not too many columns loaded at once if they become cluttered.

  3. Dynamic Component Loading:
    If dialogs are dynamic or change dynamically throughout the application lifecycle, consider using Vue's built-in dynamic component capabilities to handle this effectively.

  4. Logging Functionality:
    The current log loading functionality seems redundant since there already exists a route /compose/folder/:id for logs. You may want to update the button action for logs to point directly to these routes instead of invoking the toRoute method again.

These improvements help organize the code better, enhance readability, prevent common pitfalls such as missing functions or unclear functionalities, and suggest further optimizations depending on the context you work with.

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/container/container/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
:label="$t('container.source')"
show-overflow-tooltip
prop="resource"
min-width="120"
min-width="150"
>
<template #default="{ row }">
<div v-if="row.hasLoad">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/database/mysql/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
/>
<fu-table-operations
:ellipsis="mobile ? 0 : 10"
:min-width="mobile ? 'auto' : 300"
:min-width="mobile ? 'auto' : 400"
:buttons="buttons"
:label="$t('commons.table.operate')"
fixed="right"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/database/postgresql/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
/>
<fu-table-operations
:ellipsis="mobile ? 0 : 10"
:min-width="mobile ? 'auto' : 300"
:min-width="mobile ? 'auto' : 400"
:buttons="buttons"
:label="$t('commons.table.operate')"
fixed="right"
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/views/host/process/process/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,17 @@
<el-table-column
:label="$t('process.memory')"
fix
min-width="120"
prop="rssValue"
:formatter="memFormatter"
sortable
></el-table-column>
<el-table-column :label="$t('process.numConnections')" fix prop="numConnections"></el-table-column>
<el-table-column
:label="$t('process.numConnections')"
fix
prop="numConnections"
min-width="120"
></el-table-column>
<el-table-column
:label="$t('process.status')"
fix
Copy link
Member

Choose a reason for hiding this comment

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

There are no significant code differences in this snippet, but here are some minor suggestions:

  1. The min-width attribute is set to 120px for both columns with "Memory" and "Number of Connections". This should ensure that these columns have a minimum width of 120 pixels, which can improve readability on smaller screens.

Overall, the changes between lines 54 and 63 are minimal and do not introduce any potential issues.

Expand Down
8 changes: 4 additions & 4 deletions frontend/src/views/toolbox/supervisor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@
:label="$t('tool.supervisor.user')"
prop="user"
show-overflow-tooltip
min-width="50px"
min-width="120"
></el-table-column>
<el-table-column
:label="$t('tool.supervisor.numprocs')"
prop="numprocs"
min-width="60px"
min-width="120"
></el-table-column>
<el-table-column :label="$t('tool.supervisor.manage')" min-width="80px">
<el-table-column :label="$t('tool.supervisor.manage')" min-width="120">
<template #default="{ row }">
<div v-if="row.status && row.status.length > 0 && row.hasLoad">
<el-button
Expand Down Expand Up @@ -142,7 +142,7 @@
:buttons="buttons"
:label="$t('commons.table.operate')"
:fixed="mobile ? false : 'right'"
width="280px"
min-width="300"
fix
/>
</ComplexTable>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/website/ssl/ca/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
:buttons="buttons"
:label="$t('commons.table.operate')"
fix
width="250px"
width="400px"
/>
</ComplexTable>
<Create ref="createRef" @close="search()" />
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/views/website/ssl/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@
fix
show-overflow-tooltip
prop="domains"
min-width="90px"
min-width="150px"
></el-table-column>
<el-table-column
:label="$t('ssl.applyType')"
fix
show-overflow-tooltip
prop="provider"
min-width="110px"
min-width="180px"
>
<template #default="{ row }">{{ getProvider(row.provider) }}</template>
</el-table-column>
Expand All @@ -61,7 +61,7 @@
fix
show-overflow-tooltip
prop="acmeAccount.email"
min-width="110px"
min-width="180px"
></el-table-column>
<el-table-column
:label="$t('commons.table.status')"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/website/website/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
</div>
</template>
</el-table-column>
<el-table-column :label="$t('website.sslExpireDate')" width="150px">
<el-table-column :label="$t('website.sslExpireDate')" width="220px">
<template #default="{ row }">
<el-tag v-if="row.protocol == 'HTTPS'" :type="row.sslStatus">
{{ dateFormatSimple(row.sslExpireDate) }}
Expand Down
Loading