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
11 changes: 10 additions & 1 deletion frontend/src/components/app-status/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,27 @@
<div class="mt-0.5">
<el-button
type="primary"
v-permission="'app_manage'"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use route-scoped manage permission for AppStatus actions

The new hardcoded v-permission="'app_manage'" on start/stop/restart couples this shared component to App Store permissions, but AppStatus is reused in non-App-Store pages (for example website and database views). In those routes, users with module manage rights (e.g. website/database) but without app_manage will now have these controls disabled, which is a functional regression for service operations outside the app module.

Useful? React with 👍 / 👎.

v-if="data.status != 'Running'"
link
@click="onOperate('start')"
:disabled="data.status === 'Installing'"
>
{{ $t('commons.operate.start') }}
</el-button>
<el-button type="primary" v-if="data.status === 'Running'" link @click="onOperate('stop')">
<el-button
type="primary"
v-permission="'app_manage'"
v-if="data.status === 'Running'"
link
@click="onOperate('stop')"
>
{{ $t('commons.operate.stop') }}
</el-button>
<el-divider direction="vertical" />
<el-button
type="primary"
v-permission="'app_manage'"
link
:disabled="data.status === 'Installing'"
@click="onOperate('restart')"
Expand All @@ -34,6 +42,7 @@
<el-button
type="primary"
link
v-permission:view="'website_manage'"
v-if="data.app === 'OpenResty'"
@click="onOperate('reload')"
:disabled="data.status !== 'Running'"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/log/container/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<el-button class="margin-button" @click="openDownloadDialog" icon="Download">
{{ $t('commons.button.download') }}
</el-button>
<el-button class="margin-button" @click="onClean" icon="Delete">
<el-button v-permission="'container_manage'" class="margin-button" @click="onClean" icon="Delete">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not gate shared log cleanup with container-only permission

This component is used outside container pages (including website and database log screens), but the cleanup button now requires container_manage explicitly. That prevents users who have the relevant module manage permission for those pages, but not container permission, from cleaning logs in those contexts, introducing an unnecessary cross-module permission dependency in a shared widget.

Useful? React with 👍 / 👎.

{{ $t('commons.button.clean') }}
</el-button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/app-store/installed/ignore/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</el-table-column>
<el-table-column prop="scope" :label="$t('commons.table.operate')">
<template #default="{ row }">
<el-button type="primary" link @click="cancelIgnore(row.ID)">
<el-button v-permission type="primary" link @click="cancelIgnore(row.ID)">
{{ $t('app.cancelIgnore') }}
</el-button>
</template>
Expand Down
28 changes: 15 additions & 13 deletions frontend/src/views/app-store/installed/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</el-button>
<el-button
@click="enterSortMode"
v-permission
type="primary"
plain
v-if="mode === 'installed' && !sortMode && data != null"
Expand Down Expand Up @@ -86,19 +87,20 @@
class="d-button flex flex-wrap items-center justify-start gap-1.5"
v-if="mode === 'installed' && installed.status != 'Installing'"
>
<el-button
class="app-button"
v-for="(button, key) in buttons"
:key="key"
:type="button.disabled && button.disabled(installed) ? 'info' : ''"
plain
round
size="small"
@click="button.click(installed)"
:disabled="button.disabled && button.disabled(installed)"
>
{{ button.label }}
</el-button>
<template v-for="(button, key) in buttons" :key="key">
<el-button
v-permission
class="app-button"
:type="button.disabled && button.disabled(installed) ? 'info' : ''"
plain
round
size="small"
@click="button.click(installed)"
:disabled="button.disabled && button.disabled(installed)"
>
{{ button.label }}
</el-button>
</template>
</div>
</template>
</AppCard>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/cronjob/library/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</template>
</el-dropdown>

<el-button type="primary" plain @click="onOpenGroupDialog()">
<el-button v-permission type="primary" plain @click="onOpenGroupDialog()">
{{ $t('commons.table.group') }}
</el-button>
<el-button v-permission plain :disabled="selects.length === 0" @click="onDelete(null)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
</el-button>
<el-button
class="w-full sm:w-auto !ml-0"
type="danger"
v-permission
:disabled="selected.length === 0"
:loading="deleteLoading"
@click="deleteSelected(null)"
Expand Down Expand Up @@ -152,7 +152,7 @@
<el-button link type="primary" @click.stop="openHistoryRecord(row)">
{{ $t('commons.button.view') }}
</el-button>
<el-button link type="danger" @click.stop="deleteSelected(row)">
<el-button v-permission link type="primary" @click.stop="deleteSelected(row)">
{{ $t('commons.button.delete') }}
</el-button>
</template>
Expand Down Expand Up @@ -183,6 +183,7 @@
<el-tag effect="plain">{{ computeSize(selectedHistory.contentSize) }}</el-tag>
<el-button
v-if="canRestoreSelected"
v-permission
type="primary"
:loading="restoreLoading"
@click="confirmRestoreSelected"
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/views/host/file-management/code-editor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<div class="flex justify-start items-center gap-x-4 card-action">
<el-text class="cursor-pointer" @click="handleReset">{{ $t('commons.button.reset') }}</el-text>
<el-divider direction="vertical" class="!mx-0" />
<el-text class="cursor-pointer ml-0" @click="saveContent()">
<el-text v-permission class="cursor-pointer ml-0" @click="saveContent()">
{{ $t('commons.button.save') }}
</el-text>
<el-divider direction="vertical" class="!mx-0" />
Expand Down Expand Up @@ -127,14 +127,14 @@
</el-text>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="dir" class="!px-2">
<fu-dropdown-item v-permission command="dir" class="!px-2">
<svg-icon class="!w-5 !h-5" iconName="p-file-folder"></svg-icon>
{{ $t('file.dir') }}
</el-dropdown-item>
<el-dropdown-item command="file" class="!px-2">
</fu-dropdown-item>
<fu-dropdown-item v-permission command="file" class="!px-2">
<svg-icon class="!w-5 !h-5" iconName="p-file-normal"></svg-icon>
{{ $t('menu.files') }}
</el-dropdown-item>
</fu-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/views/host/file-management/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,12 @@
</template>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="openShareList">
<fu-dropdown-item @click="openShareList">
{{ $t('file.shareList') }}
</el-dropdown-item>
<el-dropdown-item @click="openFileHistoryCenter">
</fu-dropdown-item>
<fu-dropdown-item @click="openFileHistoryCenter">
{{ $t('file.history') }}
</el-dropdown-item>
</fu-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
</el-col>
<el-col :span="3">
<el-form-item>
<el-button type="primary" @click="removeEnv(index)" link class="mt-1">
<el-button v-permission type="primary" @click="removeEnv(index)" link class="mt-1">
{{ $t('commons.button.delete') }}
</el-button>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="4">
<el-button @click="addEnv">{{ $t('commons.button.add') }}</el-button>
<el-button v-permission @click="addEnv">{{ $t('commons.button.add') }}</el-button>
</el-col>
</el-row>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
</el-col>
<el-col :span="4">
<el-form-item>
<el-button type="primary" @click="removeEnv(index)" link class="mt-1">
<el-button v-permission type="primary" @click="removeEnv(index)" link class="mt-1">
{{ $t('commons.button.delete') }}
</el-button>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="4">
<el-button @click="addEnv">{{ $t('commons.button.add') }}</el-button>
<el-button v-permission @click="addEnv">{{ $t('commons.button.add') }}</el-button>
</el-col>
</el-row>
</div>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/website/runtime/components/port/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
</el-col>
<el-col :span="2">
<el-form-item>
<el-button type="primary" @click="removePort(index)" link class="mt-1">
<el-button v-permission type="primary" @click="removePort(index)" link class="mt-1">
{{ $t('commons.button.delete') }}
</el-button>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="4">
<el-button @click="addPort">{{ $t('commons.button.add') }}</el-button>
<el-button v-permission @click="addPort">{{ $t('commons.button.add') }}</el-button>
</el-col>
</el-row>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
</el-col>
<el-col :span="4">
<el-form-item>
<el-button type="primary" @click="removeEnv(index)" link class="mt-1">
<el-button v-permission type="primary" @click="removeEnv(index)" link class="mt-1">
{{ $t('commons.button.delete') }}
</el-button>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="4">
<el-button @click="addEnv">{{ $t('commons.button.add') }}</el-button>
<el-button v-permission @click="addEnv">{{ $t('commons.button.add') }}</el-button>
</el-col>
</el-row>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/website/runtime/delete/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="handleClose" :disabled="loading">{{ $t('commons.button.cancel') }}</el-button>
<el-button type="primary" @click="submit()" :loading="loading">
<el-button v-permission type="primary" @click="submit()" :loading="loading">
{{ $t('commons.button.confirm') }}
</el-button>
</span>
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/views/website/runtime/dotnet/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ const req = reactive<Runtime.RuntimeReq>({
const buttons = [
{
label: i18n.global.t('commons.operate.stop'),
permission: true,
click: function (row: Runtime.Runtime) {
operateRuntime('down', row.id, loading, search);
},
Expand All @@ -158,6 +159,7 @@ const buttons = [
},
{
label: i18n.global.t('commons.operate.start'),
permission: true,
click: function (row: Runtime.Runtime) {
operateRuntime('up', row.id, loading, search);
},
Expand All @@ -167,6 +169,7 @@ const buttons = [
},
{
label: i18n.global.t('commons.operate.restart'),
permission: true,
click: function (row: Runtime.Runtime) {
operateRuntime('restart', row.id, loading, search);
},
Expand All @@ -176,6 +179,7 @@ const buttons = [
},
{
label: i18n.global.t('commons.button.edit'),
permission: true,
click: function (row: Runtime.Runtime) {
openDetail(row);
},
Expand All @@ -185,6 +189,7 @@ const buttons = [
},
{
label: i18n.global.t('menu.terminal'),
permission: true,
click: function (row: Runtime.Runtime) {
openTerminal(row);
},
Expand All @@ -194,6 +199,7 @@ const buttons = [
},
{
label: i18n.global.t('commons.button.delete'),
permission: true,
click: function (row: Runtime.Runtime) {
openDelete(row);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<template #footer>
<span>
<el-button @click="handleClose" :disabled="loading">{{ $t('commons.button.cancel') }}</el-button>
<el-button type="primary" @click="submit(runtimeForm)" :disabled="loading">
<el-button v-permission type="primary" @click="submit(runtimeForm)" :disabled="loading">
{{ $t('commons.button.confirm') }}
</el-button>
</span>
Expand Down
13 changes: 12 additions & 1 deletion frontend/src/views/website/runtime/go/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@
</el-table-column>
<el-table-column :label="$t('runtime.codeDir')" prop="codeDir" min-width="120px">
<template #default="{ row }">
<el-button type="primary" link @click="routerToFileWithPath(row.codeDir)">
<el-button
v-permission:view="'host_file_view'"
type="primary"
link
@click="routerToFileWithPath(row.codeDir)"
>
<el-icon>
<FolderOpened />
</el-icon>
Expand Down Expand Up @@ -144,6 +149,7 @@ const req = reactive<Runtime.RuntimeReq>({
const buttons = [
{
label: i18n.global.t('commons.operate.stop'),
permission: true,
click: function (row: Runtime.Runtime) {
operateRuntime('down', row.id, loading, search);
},
Expand All @@ -153,6 +159,7 @@ const buttons = [
},
{
label: i18n.global.t('commons.operate.start'),
permission: true,
click: function (row: Runtime.Runtime) {
operateRuntime('up', row.id, loading, search);
},
Expand All @@ -162,6 +169,7 @@ const buttons = [
},
{
label: i18n.global.t('commons.button.restart'),
permission: true,
click: function (row: Runtime.Runtime) {
operateRuntime('restart', row.id, loading, search);
},
Expand All @@ -171,6 +179,7 @@ const buttons = [
},
{
label: i18n.global.t('commons.button.edit'),
permission: true,
click: function (row: Runtime.Runtime) {
openDetail(row);
},
Expand All @@ -180,6 +189,7 @@ const buttons = [
},
{
label: i18n.global.t('menu.terminal'),
permission: true,
click: function (row: Runtime.Runtime) {
openTerminal(row);
},
Expand All @@ -189,6 +199,7 @@ const buttons = [
},
{
label: i18n.global.t('commons.button.delete'),
permission: true,
click: function (row: Runtime.Runtime) {
openDelete(row);
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/website/runtime/go/operate/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

<template #footer>
<el-button @click="handleClose" :disabled="loading">{{ $t('commons.button.cancel') }}</el-button>
<el-button type="primary" @click="submit(runtimeForm)" :disabled="loading">
<el-button v-permission type="primary" @click="submit(runtimeForm)" :disabled="loading">
{{ $t('commons.button.confirm') }}
</el-button>
</template>
Expand Down
Loading
Loading