Compare commits
2 Commits
devForBF
...
feature-sh
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43ad0f5dd8 | ||
|
|
f5b5607297 |
@@ -1,28 +0,0 @@
|
||||
from functools import wraps
|
||||
|
||||
from app.db.crud import create_operationlog
|
||||
from app.db.schemas import OperationCreate
|
||||
from fastapi.encoders import jsonable_encoder
|
||||
|
||||
def log_operation(operation):
|
||||
def decorator(func):
|
||||
@wraps(func)
|
||||
async def wrapper(*args,**kwargs):
|
||||
db = kwargs.get('db')
|
||||
request = kwargs.get('request')
|
||||
result = await func(*args,**kwargs)
|
||||
detial = f"Request: {request.method} {request.url}\
|
||||
Request Headers: {request.headers}\
|
||||
Request Body: {request.body()}\
|
||||
Result: {jsonable_encoder(result,exclude_unset=True)}"
|
||||
function = func.__name__
|
||||
db_operation = OperationCreate(tenantid ="t",
|
||||
domainurl="d",
|
||||
userid=3,
|
||||
operation=operation,
|
||||
function=function,
|
||||
detail=detial)
|
||||
create_operationlog(db,db_operation)
|
||||
return result
|
||||
return wrapper
|
||||
return decorator
|
||||
@@ -364,18 +364,4 @@ def create_log(db: Session, error:schemas.ErrorCreate):
|
||||
|
||||
def get_kintoneformat(db: Session):
|
||||
formats = db.query(models.KintoneFormat).order_by(models.KintoneFormat.id).all()
|
||||
return formats
|
||||
|
||||
def create_operationlog(db: Session, log: schemas.OperationCreate):
|
||||
db_log = models.OperationLog(
|
||||
tenantid=log.tenantid,
|
||||
domainurl=log.domainurl,
|
||||
userid = log.userid,
|
||||
operation = log.operation,
|
||||
function = log.function,
|
||||
detail = log.detail
|
||||
)
|
||||
db.add(db_log)
|
||||
db.commit()
|
||||
db.refresh(db_log)
|
||||
return db_log
|
||||
return formats
|
||||
@@ -162,12 +162,4 @@ class Event(Base):
|
||||
class ErrorCreate(BaseModel):
|
||||
title:str
|
||||
location:str
|
||||
content:str
|
||||
|
||||
class OperationCreate(BaseModel):
|
||||
tenantid:str
|
||||
domainurl:str
|
||||
userid:int
|
||||
operation:str
|
||||
function:str
|
||||
detail:str
|
||||
content:str
|
||||
@@ -22,6 +22,8 @@
|
||||
<div v-if="isAdmin()">
|
||||
<EssentialLink v-for="link in adminLinks" :key="link.title" v-bind="link" />
|
||||
</div>
|
||||
<EssentialLink v-for="link in domainLinks" :key="link.title" v-bind="link" />
|
||||
|
||||
</q-list>
|
||||
</q-drawer>
|
||||
|
||||
@@ -83,58 +85,23 @@ const essentialLinks: EssentialLinkProps[] = [
|
||||
// link:'https://cybozu.dev/ja/kintone/docs/',
|
||||
// icon:'help_outline'
|
||||
// },
|
||||
];
|
||||
|
||||
const domainLinks: EssentialLinkProps[] = [
|
||||
{
|
||||
title: 'ドメイン管理',
|
||||
caption: 'kintoneのドメイン設定',
|
||||
icon: 'domain',
|
||||
link: '/#/domain',
|
||||
target: '_self'
|
||||
},
|
||||
// {
|
||||
// title:'',
|
||||
// isSeparator:true
|
||||
// title: 'ドメイン適用',
|
||||
// caption: 'ユーザー使用可能なドメインの設定',
|
||||
// icon: 'assignment_ind',
|
||||
// link: '/#/userDomain',
|
||||
// target: '_self'
|
||||
// },
|
||||
// {
|
||||
// title: 'Docs',
|
||||
// caption: 'quasar.dev',
|
||||
// icon: 'school',
|
||||
// link: 'https://quasar.dev'
|
||||
// },
|
||||
// {
|
||||
// title: 'Icons',
|
||||
// caption: 'Material Icons',
|
||||
// icon: 'insert_emoticon',
|
||||
// link: 'https://fonts.google.com/icons?selected=Material+Icons:insert_emoticon:'
|
||||
// },
|
||||
// {
|
||||
// title: 'Github',
|
||||
// caption: 'github.com/quasarframework',
|
||||
// icon: 'code',
|
||||
// link: 'https://github.com/quasarframework'
|
||||
// },
|
||||
// {
|
||||
// title: 'Discord Chat Channel',
|
||||
// caption: 'chat.quasar.dev',
|
||||
// icon: 'chat',
|
||||
// link: 'https://chat.quasar.dev'
|
||||
// },
|
||||
// {
|
||||
// title: 'Forum',
|
||||
// caption: 'forum.quasar.dev',
|
||||
// icon: 'record_voice_over',
|
||||
// link: 'https://forum.quasar.dev'
|
||||
// },
|
||||
// {
|
||||
// title: 'Twitter',
|
||||
// caption: '@quasarframework',
|
||||
// icon: 'rss_feed',
|
||||
// link: 'https://twitter.quasar.dev'
|
||||
// },
|
||||
// {
|
||||
// title: 'Facebook',
|
||||
// caption: '@QuasarFramework',
|
||||
// icon: 'public',
|
||||
// link: 'https://facebook.quasar.dev'
|
||||
// },
|
||||
// {
|
||||
// title: 'Quasar Awesome',
|
||||
// caption: 'Community Quasar projects',
|
||||
// icon: 'favorite',
|
||||
// link: 'https://awesome.quasar.dev'
|
||||
// }
|
||||
];
|
||||
|
||||
const adminLinks: EssentialLinkProps[] = [
|
||||
@@ -145,20 +112,6 @@ const adminLinks: EssentialLinkProps[] = [
|
||||
link: '/#/user',
|
||||
target: '_self'
|
||||
},
|
||||
{
|
||||
title: 'ドメイン管理',
|
||||
caption: 'kintoneのドメイン設定',
|
||||
icon: 'domain',
|
||||
link: '/#/domain',
|
||||
target: '_self'
|
||||
},
|
||||
{
|
||||
title: 'ドメイン適用',
|
||||
caption: 'ユーザー使用可能なドメインの設定',
|
||||
icon: 'assignment_ind',
|
||||
link: '/#/userDomain',
|
||||
target: '_self'
|
||||
},
|
||||
]
|
||||
|
||||
const version = process.env.version;
|
||||
|
||||
@@ -155,7 +155,8 @@ let editId = ref(0);
|
||||
|
||||
const getDomain = async () => {
|
||||
loading.value = true;
|
||||
const result = await api.get(`api/domains/1`);
|
||||
const userId = authStore.userId;
|
||||
const result = await api.get(`api/domain?userId=${userId}`);
|
||||
rows.value = result.data.map((item) => {
|
||||
return { id: item.id, tenantid: item.tenantid, name: item.name, url: item.url, user: item.kintoneuser, password: item.kintonepwd }
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ const routes: RouteRecordRaw[] = [
|
||||
// { path: 'FlowChart', component: () => import('pages/FlowChart.vue') },
|
||||
{ path: 'right', component: () => import('pages/testRight.vue') },
|
||||
{ path: 'domain', component: () => import('pages/TenantDomain.vue') },
|
||||
{ path: 'userdomain', component: () => import('pages/UserDomain.vue')},
|
||||
// { path: 'userdomain', component: () => import('pages/UserDomain.vue')},
|
||||
{ path: 'user', component: () => import('pages/UserManagement.vue')},
|
||||
{ path: 'condition', component: () => import('pages/conditionPage.vue') }
|
||||
],
|
||||
|
||||
@@ -60,11 +60,11 @@ export const useAuthStore = defineStore('auth', {
|
||||
}
|
||||
},
|
||||
async getCurrentDomain(): Promise<IDomainInfo> {
|
||||
const activedomain = await api.get(`api/activedomain`);
|
||||
const activedomain = (await api.get(`api/activedomain`))?.data;
|
||||
return {
|
||||
id: activedomain.data.id,
|
||||
domainName: activedomain.data.name,
|
||||
kintoneUrl: activedomain.data.url,
|
||||
id: activedomain?.id,
|
||||
domainName: activedomain?.name,
|
||||
kintoneUrl: activedomain?.url,
|
||||
};
|
||||
},
|
||||
async getUserDomains(): Promise<IDomainInfo[]> {
|
||||
|
||||
Reference in New Issue
Block a user