mirror of https://github.com/veops/cmdb.git
vue lint
This commit is contained in:
parent
08c96039e9
commit
58ad9d3f05
|
@ -1,5 +1,8 @@
|
|||
# -*- coding:utf-8 -*-
|
||||
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import datetime
|
||||
|
||||
import six
|
||||
|
@ -37,8 +40,8 @@ type_map = {
|
|||
'deserialize': {
|
||||
Attribute.INT: string2int,
|
||||
Attribute.FLOAT: float,
|
||||
Attribute.TEXT: escape,
|
||||
Attribute.TIME: escape,
|
||||
Attribute.TEXT: lambda x: escape(x).encode('utf-8').decode('utf-8'),
|
||||
Attribute.TIME: lambda x: escape(x).encode('utf-8').decode('utf-8'),
|
||||
Attribute.DATETIME: str2datetime,
|
||||
Attribute.DATE: str2datetime,
|
||||
},
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# -*- coding:utf-8 -*-
|
||||
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import markupsafe
|
||||
from flask import abort
|
||||
|
||||
|
|
|
@ -61,7 +61,6 @@ services:
|
|||
CMDB_API_HOST: cmdb-api:5000
|
||||
NGINX_PORT: 80
|
||||
volumes:
|
||||
- "$PWD/conf.d:/etc/nginx/conf.d"
|
||||
- ./docs/nginx.cmdb.conf.example:/etc/nginx/conf.d/nginx.cmdb.conf.example
|
||||
command:
|
||||
- /bin/bash
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM alpine:3.9 as builder
|
||||
FROM node:alpine as builder
|
||||
|
||||
LABEL description="cmdb-ui"
|
||||
|
||||
|
@ -6,7 +6,7 @@ COPY . /data/apps/cmdb-ui
|
|||
|
||||
WORKDIR /data/apps/cmdb-ui
|
||||
|
||||
RUN apk add yarn && yarn install && sed -i 's#http://127.0.0.1:5000##g' .env && yarn build
|
||||
RUN sed -i 's#http://127.0.0.1:5000##g' .env && yarn install && yarn build
|
||||
|
||||
|
||||
FROM nginx:latest
|
||||
|
|
|
@ -51,7 +51,6 @@ export function logout() {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// eslint-disable-next-line
|
||||
import store from '@/store'
|
||||
|
||||
import { UserLayout, BasicLayout, RouteView, PageView } from '@/layouts'
|
||||
import { UserLayout, BasicLayout, RouteView } from '@/layouts'
|
||||
import { getPreference } from '@/api/cmdb/preference'
|
||||
|
||||
const cmdbRouter = [
|
||||
|
|
|
@ -7,7 +7,7 @@ import 'nprogress/nprogress.css' // progress bar style
|
|||
import notification from 'ant-design-vue/es/notification'
|
||||
import { setDocumentTitle, domTitle } from '@/utils/domUtil'
|
||||
import config from '@/config/defaultSettings'
|
||||
import { ACCESS_TOKEN } from './store/mutation-types';
|
||||
import { ACCESS_TOKEN } from './store/mutation-types'
|
||||
|
||||
NProgress.configure({ showSpinner: false }) // NProgress Configuration
|
||||
|
||||
|
@ -44,15 +44,13 @@ router.beforeEach((to, from, next) => {
|
|||
store.dispatch('Logout')
|
||||
}, 3000)
|
||||
})
|
||||
|
||||
} else if (to.path === '/user/login' && !config.useSSO && store.getters.roles.length !== 0) {
|
||||
next({ path: '/' })
|
||||
NProgress.done()
|
||||
} else if (!config.useSSO && !Vue.ls.get(ACCESS_TOKEN) && to.path !== "/user/login") {
|
||||
} else if (!config.useSSO && !Vue.ls.get(ACCESS_TOKEN) && to.path !== '/user/login') {
|
||||
next({ path: '/user/login', query: { redirect: to.fullPath } })
|
||||
NProgress.done()
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
})
|
||||
|
|
|
@ -322,9 +322,9 @@ export default {
|
|||
this.loadTip = '正在下载 ...'
|
||||
const promises = this.selectedRowKeys.map(ciId => {
|
||||
return searchCI(`q=_id:${ciId}`).then(res => {
|
||||
let ciMap = {}
|
||||
const ciMap = {}
|
||||
Object.keys(res.result[0]).forEach(k => {
|
||||
if (!["ci_type", "_id", "ci_type_alias", "_type"].includes(k)) {
|
||||
if (!['ci_type', '_id', 'ci_type_alias', '_type'].includes(k)) {
|
||||
ciMap[k] = res.result[0][k]
|
||||
}
|
||||
})
|
||||
|
|
|
@ -130,7 +130,7 @@ export default {
|
|||
this.form.validateFields((err, values) => {
|
||||
Object.keys(values).forEach(k => {
|
||||
if (typeof values[k] === 'object') {
|
||||
values[k] = values[k].format("YYYY-MM-DD HH:mm:ss")
|
||||
values[k] = values[k].format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
})
|
||||
if (!err) {
|
||||
|
|
Loading…
Reference in New Issue