Merge "feat: support zun services"

This commit is contained in:
Zuul 2022-08-12 09:30:59 +00:00 committed by Gerrit Code Review
commit 686bbe3ba9
7 changed files with 127 additions and 0 deletions

View File

@ -88,6 +88,10 @@ export class ZunClient extends Base {
{
key: 'quotas',
},
{
key: 'services',
responseKey: 'service',
},
];
}
}

View File

@ -870,6 +870,13 @@ const renderMenu = (t) => {
},
],
},
{
path: '/container/services-admin',
name: t('Services'),
key: 'zunServicesAdmin',
endpoints: 'zun',
level: 1,
},
],
},
];

View File

@ -970,6 +970,7 @@
"Force Delete Container": "Force Delete Container",
"Force Delete Share Instance": "Force Delete Share Instance",
"Force release": "Force release",
"Forced Down": "Forced Down",
"Forced Shutdown": "Forced Shutdown",
"Forced shutdown may result in data loss or file system damage. You can also take the initiative to shut down and perform operations.": "Forced shutdown may result in data loss or file system damage. You can also take the initiative to shut down and perform operations.",
"Forgot your password?": "Forgot your password?",
@ -1912,6 +1913,7 @@
"Rename": "Rename",
"Rename is to copy the current file to the new file address and delete the current file, which will affect the creation time of the file.": "Rename is to copy the current file to the new file address and delete the current file, which will affect the creation time of the file.",
"Replication Change": "Replication Change",
"Report Count": "Report Count",
"Republic of the Congo": "Republic of the Congo",
"Request ID": "Request ID",
"Require": "Require",

View File

@ -970,6 +970,7 @@
"Force Delete Container": "强制删除容器",
"Force Delete Share Instance": "强制删除共享实例",
"Force release": "强制释放",
"Forced Down": "强制关闭",
"Forced Shutdown": "强制关机",
"Forced shutdown may result in data loss or file system damage. You can also take the initiative to shut down and perform operations.": "强制关机可能会导致数据丢失或文件系统损坏,您也可以主动关机后再进行操作。",
"Forgot your password?": "忘记密码?",
@ -1912,6 +1913,7 @@
"Rename": "重命名",
"Rename is to copy the current file to the new file address and delete the current file, which will affect the creation time of the file.": "重命名是把当前文件复制到新文件地址,并删除当前文件,会影响文件的创建时间。",
"Replication Change": "复制更改中",
"Report Count": "报告数量",
"Republic of the Congo": "刚果共和国",
"Request ID": "请求ID",
"Require": "强制",

View File

@ -0,0 +1,81 @@
// Copyright 2021 99cloud
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// import React from 'react';
import Base from 'containers/List';
import { inject, observer } from 'mobx-react';
import globalServicesStore from 'src/stores/zun/services';
import { serviceState } from 'resources/nova/service';
export class Services extends Base {
init() {
this.store = globalServicesStore;
this.downloadStore = globalServicesStore;
}
get name() {
return t('services');
}
get policy() {
return 'zun-service:get_all';
}
getColumns = () => [
{
title: t('Name'),
dataIndex: 'binary',
},
{
title: t('Hosts'),
dataIndex: 'host',
isHideable: true,
},
{
title: t('Availability Zone'),
dataIndex: 'availability_zone',
isHideable: true,
},
{
title: t('Report Count'),
dataIndex: 'report_count',
isHideable: true,
},
{
title: t('Forced Down'),
dataIndex: 'forced_down',
valueRender: 'yesNo',
isHideable: true,
},
{
title: t('Forbidden'),
dataIndex: 'disabled',
valueRender: 'yesNo',
isHideable: true,
},
{
title: t('Service State'),
dataIndex: 'state',
render: (value) => serviceState[value] || value,
},
{
title: t('Last Updated'),
dataIndex: 'updated_at',
isHideable: true,
valueRender: 'sinceTime',
},
];
}
export default inject('rootStore')(observer(Services));

View File

@ -21,6 +21,7 @@ import ContainersDetail from '../containers/Containers/Detail';
import CapsulesDetail from '../containers/Capsules/Detail';
import HostsDetail from '../containers/Hosts/Detail';
import StepCreateContainer from '../containers/Containers/actions/StepCreate';
import Services from '../containers/Services';
const PATH = '/container';
export default [
@ -66,6 +67,11 @@ export default [
component: HostsDetail,
exact: true,
},
{
path: `${PATH}/services-admin`,
component: Services,
exact: true,
},
// All
{ path: '*', component: E404 },
],

View File

@ -0,0 +1,25 @@
// Copyright 2021 99cloud
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import Base from 'stores/base';
import client from 'client';
export class ServicesStore extends Base {
get client() {
return client.zun.services;
}
}
const globalServicesStore = new ServicesStore();
export default globalServicesStore;