>;
3 | export default content;
4 | }
5 |
6 | declare module '*.less' {
7 | const classes: { [className: string]: string };
8 | export default classes;
9 | }
10 |
11 | declare module '*/settings.json' {
12 | const value: {
13 | colorWeek: boolean;
14 | navbar: boolean;
15 | menu: boolean;
16 | footer: boolean;
17 | themeColor: string;
18 | menuWidth: number;
19 | };
20 |
21 | export default value;
22 | }
23 |
24 | declare module '*.png' {
25 | const value: string;
26 | export default value;
27 | }
28 |
--------------------------------------------------------------------------------
/light-webapps/src/mock/index.ts:
--------------------------------------------------------------------------------
1 | import Mock from 'mockjs';
2 | import { isSSR } from '@/utils/is';
3 |
4 | // import './message-box';
5 | // import '../pages/department/mock'
6 | // import '../pages/user/mock'
7 | // import '../pages/privilege/mock'
8 | // import '../pages/project/mock'
9 | // import '../pages/group/mock'
10 | // import '../pages/stat/mock'
11 | // import '../pages/metricset/mock'
12 | // import '../pages/component/mock'
13 | // import '../pages/order/apply/mock'
14 |
15 | if (!isSSR) {
16 | Mock.setup({
17 | timeout: '500-1500',
18 | });
19 | }
20 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/caller/create/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'callerCreate.title':'Create API Caller',
4 | 'callerCreate.form.label.name':'Name',
5 | 'callerCreate.form.label.department':'Department',
6 | 'callerCreate.form.label.desc':'Description',
7 | 'callerCreate.form.submit.success':'Caller Create Success!',
8 | 'callerCreate.form.department.errMsg': 'Department cannot be empty!',
9 | },
10 | 'zh-CN': {
11 | 'callerCreate.title':'创建调用方',
12 | 'callerCreate.form.label.name':'名称',
13 | 'callerCreate.form.label.department':'部门',
14 | 'callerCreate.form.label.desc':'描述',
15 | 'callerCreate.form.submit.success':'调用方创建成功!',
16 | 'callerCreate.form.department.errMsg': '请选择部门!',
17 | },
18 | };
19 |
20 | export default i18n;
21 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/caller/list/style/index.module.less:
--------------------------------------------------------------------------------
1 | .toolbar {
2 | display: flex;
3 | justify-content: space-between;
4 | margin-bottom: 24px;
5 | }
6 |
7 | .operations {
8 | display: flex;
9 | }
10 |
11 | .content-type {
12 | display: flex;
13 |
14 | > svg {
15 | margin-right: 8px;
16 | margin-top: 3px;
17 | }
18 | }
19 |
20 | .search-form-wrapper {
21 | display: flex;
22 | border-bottom: 1px solid var(--color-border-1);
23 | margin-bottom: 20px;
24 |
25 | .right-button {
26 | display: flex;
27 | flex-direction: column;
28 | justify-content: space-between;
29 | padding-left: 20px;
30 | margin-bottom: 20px;
31 | border-left: 1px solid var(--color-border-2);
32 | box-sizing: border-box;
33 | }
34 | }
35 |
36 | .button-group {
37 | display: flex;
38 | justify-content: space-between;
39 | margin-bottom: 20px;
40 | }
41 |
42 | .search-form {
43 | padding-right: 20px;
44 |
45 | :global(.arco-form-label-item-left) {
46 | > label {
47 | white-space: nowrap;
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/caller/manage/index.tsx:
--------------------------------------------------------------------------------
1 | import React, {useEffect, useRef, useState} from 'react';
2 | import {useParams} from "react-router-dom";
3 | import CallerManagePanel from "@/pages/caller/manage/CallerMangePanel";
4 |
5 | export default function CallerManage(){
6 |
7 | const {id} = useParams();
8 |
9 | return (
10 |
11 | )
12 | }
--------------------------------------------------------------------------------
/light-webapps/src/pages/caller/preview/style/index.module.less:
--------------------------------------------------------------------------------
1 | .toolbar {
2 | display: flex;
3 | justify-content: space-between;
4 | margin-bottom: 24px;
5 | }
6 |
7 | .operations {
8 | display: flex;
9 | }
10 |
11 | .content-type {
12 | display: flex;
13 |
14 | > svg {
15 | margin-right: 8px;
16 | margin-top: 3px;
17 | }
18 | }
19 |
20 | .search-form-wrapper {
21 | display: flex;
22 | .right-button {
23 | display: flex;
24 | flex-direction: column;
25 | justify-content: space-between;
26 | padding-left: 20px;
27 | margin-bottom: 20px;
28 | border-left: 1px solid var(--color-border-2);
29 | box-sizing: border-box;
30 | }
31 | }
32 |
33 | .button-group {
34 | display: flex;
35 | justify-content: space-between;
36 | margin-bottom: 20px;
37 | }
38 |
39 | .search-form {
40 | padding-right: 20px;
41 |
42 | :global(.arco-form-label-item-left) {
43 | > label {
44 | white-space: nowrap;
45 | }
46 | }
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/caller/update/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'callerUpdate.title':'Update API Caller',
4 | 'callerUpdate.form.label.name':'Name',
5 | 'callerUpdate.form.label.desc':'Description',
6 | 'callerUpdate.form.submit.success':'Update caller info success!',
7 | 'callerUpdate.form.label.department':'Department',
8 | 'callerUpdate.form.department.errMsg': 'Department cannot be empty!',
9 | },
10 | 'zh-CN': {
11 | 'callerUpdate.title':'修改调用方',
12 | 'callerUpdate.form.label.name':'名称',
13 | 'callerUpdate.form.label.desc':'描述',
14 | 'callerUpdate.form.submit.success':'修改调用方信息成功!',
15 | 'callerUpdate.form.label.department':'部门',
16 | 'callerUpdate.form.department.errMsg': '请选择部门!',
17 | },
18 | };
19 |
20 | export default i18n;
21 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/common/context.tsx:
--------------------------------------------------------------------------------
1 | import React, { createContext, useState, ReactNode } from 'react';
2 |
3 | export const GroupManageContext = React.createContext(null)
4 |
5 | export const MetricSetPreviewContext = React.createContext(null);
6 |
7 | export const HomePageContext = React.createContext(null)
8 |
9 | export const MetricSetBindListContext = React.createContext(null)
10 |
11 | export const MetricSetStructureContext = React.createContext(null);
12 |
13 | export const StatInfoPreviewContext = React.createContext(null);
14 |
15 | export const ViewRenderContext = React.createContext(null);
16 |
17 | export const CallerManageContext = React.createContext(null);
18 |
19 | export default function Constants() {
20 | return <>{/* nothing */}>;
21 | }
--------------------------------------------------------------------------------
/light-webapps/src/pages/common/editable_v2/style/index.module.less:
--------------------------------------------------------------------------------
1 | .edit_panel{
2 |
3 | }
4 |
5 | :global{
6 | .edit_table_panel_v2 td {
7 | border-right:1px solid var(--color-border-1);
8 | padding:0 6px !important;
9 | height: 32px !important;
10 | }
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/common/popmenu/style/index.module.less:
--------------------------------------------------------------------------------
1 | .floating-button {
2 | position: fixed;
3 | bottom: 80px;
4 | right: 50px;
5 | opacity: 0.8;
6 | transition: opacity 0.3s ease;
7 | }
8 |
9 | .floating-button.visible {
10 | opacity: 1;
11 | }
12 |
13 |
14 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/common/prompt.ts:
--------------------------------------------------------------------------------
1 | import { useHistory } from 'react-router-dom';
2 | import {ResultData} from "@/types/insights-common";
3 | import {Message, Notification} from "@arco-design/web-react";
4 |
5 | export const handleWarningCode = (errorCode, message, history: any) => {
6 | if (errorCode === '403') {
7 | history.push('/exception/403');
8 | }else if (errorCode === '404') {
9 | history.push('/exception/404');
10 | }else if(errorCode === '500'){
11 | history.push('/exception/500');
12 | }else {
13 | Notification.warning({style: { width: 420 }, title: 'Warning', content: message});
14 | }
15 | };
--------------------------------------------------------------------------------
/light-webapps/src/pages/common/redirect/useNavigateTo.tsx:
--------------------------------------------------------------------------------
1 | import {useHistory} from 'react-router-dom';
2 |
3 | const useNavigateTo = () => {
4 |
5 | const history = useHistory();
6 | return (path, state = {}) => {
7 | history.push(path, state);
8 | };
9 | };
10 |
11 | export default useNavigateTo;
12 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/common/selector/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'treeSelector.label.selectAll':'All',
4 | },
5 | 'zh-CN': {
6 | 'treeSelector.label.selectAll':'全选',
7 | },
8 | };
9 |
10 | export default i18n;
11 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/component/create/style/index.module.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xl-xueling/xl-lighthouse/ee56445ae885d7e429d1759b3a432b37a0265221/light-webapps/src/pages/component/create/style/index.module.less
--------------------------------------------------------------------------------
/light-webapps/src/pages/component/update/style/index.module.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xl-xueling/xl-lighthouse/ee56445ae885d7e429d1759b3a432b37a0265221/light-webapps/src/pages/component/update/style/index.module.less
--------------------------------------------------------------------------------
/light-webapps/src/pages/components/transfer/department_transfer/style/index.module.less:
--------------------------------------------------------------------------------
1 | .transfer_panel{
2 |
3 | :global{
4 | .arco-transfer-view-header{
5 | height: 32px;
6 | }
7 |
8 | .arco-transfer-view{
9 | width: 300px;
10 | height: 330px;
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/components/transfer/user_transfer/style/index.module.less:
--------------------------------------------------------------------------------
1 | .transfer_panel{
2 |
3 | :global{
4 | .arco-transfer-view-source .arco-transfer-view-header{
5 | height: 0;
6 | }
7 |
8 | .arco-transfer-view-header{
9 | height: 32px;
10 | }
11 |
12 | .arco-transfer-view{
13 | width: 300px;
14 | height: 330px;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/dashboard/monitor/message-list/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Result } from '@arco-design/web-react';
3 | import MessageItem, { Message } from './item';
4 | import styles from './style/index.module.less';
5 |
6 | interface MessageListProps {
7 | data: Message[];
8 | }
9 |
10 | function MessageList(props: MessageListProps) {
11 | const { data = [] } = props;
12 | return (
13 |
14 | {data.map((item) => (
15 |
16 | ))}
17 | {!data.length && }
18 |
19 | );
20 | }
21 |
22 | export default MessageList;
23 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/dashboard/monitor/mock/index.ts:
--------------------------------------------------------------------------------
1 | import Mock from 'mockjs';
2 | import setupMock from '@/utils/setupMock';
3 |
4 | setupMock({
5 | setup: () => {
6 | Mock.mock(new RegExp('/api/chatList'), () => {
7 | const data = Mock.mock({
8 | 'data|4-6': [
9 | {
10 | 'id|+1': 1,
11 | username: '用户7352772',
12 | content: '马上就开始了,好激动!',
13 | time: '13:09:12',
14 | 'isCollect|2': true,
15 | },
16 | ],
17 | });
18 | return data.data;
19 | });
20 | },
21 | });
22 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/dashboard/workplace/style/announcement.module.less:
--------------------------------------------------------------------------------
1 | .item {
2 | display: flex;
3 | align-items: center;
4 | width: 100%;
5 | height: 24px;
6 | margin-bottom: 4px;
7 | }
8 |
9 | .link {
10 | flex: 1;
11 | overflow: hidden;
12 | text-overflow: ellipsis;
13 | white-space: nowrap;
14 | margin-left: 4px;
15 | color: var(--color-text-2);
16 | text-decoration: none;
17 | font-size: 13px;
18 | cursor: pointer;
19 | }
20 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/dashboard/workplace/style/docs.module.less:
--------------------------------------------------------------------------------
1 | .docs {
2 | display: grid;
3 | grid-template-columns: 50% 50%;
4 | }
5 |
6 | .link {
7 | color: var(--color-text-2);
8 | padding: 4px;
9 | box-sizing: border-box;
10 | margin-bottom: 12px;
11 |
12 | &:hover {
13 | color: rgb(var(--primary-6));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/dashboard/workplace/style/popular-contents.module.less:
--------------------------------------------------------------------------------
1 | .symbol {
2 | font-size: 10px;
3 | margin-left: 4px;
4 |
5 | > svg {
6 | vertical-align: 0;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/department/manage/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import styles from './style/index.module.less';
4 | import ManagePanel from "./manage";
5 | import {Breadcrumb} from "@arco-design/web-react";
6 | import {IconHome} from "@arco-design/web-react/icon";
7 | import useLocale from "@/utils/useLocale";
8 | import locale from "./locale";
9 | const BreadcrumbItem = Breadcrumb.Item;
10 |
11 | export default function DepartmentManageIndex() {
12 | const t = useLocale(locale);
13 | return (
14 |
15 |
16 |
17 |
18 |
19 | {t['departmentManage.breadcrumb.title']}
20 |
21 |
26 |
27 | );
28 | }
29 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/department/manage/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'departmentManage.breadcrumb.title':'Department Manage',
4 | 'department.enterprise.structure': 'Enterprise Structure',
5 | 'department.manage.invalidLength':'The length of department name should between 3 and 20 chars!',
6 | 'department.manage.hasInvalidChars':'Department name contains invalid characters!',
7 | 'department.manage.deletePrompt':'Are you sure to delete this item?',
8 | 'department.manage.deleteHasChild':'The node has child,delete child-node first!',
9 | },
10 | 'zh-CN': {
11 | 'departmentManage.breadcrumb.title':'部门管理',
12 | 'department.enterprise.structure': '组织架构',
13 | 'department.manage.invalidLength':'部门名称长度应在3~20字符之间!',
14 | 'department.manage.hasInvalidChars':'部门名称含有无效字符!',
15 | 'department.manage.deletePrompt':'是否确认删除当前节点?',
16 | 'department.manage.deleteHasChild':'请删除子节点后再执行该操作!',
17 | },
18 | };
19 |
20 | export default i18n;
21 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/exception/100/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Result, Button } from '@arco-design/web-react';
3 | import locale from './locale';
4 | import useLocale from '@/utils/useLocale';
5 | import styles from './style/index.module.less';
6 |
7 | function Exception100({fromExternalEmbedding = false,errorMessage}) {
8 |
9 | const t = useLocale(locale);
10 |
11 | return (
12 |
13 |
18 |
19 | );
20 | }
21 |
22 | export default Exception100;
23 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/exception/100/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'exception.result.basic.description': '',
4 | },
5 | 'zh-CN': {
6 | 'exception.result.basic.description': 'Whoops, this page is gone.',
7 | },
8 | };
9 |
10 | export default i18n;
11 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/exception/100/style/index.module.less:
--------------------------------------------------------------------------------
1 | .wrapper {
2 | position: relative;
3 | background-color: var(--color-bg-2);
4 | height: calc(100vh - 368px);
5 | }
6 |
7 | .externalEmbeddingWrapper {
8 | position: relative;
9 | height: 300px;
10 | }
11 |
12 | .result {
13 | position: absolute;
14 | top: 50%;
15 | transform: translateY(-50%);
16 | }
17 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/exception/403/index.tsx:
--------------------------------------------------------------------------------
1 | import React, {useEffect} from 'react';
2 | import { Result, Button } from '@arco-design/web-react';
3 | import locale from './locale';
4 | import useLocale from '@/utils/useLocale';
5 | import styles from './style/index.module.less';
6 |
7 | function Exception403({fromExternalEmbedding = false,errorMessage = null}) {
8 |
9 | const t = useLocale(locale);
10 |
11 | return (
12 |
13 |
18 |
19 | );
20 | }
21 |
22 | export default Exception403;
23 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/exception/403/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'menu.exception': 'Exception page',
4 | 'menu.exception.403': '403',
5 | 'exception.result.403.description':
6 | 'Access to this resource on the server is denied.',
7 | 'exception.result.403.back': 'Back',
8 | },
9 | 'zh-CN': {
10 | 'menu.exception': '异常页',
11 | 'menu.exception.403': '403',
12 | 'exception.result.403.description': '对不起,您没有访问该资源的权限!',
13 | 'exception.result.403.back': '返回',
14 | },
15 | };
16 |
17 | export default i18n;
18 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/exception/403/style/index.module.less:
--------------------------------------------------------------------------------
1 | .wrapper {
2 | position: relative;
3 | background-color: var(--color-bg-2);
4 | height: calc(100vh - 368px);
5 | }
6 |
7 | .externalEmbeddingWrapper {
8 | position: relative;
9 | height: 300px;
10 | }
11 |
12 | .result {
13 | position: absolute;
14 | top: 50%;
15 | transform: translateY(-50%);
16 | }
17 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/exception/404/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Result, Button } from '@arco-design/web-react';
3 | import locale from './locale';
4 | import useLocale from '@/utils/useLocale';
5 | import styles from './style/index.module.less';
6 |
7 | function Exception404({fromExternalEmbedding = false,errorMessage = null}) {
8 |
9 | const t = useLocale(locale);
10 |
11 | return (
12 |
13 |
18 |
19 | );
20 | }
21 |
22 | export default Exception404;
23 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/exception/404/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'menu.exception': 'Exception page',
4 | 'menu.exception.404': '404',
5 | 'exception.result.404.description': 'Whoops, this page is gone.',
6 | 'exception.result.404.retry': 'Retry',
7 | 'exception.result.404.back': 'Back',
8 | },
9 | 'zh-CN': {
10 | 'menu.exception': '异常页',
11 | 'menu.exception.404': '404',
12 | 'exception.result.404.description': '抱歉,页面不见了~',
13 | 'exception.result.404.retry': '重试',
14 | 'exception.result.404.back': '返回',
15 | },
16 | };
17 |
18 | export default i18n;
19 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/exception/404/style/index.module.less:
--------------------------------------------------------------------------------
1 | .wrapper {
2 | position: relative;
3 | background-color: var(--color-bg-2);
4 | height: calc(100vh - 368px);
5 | }
6 |
7 | .externalEmbeddingWrapper {
8 | position: relative;
9 | height: 300px;
10 | }
11 |
12 | .result {
13 | position: absolute;
14 | top: 50%;
15 | transform: translateY(-50%);
16 | }
17 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/exception/500/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Result, Button } from '@arco-design/web-react';
3 | import locale from './locale';
4 | import useLocale from '@/utils/useLocale';
5 | import styles from './style/index.module.less';
6 |
7 | function Exception500({fromExternalEmbedding = false,errorMessage = null}) {
8 |
9 | const t = useLocale(locale);
10 |
11 | return (
12 |
13 |
18 |
19 | );
20 | }
21 |
22 | export default Exception500;
23 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/exception/500/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'menu.exception': 'Exception page',
4 | 'menu.exception.500': '500',
5 | 'exception.result.500.description': 'Internal server error',
6 | 'exception.result.500.back': 'Back',
7 | },
8 | 'zh-CN': {
9 | 'menu.exception': '异常页',
10 | 'menu.exception.500': '500',
11 | 'exception.result.500.description': '抱歉,服务器出了点问题~',
12 | 'exception.result.500.back': '返回',
13 | },
14 | };
15 |
16 | export default i18n;
17 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/exception/500/style/index.module.less:
--------------------------------------------------------------------------------
1 | .wrapper {
2 | position: relative;
3 | background-color: var(--color-bg-2);
4 | height: calc(100vh - 368px);
5 | }
6 |
7 | .externalEmbeddingWrapper {
8 | position: relative;
9 | height: 300px;
10 | }
11 |
12 | .result {
13 | position: absolute;
14 | top: 50%;
15 | transform: translateY(-50%);
16 | }
17 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/form/group/mock/index.ts:
--------------------------------------------------------------------------------
1 | import Mock from 'mockjs';
2 | import setupMock from '@/utils/setupMock';
3 |
4 | setupMock({
5 | setup: () => {
6 | // 保存表单数据
7 | Mock.mock(new RegExp('/api/groupForm'), () => {
8 | return true;
9 | });
10 | },
11 | });
12 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/form/group/style/index.module.less:
--------------------------------------------------------------------------------
1 | .container {
2 | overflow: hidden;
3 |
4 | :global(.arco-card-body) {
5 | padding: 20px 20px 10px;
6 | }
7 |
8 | :global(.arco-card) {
9 | margin-bottom: 16px;
10 | }
11 | }
12 |
13 | .actions {
14 | padding: 12px 40px;
15 | background-color: var(--color-bg-2);
16 | display: flex;
17 | flex-direction: row-reverse;
18 | position: fixed;
19 | left: 0;
20 | right: 0;
21 | bottom: 0;
22 | box-shadow: 0 -3px 12px rgb(0 0 0 / 10%);
23 | }
24 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/form/step/mock/index.ts:
--------------------------------------------------------------------------------
1 | import Mock from 'mockjs';
2 | import setupMock from '@/utils/setupMock';
3 |
4 | setupMock({
5 | setup: () => {
6 | // 保存表单数据
7 | Mock.mock(new RegExp('/api/groupForm'), () => {
8 | return true;
9 | });
10 | },
11 | });
12 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/form/step/style/index.module.less:
--------------------------------------------------------------------------------
1 | .container {
2 | :global(.arco-card-body) {
3 | > h5 {
4 | margin: 0;
5 | }
6 |
7 | padding: 20px;
8 | }
9 | }
10 |
11 | .wrapper {
12 | width: 624px;
13 | margin: 0 auto;
14 | padding-top: 56px;
15 | padding-bottom: 70px;
16 | }
17 |
18 | .form {
19 | width: 100%;
20 | box-sizing: border-box;
21 | margin-top: 76px;
22 | padding-right: 76px;
23 | }
24 |
25 | .form-extra {
26 | width: 895px;
27 | margin: 54px auto;
28 | background-color: var(--color-fill-1);
29 | padding: 20px;
30 | margin-bottom: 120px;
31 |
32 | > h6 {
33 | margin-top: 0;
34 | }
35 |
36 | > div {
37 | margin-bottom: 0;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/group/basic/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'group.basic.secretKey':'Secret Key',
4 | 'group.basic.label.token':'Token: ',
5 | 'group.basic.label.column':'Columns: ',
6 | 'group.basic.label.description':'Description: ',
7 | 'group.basic.label.createTime':'CreateTime: ',
8 | },
9 | 'zh-CN': {
10 | 'group.basic.label.token':'Token:',
11 | 'group.basic.secretKey':'统计组秘钥',
12 | 'group.basic.label.column':'字段信息:',
13 | 'group.basic.label.description':'描述信息:',
14 | 'group.basic.label.createTime':'创建时间:',
15 | },
16 | };
17 |
18 | export default i18n;
19 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/group/basic/style/index.module.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xl-xueling/xl-lighthouse/ee56445ae885d7e429d1759b3a432b37a0265221/light-webapps/src/pages/group/basic/style/index.module.less
--------------------------------------------------------------------------------
/light-webapps/src/pages/group/create/style/index.module.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xl-xueling/xl-lighthouse/ee56445ae885d7e429d1759b3a432b37a0265221/light-webapps/src/pages/group/create/style/index.module.less
--------------------------------------------------------------------------------
/light-webapps/src/pages/group/limiting/style/index.module.less:
--------------------------------------------------------------------------------
1 | :global {
2 | .arco-collapse-item-content{
3 | background-color: var(--color-bg-1) !important;
4 | }
5 | }
--------------------------------------------------------------------------------
/light-webapps/src/pages/group/manage/style/index.module.less:
--------------------------------------------------------------------------------
1 | .layout {
2 | display: flex;
3 |
4 | &-content {
5 | flex: 1;
6 | padding: 0 16px;
7 | }
8 |
9 | }
10 |
11 | .manage-panel {
12 | height: 100%;
13 | min-height: 380px;
14 | background-color: var(--color-bg-2);
15 | padding: 10px;
16 | box-sizing: border-box;
17 | display: flex;
18 | flex-direction: column;
19 | border-radius: 4px;
20 | &-content {
21 | flex: 1;
22 | margin: 20px 0;
23 | box-sizing: border-box;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/group/update/style/index.module.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xl-xueling/xl-lighthouse/ee56445ae885d7e429d1759b3a432b37a0265221/light-webapps/src/pages/group/update/style/index.module.less
--------------------------------------------------------------------------------
/light-webapps/src/pages/license/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Markdown from "markdown-to-jsx";
3 | import licenseContent from "@/pages/license/license.md?raw";
4 |
5 | function License() {
6 |
7 | return (
8 |
9 |
10 | {licenseContent}
11 | ;
12 |
13 | )
14 | }
15 |
16 | export default License;
--------------------------------------------------------------------------------
/light-webapps/src/pages/list/card/card-add.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Card } from '@arco-design/web-react';
3 | import cs from 'classnames';
4 | import { IconPlus } from '@arco-design/web-react/icon';
5 | import styles from './style/index.module.less';
6 |
7 | interface AddCardProps {
8 | description?: string;
9 | }
10 | function AddCard(props: AddCardProps) {
11 | return (
12 |
18 |
19 |
20 |
21 |
22 |
{props.description}
23 |
24 |
25 | );
26 | }
27 |
28 | export default AddCard;
29 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/list/card/interface.ts:
--------------------------------------------------------------------------------
1 | export interface QualityInspection {
2 | title?: string;
3 | time?: string;
4 | qualityCount?: number;
5 | randomCount?: number;
6 | duration?: number;
7 | }
8 |
9 | export interface BasicCard {
10 | icon?: number;
11 | status?: 0 | 1 | 2;
12 | description?: string;
13 | }
14 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/list/card/useRequest.ts:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { useEffect, useState } from 'react';
3 |
4 | export default (url: string, defaultValue: T[]): [boolean, T[]] => {
5 | const [loading, setLoading] = useState(false);
6 | const [data, setData] = useState(defaultValue);
7 |
8 | useEffect(() => {
9 | setLoading(true);
10 | axios
11 | .get(url)
12 | .then((res) => {
13 | setData(res.data);
14 | })
15 | .finally(() => {
16 | setLoading(false);
17 | });
18 | }, [url]);
19 |
20 | return [loading, data];
21 | };
22 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/login/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect } from 'react';
2 | import Footer from '@/components/Footer';
3 | import LoginForm from './form';
4 | import styles from './style/index.module.less';
5 |
6 | function Login() {
7 | useEffect(() => {
8 | document.body.setAttribute('arco-theme', 'light');
9 | }, []);
10 |
11 | return (
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | );
23 | }
24 | Login.displayName = 'LoginPage';
25 |
26 | export default Login;
27 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/metricset/binded/binded/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'bindedModal.title':'Bind Elements',
4 | },
5 | 'zh-CN': {
6 | 'bindedModal.title':'绑定元素',
7 | },
8 | };
9 |
10 | export default i18n;
11 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/metricset/binded/binded/style/index.module.less:
--------------------------------------------------------------------------------
1 | :global{
2 | .arco-modal-footer {
3 | position: absolute;
4 | right: 20px;
5 | bottom: 20px;
6 | }
7 | }
--------------------------------------------------------------------------------
/light-webapps/src/pages/metricset/binded/list/style/index.module.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xl-xueling/xl-lighthouse/ee56445ae885d7e429d1759b3a432b37a0265221/light-webapps/src/pages/metricset/binded/list/style/index.module.less
--------------------------------------------------------------------------------
/light-webapps/src/pages/metricset/binded/reverse-binded/style/index.module.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xl-xueling/xl-lighthouse/ee56445ae885d7e429d1759b3a432b37a0265221/light-webapps/src/pages/metricset/binded/reverse-binded/style/index.module.less
--------------------------------------------------------------------------------
/light-webapps/src/pages/metricset/common/index.tsx:
--------------------------------------------------------------------------------
1 | import React, {useCallback, useEffect, useMemo, useState} from 'react';
2 |
3 | export default function Index() {
4 |
5 | return (ss
);
6 | }
--------------------------------------------------------------------------------
/light-webapps/src/pages/metricset/common/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'MetricNavModal.modal.title':'MetricSet Shortcuts',
4 | 'metricStar.operations.star.submit.success':'MetricSet has been stared!',
5 | 'metricStar.operations.star.confirm':'Are you sure to star this item?',
6 | 'metricStar.operations.unstar.confirm':'Are you sure to unstar this item?',
7 | 'metricStar.operations.unstar.submit.success':'MetricSet has been unStared!'
8 | },
9 | 'zh-CN': {
10 | 'MetricNavModal.modal.title':'指标集导航',
11 | 'metricStar.operations.star.submit.success':'已关注当前指标集!',
12 | 'metricStar.operations.star.confirm':'是否确认关注当前指标集?',
13 | 'metricStar.operations.unstar.confirm':'是否确认取消关注指标集?',
14 | 'metricStar.operations.unstar.submit.success':'指标集已被取消关注!',
15 | },
16 | };
17 |
18 | export default i18n;
19 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/metricset/common/style/index.module.less:
--------------------------------------------------------------------------------
1 | .left {
2 | width: calc(100% - 296px);
3 | margin-right: 16px;
4 | }
5 |
6 | .right {
7 | width: 280px;
8 | }
--------------------------------------------------------------------------------
/light-webapps/src/pages/metricset/list/card-add.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Card } from '@arco-design/web-react';
3 | import cs from 'classnames';
4 | import { IconPlus } from '@arco-design/web-react/icon';
5 | import styles from './style/index.module.less';
6 |
7 | function AddCard({description,onShow}) {
8 | return (
9 |
16 |
17 |
18 |
19 |
20 |
{description}
21 |
22 |
23 | );
24 | }
25 |
26 | export default AddCard;
27 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/metricset/list/interface.ts:
--------------------------------------------------------------------------------
1 | export interface QualityInspection {
2 | title?: string;
3 | time?: string;
4 | qualityCount?: number;
5 | randomCount?: number;
6 | duration?: number;
7 | }
8 |
9 | export interface BasicCard {
10 | icon?: number;
11 | status?: 0 | 1 | 2;
12 | description?: string;
13 | }
14 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/metricset/preview/history.ts:
--------------------------------------------------------------------------------
1 | import {getDataWithLocalCache} from "@/utils/localCache";
2 | import {MetricSet} from "@/types/insights-web";
3 |
4 |
5 | export function getMetricPreviewHistory(){
6 | const cacheData = localStorage.getItem('history_preview_metrics')
7 | let listData:Array;
8 | if(cacheData){
9 | listData = JSON.parse(cacheData);
10 | }else{
11 | listData = [];
12 | }
13 | return listData;
14 | }
15 |
16 | export function addMetricPreviewHistory(item:MetricSet){
17 | const cacheData = localStorage.getItem('history_preview_metrics')
18 | let listData:Array = null;
19 | if(cacheData){
20 | listData = JSON.parse(cacheData);
21 | }else{
22 | listData = [];
23 | }
24 | const filterList = listData.filter(x => x.id != item.id);
25 | filterList.unshift(item);
26 | filterList.slice(0,15);
27 | localStorage.setItem('history_preview_metrics',JSON.stringify(filterList));
28 | }
--------------------------------------------------------------------------------
/light-webapps/src/pages/metricset/structure/style/index.module.less:
--------------------------------------------------------------------------------
1 | .banner {
2 | background-color: var(--color-bg-2);
3 | padding: 20px;
4 | }
5 |
6 | .wrapper {
7 | display: flex;
8 | width: 100%;
9 | }
10 |
11 | .right {
12 | width: calc(60% - 16px);
13 | }
14 |
15 | .left {
16 | width: 46%;
17 | margin-right: 16px;
18 | }
19 |
20 | .panel {
21 | background-color: var(--color-bg-2);
22 | border-radius: 4px;
23 | overflow: auto;
24 | }
25 |
26 | @nav-size-height: 60px;
27 |
28 | .spin {
29 | display: flex;
30 | align-items: center;
31 | justify-content: center;
32 | width: 100%;
33 | min-height: calc(100vh);
34 | }
35 |
36 | :global{
37 | .disable-select {
38 | -webkit-user-select: none; /* Safari */
39 | -moz-user-select: none; /* Firefox */
40 | -ms-user-select: none; /* IE 10 and IE Edge */
41 | user-select: none;
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/order/apply/modal/ApplyModal.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Typography,
3 | Grid,
4 | } from '@arco-design/web-react';
5 | import React, {useEffect, useMemo, useState} from 'react';
6 |
7 | import ProjectApplyModal from "@/pages/project/apply";
8 | import {ResourceTypeEnum} from "@/types/insights-common";
9 | import StatApplyModal from "@/pages/stat/apply";
10 | const { Row, Col } = Grid;
11 | const { Text } = Typography;
12 |
13 |
14 | export default function ApplyModal({itemInfo,resourceType,onClose}) {
15 |
16 | const getRenderModal = () => {
17 | if(resourceType == ResourceTypeEnum.Project){
18 | return
19 | }else if(resourceType == ResourceTypeEnum.Stat){
20 | return
21 | }
22 | return null;
23 | }
24 |
25 | return (
26 | <>
27 | {getRenderModal()};
28 | >
29 | );
30 | }
--------------------------------------------------------------------------------
/light-webapps/src/pages/order/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect } from 'react';
2 | import {ResultData} from "@/types/insights-common";
3 |
4 |
5 | export default function OrderIndex() {
6 |
7 | return (sss
);
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/permission/styles/index.module.less:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/profile/basic/style/index.module.less:
--------------------------------------------------------------------------------
1 | .container {
2 | :global(.arco-card) {
3 | margin-top: 16px;
4 | }
5 | }
6 |
7 | .steps {
8 | max-width: 548px;
9 | margin: 0 auto;
10 | margin-top: 8px;
11 | margin-bottom: 30px;
12 | }
13 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/project/card/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'projectList.operations.star.submit.success':'Project has been stared!',
4 | 'projectList.operations.star.confirm':'Are you sure to star this item?',
5 | 'projectList.operations.unstar.confirm':'Are you sure to unstar this item?',
6 | 'projectList.operations.unstar.submit.success':'Project has been unStared!'
7 | },
8 | 'zh-CN': {
9 | 'projectList.operations.star.submit.success':'已关注当前统计工程!',
10 | 'projectList.operations.star.confirm':'是否确认关注当前统计工程?',
11 | 'projectList.operations.unstar.confirm':'是否确认取消关注当前统计工程?',
12 | 'projectList.operations.unstar.submit.success':'统计工程已被取消关注!',
13 | },
14 | };
15 |
16 | export default i18n;
17 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/project/common/styles/index.module.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xl-xueling/xl-lighthouse/ee56445ae885d7e429d1759b3a432b37a0265221/light-webapps/src/pages/project/common/styles/index.module.less
--------------------------------------------------------------------------------
/light-webapps/src/pages/project/list/style/index.module.less:
--------------------------------------------------------------------------------
1 | .toolbar {
2 | display: flex;
3 | justify-content: space-between;
4 | margin-bottom: 24px;
5 | }
6 |
7 | .operations {
8 | display: flex;
9 | }
10 |
11 | .content-type {
12 | display: flex;
13 |
14 | > svg {
15 | margin-right: 8px;
16 | margin-top: 3px;
17 | }
18 | }
19 |
20 | .search-form-wrapper {
21 | display: flex;
22 | border-bottom: 1px solid var(--color-border-1);
23 | margin-bottom: 20px;
24 |
25 | .right-button {
26 | display: flex;
27 | flex-direction: column;
28 | justify-content: space-between;
29 | padding-left: 20px;
30 | margin-bottom: 20px;
31 | border-left: 1px solid var(--color-border-2);
32 | box-sizing: border-box;
33 | }
34 | }
35 |
36 | .button-group {
37 | display: flex;
38 | justify-content: space-between;
39 | margin-bottom: 20px;
40 | }
41 |
42 | .search-form {
43 | padding-right: 20px;
44 |
45 | :global(.arco-form-label-item-left) {
46 | > label {
47 | white-space: nowrap;
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/project/manage/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'projectManage.breadcrumbItem':'Project Manage',
4 | 'projectManage.card.label.projectManage':'Project Manage',
5 | 'projectManage.card.label.description':'Information',
6 | 'projectManage.shortcuts.createGroup':'Create Group',
7 | 'projectManage.shortcuts.permissionsManage':'Permissions',
8 | },
9 | 'zh-CN': {
10 | 'projectManage.breadcrumbItem':'工程管理',
11 | 'projectManage.card.label.projectManage':'工程管理',
12 | 'projectManage.card.label.description':'工程信息',
13 | 'projectManage.shortcuts.createGroup':'创建统计组',
14 | 'projectManage.shortcuts.permissionsManage':'权限管理',
15 | },
16 | };
17 |
18 | export default i18n;
19 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/project/manage/message-list/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Result } from '@arco-design/web-react';
3 | import MessageItem, { Message } from './item';
4 | import styles from './style/index.module.less';
5 |
6 | interface MessageListProps {
7 | data: Message[];
8 | }
9 |
10 | function MessageList(props: MessageListProps) {
11 | const { data = [] } = props;
12 | return (
13 |
14 | {data.map((item) => (
15 |
16 | ))}
17 | {!data.length && }
18 |
19 | );
20 | }
21 |
22 | export default MessageList;
23 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/project/manage/mock/index.ts:
--------------------------------------------------------------------------------
1 | import Mock from 'mockjs';
2 | import setupMock from '@/utils/setupMock';
3 | import qs from "query-string";
4 |
5 | // setupMock({
6 | // setup: () => {
7 | //
8 | // },
9 | // });
10 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/project/preview/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'projectPreview.breadcrumb':'Project Preview',
4 | 'projectPreview.nodata.tooltip1':'Empty Data',
5 | 'projectPreview.nodata.tooltip2':'Please Create Statistic Groups and Items First!',
6 | 'projectPreview.label.project':'Project',
7 | },
8 | 'zh-CN': {
9 | 'projectPreview.breadcrumb':'工程视图',
10 | 'projectPreview.nodata.tooltip1':'暂无数据',
11 | 'projectPreview.nodata.tooltip2':'当前工程下暂无统计组和统计项!',
12 | 'projectPreview.label.project':'统计工程',
13 | },
14 | };
15 |
16 | export default i18n;
17 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/project/preview/style/index.module.less:
--------------------------------------------------------------------------------
1 | .banner {
2 | background-color: var(--color-bg-2);
3 | padding: 20px;
4 | }
5 |
6 | .wrapper {
7 | display: flex;
8 | width: 100%;
9 | }
10 |
11 | .right {
12 | width: calc(100% - 356px);
13 | }
14 |
15 | .left {
16 | width: 340px;
17 | margin-right: 16px;
18 | }
19 |
20 | .panel {
21 | background-color: var(--color-bg-2);
22 | border-radius: 4px;
23 | overflow: auto;
24 | }
25 |
26 | @nav-size-height: 60px;
27 |
28 | .spin {
29 | display: flex;
30 | align-items: center;
31 | justify-content: center;
32 | width: 100%;
33 | min-height: calc(100vh);
34 | }
35 |
36 | :global{
37 | .disable-select {
38 | -webkit-user-select: none; /* Safari */
39 | -moz-user-select: none; /* Firefox */
40 | -ms-user-select: none; /* IE 10 and IE Edge */
41 | user-select: none;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/record/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'recordType.limited.title':'Limited Records',
4 | 'recordType.groupLimited.strategy':'Strategy',
5 | 'recordType.groupLimited.startTime':'StartTime',
6 | 'recordType.groupLimited.endTime':'EndTime',
7 | },
8 | 'zh-CN': {
9 | 'recordType.limited.title':'限流记录',
10 | 'recordType.groupLimited.strategy':'限流策略',
11 | 'recordType.groupLimited.startTime':'开始时间',
12 | 'recordType.groupLimited.endTime':'截止时间',
13 | },
14 | };
15 |
16 | export default i18n;
17 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/register/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import Footer from '@/components/Footer';
3 | import RegisterForm from './form';
4 | import styles from './style/index.module.less';
5 |
6 | export default function Index() {
7 |
8 | return (
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | );
20 | }
--------------------------------------------------------------------------------
/light-webapps/src/pages/result/error/style/index.module.less:
--------------------------------------------------------------------------------
1 | .wrapper {
2 | padding: 24px 150px;
3 | background-color: var(--color-bg-2);
4 | box-sizing: border-box;
5 | min-height: calc(100vh - 168px);
6 | }
7 |
8 | .result {
9 | margin: 150px 0 36px;
10 | }
11 |
12 | .details-wrapper {
13 | width: 100%;
14 | padding: 20px;
15 | background-color: var(--color-fill-2);
16 | box-sizing: border-box;
17 | margin-bottom: 150px;
18 | }
19 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/result/success/style/index.module.less:
--------------------------------------------------------------------------------
1 | .wrapper {
2 | padding: 24px 150px;
3 | background-color: var(--color-bg-2);
4 | box-sizing: border-box;
5 | min-height: calc(100vh - 168px);
6 | }
7 |
8 | .result {
9 | margin: 150px 0 36px;
10 | }
11 |
12 | .steps-wrapper {
13 | width: 100%;
14 | min-width: fit-content;
15 | padding: 20px;
16 | background-color: var(--color-fill-2);
17 | box-sizing: border-box;
18 | margin-bottom: 150px;
19 | }
20 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/stat/common/locale/index.tsx:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'statLabel.label.id':'ID',
4 | 'statLabel.label.project':'Project',
5 | 'statLabel.label.group':'Group',
6 |
7 | },
8 | 'zh-CN': {
9 | 'statLabel.label.id':'ID',
10 | 'statLabel.label.project':'工程',
11 | 'statLabel.label.group':'统计组',
12 | },
13 | };
14 |
15 | export default i18n;
16 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/stat/create/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'statCreate.modal.title':'Create Statistics',
4 | 'statCreate.form.submit.success':'Create statistic item successfully!',
5 | 'statCreate.label.template':'Template',
6 | 'statCreate.label.timeparam':'TimeParam',
7 | 'statCreate.label.expired':'Expired',
8 | 'statCreate.label.group':'Group',
9 | 'statCreate.label.description':'Description',
10 | },
11 | 'zh-CN': {
12 | 'statCreate.modal.title':'创建统计项',
13 | 'statCreate.form.submit.success':'创建统计项成功!',
14 | 'statCreate.label.template':'统计模板',
15 | 'statCreate.label.timeparam':'时间周期',
16 | 'statCreate.label.expired':'有效期',
17 | 'statCreate.label.group':'统计组',
18 | 'statCreate.label.description':'描述',
19 | },
20 | };
21 |
22 | export default i18n;
23 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/stat/limiting/StatLimitingModal.tsx:
--------------------------------------------------------------------------------
1 | import React, {useContext, useEffect, useRef, useState} from 'react';
2 | import {
3 | Modal,
4 | } from "@arco-design/web-react";
5 | import useLocale from "@/utils/useLocale";
6 | import locale from "./locale";
7 | import {StatLimitingRecordsPanel} from "@/pages/stat/limiting/limit_records_panel";
8 | import {StatInfoPreviewContext} from "@/pages/common/context";
9 |
10 | function StatLimitingModal({onClose}) {
11 |
12 | const t = useLocale(locale);
13 | const { statInfo, setStatInfo } = useContext(StatInfoPreviewContext);
14 |
15 | return (
16 |
23 |
24 |
25 | );
26 | }
27 |
28 | export default StatLimitingModal;
--------------------------------------------------------------------------------
/light-webapps/src/pages/stat/limiting/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'limitingRecords.modal.title':'Limiting Records',
4 | },
5 | 'zh-CN': {
6 | 'limitingRecords.modal.title':'限流记录',
7 | },
8 | };
9 |
10 | export default i18n;
--------------------------------------------------------------------------------
/light-webapps/src/pages/stat/list/list.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Breadcrumb,
3 | Card,
4 | } from '@arco-design/web-react';
5 | import React, {useState} from 'react';
6 | import useLocale from '@/utils/useLocale';
7 | import StatisticalListPanel from "@/pages/stat/list/stat_list";
8 | import locale from "./locale";
9 | import SearchForm from "@/pages/stat/list/form";
10 | import {IconHome} from "@arco-design/web-react/icon";
11 | const BreadcrumbItem = Breadcrumb.Item;
12 |
13 | export default function StatList() {
14 |
15 | const t = useLocale(locale);
16 | const [formParams, setFormParams] = useState({});
17 |
18 | function handleSearch(params) {
19 | setFormParams(params);
20 | }
21 |
22 | return (
23 |
24 |
25 |
26 |
27 | );
28 | }
--------------------------------------------------------------------------------
/light-webapps/src/pages/stat/preview/settings/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'statPreviewSettings.breadcrumbItem':'Preview Settings',
4 | 'statPreviewSettings.form.label.function':'Statistic Function',
5 | 'statPreviewSettings.form.label.chartTitle':'Chart Title',
6 | 'statPreviewSettings.form.label.chartType':'Chart Type',
7 | 'statPreviewSettings.form.label.chartType.lineChart':'Line Chart',
8 | },
9 | 'zh-CN': {
10 | 'statPreviewSettings.breadcrumbItem':'显示设置',
11 | 'statPreviewSettings.form.label.function':'运算函数',
12 | 'statPreviewSettings.form.label.chartTitle':'图表名称',
13 | 'statPreviewSettings.form.label.chartType':'图表类型',
14 | 'statPreviewSettings.form.label.chartType.lineChart':'折线图',
15 | },
16 | };
17 |
18 | export default i18n;
19 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/stat/update/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'statUpdate.modal.title':'Update Statistic',
4 | 'statUpdate.form.submit.success':'Update statistic item successfully!',
5 | },
6 | 'zh-CN': {
7 | 'statUpdate.modal.title':'修改统计项',
8 | 'statUpdate.form.submit.success':'修改统计项成功!',
9 | },
10 | };
11 |
12 | export default i18n;
13 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/track/style/index.module.less:
--------------------------------------------------------------------------------
1 | .banner {
2 | background-color: var(--color-bg-2);
3 | padding: 20px;
4 | }
5 |
6 | .wrapper {
7 | display: flex;
8 | width: 100%;
9 | }
10 |
11 | .left {
12 | width: calc(100% - 766px);
13 | margin-right: 16px;
14 | }
15 |
16 | .right {
17 | width: 750px;
18 | }
--------------------------------------------------------------------------------
/light-webapps/src/pages/user/common/locale/index.ts:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'userTerm.exceed.limit':'Number of selections exceeds maximum limit',
4 | 'userGroups.label.user':'User',
5 | 'userGroups.label.email':'Email',
6 | 'userGroups.label.phone':'Phone',
7 | 'userGroups.label.department':'Department',
8 | },
9 | 'zh-CN': {
10 | 'userTerm.exceed.limit':'所选数量超出最大限制',
11 | 'userGroups.label.user':'用户',
12 | 'userGroups.label.email':'邮箱',
13 | 'userGroups.label.phone':'手机',
14 | 'userGroups.label.department':'部门',
15 | },
16 | };
17 |
18 | export default i18n;
19 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/user/settings/style/header.module.less:
--------------------------------------------------------------------------------
1 | .info-wrapper {
2 | display: flex;
3 | }
4 |
5 | .info-avatar {
6 | :global(.arco-avatar-trigger-icon-button) {
7 | color: rgb(var(--arcoblue-6));
8 | right: 0;
9 | bottom: 0;
10 | width: 30px;
11 | height: 30px;
12 | font-size: 14px;
13 | box-sizing: border-box;
14 | border: 2px solid var(--color-white);
15 | }
16 | }
17 |
18 | .info-content {
19 | flex: 1;
20 | width: 0;
21 | margin-left: 60px;
22 | padding-right: 60px;
23 | }
24 |
25 | .verified-tag {
26 | height: 20px;
27 | line-height: 20px;
28 | margin-top: -2px;
29 | }
30 |
31 | .edit-btn {
32 | margin-left: 12px;
33 | }
34 |
--------------------------------------------------------------------------------
/light-webapps/src/pages/view/common/locale/index.tsx:
--------------------------------------------------------------------------------
1 | const i18n = {
2 | 'en-US': {
3 | 'viewLabel.label.id':'ID',
4 | 'viewLabel.label.title':'Title',
5 | },
6 | 'zh-CN': {
7 | 'viewLabel.label.id':'ID',
8 | 'viewLabel.label.title':'名称',
9 | },
10 | };
11 |
12 | export default i18n;
13 |
--------------------------------------------------------------------------------
/light-webapps/src/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "colorWeek": false,
3 | "navbar": true,
4 | "menu": true,
5 | "footer": true,
6 | "themeColor": "#165DFF",
7 | "menuWidth": 220
8 | }
9 |
--------------------------------------------------------------------------------
/light-webapps/src/types/caller.ts:
--------------------------------------------------------------------------------
1 | import {User} from "@/types/insights-web";
2 | import {CallerStateEnum, PermissionEnum, ResourceTypeEnum} from "@/types/insights-common";
3 |
4 | export interface Caller {
5 | id?:number;
6 | name?:string;
7 | desc?:string;
8 | state?:CallerStateEnum;
9 | departmentId?:number;
10 | adminIds?:Array;
11 | admins?:Array;
12 | createTime?:number;
13 | updateTime?:number;
14 | permissions?:PermissionEnum[];
15 | }
16 |
17 | export interface AuthRecord {
18 | id?:number;
19 | resourceId?:number;
20 | resourceType?:ResourceTypeEnum;
21 | expireTime?:number;
22 | createTime?:number;
23 | updateTime?:number;
24 | extend?:any;
25 | }
--------------------------------------------------------------------------------
/light-webapps/src/types/rollback.ts:
--------------------------------------------------------------------------------
1 | export enum RollbackTypeEnum{
2 | VISUALIZATION_DESIGN = 1,
3 | }
4 |
5 | export interface Rollback {
6 | id?:number;
7 | userId?:number;
8 | resourceId?:number;
9 | state?:number;
10 | dataType?:RollbackTypeEnum;
11 | config?:string;
12 | version?:number;
13 | createTime?:number;
14 | }
--------------------------------------------------------------------------------
/light-webapps/src/types/stat.ts:
--------------------------------------------------------------------------------
1 | export interface CommonlyFilterConfigParam{
2 | key?:string,
3 | statId?:number,
4 | filters?:Map,
5 | }
--------------------------------------------------------------------------------
/light-webapps/src/utils/changeTheme.ts:
--------------------------------------------------------------------------------
1 | function changeTheme(theme) {
2 | if (theme === 'dark') {
3 | document.body.setAttribute('arco-theme', 'dark');
4 | } else {
5 | document.body.removeAttribute('arco-theme');
6 | }
7 | }
8 |
9 | export default changeTheme;
10 |
--------------------------------------------------------------------------------
/light-webapps/src/utils/checkLogin.tsx:
--------------------------------------------------------------------------------
1 | export function checkLogin() {
2 | return localStorage.getItem('userStatus') === 'login';
3 | }
4 |
5 | export function removeLoginStatus() {
6 | localStorage.removeItem('userStatus');
7 | localStorage.removeItem('loginParams');
8 | localStorage.removeItem('refreshKey');
9 | localStorage.removeItem('accessKey');
10 | localStorage.removeItem('userRole');
11 | localStorage.removeItem('cache_stared_metrics');
12 | localStorage.removeItem('cache_stared_projects');
13 | localStorage.removeItem('cache_all_department');
14 | localStorage.removeItem('cache_user_info');
15 | }
--------------------------------------------------------------------------------
/light-webapps/src/utils/configLoader.ts:
--------------------------------------------------------------------------------
1 | interface Config {
2 | REACT_APP_BASE_URL: string;
3 | AXIOS_TIMEOUT: number;
4 | }
5 |
6 | let config: Config | null = null;
7 |
8 | const loadGlobalConfig = async (configPath = null): Promise => {
9 | if (!config) {
10 | if(configPath){
11 | const response = await fetch(configPath);
12 | config = await response.json();
13 | }else{
14 | const response = await fetch('/config.json');
15 | config = await response.json();
16 | }
17 | }
18 | };
19 |
20 | export const getGlobalConfig = async (configPath = null): Promise => {
21 | if (!config) {
22 | await loadGlobalConfig(configPath);
23 | return config;
24 | }else{
25 | return config;
26 | }
27 | };
--------------------------------------------------------------------------------
/light-webapps/src/utils/constants.ts:
--------------------------------------------------------------------------------
1 |
2 |
3 | export const TEXT_BASE_PATTERN_1 = /^[a-zA-Z0-9_]+$/;
4 | export const TEXT_BASE_PATTERN_2 = /^[\u3010\u3011\uFF08\uFF09\u4E00-\u9FA5a-zA-Z0-9_\-()\[\]\/\\#\s]+$/;
5 | export const TEXT_BASE_PATTERN_3 = /^[\u3010\u3011\uFF08\uFF09\u4E00-\u9FA5a-zA-Z0-9_:\-()\[\]\/\\#\s]+$/;
6 | export const TEXT_BASE_PATTERN_4 = /^[a-z][a-z0-9_]{4,24}$/;
7 | export const TEXT_BASE_PATTERN_5 = /^[\u4e00-\u9fa5a-zA-Z0-9]+$/;
8 | export const TEXT_BASE_PATTERN_6 = /^[\u4e00-\u9fa5a-zA-Z0-9.]+$/;
9 | export const _TokenPattern = /^[a-z][a-z0-9_]{4,24}$/;
10 | export const _ColumnNamePattern = /^[a-zA-Z][a-zA-Z0-9_]*$/;
11 |
12 | export const GlobalErrorCodes:string[] = ['401','402','403','404','500'];
13 |
--------------------------------------------------------------------------------
/light-webapps/src/utils/getUrlParams.ts:
--------------------------------------------------------------------------------
1 | // 仅用于线上预览,实际使用中可以将此逻辑删除
2 | import qs from 'query-string';
3 | import { isSSR } from './is';
4 |
5 | export type ParamsType = Record;
6 |
7 | export default function getUrlParams(): ParamsType {
8 | const params = qs.parseUrl(!isSSR ? window.location.href : '').query;
9 | const returnParams: ParamsType = {};
10 | Object.keys(params).forEach((p) => {
11 | if (params[p] === 'true') {
12 | returnParams[p] = true;
13 | }
14 | if (params[p] === 'false') {
15 | returnParams[p] = false;
16 | }
17 | });
18 | return returnParams;
19 | }
20 |
--------------------------------------------------------------------------------
/light-webapps/src/utils/is.ts:
--------------------------------------------------------------------------------
1 | export function isArray(val): boolean {
2 | return Object.prototype.toString.call(val) === '[object Array]';
3 | }
4 | export function isObject(val): boolean {
5 | return Object.prototype.toString.call(val) === '[object Object]';
6 | }
7 | export function isString(val): boolean {
8 | return Object.prototype.toString.call(val) === '[object String]';
9 | }
10 |
11 | export const isSSR = (function () {
12 | try {
13 | return !(typeof window !== 'undefined' && document !== undefined);
14 | } catch (e) {
15 | return true;
16 | }
17 | })();
18 |
--------------------------------------------------------------------------------
/light-webapps/src/utils/lazyload.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import loadable from '@loadable/component';
3 | import { Spin } from '@arco-design/web-react';
4 | import styles from '../style/layout.module.less';
5 |
6 | // https://github.com/gregberge/loadable-components/pull/226
7 | function load(fn, options) {
8 | const Component = loadable(fn, options);
9 | Component.preload = fn.requireAsync || fn;
10 |
11 | return Component;
12 | }
13 |
14 | function LoadingComponent(props: {
15 | error: boolean;
16 | timedOut: boolean;
17 | pastDelay: boolean;
18 | }) {
19 | if (props.error) {
20 | console.error(props.error);
21 | return null;
22 | }
23 | return (
24 |
25 |
26 |
27 | );
28 | }
29 |
30 | export default (loader) =>
31 | load(loader, {
32 | fallback: LoadingComponent({
33 | pastDelay: true,
34 | error: false,
35 | timedOut: false,
36 | }),
37 | });
--------------------------------------------------------------------------------
/light-webapps/src/utils/localCache.ts:
--------------------------------------------------------------------------------
1 | export const getDataWithLocalCache = async (key: string, seconds: number, callback: () => Promise, storageType = 'sessionStorage'): Promise => {
2 | const storage = localStorage;
3 | let result;
4 | const cachedData = storage.getItem(key);
5 | if (cachedData) {
6 | const {data, timestamp} = JSON.parse(cachedData);
7 | const now = Date.now();
8 | if (now - timestamp <= seconds * 1000) {
9 | result = data;
10 | } else {
11 | storage.removeItem(key);
12 | }
13 | }
14 | if(!result){
15 | result = await callback();
16 | const cachedData = {
17 | data:result,
18 | timestamp: Date.now()
19 | };
20 | storage.setItem(key, JSON.stringify(cachedData));
21 | }
22 | return result;
23 | }
24 |
25 | const clearLocalCache = (key:string):void => {
26 | localStorage.removeItem(key);
27 | }
--------------------------------------------------------------------------------
/light-webapps/src/utils/setupMock.ts:
--------------------------------------------------------------------------------
1 | export default (config: { mock?: boolean; setup: () => void }) => {
2 | const { mock = process.env.NODE_ENV === 'development', setup } = config;
3 | if (mock === false) return;
4 | setup();
5 | };
6 |
--------------------------------------------------------------------------------
/light-webapps/src/utils/useLocale.ts:
--------------------------------------------------------------------------------
1 | import { useContext } from 'react';
2 | import { GlobalContext } from '@/context';
3 |
4 | import defaultLocale from '../locale/index';
5 | import commonLocale from '../locale/common';
6 |
7 | function useLocale(locale = null) {
8 | const { lang } = useContext(GlobalContext);
9 | const customLocale = (locale || defaultLocale)[lang] || {};
10 | return Object.assign(customLocale,commonLocale[lang]);
11 | }
12 |
13 | export default useLocale;
--------------------------------------------------------------------------------
/light-webapps/src/utils/useSingleAndDoubleClick.ts:
--------------------------------------------------------------------------------
1 | import {useCallback, useRef} from 'react';
2 |
3 | const useSingleAndDoubleClick = (onSingleClick, onDoubleClick,delay = 300) => {
4 | const clickTimeout = useRef(null);
5 | const lastClickTime = useRef(0);
6 |
7 | return useCallback((event) => {
8 | const currentTime = new Date().getTime();
9 | const timeDifference = currentTime - lastClickTime.current;
10 | if (timeDifference < delay) {
11 | clearTimeout(clickTimeout.current);
12 | onDoubleClick(event);
13 | event.stopPropagation();
14 | } else {
15 | clickTimeout.current = setTimeout(() => {
16 | onSingleClick(event);
17 | }, delay);
18 | }
19 |
20 | lastClickTime.current = currentTime;
21 | }, [onSingleClick, onDoubleClick, delay]);
22 | };
23 |
24 | export default useSingleAndDoubleClick;
25 |
--------------------------------------------------------------------------------
/light-webapps/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/light-webapps/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import react from '@vitejs/plugin-react';
3 | import svgrPlugin from '@arco-plugins/vite-plugin-svgr';
4 | import vitePluginForArco from '@arco-plugins/vite-react';
5 | import setting from './src/settings.json';
6 |
7 | // https://vitejs.dev/config/
8 | export default defineConfig({
9 | resolve: {
10 | alias: [{ find: '@', replacement: '/src' }],
11 | },
12 | plugins: [
13 | react(),
14 | svgrPlugin({
15 | svgrOptions: {},
16 | }),
17 | vitePluginForArco({
18 | theme: '@arco-themes/react-ldp-theme',
19 | modifyVars: {
20 | 'arcoblue-6': setting.themeColor,
21 | },
22 | }),
23 | ],
24 | css: {
25 | preprocessorOptions: {
26 | less: {
27 | javascriptEnabled: true,
28 | },
29 | },
30 | },
31 | build: {
32 | outDir: 'build',
33 | chunkSizeWarningLimit: 10000,
34 | }
35 | });
36 |
--------------------------------------------------------------------------------
/lighthouse-client/src/test/java/com/dtstep/lighthouse/client/cluster/ClientBaseTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.client.cluster;
2 |
3 | import com.dtstep.lighthouse.client.LightHouse;
4 |
5 | public class ClientBaseTest {
6 |
7 | static {
8 | try{
9 | LightHouse.init("10.206.6.12:4061");
10 | }catch (Exception ex){
11 | ex.printStackTrace();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/lighthouse-client/src/test/java/com/dtstep/lighthouse/client/cluster/TestDataQuery.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.client.cluster;
2 |
3 | import com.dtstep.lighthouse.client.LightHouse;
4 | import com.dtstep.lighthouse.common.entity.view.StatValue;
5 | import com.dtstep.lighthouse.common.util.DateUtil;
6 | import com.dtstep.lighthouse.common.util.JsonUtil;
7 | import org.junit.Test;
8 |
9 | import java.util.ArrayList;
10 | import java.util.Collections;
11 | import java.util.List;
12 | import java.util.concurrent.TimeUnit;
13 |
14 | public class TestDataQuery extends ClientBaseTest{
15 |
16 | @Test
17 | public void testDataQuery() throws Exception {
18 | int id = 1100578;
19 | long batchTime = DateUtil.batchTime(1, TimeUnit.MINUTES,System.currentTimeMillis());
20 | // List result = LightHouse.dataQuery(id,"5ONJTOU4JpvoclyI4E0Xbm6XIysis4O0UHCVQhy3",null, new ArrayList<>(Collections.singletonList(batchTime)));
21 | // System.out.println("result:" + JsonUtil.toJSONString(result));
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lighthouse-client/src/test/java/com/dtstep/lighthouse/client/cluster/TestQueryGroupInfo.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.client.cluster;
2 |
3 | import com.dtstep.lighthouse.client.LightHouse;
4 | import com.dtstep.lighthouse.common.entity.group.GroupVerifyEntity;
5 | import com.dtstep.lighthouse.common.serializer.KryoSerializer;
6 | import com.dtstep.lighthouse.common.serializer.Serializer;
7 | import com.dtstep.lighthouse.common.util.JsonUtil;
8 | import org.junit.Test;
9 |
10 | public class TestQueryGroupInfo extends ClientBaseTest {
11 |
12 | @Test
13 | public void testQueryGroupInfo() throws Exception {
14 | String token = "test_scene_behavior_stat";
15 | GroupVerifyEntity groupVerifyEntity = LightHouse.queryGroupInfo(token);
16 | Serializer serializer = new KryoSerializer();
17 | byte[] bytes = serializer.serialize(groupVerifyEntity);
18 | GroupVerifyEntity result = serializer.deserialize(bytes,GroupVerifyEntity.class);
19 | System.out.println("result:" + JsonUtil.toJSONString(result));
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lighthouse-client/src/test/java/com/dtstep/lighthouse/client/standalone/StandaloneBaseTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.client.standalone;
2 |
3 | import com.dtstep.lighthouse.client.LightHouse;
4 | import com.dtstep.lighthouse.common.enums.RunningMode;
5 |
6 | public class StandaloneBaseTest {
7 |
8 | static {
9 | try{
10 | LightHouse.init("127.0.0.1:4061");
11 | }catch (Exception ex){
12 | ex.printStackTrace();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/lighthouse-client/src/test/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/annotation/BLengthValidation.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.annotation;
2 |
3 | import javax.validation.Constraint;
4 | import javax.validation.Payload;
5 | import java.lang.annotation.ElementType;
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 | import java.lang.annotation.Target;
9 |
10 | @Target({ElementType.FIELD, ElementType.METHOD})
11 | @Retention(RetentionPolicy.RUNTIME)
12 | @Constraint(validatedBy = BLengthValidator.class)
13 | public @interface BLengthValidation {
14 |
15 | String message() default "Invalid value";
16 |
17 | Class>[] groups() default {};
18 |
19 | Class extends Payload>[] payload() default {};
20 |
21 | int min() default -1;
22 |
23 | int max() default -1;
24 | }
25 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/annotation/BLengthValidator.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.annotation;
2 |
3 | import com.dtstep.lighthouse.common.util.StringUtil;
4 |
5 | import javax.validation.ConstraintValidator;
6 | import javax.validation.ConstraintValidatorContext;
7 |
8 | public class BLengthValidator implements ConstraintValidator {
9 |
10 | private int max;
11 |
12 | private int min;
13 |
14 | @Override
15 | public void initialize(BLengthValidation constraintAnnotation) {
16 | max = constraintAnnotation.max();
17 | min = constraintAnnotation.min();
18 | }
19 |
20 | @Override
21 | public boolean isValid(String value, ConstraintValidatorContext context) {
22 | int length = StringUtil.getBLen(value);
23 | return length >= min && length <= max;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/entity/Owner.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.entity;
2 |
3 | import com.dtstep.lighthouse.common.enums.OwnerTypeEnum;
4 |
5 | public class Owner {
6 |
7 | private Integer ownerId;
8 |
9 | private OwnerTypeEnum ownerType;
10 |
11 | public Integer getOwnerId() {
12 | return ownerId;
13 | }
14 |
15 | public void setOwnerId(Integer ownerId) {
16 | this.ownerId = ownerId;
17 | }
18 |
19 | public OwnerTypeEnum getOwnerType() {
20 | return ownerType;
21 | }
22 |
23 | public void setOwnerType(OwnerTypeEnum ownerType) {
24 | this.ownerType = ownerType;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/entity/Role.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.entity;
2 |
3 | import com.dtstep.lighthouse.common.enums.AuthRoleTypeEnum;
4 |
5 | public class Role {
6 |
7 | private AuthRoleTypeEnum authRoleTypeEnum;
8 |
9 | public Role(AuthRoleTypeEnum authRoleTypeEnum){
10 | this.authRoleTypeEnum = authRoleTypeEnum;
11 | }
12 |
13 | public AuthRoleTypeEnum getRoleType() {
14 | return authRoleTypeEnum;
15 | }
16 |
17 | public void setRoleType(AuthRoleTypeEnum authRoleTypeEnum) {
18 | this.authRoleTypeEnum = authRoleTypeEnum;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/entity/monitor/ClusterInfo.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.entity.monitor;
2 |
3 | import com.dtstep.lighthouse.common.enums.RunningMode;
4 |
5 | import java.io.Serializable;
6 |
7 | public class ClusterInfo implements Serializable {
8 |
9 | private RunningMode runningMode;
10 |
11 | private long startTime;
12 |
13 | private long runningTime;
14 |
15 | public RunningMode getRunningMode() {
16 | return runningMode;
17 | }
18 |
19 | public void setRunningMode(RunningMode runningMode) {
20 | this.runningMode = runningMode;
21 | }
22 |
23 | public long getStartTime() {
24 | return startTime;
25 | }
26 |
27 | public void setStartTime(long startTime) {
28 | this.startTime = startTime;
29 | }
30 |
31 | public long getRunningTime() {
32 | return runningTime;
33 | }
34 |
35 | public void setRunningTime(long runningTime) {
36 | this.runningTime = runningTime;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/entity/rpc/RpcMsgType.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.entity.rpc;
2 |
3 | public enum RpcMsgType {
4 |
5 | HeartBeat,
6 |
7 | Normal,
8 | }
9 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/entity/stat/StatVerifyEntity.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.entity.stat;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 |
5 | import java.io.Serializable;
6 |
7 | @JsonIgnoreProperties(ignoreUnknown = true)
8 | public class StatVerifyEntity implements Serializable {
9 |
10 | private int statId;
11 |
12 | private String verifyKey;
13 |
14 | public int getStatId() {
15 | return statId;
16 | }
17 |
18 | public void setStatId(int statId) {
19 | this.statId = statId;
20 | }
21 |
22 | public String getVerifyKey() {
23 | return verifyKey;
24 | }
25 |
26 | public void setVerifyKey(String verifyKey) {
27 | this.verifyKey = verifyKey;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/AlarmChannelType.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | public enum AlarmChannelType {
4 |
5 | custom,
6 |
7 | aliyun,
8 | }
9 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/AlarmMatchEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum AlarmMatchEnum {
9 |
10 | MATCH_ANY(1),
11 |
12 | MATCH_ALL(2),
13 |
14 | ;
15 |
16 | AlarmMatchEnum(int type){
17 | this.type = type;
18 | }
19 |
20 | @JsonValue
21 | private int type;
22 |
23 | public int getType() {
24 | return type;
25 | }
26 |
27 | public void setType(int type) {
28 | this.type = type;
29 | }
30 |
31 | @JsonCreator
32 | public static AlarmMatchEnum forValue(int type){
33 | AlarmMatchEnum[] values = AlarmMatchEnum.values();
34 | return Stream.of(values).filter(it -> it.type == type).findAny().orElse(null);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/AlarmStateEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum AlarmStateEnum {
9 |
10 | DISABLE(0),
11 |
12 | ENABLE(1),
13 |
14 | ;
15 |
16 | AlarmStateEnum(int state){
17 | this.state = state;
18 | }
19 |
20 | @JsonValue
21 | private int state;
22 |
23 | public int getState() {
24 | return state;
25 | }
26 |
27 | public void setState(int state) {
28 | this.state = state;
29 | }
30 |
31 | @JsonCreator
32 | public static AlarmStateEnum forValue(int state){
33 | AlarmStateEnum[] values = AlarmStateEnum.values();
34 | return Stream.of(values).filter(it -> it.getState() == state).findAny().orElse(null);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/AuthRoleTypeEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | public enum AuthRoleTypeEnum {
4 |
5 | ADMIN("admin"),
6 |
7 | USER("user");
8 |
9 | private final String roleName;
10 |
11 | AuthRoleTypeEnum(String roleName) {
12 | this.roleName = roleName;
13 | }
14 |
15 | public String getRoleName() {
16 | return roleName;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/CalculateMethod.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum CalculateMethod {
9 |
10 | ADD(1),
11 |
12 | SUB(2),
13 |
14 | MUL(3),
15 |
16 | DIVIDE(4),
17 |
18 | MAX(5),
19 |
20 | MIN(6),
21 |
22 | AVG(7),
23 |
24 | ;
25 |
26 | @JsonValue
27 | private Integer type;
28 |
29 | CalculateMethod(int type){
30 | this.type = type;
31 | }
32 |
33 | public Integer getType() {
34 | return type;
35 | }
36 |
37 | public void setType(Integer type) {
38 | this.type = type;
39 | }
40 |
41 | @JsonCreator
42 | public static CalculateMethod forValue(int type){
43 | CalculateMethod[] values = CalculateMethod.values();
44 | return Stream.of(values).filter(it -> it.getType() == type).findAny().orElse(null);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/ColumnTypeEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum ColumnTypeEnum {
9 |
10 | STRING("string"),
11 |
12 | NUMBER("number"),
13 |
14 | ;
15 |
16 |
17 | @JsonValue
18 | private String type;
19 |
20 | ColumnTypeEnum(String type){
21 | this.type = type;
22 | }
23 |
24 | public String getType() {
25 | return type;
26 | }
27 |
28 | public void setType(String type) {
29 | this.type = type;
30 | }
31 |
32 | @JsonCreator
33 | public static ColumnTypeEnum forValue(String value){
34 | ColumnTypeEnum[] values = ColumnTypeEnum.values();
35 | return Stream.of(values).filter(it -> it.getType().equals(value)).findAny().orElse(null);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/Component.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | public interface Component {
4 | }
5 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/DocumentTypeEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum DocumentTypeEnum {
9 |
10 | DOC_DIRECTORY(1),
11 |
12 | DOC_MARKDOWN(2),
13 |
14 | ;
15 |
16 | @JsonValue
17 | private int type;
18 |
19 | DocumentTypeEnum(int type){
20 | this.type = type;
21 | }
22 |
23 | public int getType() {
24 | return type;
25 | }
26 |
27 | public void setType(int type) {
28 | this.type = type;
29 | }
30 |
31 | @JsonCreator
32 | public static DocumentTypeEnum forValue(int type){
33 | DocumentTypeEnum[] values = DocumentTypeEnum.values();
34 | return Stream.of(values).filter(it -> it.getType() == type).findAny().orElse(null);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/LanguageEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum LanguageEnum {
9 |
10 | ENGLISH(1),
11 |
12 | CHINESE(2),
13 |
14 | ;
15 |
16 | LanguageEnum(int type){
17 | this.type = type;
18 | }
19 |
20 | @JsonValue
21 | private int type;
22 |
23 | public int getType() {
24 | return type;
25 | }
26 |
27 | public void setType(int type) {
28 | this.type = type;
29 | }
30 |
31 | @JsonCreator
32 | public static LanguageEnum forValue(int type){
33 | LanguageEnum[] values = LanguageEnum.values();
34 | return Stream.of(values).filter(it -> it.type == type).findAny().orElse(null);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/MetaTableStateEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 |
5 | import java.util.stream.Stream;
6 |
7 | public enum MetaTableStateEnum {
8 |
9 | VALID(1),
10 |
11 | INVALID(2),
12 |
13 | ;
14 |
15 | private int state;
16 |
17 | public int getState() {
18 | return state;
19 | }
20 |
21 | public void setState(int state) {
22 | this.state = state;
23 | }
24 |
25 | MetaTableStateEnum(int state){
26 | this.state = state;
27 | }
28 |
29 | @JsonCreator
30 | public static MetaTableStateEnum forValue(int state){
31 | MetaTableStateEnum[] values = MetaTableStateEnum.values();
32 | return Stream.of(values).filter(it -> it.getState() == state).findAny().orElse(null);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/NotificationStateEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum NotificationStateEnum {
9 |
10 | Pend(1),
11 |
12 | Sent(2),
13 |
14 | ReportingFailed(3),
15 |
16 | Failed(4),
17 |
18 | ;
19 |
20 | NotificationStateEnum(int state){
21 | this.state = state;
22 | }
23 |
24 | @JsonValue
25 | private int state;
26 |
27 | public int getState() {
28 | return state;
29 | }
30 |
31 | public void setState(int state) {
32 | this.state = state;
33 | }
34 |
35 | @JsonCreator
36 | public static NotificationStateEnum forValue(int state){
37 | NotificationStateEnum[] values = NotificationStateEnum.values();
38 | return Stream.of(values).filter(it -> it.getState() == state).findAny().orElse(null);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/NotificationTypeEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.List;
7 | import java.util.stream.Stream;
8 |
9 | public enum NotificationTypeEnum {
10 |
11 | StatAlarm(1),
12 |
13 | ;
14 |
15 | @JsonValue
16 | private int type;
17 |
18 | NotificationTypeEnum(int type){
19 | this.type = type;
20 | }
21 |
22 | public int getType() {
23 | return type;
24 | }
25 |
26 | public void setType(int type) {
27 | this.type = type;
28 | }
29 |
30 | @JsonCreator
31 | public static NotificationTypeEnum forValue(int type){
32 | NotificationTypeEnum[] values = NotificationTypeEnum.values();
33 | return Stream.of(values).filter(it -> it.getType() == type).findAny().orElse(null);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/NumberCompareType.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum NumberCompareType {
9 |
10 | GT(1),
11 |
12 | GE(2),
13 |
14 | LT(3),
15 |
16 | LE(4),
17 |
18 | EQ(5),
19 |
20 | ;
21 |
22 | @JsonValue
23 | private Integer type;
24 |
25 | NumberCompareType(int type){
26 | this.type = type;
27 | }
28 |
29 | public Integer getType() {
30 | return type;
31 | }
32 |
33 | public void setType(Integer type) {
34 | this.type = type;
35 | }
36 |
37 | @JsonCreator
38 | public static NumberCompareType forValue(int type){
39 | NumberCompareType[] values = NumberCompareType.values();
40 | return Stream.of(values).filter(it -> it.getType() == type).findAny().orElse(null);
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/OrderStateEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum OrderStateEnum {
9 |
10 | PROCESSING(0),
11 |
12 | DELETED(1),
13 |
14 | APPROVED(2),
15 |
16 | REJECTED(3),
17 |
18 | RETRACTED(4),
19 |
20 | ;
21 |
22 | @JsonValue
23 | private Integer state;
24 |
25 | OrderStateEnum(int state){
26 | this.state = state;
27 | }
28 |
29 | public Integer getState() {
30 | return state;
31 | }
32 |
33 | public void setState(Integer state) {
34 | this.state = state;
35 | }
36 |
37 | @JsonCreator
38 | public static OrderStateEnum forValue(int state){
39 | OrderStateEnum[] values = OrderStateEnum.values();
40 | return Stream.of(values).filter(it -> it.getState() == state).findAny().orElse(null);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/OwnerTypeEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum OwnerTypeEnum {
9 |
10 | USER(1),
11 |
12 | DEPARTMENT(2),
13 |
14 | CALLER(3),
15 |
16 | ;
17 |
18 | OwnerTypeEnum(int ownerType){
19 | this.ownerType = ownerType;
20 | }
21 |
22 | @JsonValue
23 | private int ownerType;
24 |
25 | public int getOwnerType() {
26 | return ownerType;
27 | }
28 |
29 | public void setOwnerType(int ownerType) {
30 | this.ownerType = ownerType;
31 | }
32 |
33 |
34 | @JsonCreator
35 | public static OwnerTypeEnum forValue(int value){
36 | OwnerTypeEnum[] values = OwnerTypeEnum.values();
37 | return Stream.of(values).filter(it -> it.getOwnerType() == value).findAny().orElse(null);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/PrivateTypeEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum PrivateTypeEnum {
9 |
10 | Private(0),
11 |
12 | Public(1),
13 | ;
14 |
15 | PrivateTypeEnum(int privateType){
16 | this.privateType = privateType;
17 | }
18 |
19 | @JsonValue
20 | private Integer privateType;
21 |
22 | public Integer getPrivateType() {
23 | return privateType;
24 | }
25 |
26 | public void setPrivateType(Integer privateType) {
27 | this.privateType = privateType;
28 | }
29 |
30 | @JsonCreator
31 | public static PrivateTypeEnum forValue(int privateType){
32 | PrivateTypeEnum[] values = PrivateTypeEnum.values();
33 | return Stream.of(values).filter(it -> it.getPrivateType() == privateType).findAny().orElse(null);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/RollbackStateEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum RollbackStateEnum {
9 |
10 | UNPUBLISHED(0),
11 |
12 | PUBLISHED(1),
13 |
14 | ;
15 |
16 | @JsonValue
17 | private Integer state;
18 |
19 | RollbackStateEnum(int state){
20 | this.state = state;
21 | }
22 |
23 | public Integer getState() {
24 | return state;
25 | }
26 |
27 | public void setState(Integer state) {
28 | this.state = state;
29 | }
30 |
31 | @JsonCreator
32 | public static RollbackStateEnum forValue(int state){
33 | RollbackStateEnum[] values = RollbackStateEnum.values();
34 | return Stream.of(values).filter(it -> it.getState() == state).findAny().orElse(null);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/RollbackTypeEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum RollbackTypeEnum {
9 |
10 | VISUALIZATION_DESIGN(1),
11 |
12 | ;
13 |
14 | RollbackTypeEnum(int type){
15 | this.type = type;
16 | }
17 |
18 | @JsonValue
19 | private int type;
20 |
21 | public int getType() {
22 | return type;
23 | }
24 |
25 | public void setType(int type) {
26 | this.type = type;
27 | }
28 |
29 | @JsonCreator
30 | public static RollbackTypeEnum forValue(int type){
31 | RollbackTypeEnum[] values = RollbackTypeEnum.values();
32 | return Stream.of(values).filter(it -> it.getType() == type).findAny().orElse(null);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/RunningMode.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | public enum RunningMode {
4 |
5 | STANDALONE,
6 |
7 | CLUSTER,
8 | }
9 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/SwitchStateEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum SwitchStateEnum {
9 |
10 | CLOSE(0),
11 |
12 | OPEN(1),
13 |
14 | ;
15 |
16 | SwitchStateEnum(int state){
17 | this.state = state;
18 | }
19 |
20 | @JsonValue
21 | private int state;
22 |
23 | public int getState() {
24 | return state;
25 | }
26 |
27 | public void setState(int state) {
28 | this.state = state;
29 | }
30 |
31 | @JsonCreator
32 | public static SwitchStateEnum forValue(int state){
33 | SwitchStateEnum[] values = SwitchStateEnum.values();
34 | return Stream.of(values).filter(it -> it.getState() == state).findAny().orElse(null);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/enums/ViewStateEnum.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.enums;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.stream.Stream;
7 |
8 | public enum ViewStateEnum {
9 |
10 | UNPUBLISHED(0),
11 |
12 | PUBLISHED(1),
13 |
14 | ;
15 |
16 | @JsonValue
17 | private Integer state;
18 |
19 | ViewStateEnum(int state){
20 | this.state = state;
21 | }
22 |
23 | public Integer getState() {
24 | return state;
25 | }
26 |
27 | public void setState(Integer state) {
28 | this.state = state;
29 | }
30 |
31 | @JsonCreator
32 | public static ViewStateEnum forValue(int state){
33 | ViewStateEnum[] values = ViewStateEnum.values();
34 | return Stream.of(values).filter(it -> it.getState() == state).findAny().orElse(null);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/exception/LDPUncaughtExceptionHandler.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.exception;
2 |
3 | import org.slf4j.Logger;
4 | import org.slf4j.LoggerFactory;
5 |
6 | public class LDPUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
7 |
8 | private static final Logger logger = LoggerFactory.getLogger(LDPUncaughtExceptionHandler.class);
9 |
10 | @Override
11 | public void uncaughtException(Thread t, Throwable ex) {
12 | logger.error("Exception has been captured,Thread: {}", t.getName() , ex);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/exception/StatisticNotFoundException.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.exception;
2 |
3 | public class StatisticNotFoundException extends RuntimeException {
4 |
5 | public StatisticNotFoundException() {
6 | super();
7 | }
8 |
9 | public StatisticNotFoundException(String message) {
10 | super(message);
11 | }
12 |
13 | public StatisticNotFoundException(String message, Throwable cause) {
14 | super(message, cause);
15 | }
16 |
17 | public StatisticNotFoundException(Throwable cause) {
18 | super(cause);
19 | }
20 |
21 | protected StatisticNotFoundException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
22 | super(message, cause, enableSuppression, writableStackTrace);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/ice/_Marker.java:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) ZeroC, Inc. All rights reserved.
3 | //
4 | //
5 | // Ice version 3.7.10
6 | //
7 | //
8 | //
9 | // Generated from file `lighthouse.ice'
10 | //
11 | // Warning: do not edit this file.
12 | //
13 | //
14 | //
15 |
16 | package com.dtstep.lighthouse.common.ice;
17 |
18 | interface _Marker
19 | {
20 | }
21 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/ice/_RemoteLightServerPrxI.java:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) ZeroC, Inc. All rights reserved.
3 | //
4 | //
5 | // Ice version 3.7.10
6 | //
7 | //
8 | //
9 | // Generated from file `lighthouse.ice'
10 | //
11 | // Warning: do not edit this file.
12 | //
13 | //
14 | //
15 |
16 | package com.dtstep.lighthouse.common.ice;
17 |
18 | /** @hidden */
19 | public class _RemoteLightServerPrxI extends com.zeroc.Ice._ObjectPrxI implements RemoteLightServerPrx
20 | {
21 | /** @hidden */
22 | public static final long serialVersionUID = 0L;
23 | }
24 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/modal/AlarmSettings.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.modal;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | public class AlarmSettings {
7 |
8 | private String activeChannel;
9 |
10 | private Map channels = new HashMap<>();
11 |
12 | public String getActiveChannel() {
13 | return activeChannel;
14 | }
15 |
16 | public void setActiveChannel(String activeChannel) {
17 | this.activeChannel = activeChannel;
18 | }
19 |
20 | public Map getChannels() {
21 | return channels;
22 | }
23 |
24 | public void setChannels(Map channels) {
25 | this.channels = channels;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/modal/CustomAlarmChannel.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.modal;
2 |
3 | public class CustomAlarmChannel extends AlarmChannel {
4 |
5 | public CustomAlarmChannel() {
6 | super("custom");
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/modal/IDParams.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.modal;
2 |
3 | import javax.validation.constraints.NotNull;
4 | import java.util.List;
5 |
6 | public class IDParams {
7 |
8 | @NotNull
9 | private List ids;
10 |
11 | public List getIds() {
12 | return ids;
13 | }
14 |
15 | public void setIds(List ids) {
16 | this.ids = ids;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/modal/RenderChartConfig.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.modal;
2 |
3 | import com.dtstep.lighthouse.common.enums.ChartTypeEnum;
4 |
5 | public class RenderChartConfig {
6 |
7 | private int functionIndex;
8 |
9 | private String title;
10 |
11 | private ChartTypeEnum chartType;
12 |
13 | public int getFunctionIndex() {
14 | return functionIndex;
15 | }
16 |
17 | public void setFunctionIndex(int functionIndex) {
18 | this.functionIndex = functionIndex;
19 | }
20 |
21 | public String getTitle() {
22 | return title;
23 | }
24 |
25 | public void setTitle(String title) {
26 | this.title = title;
27 | }
28 |
29 | public ChartTypeEnum getChartType() {
30 | return chartType;
31 | }
32 |
33 | public void setChartType(ChartTypeEnum chartType) {
34 | this.chartType = chartType;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/modal/UserView.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.modal;
2 | /*
3 | * Copyright (C) 2022-2024 XueLing.雪灵
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with
6 | * this work for additional information regarding copyright ownership.
7 | * The ASF licenses this file to You under the Apache License, Version 2.0
8 | * (the "License"); you may not use this file except in compliance with
9 | * the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 | public class UserView {
20 | }
21 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/util/BeanCopyUtil.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.util;
2 |
3 | import net.sf.cglib.beans.BeanCopier;
4 |
5 | public class BeanCopyUtil {
6 |
7 | public static void copy(Object a,Object b){
8 | BeanCopier copier = BeanCopier.create(a.getClass(),b.getClass(),false);
9 | copier.copy(a,b,null);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/util/CalculateUtil.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.util;
2 |
3 | public class CalculateUtil {
4 |
5 | public static long getMaxDivisor(long m,long n){
6 | long temp;
7 | if (n > m) {
8 | temp = n;
9 | n = m;
10 | m = temp;
11 | }
12 | if (m % n == 0) {
13 | return n;
14 | }
15 | return getMaxDivisor(n, m % n);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/util/CopierUtil.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.util;
2 |
3 | import net.sf.cglib.beans.BeanCopier;
4 |
5 | public class CopierUtil {
6 |
7 | public static void copyTo(Object a,Object b){
8 | if(a == null || b == null){
9 | return;
10 | }
11 | BeanCopier copier = BeanCopier.create(a.getClass(), b.getClass(),false);
12 | copier.copy(a,b,null);
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/java/com/dtstep/lighthouse/common/util/NumberUtil.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.util;
2 |
3 | public class NumberUtil {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/test/com/dtstep/lighthouse/common/base/BaseTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.base;
2 |
3 | public class BaseTest {
4 |
5 | static {
6 | try{
7 |
8 | }catch (Exception ex){
9 | ex.printStackTrace();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/test/com/dtstep/lighthouse/common/fusing/FusingTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.fusing;
2 |
3 | import com.dtstep.lighthouse.common.enums.fusing.FusingRules;
4 | import org.junit.Test;
5 |
6 | public class FusingTest {
7 |
8 | @Test
9 | public void testFusing() throws Exception {
10 | for(int i=0;i<100;i++){
11 | FusingToken fusingToken = FusingSwitch.entry(FusingRules.CLIENT_EXCEPTION_RULE);
12 |
13 | FusingSwitch.track(fusingToken);
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/test/com/dtstep/lighthouse/common/key/KeyGeneratorTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.random;
2 |
3 | import org.junit.Assert;
4 | import org.junit.Test;
5 |
6 | public class KeyGeneratorTest {
7 |
8 | @Test
9 | public void generateKeyTest(){
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/test/com/dtstep/lighthouse/common/protobuf/ProtobufTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.protobuf;
2 |
3 | public class ProtobufTest {
4 |
5 | public void testProtobuf() throws Exception {
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/test/com/dtstep/lighthouse/common/sbr/StringBuilderHolderTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.sbr;
2 |
3 | import org.junit.Test;
4 |
5 | public class StringBuilderHolderTest {
6 |
7 | @Test
8 | public void test01() throws Exception{
9 | StringBuilder sbr = StringBuilderHolder.Bigger.getStringBuilder();
10 | System.out.println("sbr1:" + sbr);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/test/com/dtstep/lighthouse/common/util/CityHashTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.util;
2 |
3 | import com.dtstep.lighthouse.common.hash.CityHash;
4 | import org.junit.Test;
5 |
6 | public class CityHashTest {
7 |
8 | @Test
9 | public void cityHash() throws Exception {
10 | long[] s = CityHash.cityHash128("test".getBytes(),0,4);
11 | for(int i=0;i void clone(T obj1,T obj2) throws Exception{
8 | BeanUtils.copyProperties(obj1, obj2);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/test/com/dtstep/lighthouse/common/util/HttpClientUtil.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.util;
2 |
3 | public class HttpClientUtil {
4 | }
5 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/test/com/dtstep/lighthouse/common/util/HttpUtilTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.util;
2 |
3 | import org.junit.Test;
4 |
5 | public class HttpUtilTest {
6 |
7 | @Test
8 | public void testReachable() throws Exception {
9 | String url = "http://baidu.com";
10 | boolean is = HttpUtil.isUrlReachable(url);
11 | System.out.println("is:" + is);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/test/com/dtstep/lighthouse/common/util/LangUtilTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.util;
2 |
3 | import org.apache.commons.lang3.time.StopWatch;
4 | import org.junit.Test;
5 |
6 | public class LangUtilTest {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/test/com/dtstep/lighthouse/common/util/NumberUtilTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.util;
2 |
3 | import org.junit.Test;
4 |
5 | import java.math.BigDecimal;
6 | import java.math.RoundingMode;
7 | import java.text.DecimalFormat;
8 |
9 | public class NumberUtilTest {
10 |
11 | @Test
12 | public void test1() throws Exception {
13 | Double d = 12002579690694.587;
14 | // double d3 = 12002579690694.587d;
15 | // String s = "12002579690694.587";
16 | // String s2 = String.valueOf(d3);
17 | // String s4 = Double.toString(d);
18 | // String s5 = String.format("%.3f",d);
19 | // System.out.println("s2:" + s2);
20 | // System.out.println("s5:" + s5);
21 | // System.out.println("d2:" + new BigDecimal(s).toPlainString());
22 | // DecimalFormat decimalFormat = new DecimalFormat("#.####");
23 | // System.out.println(decimalFormat.format(d)); // 0.0005
24 |
25 | String s = d + "";
26 | System.out.println("s:" + s);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lighthouse-common/src/main/test/com/dtstep/lighthouse/common/util/OKhttpTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.common.util;
2 |
3 | import org.junit.Test;
4 |
5 | public class OKhttpTest {
6 |
7 | @Test
8 | public void testRequest() throws Exception {
9 | String url = "http://10.206.6.31:18101/clusterInfo";
10 | String response = OkHttpUtil.get(url);
11 | System.out.println("resonse:" + response);
12 | }
13 |
14 | @Test
15 | public void testPost() throws Exception {
16 | String url = "http://test.com";
17 | long t1 = System.currentTimeMillis();
18 | String response = null;
19 | try{
20 | response = OkHttpUtil.post(url,"test");
21 | }catch (Exception ex){
22 | ex.printStackTrace();
23 | }
24 | long t2 = System.currentTimeMillis();
25 | System.out.println("response:" + response + ",cost:" + (t2 - t1));
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lighthouse-core/src/main/java/com/dtstep/lighthouse/core/plugins/NotificationPlugin.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.core.plugins;
2 |
3 |
4 | import com.dtstep.lighthouse.common.entity.AlarmNotification;
5 |
6 | import java.util.List;
7 |
8 | public interface NotificationPlugin extends Plugin {
9 |
10 | void send(List notifications);
11 | }
12 |
--------------------------------------------------------------------------------
/lighthouse-core/src/main/java/com/dtstep/lighthouse/core/plugins/Plugin.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.core.plugins;
2 |
3 | public interface Plugin {
4 |
5 | String getName();
6 |
7 | void initialize();
8 | }
9 |
--------------------------------------------------------------------------------
/lighthouse-core/src/main/java/com/dtstep/lighthouse/core/plugins/StatAlarmPlugin.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.core.plugins;
2 |
3 | import com.dtstep.lighthouse.common.entity.stat.StatExtEntity;
4 |
5 | public interface StatAlarmPlugin extends Plugin {
6 |
7 | void trigger(StatExtEntity statExtEntity, long batchTime, String dimensValue);
8 | }
9 |
--------------------------------------------------------------------------------
/lighthouse-core/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/lighthouse-core/src/test/java/com/dtstep/lighthouse/core/test/CoreBaseTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.core.test;
2 |
3 | import com.dtstep.lighthouse.client.LightHouse;
4 | import com.dtstep.lighthouse.core.config.LDPConfig;
5 |
6 | public class CoreBaseTest {
7 |
8 | static {
9 | try{
10 | LDPConfig.initWithHomePath("/Users/xueling/lighthouse");
11 | LightHouse.init(LDPConfig.getVal(LDPConfig.KEY_LIGHTHOUSE_ICE_LOCATORS));
12 | }catch (Exception ex){
13 | ex.printStackTrace();
14 | }
15 |
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lighthouse-core/src/test/java/com/dtstep/lighthouse/core/test/config/TestLDPConfig.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.core.test.config;
2 |
3 | import com.dtstep.lighthouse.core.config.LDPConfig;
4 | import org.junit.Test;
5 |
6 | public class TestLDPConfig {
7 |
8 | @Test
9 | public void testLoadConfig() throws Exception {
10 | LDPConfig.init("/Users/xueling/lighthouse/conf/ldp-site-standalone.xml");
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lighthouse-core/src/test/java/com/dtstep/lighthouse/core/test/redisson/RedissonTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.core.test.redisson;
2 |
3 | import com.dtstep.lighthouse.core.config.LDPConfig;
4 | import com.dtstep.lighthouse.core.lock.RedissonLock;
5 | import org.junit.Test;
6 |
7 | import java.util.concurrent.TimeUnit;
8 |
9 | public class RedissonTest {
10 |
11 | static {
12 | try{
13 | LDPConfig.initWithHomePath("/Users/xueling/lighthouse");
14 | }catch (Exception ex){
15 | ex.printStackTrace();
16 | }
17 | }
18 |
19 | @Test
20 | public void testLock() throws Exception {
21 | String key = "test123";
22 | boolean is = RedissonLock.tryLock(key,0,5, TimeUnit.SECONDS);
23 | if(is){
24 | try{
25 | System.out.println("get lock!");
26 | }catch (Exception ex){
27 | ex.printStackTrace();
28 | RedissonLock.unLock(key);
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/lighthouse-core/src/test/java/com/dtstep/lighthouse/core/test/template/TestTemplate.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.core.test.template;
2 |
3 | import com.dtstep.lighthouse.core.test.CoreBaseTest;
4 | import org.junit.Test;
5 |
6 | public class TestTemplate extends CoreBaseTest {
7 |
8 | @Test
9 | public void testTemplate() throws Exception {
10 | String template = "";
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/lighthouse-core/src/test/java/com/dtstep/lighthouse/core/test/track/TrackTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.core.test.track;
2 |
3 | import com.dtstep.lighthouse.core.config.LDPConfig;
4 | import org.junit.Test;
5 |
6 | public class TrackTest {
7 |
8 | static {
9 | try{
10 | LDPConfig.initWithHomePath("/Users/xueling/lighthouse");
11 | }catch (Exception ex){
12 | ex.printStackTrace();
13 | }
14 | }
15 |
16 | @Test
17 | public void testScanMessage() throws Exception {
18 | int groupId = 100288;
19 | int statId = 1100520;
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lighthouse-core/src/test/java/com/dtstep/lighthouse/core/test/utils/CMDBUtilTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.core.test.utils;
2 |
3 | import com.dtstep.lighthouse.core.test.CoreBaseTest;
4 | import com.dtstep.lighthouse.core.tools.CMDBUtil;
5 | import org.junit.Test;
6 |
7 | public class CMDBUtilTest extends CoreBaseTest {
8 |
9 | @Test
10 | public void testAddColumn() throws Exception {
11 | System.out.println("add column start!");
12 | CMDBUtil.addColumnIfNotExist("ldp_relations","extend2","MEDIUMTEXT");
13 | System.out.println("add column end!");
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/lighthouse-core/src/test/java/com/dtstep/lighthouse/core/test/wrapper/CallerDBWrapperTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.core.test.wrapper;
2 |
3 | import com.dtstep.lighthouse.common.modal.Caller;
4 | import com.dtstep.lighthouse.common.util.JsonUtil;
5 | import com.dtstep.lighthouse.core.test.CoreBaseTest;
6 | import com.dtstep.lighthouse.core.wrapper.CallerDBWrapper;
7 | import org.junit.Test;
8 |
9 | public class CallerDBWrapperTest extends CoreBaseTest {
10 |
11 | @Test
12 | public void testQueryByName() throws Exception {
13 | String callerName = "caller:wuxian_test_demo2";
14 | for(int i=0;i<100;i++){
15 | Caller caller = CallerDBWrapper.queryByName(callerName);
16 | System.out.println(caller);
17 | System.out.println("caller:" + JsonUtil.toJSONString(caller));
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lighthouse-core/src/test/java/com/dtstep/lighthouse/core/test/wrapper/PermissionDBWrapperTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.core.test.wrapper;
2 |
3 | import com.dtstep.lighthouse.common.enums.OwnerTypeEnum;
4 | import com.dtstep.lighthouse.common.enums.ResourceTypeEnum;
5 | import com.dtstep.lighthouse.common.modal.Role;
6 | import com.dtstep.lighthouse.common.util.JsonUtil;
7 | import com.dtstep.lighthouse.core.test.CoreBaseTest;
8 | import com.dtstep.lighthouse.core.wrapper.PermissionDBWrapper;
9 | import com.dtstep.lighthouse.core.wrapper.RoleDBWrapper;
10 | import org.junit.Test;
11 |
12 | public class PermissionDBWrapperTest extends CoreBaseTest {
13 |
14 | @Test
15 | public void testHasPermission() throws Exception {
16 | for(int i=0;i<100;i++){
17 | boolean is = PermissionDBWrapper.hasPermission(11033, OwnerTypeEnum.CALLER,1224);
18 | System.out.println("is:" + is);
19 | }
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/lighthouse-core/src/test/java/com/dtstep/lighthouse/core/test/wrapper/RoleDBWrapperTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.core.test.wrapper;
2 |
3 | import com.dtstep.lighthouse.common.enums.ResourceTypeEnum;
4 | import com.dtstep.lighthouse.common.modal.Role;
5 | import com.dtstep.lighthouse.common.util.JsonUtil;
6 | import com.dtstep.lighthouse.core.test.CoreBaseTest;
7 | import com.dtstep.lighthouse.core.wrapper.RoleDBWrapper;
8 | import org.junit.Test;
9 |
10 | public class RoleDBWrapperTest extends CoreBaseTest {
11 |
12 | @Test
13 | public void testQueryByName() throws Exception {
14 | Role role = RoleDBWrapper.queryAccessRoleByResource(1100607, ResourceTypeEnum.Stat);
15 | System.out.println("role is:" + JsonUtil.toJSONString(role));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lighthouse-core/src/test/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/lighthouse-ice/src/main/resources/assembly.xml:
--------------------------------------------------------------------------------
1 |
2 | deploy
3 |
4 | tar.gz
5 |
6 |
7 |
8 | lib
9 | runtime
10 |
11 | ${groupId}:${artifactId}
12 |
13 |
14 |
15 |
16 |
17 | src/main/resources
18 |
19 | assembly.xml
20 |
21 | /
22 |
23 |
24 | ${project.build.directory}
25 | /
26 |
27 | *.jar
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/lighthouse-ice/src/test/java/com/dtstep/lighthouse/ice/test/servant/rpc/http/CoreBaseTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.ice.test.servant.rpc.http;
2 |
3 | import com.dtstep.lighthouse.client.LightHouse;
4 | import com.dtstep.lighthouse.core.config.LDPConfig;
5 |
6 | public class CoreBaseTest {
7 |
8 | static {
9 | try{
10 | LDPConfig.initWithHomePath("/Users/xueling/lighthouse");
11 | LightHouse.init(LDPConfig.getVal(LDPConfig.KEY_LIGHTHOUSE_ICE_LOCATORS));
12 | }catch (Exception ex){
13 | ex.printStackTrace();
14 | }
15 |
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lighthouse-ice/src/test/java/com/dtstep/lighthouse/ice/test/servant/rpc/http/TestStartHttpService.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.ice.test.servant.rpc.http;
2 |
3 | import com.dtstep.lighthouse.core.http.LightHouseHttpService;
4 | import org.junit.Test;
5 |
6 | public class TestStartHttpService extends CoreBaseTest {
7 |
8 | @Test
9 | public void testDataQuery() throws Exception {
10 | new LightHouseHttpService().start();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/config/CallerKeyAuthenticationToken.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.config;
2 |
3 | import org.springframework.security.authentication.AbstractAuthenticationToken;
4 |
5 | public class CallerKeyAuthenticationToken extends AbstractAuthenticationToken {
6 |
7 | private final Integer callerId;
8 |
9 | private final String callerKey;
10 |
11 | public CallerKeyAuthenticationToken(Integer callerId, String callerKey) {
12 | super(null);
13 | this.callerId = callerId;
14 | this.callerKey = callerKey;
15 | setAuthenticated(true);
16 | }
17 |
18 | @Override
19 | public Object getCredentials() {
20 | return callerKey;
21 | }
22 |
23 | @Override
24 | public Object getPrincipal() {
25 | return callerId;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/controller/annotation/AllowCallerAccess.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.controller.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Target(ElementType.METHOD)
9 | @Retention(RetentionPolicy.RUNTIME)
10 | public @interface AllowCallerAccess {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dao/AlarmDao.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dao;
2 |
3 | import com.dtstep.lighthouse.common.modal.Alarm;
4 | import com.dtstep.lighthouse.common.modal.AlarmQueryParam;
5 | import org.apache.ibatis.annotations.Param;
6 | import org.springframework.stereotype.Repository;
7 |
8 | import java.util.List;
9 |
10 | @Repository
11 | public interface AlarmDao {
12 |
13 | int insert(Alarm alarm);
14 |
15 | int update(Alarm alarm);
16 |
17 | int deleteById(Integer id);
18 |
19 | Alarm queryById(Integer id);
20 |
21 | Alarm queryByParam(@Param("queryParam")AlarmQueryParam queryParam);
22 |
23 | int countByParam(@Param("queryParam")AlarmQueryParam queryParam);
24 |
25 | List queryList(@Param("queryParam")AlarmQueryParam queryParam);
26 | }
27 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dao/AlarmTemplateDao.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dao;
2 |
3 | import com.dtstep.lighthouse.common.modal.AlarmTemplate;
4 | import org.springframework.stereotype.Repository;
5 |
6 | import java.util.List;
7 |
8 | @Repository
9 | public interface AlarmTemplateDao {
10 |
11 | int insert(AlarmTemplate caller);
12 |
13 | int update(AlarmTemplate caller);
14 |
15 | int deleteById(Integer id);
16 |
17 | AlarmTemplate queryById(Integer id);
18 |
19 | List queryByUserId(Integer userId);
20 |
21 | int countByUserId(Integer userId);
22 | }
23 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dao/CallerDao.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dao;
2 |
3 | import com.dtstep.lighthouse.common.modal.Caller;
4 | import com.dtstep.lighthouse.common.modal.CallerQueryParam;
5 | import org.apache.ibatis.annotations.Param;
6 | import org.springframework.stereotype.Repository;
7 | import java.util.List;
8 |
9 | @Repository
10 | public interface CallerDao {
11 |
12 | int insert(Caller caller);
13 |
14 | int update(Caller caller);
15 |
16 | int deleteById(Integer id);
17 |
18 | Caller queryById(Integer id);
19 |
20 | int count(@Param("queryParam") CallerQueryParam queryParam);
21 |
22 | List queryList(@Param("queryParam") CallerQueryParam queryParam);
23 |
24 | String getSecretKey(Integer id);
25 | }
26 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dao/NotificationDao.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dao;
2 |
3 | import com.dtstep.lighthouse.common.modal.Notification;
4 | import com.dtstep.lighthouse.insights.dto.NotificationQueryParam;
5 | import org.apache.ibatis.annotations.Param;
6 | import org.springframework.stereotype.Repository;
7 |
8 | import java.util.List;
9 |
10 | @Repository
11 | public interface NotificationDao {
12 |
13 | int insert(Notification notification);
14 |
15 | List queryList(@Param("queryParam")NotificationQueryParam queryParam);
16 | }
17 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dao/RollbackDao.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dao;
2 |
3 | import com.dtstep.lighthouse.common.enums.RollbackTypeEnum;
4 | import com.dtstep.lighthouse.common.modal.RollbackModal;
5 | import com.dtstep.lighthouse.insights.dto.RollbackQueryParam;
6 | import org.apache.ibatis.annotations.Param;
7 | import org.springframework.stereotype.Repository;
8 |
9 | import java.util.List;
10 |
11 | @Repository
12 | public interface RollbackDao {
13 |
14 | int insert(RollbackModal rollbackModal);
15 |
16 | Integer getLatestVersion(Integer resourceId, RollbackTypeEnum rollbackTypeEnum) throws Exception;
17 |
18 | RollbackModal queryByVersion(@Param("queryParam")RollbackQueryParam queryParam) throws Exception;
19 |
20 | List queryVersionList(@Param("queryParam")RollbackQueryParam queryParam) throws Exception;
21 |
22 | Integer update(RollbackModal rollbackModal);
23 | }
24 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dao/ViewDao.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dao;
2 |
3 | import com.dtstep.lighthouse.common.modal.View;
4 | import com.dtstep.lighthouse.common.modal.ViewQueryParam;
5 | import org.apache.ibatis.annotations.Param;
6 | import org.springframework.stereotype.Repository;
7 |
8 | import java.util.List;
9 |
10 | @Repository
11 | public interface ViewDao {
12 |
13 | int insert(View view);
14 |
15 | int update(View view);
16 |
17 | int deleteById(Integer id);
18 |
19 | View queryById(Integer id);
20 |
21 | List queryList(@Param("queryParam") ViewQueryParam queryParam);
22 | }
23 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dto/AlarmTestingParam.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dto;
2 |
3 | import com.dtstep.lighthouse.common.enums.LanguageEnum;
4 |
5 | import javax.validation.constraints.NotNull;
6 | import java.io.Serializable;
7 |
8 | public class AlarmTestingParam implements Serializable {
9 |
10 | @NotNull
11 | private String server;
12 |
13 | private LanguageEnum lang = LanguageEnum.CHINESE;
14 |
15 | public String getServer() {
16 | return server;
17 | }
18 |
19 | public void setServer(String server) {
20 | this.server = server;
21 | }
22 |
23 | public LanguageEnum getLang() {
24 | return lang;
25 | }
26 |
27 | public void setLang(LanguageEnum lang) {
28 | this.lang = lang;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dto/CommonlyFilterConfigParam.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dto;
2 |
3 | import java.io.Serializable;
4 | import java.util.LinkedHashMap;
5 |
6 | public class CommonlyFilterConfigParam implements Serializable {
7 |
8 | private String key;
9 |
10 | private Integer statId;
11 |
12 | private LinkedHashMap filters;
13 |
14 | public String getKey() {
15 | return key;
16 | }
17 |
18 | public void setKey(String key) {
19 | this.key = key;
20 | }
21 |
22 | public LinkedHashMap getFilters() {
23 | return filters;
24 | }
25 |
26 | public void setFilters(LinkedHashMap filters) {
27 | this.filters = filters;
28 | }
29 |
30 | public Integer getStatId() {
31 | return statId;
32 | }
33 |
34 | public void setStatId(Integer statId) {
35 | this.statId = statId;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dto/CommonlyFilterRemoveParam.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dto;
2 |
3 | import java.io.Serializable;
4 |
5 | public class CommonlyFilterRemoveParam implements Serializable {
6 |
7 | private Integer statId;
8 |
9 | private String key;
10 |
11 | public Integer getStatId() {
12 | return statId;
13 | }
14 |
15 | public void setStatId(Integer statId) {
16 | this.statId = statId;
17 | }
18 |
19 | public String getKey() {
20 | return key;
21 | }
22 |
23 | public void setKey(String key) {
24 | this.key = key;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dto/DimensValueDeleteParam.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dto;
2 |
3 | import java.io.Serializable;
4 |
5 | public class DimensValueDeleteParam implements Serializable {
6 |
7 | private Integer groupId;
8 |
9 | private String dimens;
10 |
11 | private String dimensValue;
12 |
13 | public Integer getGroupId() {
14 | return groupId;
15 | }
16 |
17 | public void setGroupId(Integer groupId) {
18 | this.groupId = groupId;
19 | }
20 |
21 | public String getDimens() {
22 | return dimens;
23 | }
24 |
25 | public void setDimens(String dimens) {
26 | this.dimens = dimens;
27 | }
28 |
29 | public String getDimensValue() {
30 | return dimensValue;
31 | }
32 |
33 | public void setDimensValue(String dimensValue) {
34 | this.dimensValue = dimensValue;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dto/FilterQueryParam.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dto;
2 |
3 | public class FilterQueryParam {
4 |
5 | private String search;
6 |
7 | private String token;
8 |
9 | public String getToken() {
10 | return token;
11 | }
12 |
13 | public void setToken(String token) {
14 | this.token = token;
15 | }
16 |
17 | public String getSearch() {
18 | return search;
19 | }
20 |
21 | public void setSearch(String search) {
22 | this.search = search;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dto/GroupDimensQueryParam.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dto;
2 |
3 | import java.io.Serializable;
4 |
5 | public class GroupDimensQueryParam implements Serializable {
6 |
7 | private Integer groupId;
8 |
9 | private String dimens;
10 |
11 | public Integer getGroupId() {
12 | return groupId;
13 | }
14 |
15 | public void setGroupId(Integer groupId) {
16 | this.groupId = groupId;
17 | }
18 |
19 | public String getDimens() {
20 | return dimens;
21 | }
22 |
23 | public void setDimens(String dimens) {
24 | this.dimens = dimens;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dto/RollbackCreateParam.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dto;
2 |
3 | import javax.validation.constraints.NotNull;
4 |
5 | public class RollbackCreateParam {
6 |
7 | @NotNull
8 | private Integer id;
9 |
10 | @NotNull
11 | private Object config;
12 |
13 | public Integer getId() {
14 | return id;
15 | }
16 |
17 | public void setId(Integer id) {
18 | this.id = id;
19 | }
20 |
21 | public Object getConfig() {
22 | return config;
23 | }
24 |
25 | public void setConfig(Object config) {
26 | this.config = config;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dto/RollbackQueryParam.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dto;
2 |
3 | import com.dtstep.lighthouse.common.enums.RollbackTypeEnum;
4 |
5 | public class RollbackQueryParam {
6 |
7 | private Integer resourceId;
8 |
9 | private RollbackTypeEnum dataType;
10 |
11 | private Integer version;
12 |
13 | public Integer getResourceId() {
14 | return resourceId;
15 | }
16 |
17 | public void setResourceId(Integer resourceId) {
18 | this.resourceId = resourceId;
19 | }
20 |
21 | public RollbackTypeEnum getDataType() {
22 | return dataType;
23 | }
24 |
25 | public void setDataType(RollbackTypeEnum dataType) {
26 | this.dataType = dataType;
27 | }
28 |
29 | public Integer getVersion() {
30 | return version;
31 | }
32 |
33 | public void setVersion(Integer version) {
34 | this.version = version;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dto/ViewInfoQueryParam.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dto;
2 |
3 | import java.io.Serializable;
4 |
5 | public class ViewInfoQueryParam implements Serializable {
6 |
7 | private String from = "preview";
8 |
9 | private Integer id;
10 |
11 | private Integer version;
12 |
13 | public String getFrom() {
14 | return from;
15 | }
16 |
17 | public void setFrom(String from) {
18 | this.from = from;
19 | }
20 |
21 | public Integer getId() {
22 | return id;
23 | }
24 |
25 | public void setId(Integer id) {
26 | this.id = id;
27 | }
28 |
29 | public Integer getVersion() {
30 | return version;
31 | }
32 |
33 | public void setVersion(Integer version) {
34 | this.version = version;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/dto/ViewPublishParam.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.dto;
2 |
3 | public class ViewPublishParam {
4 |
5 | private Integer id;
6 |
7 | private Integer version;
8 |
9 | public Integer getId() {
10 | return id;
11 | }
12 |
13 | public void setId(Integer id) {
14 | this.id = id;
15 | }
16 |
17 | public Integer getVersion() {
18 | return version;
19 | }
20 |
21 | public void setVersion(Integer version) {
22 | this.version = version;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/service/FilterService.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.service;
2 |
3 | import com.dtstep.lighthouse.common.entity.ListData;
4 | import com.dtstep.lighthouse.common.modal.RenderFilterConfig;
5 | import com.dtstep.lighthouse.insights.dto.FilterQueryParam;
6 | import com.dtstep.lighthouse.insights.dto.StatFilterConfigParam;
7 |
8 | public interface FilterService {
9 |
10 | ListData queryDefaultList(String token, Integer pageNum, Integer pageSize) throws Exception;
11 |
12 | ListData queryCustomList(FilterQueryParam queryParam, Integer pageNum, Integer pageSize) throws Exception;
13 | }
14 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/service/RollbackService.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.service;
2 |
3 | import com.dtstep.lighthouse.common.modal.RollbackModal;
4 | import com.dtstep.lighthouse.insights.dto.RollbackQueryParam;
5 | import com.fasterxml.jackson.databind.node.ObjectNode;
6 |
7 | import java.util.List;
8 |
9 | public interface RollbackService {
10 |
11 | ObjectNode put(RollbackModal rollbackModal) throws Exception;
12 |
13 | RollbackModal queryByVersion(RollbackQueryParam queryParam) throws Exception;
14 |
15 | List queryVersionList(RollbackQueryParam queryParam) throws Exception;
16 | }
17 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/service/ViewService.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.service;
2 |
3 | import com.dtstep.lighthouse.insights.vo.ProjectVO;
4 | import com.dtstep.lighthouse.insights.vo.ViewVO;
5 |
6 | import java.util.List;
7 |
8 | public interface ViewService {
9 |
10 | ViewVO queryById(Integer id);
11 |
12 | List queryByIds(List ids);
13 | }
14 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/vo/AlarmVO.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.vo;
2 |
3 | import com.dtstep.lighthouse.common.modal.Alarm;
4 | import com.dtstep.lighthouse.common.util.BeanCopyUtil;
5 |
6 | public class AlarmVO extends Alarm {
7 |
8 | private Object extend;
9 |
10 | public AlarmVO(){}
11 |
12 | public AlarmVO(Alarm alarm){
13 | assert alarm != null;
14 | BeanCopyUtil.copy(alarm,this);
15 | }
16 |
17 | public Object getExtend() {
18 | return extend;
19 | }
20 |
21 | public void setExtend(Object extend) {
22 | this.extend = extend;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/vo/ExportVO.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.vo;
2 |
3 | import java.io.Serializable;
4 |
5 | public class ExportVO implements Serializable {
6 |
7 | private String filename;
8 |
9 | private String content;
10 |
11 | public String getFilename() {
12 | return filename;
13 | }
14 |
15 | public void setFilename(String filename) {
16 | this.filename = filename;
17 | }
18 |
19 | public String getContent() {
20 | return content;
21 | }
22 |
23 | public void setContent(String content) {
24 | this.content = content;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/vo/NotificationVO.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.vo;
2 |
3 | import com.dtstep.lighthouse.common.modal.Notification;
4 | import com.dtstep.lighthouse.common.util.BeanCopyUtil;
5 |
6 | public class NotificationVO extends Notification {
7 |
8 | private Object extend;
9 |
10 | public NotificationVO(Notification notification){
11 | assert notification != null;
12 | BeanCopyUtil.copy(notification,this);
13 | }
14 |
15 | public Object getExtend() {
16 | return extend;
17 | }
18 |
19 | public void setExtend(Object extend) {
20 | this.extend = extend;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/java/com/dtstep/lighthouse/insights/vo/VersionVO.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.vo;
2 |
3 | import java.io.Serializable;
4 | import java.time.LocalDateTime;
5 |
6 | public class VersionVO implements Serializable {
7 |
8 | private Integer resourceId;
9 |
10 | private Integer version;
11 |
12 | private LocalDateTime createTime;
13 |
14 | public Integer getResourceId() {
15 | return resourceId;
16 | }
17 |
18 | public void setResourceId(Integer resourceId) {
19 | this.resourceId = resourceId;
20 | }
21 |
22 | public Integer getVersion() {
23 | return version;
24 | }
25 |
26 | public void setVersion(Integer version) {
27 | this.version = version;
28 | }
29 |
30 | public LocalDateTime getCreateTime() {
31 | return createTime;
32 | }
33 |
34 | public void setCreateTime(LocalDateTime createTime) {
35 | this.createTime = createTime;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/resources/i18n/messages.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xl-xueling/xl-lighthouse/ee56445ae885d7e429d1759b3a432b37a0265221/lighthouse-insights/src/main/resources/i18n/messages.properties
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/resources/light-insights/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | #npm run pre-commit
5 | #npm run pre-commit
6 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/resources/lighthouse-insights.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 9089
3 | servlet:
4 | context-path: /api/v1
5 | session:
6 | timeout: 18000
7 | tomcat:
8 | uri-encoding: utf-8
9 | spring:
10 | messages:
11 | basename: i18n/messages
12 | mvc:
13 | locale-resolver: fixed
14 | locale: en_US
15 | static-path-pattern: /static/**
16 | hiddenmethod:
17 | filter:
18 | enabled: true
19 | main:
20 | allow-circular-references: true
21 | devtools:
22 | restart:
23 | enabled: false
24 | thymeleaf:
25 | cache: false
26 | cache:
27 | redis:
28 | time-to-live: 86400000
29 | mybatis:
30 | config-location: classpath:mybatis-config.xml
31 | mapper-locations:
32 | - classpath*:mybatis/mapper/*.xml
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/main/resources/mybatis-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/test/java/com/dtstep/lighthouse/insights/test/components/ComponentUtil.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.test.components;
2 |
3 | import com.dtstep.lighthouse.common.modal.TreeNode;
4 | import com.dtstep.lighthouse.common.util.JsonUtil;
5 | import org.junit.Test;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | public class ComponentUtil {
11 |
12 | @Test
13 | public void testComponent() throws Exception {
14 | TreeNode treeNode1 = new TreeNode("北京","1");
15 | TreeNode treeNode2 = new TreeNode("上海","2");
16 | List nodeList = new ArrayList<>();
17 | nodeList.add(treeNode1);
18 | nodeList.add(treeNode2);
19 | System.out.println("data:" + JsonUtil.toJSONString(nodeList));
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/test/java/com/dtstep/lighthouse/insights/test/dao/TestProjectDao.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.test.dao;
2 |
3 | import com.dtstep.lighthouse.insights.LightHouseInsightsApplication;
4 | import com.dtstep.lighthouse.insights.dao.ProjectDao;
5 | import com.dtstep.lighthouse.insights.dto.ProjectCreateParam;
6 | import com.dtstep.lighthouse.common.enums.PrivateTypeEnum;
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.boot.test.context.SpringBootTest;
11 | import org.springframework.test.context.junit4.SpringRunner;
12 |
13 | import java.time.LocalDateTime;
14 |
15 | @RunWith(SpringRunner.class)
16 | @SpringBootTest(classes = LightHouseInsightsApplication.class,properties = {"spring.config.location=classpath:lighthouse-insights.yml"})
17 | public class TestProjectDao {
18 |
19 | @Autowired
20 | private ProjectDao projectDao;
21 |
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/test/java/com/dtstep/lighthouse/insights/test/service/TestProjectService.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.test.service;
2 |
3 | import com.dtstep.lighthouse.insights.LightHouseInsightsApplication;
4 | import com.dtstep.lighthouse.insights.dto.ProjectCreateParam;
5 | import com.dtstep.lighthouse.common.enums.PrivateTypeEnum;
6 | import com.dtstep.lighthouse.insights.service.ProjectService;
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.boot.test.context.SpringBootTest;
11 | import org.springframework.test.context.junit4.SpringRunner;
12 |
13 | import java.time.LocalDateTime;
14 |
15 | @RunWith(SpringRunner.class)
16 | @SpringBootTest(classes = LightHouseInsightsApplication.class,properties = {"spring.config.location=classpath:lighthouse-insights.yml"})
17 | public class TestProjectService {
18 |
19 | @Autowired
20 | private ProjectService projectService;
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/test/java/com/dtstep/lighthouse/insights/test/service/TestResultData.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.test.service;
2 |
3 | import com.dtstep.lighthouse.insights.LightHouseInsightsApplication;
4 | import org.junit.Test;
5 | import org.junit.runner.RunWith;
6 | import org.springframework.boot.test.context.SpringBootTest;
7 | import org.springframework.test.context.junit4.SpringRunner;
8 |
9 | @RunWith(SpringRunner.class)
10 | @SpringBootTest(classes = LightHouseInsightsApplication.class,properties = {"spring.config.location=classpath:lighthouse-insights.yml"})
11 | public class TestResultData {
12 |
13 | @Test
14 | public void testMessage(){
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/test/java/com/dtstep/lighthouse/insights/test/utils/TestAviator.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.test.utils;
2 |
3 | import com.dtstep.lighthouse.common.entity.state.StatState;
4 | import com.dtstep.lighthouse.core.expression.embed.AviatorHandler;
5 | import com.dtstep.lighthouse.core.formula.FormulaCalculate;
6 | import com.dtstep.lighthouse.core.formula.FormulaTranslate;
7 | import org.apache.commons.lang3.tuple.Pair;
8 | import org.junit.Test;
9 |
10 | import java.util.HashMap;
11 | import java.util.List;
12 | import java.util.Map;
13 | import java.util.UUID;
14 |
15 | public class TestAviator {
16 |
17 | @Test
18 | public void testFormula() throws Exception {
19 | String formula = "'userId'";
20 | Map envMap = new HashMap<>();
21 | envMap.put("userId", UUID.randomUUID().toString());
22 | Object obj = AviatorHandler.execute(formula,envMap);
23 | System.out.println("obj:" + obj);
24 | }
25 | }
26 |
27 |
28 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/test/java/com/dtstep/lighthouse/insights/test/utils/TestDateUtil.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.test.utils;
2 |
3 | import com.dtstep.lighthouse.common.util.DateUtil;
4 | import com.dtstep.lighthouse.core.batch.BatchAdapter;
5 | import org.junit.Test;
6 |
7 | import java.time.Instant;
8 | import java.time.LocalDateTime;
9 | import java.time.ZoneId;
10 | import java.util.List;
11 | import java.util.concurrent.TimeUnit;
12 |
13 | public class TestDateUtil {
14 |
15 | @Test
16 | public void test() throws Exception {
17 | long t = TimeUnit.DAYS.toSeconds(7);
18 | System.out.println("t:" + t);
19 | }
20 |
21 | @Test
22 | public void testBatchTime() throws Exception {
23 | long t1 = 1704902400000L;
24 | long t2 = 1704988800000L;
25 | LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(t1), ZoneId.systemDefault());
26 | System.out.println("localDateTime:" + localDateTime);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/test/java/com/dtstep/lighthouse/insights/test/utils/TestMd5Util.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.test.utils;
2 |
3 | import com.dtstep.lighthouse.common.entity.group.GroupVerifyEntity;
4 | import com.dtstep.lighthouse.common.lru.Cache;
5 | import com.dtstep.lighthouse.common.lru.LRU;
6 | import com.dtstep.lighthouse.common.util.Md5Util;
7 | import com.dtstep.lighthouse.core.batch.BatchAdapter;
8 | import org.junit.Test;
9 |
10 | import java.util.Optional;
11 | import java.util.UUID;
12 | import java.util.concurrent.TimeUnit;
13 |
14 | public class TestMd5Util {
15 |
16 | private static final Cache cacheHolder = LRU.newBuilder().maximumSize(5000).expireAfterWrite(2, TimeUnit.MINUTES).softValues().build();
17 |
18 | @Test
19 | public void test() throws Exception {
20 | String md5 = Md5Util.getMD5(null);
21 | System.out.println(md5);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/test/java/com/dtstep/lighthouse/insights/test/utils/TestPattern.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.test.utils;
2 |
3 | import org.junit.Test;
4 |
5 | import java.util.regex.Pattern;
6 |
7 | public class TestPattern {
8 |
9 | @Test
10 | public void testPattern() {
11 | String s = "^[\\u3010\\u3011\\uFF08\\uFF09\\u4E00-\\u9FA5a-zA-Z0-9_()()【】 \\[\\]#\\s]+$";
12 | String str = "你好()【体验部】用户增长中心";
13 | boolean is = Pattern.compile(s).matcher(str).matches();
14 | System.out.println("is:" + is);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lighthouse-insights/src/test/java/com/dtstep/lighthouse/insights/test/utils/TestPbkdfUtil.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.insights.test.utils;
2 |
3 | import org.junit.Test;
4 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
5 | import org.springframework.security.crypto.password.Pbkdf2PasswordEncoder;
6 |
7 | public class TestPbkdfUtil {
8 |
9 | @Test
10 | public void testPbkdf() throws Exception{
11 | String s = "123456";
12 | // String res1 = new Pbkdf2PasswordEncoder().encode(s);
13 | // System.out.println("result:" + res1);
14 | // String res2 = new BCryptPasswordEncoder(10).encode(s);
15 | // System.out.println("result:" + res2);
16 |
17 | boolean is = new BCryptPasswordEncoder().matches(s,"$2a$10$dSBuhvzQCzK9F1LJzMoh8Ob.0glRQ8tC4VkOOupMCdzwEmYnFc6Bi");
18 | System.out.println("is:" + is);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lighthouse-shaded-client/src/main/java/com/dtstep/lighthouse/client/shade/Shade.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.client.shade;
2 |
3 | /*
4 | * Copyright (C) 2022-2024 XueLing.雪灵
5 | * Licensed to the Apache Software Foundation (ASF) under one or more
6 | * contributor license agreements. See the NOTICE file distributed with
7 | * this work for additional information regarding copyright ownership.
8 | * The ASF licenses this file to You under the Apache License, Version 2.0
9 | * (the "License"); you may not use this file except in compliance with
10 | * the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | public class Shade {
21 | }
22 |
--------------------------------------------------------------------------------
/lighthouse-standalone/src/main/java/com/dtstep/lighthouse/standalone/executive/LightStandaloneEntrance.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.standalone.executive;
2 |
3 | import com.dtstep.lighthouse.common.exception.InitializationException;
4 | import com.dtstep.lighthouse.core.config.LDPConfig;
5 | import com.dtstep.lighthouse.core.http.LightHouseHttpService;
6 | import org.slf4j.Logger;
7 | import org.slf4j.LoggerFactory;
8 |
9 | public class LightStandaloneEntrance {
10 |
11 | private static final Logger logger = LoggerFactory.getLogger(LightStandaloneEntrance.class);
12 |
13 | public static void main(String [] args) throws Exception {
14 | try{
15 | LDPConfig.loadConfiguration();
16 | }catch (Exception ex){
17 | logger.error("standalone service initialization error!",ex);
18 | throw new InitializationException();
19 | }
20 | new Thread(LightHouseHttpService::start).start();
21 | new Thread(LightStandaloneService::start).start();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lighthouse-standalone/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/lighthouse-tasks/src/main/resources/assembly.xml:
--------------------------------------------------------------------------------
1 |
2 | deploy
3 |
4 | tar.gz
5 |
6 |
7 |
8 | lib
9 | runtime
10 |
11 | ${groupId}:${artifactId}
12 |
13 |
14 |
15 |
16 |
17 | src/main/resources
18 |
19 | assembly.xml
20 |
21 | /
22 |
23 |
24 | ${project.build.directory}
25 | /
26 |
27 | *.jar
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/lighthouse-tasks/src/main/test/com/dtstep/lighthouse/tasks/test/HBaseStorageEngineTest.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.tasks.test;
2 |
3 | import com.dtstep.lighthouse.core.config.LDPConfig;
4 | import com.dtstep.lighthouse.core.storage.warehouse.StorageEngineProxy;
5 | import org.junit.Test;
6 |
7 | public class HBaseStorageEngineTest {
8 |
9 | @Test
10 | public void testCreateNamespace() throws Exception {
11 | LDPConfig.loadConfiguration();
12 | System.out.println("---11");
13 | StorageEngineProxy.getInstance().createNamespaceIfNotExist("sss");
14 | System.out.println("ss");
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lighthouse-test/src/main/java/com/dtstep/lighthouse/test/mode/OmDauPromoteMonitor.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.test.mode;
2 |
3 | import com.dtstep.lighthouse.test.local.LocalUtil;
4 |
5 | import java.util.HashMap;
6 | import java.util.concurrent.ThreadLocalRandom;
7 |
8 | public class OmDauPromoteMonitor implements SimulationModalSample>{
9 |
10 | @Override
11 | public HashMap generateSample() throws Exception {
12 | HashMap paramMap = new HashMap<>();
13 | paramMap.put("imei","imei_"+ ThreadLocalRandom.current().nextInt(1,100000));
14 | LocalUtil.LocalEntity city = LocalUtil.getRandomCity();
15 | LocalUtil.LocalEntity province = LocalUtil.getById(city.getPid());
16 | paramMap.put("province",province.getId());
17 | paramMap.put("city",city.getId());
18 | paramMap.put("from",ThreadLocalRandom.current().nextInt(1,10));
19 | return paramMap;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lighthouse-test/src/main/java/com/dtstep/lighthouse/test/mode/RDShortRecallCostSample.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.test.mode;
2 |
3 | import com.dtstep.lighthouse.common.random.RandomID;
4 |
5 | import java.util.HashMap;
6 | import java.util.concurrent.ThreadLocalRandom;
7 |
8 | public class RDShortRecallCostSample implements SimulationModalSample> {
9 |
10 | @Override
11 | public HashMap generateSample() throws Exception {
12 | HashMap paramMap = new HashMap<>();
13 | paramMap.put("request_id", RandomID.id(32));
14 | paramMap.put("recall_no","recall_"+ ThreadLocalRandom.current().nextInt(1,100));
15 | paramMap.put("cost",ThreadLocalRandom.current().nextInt(5,300));
16 | return paramMap;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/lighthouse-test/src/main/java/com/dtstep/lighthouse/test/mode/RDShortVideoRecallSizeSample.java:
--------------------------------------------------------------------------------
1 | package com.dtstep.lighthouse.test.mode;
2 |
3 | import com.dtstep.lighthouse.common.random.RandomID;
4 |
5 | import java.util.HashMap;
6 | import java.util.concurrent.ThreadLocalRandom;
7 |
8 | public class RDShortVideoRecallSizeSample implements SimulationModalSample> {
9 |
10 | @Override
11 | public HashMap generateSample() throws Exception {
12 | HashMap paramMap = new HashMap<>();
13 | paramMap.put("request_id", RandomID.id(32));
14 | paramMap.put("recall_no","recall_" + ThreadLocalRandom.current().nextInt(1,100));
15 | paramMap.put("abtest_no","abtest_" + ThreadLocalRandom.current().nextInt(1,30));
16 | paramMap.put("item_size",ThreadLocalRandom.current().nextInt(5,10));
17 | return paramMap;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/lighthouse-test/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/plugins/hadoop-auth/hadoop-auth-ldp-3.3.5.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xl-xueling/xl-lighthouse/ee56445ae885d7e429d1759b3a432b37a0265221/plugins/hadoop-auth/hadoop-auth-ldp-3.3.5.jar
--------------------------------------------------------------------------------
/plugins/redis-roaring-2.0.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xl-xueling/xl-lighthouse/ee56445ae885d7e429d1759b3a432b37a0265221/plugins/redis-roaring-2.0.tar.gz
--------------------------------------------------------------------------------