Skip to content

Commit 8e51177

Browse files
authored
fix ns plugin bugs (#513)
* fix namespace plugin batch enable * fix get alert receviers * fix namespace plugin get selector * fix ns plugin selector bug * fix namespace detail restful * fix namespace plugin restful * fix data permission ns bug * support copy selector from other ns * support rule copy from other ns * fix ns plugin bugs
1 parent 9540a89 commit 8e51177

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

src/routes/System/NamespacePlugin/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export default class NamespacePlugin extends Component {
143143
editClick = (record) => {
144144
const { dispatch, currentNamespaceId } = this.props;
145145
getUpdateModal({
146-
id: record.pluginId,
146+
id: record.id,
147147
namespaceId: currentNamespaceId,
148148
dispatch,
149149
fetchValue: this.currentQueryPayload(),
@@ -373,7 +373,7 @@ export default class NamespacePlugin extends Component {
373373
checked={text}
374374
onChange={(checked) => {
375375
this.statusSwitch({
376-
list: [row.pluginId],
376+
list: [row.id],
377377
enabled: checked,
378378
namespaceId: row.namespaceId,
379379
});
@@ -536,7 +536,6 @@ export default class NamespacePlugin extends Component {
536536
loading={loading}
537537
columns={columns}
538538
dataSource={namespacePluginList}
539-
rowKey={(record) => record.pluginId}
540539
rowSelection={rowSelection}
541540
pagination={{
542541
total,

src/routes/System/Plugin/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ export default class Plugin extends Component {
182182
fetchValue: this.currentQueryPayload({
183183
pageSize: 12,
184184
}),
185+
callback: () => {
186+
refreshAuthMenus({ dispatch });
187+
},
185188
});
186189
};
187190

src/services/api.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,12 +1294,9 @@ export async function deleteNamespace(params) {
12941294

12951295
/* findNamespacePlugin */
12961296
export async function findNamespacePlugin(params) {
1297-
return request(
1298-
`${baseUrl}/namespace-plugin/${params.namespaceId}/${params.id}`,
1299-
{
1300-
method: `GET`,
1301-
},
1302-
);
1297+
return request(`${baseUrl}/namespace-plugin/${params.id}`, {
1298+
method: `GET`,
1299+
});
13031300
}
13041301

13051302
/* getAllNamespacePlugins */
@@ -1334,13 +1331,10 @@ export async function updateNamespacePluginEnabledByNamespace(params) {
13341331

13351332
/* updateNamespacePlugin */
13361333
export async function updateNamespacePlugin(params) {
1337-
return request(
1338-
`${baseUrl}/namespace-plugin/${params.namespaceId}/${params.pluginId}`,
1339-
{
1340-
method: `PUT`,
1341-
body: params,
1342-
},
1343-
);
1334+
return request(`${baseUrl}/namespace-plugin/${params.id}`, {
1335+
method: `PUT`,
1336+
body: params,
1337+
});
13441338
}
13451339

13461340
/* deletePlugin */

src/utils/namespacePlugin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export function getUpdateModal({
5050
type: "namespacePlugin/update",
5151
payload: {
5252
config,
53+
id: plugin.id,
5354
pluginId: plugin.pluginId,
5455
enabled,
5556
namespaceId,

0 commit comments

Comments
 (0)