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
|
|
||||||
@@ -365,17 +365,3 @@ def create_log(db: Session, error:schemas.ErrorCreate):
|
|||||||
def get_kintoneformat(db: Session):
|
def get_kintoneformat(db: Session):
|
||||||
formats = db.query(models.KintoneFormat).order_by(models.KintoneFormat.id).all()
|
formats = db.query(models.KintoneFormat).order_by(models.KintoneFormat.id).all()
|
||||||
return formats
|
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
|
|
||||||
@@ -163,11 +163,3 @@ class ErrorCreate(BaseModel):
|
|||||||
title:str
|
title:str
|
||||||
location:str
|
location:str
|
||||||
content:str
|
content:str
|
||||||
|
|
||||||
class OperationCreate(BaseModel):
|
|
||||||
tenantid:str
|
|
||||||
domainurl:str
|
|
||||||
userid:int
|
|
||||||
operation:str
|
|
||||||
function:str
|
|
||||||
detail:str
|
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
<div v-if="isAdmin()">
|
<div v-if="isAdmin()">
|
||||||
<EssentialLink v-for="link in adminLinks" :key="link.title" v-bind="link" />
|
<EssentialLink v-for="link in adminLinks" :key="link.title" v-bind="link" />
|
||||||
</div>
|
</div>
|
||||||
|
<EssentialLink v-for="link in domainLinks" :key="link.title" v-bind="link" />
|
||||||
|
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-drawer>
|
</q-drawer>
|
||||||
|
|
||||||
@@ -83,58 +85,23 @@ const essentialLinks: EssentialLinkProps[] = [
|
|||||||
// link:'https://cybozu.dev/ja/kintone/docs/',
|
// link:'https://cybozu.dev/ja/kintone/docs/',
|
||||||
// icon:'help_outline'
|
// icon:'help_outline'
|
||||||
// },
|
// },
|
||||||
|
];
|
||||||
|
|
||||||
|
const domainLinks: EssentialLinkProps[] = [
|
||||||
|
{
|
||||||
|
title: 'ドメイン管理',
|
||||||
|
caption: 'kintoneのドメイン設定',
|
||||||
|
icon: 'domain',
|
||||||
|
link: '/#/domain',
|
||||||
|
target: '_self'
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// title:'',
|
// title: 'ドメイン適用',
|
||||||
// isSeparator:true
|
// 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[] = [
|
const adminLinks: EssentialLinkProps[] = [
|
||||||
@@ -145,20 +112,6 @@ const adminLinks: EssentialLinkProps[] = [
|
|||||||
link: '/#/user',
|
link: '/#/user',
|
||||||
target: '_self'
|
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;
|
const version = process.env.version;
|
||||||
|
|||||||
@@ -155,7 +155,8 @@ let editId = ref(0);
|
|||||||
|
|
||||||
const getDomain = async () => {
|
const getDomain = async () => {
|
||||||
loading.value = true;
|
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) => {
|
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 }
|
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: 'FlowChart', component: () => import('pages/FlowChart.vue') },
|
||||||
{ path: 'right', component: () => import('pages/testRight.vue') },
|
{ path: 'right', component: () => import('pages/testRight.vue') },
|
||||||
{ path: 'domain', component: () => import('pages/TenantDomain.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: 'user', component: () => import('pages/UserManagement.vue')},
|
||||||
{ path: 'condition', component: () => import('pages/conditionPage.vue') }
|
{ path: 'condition', component: () => import('pages/conditionPage.vue') }
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -60,11 +60,11 @@ export const useAuthStore = defineStore('auth', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getCurrentDomain(): Promise<IDomainInfo> {
|
async getCurrentDomain(): Promise<IDomainInfo> {
|
||||||
const activedomain = await api.get(`api/activedomain`);
|
const activedomain = (await api.get(`api/activedomain`))?.data;
|
||||||
return {
|
return {
|
||||||
id: activedomain.data.id,
|
id: activedomain?.id,
|
||||||
domainName: activedomain.data.name,
|
domainName: activedomain?.name,
|
||||||
kintoneUrl: activedomain.data.url,
|
kintoneUrl: activedomain?.url,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async getUserDomains(): Promise<IDomainInfo[]> {
|
async getUserDomains(): Promise<IDomainInfo[]> {
|
||||||
|
|||||||
Reference in New Issue
Block a user