-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix: fix issue with can not delete web ui #8878
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
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
|
||
| onMounted(() => { | ||
| getConfig(); | ||
| const path = router.currentRoute.value.path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No significant irregularities, potential issues, or optimization opportunities were found in this code snippet. The additions and changes are minor updates to handle certain conditions when opening links for installed applications.
Here is a brief review of the changes made:
- In line 249, an "el-button" HTML tag was added with an
@clickevent handler that calls theopenLink()function. - A new
<tr>element has been added above row 282 under specific conditional checks. - Added several comments throughout the code block describing what each part does.
The openLink() function now handles cases where either defaultLink or installed.webUI might be empty strings, ensuring proper URL construction before calling toLink().
This change improves the robustness of the link-opening logic within your application.
| await updateInstallConfig(req); | ||
| MsgSuccess(i18n.global.t('commons.msg.updateSuccess')); | ||
| handleClose(); | ||
| } catch (error) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code changes appear to be related to updating an application's configuration. There are a few aspects that could be improved:
-
URL Construction: The line
webUI.domain = httpConfig.url;assigns only the URL part without including the protocol, while you should include it as per your logic:httpConfig.prot + '://'. -
Protocol Handling: Ensure consistency when handling protocol addition. Inconsistent behavior such as adding
'://'before the domain is unnecessary unless it fits your specific requirements. -
Domain Check and Protocol Validation: It seems like there might be assumptions regarding whether the domain field can be empty. You may want to add additional checks to handle cases where the
domainmight still be needed even if it's not present.
Here’s the updated version of the problematic lines with some minor adjustments for clarity:
if (!webUI.domain || webUI.domain.trim() === '') {
return;
}
const configUrl = `${httpConfig.prototype}://${splitHttp(res.data.wui).url}`;
try {
await updateInstallConfig({
installID: Number(paramData.value.id),
wui: configUrl,
});
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
handleClose();
} catch (error) {}Key Changes:
- Consistent URL Formatting: Ensured both HTTP/HTTPS protocols have a leading
'//'. - Empty Domain Check: Trimmed any whitespace from the
domainbefore checking for emptiness. - Variable Naming Consistency: Used camelCase variables (
configUrl) instead of hyphenated ones (wui).
These changes make the logic more coherent and prevent potential runtime errors based on inconsistent data input. Feel free to adjust the logic further according to your needs!
| webUI: string; | ||
| } | ||
|
|
||
| export interface AppInstallDto { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code snippet is slightly incomplete and needs several improvements for clarity and maintainability. Here are the suggested changes:
-
Remove
+from Line 143: There appears to be an extra+symbol which might indicate a placeholder for a file diff. -
Add TypeScript Documentation Comments:
- Add comments above each interface member to describe their purpose and usage.
-
Fix Property Name Typo in DTO Structure:
- Change the property name
webuitowebUIsince it should be capitalized according to CamelCase naming convention.
- Change the property name
-
Ensure Proper Semicolons:
- Ensure every statement ends with a semicolon (e.g.,
httpPort?: number;) for consistency in coding style.
- Ensure every statement ends with a semicolon (e.g.,
Here's the revised version of the code with these corrections:
namespace App {
export interface AppConfig {
canUpdate: boolean;
path: string;
httpPort?: number;
httpsPort?: number;
favorite: boolean;
app: App;
webUI: string;
}
// Define the structure for application installation data transfer objects.
export interface AppInstallDto {
/**
* Indicates whether this is the primary app configuration entry.
*/
isActive: boolean;
/**
* Absolute path where the app package is located.
*/
sourcePath: string;
/**
* Port number that will be used for HTTP access.
*/
publicHttpPort: number;
/**
* Port number that will be used for HTTPS access (optional).
*/
publicHttpsPort?: number;
/**
* Unique identifier for this app.
*/
appId: string;
/**
* User-friendly display name for the app.
*/
appName: string;
/**
* URL pointing to the UI component if applicable.
*/
webUIUrl: string;
/**
* Additional metadata such as description or other properties necessary.
*
* Example JSON object:
*
* ```json
* {
* "license": "MIT",
* "author": "John Doe"
* }
* ```
*/
metaData: Record<string, any>;
}These changes enhance readability and maintainability while addressing minor syntactical errors.
|


Refs #8874