|
|
@@ -43,6 +43,8 @@ import Profile from './HeaderContent/Profile'; |
|
|
|
import "assets/style/navbarStyles.css"; |
|
|
|
import { isUserLoggedIn, isGLDLoggedIn, isPrimaryLoggedIn } from "utils/Utils"; |
|
|
|
import { handleLogoutFunction } from 'auth/index'; |
|
|
|
import * as HttpUtils from "utils/HttpUtils"; |
|
|
|
import * as UrlUtils from "utils/ApiPathConst" |
|
|
|
|
|
|
|
// assets |
|
|
|
// import { MenuFoldOutlined,MenuOutlined } from '@ant-design/icons'; |
|
|
@@ -70,6 +72,34 @@ function Header(props) { |
|
|
|
navigate('/login'); |
|
|
|
}; |
|
|
|
|
|
|
|
const getXML = () => () => { |
|
|
|
HttpUtils.get({ |
|
|
|
url: UrlUtils.GEN_GFMIS_XML + "/today?online=true", |
|
|
|
params:{}, |
|
|
|
onSuccess: (responseData) => { |
|
|
|
console.log(responseData) |
|
|
|
const parser = new DOMParser(); |
|
|
|
const xmlDoc = parser.parseFromString(responseData, 'application/xml'); |
|
|
|
const filename = xmlDoc.querySelector('FileHeader').getAttribute('H_Filename'); |
|
|
|
const blob = new Blob([responseData], { type: 'application/xml' }); |
|
|
|
// Create a download link |
|
|
|
const link = document.createElement('a'); |
|
|
|
link.href = URL.createObjectURL(blob); |
|
|
|
link.download = filename+'.xml'; |
|
|
|
|
|
|
|
// Append the link to the document body |
|
|
|
document.body.appendChild(link); |
|
|
|
|
|
|
|
// Programmatically click the link to trigger the download |
|
|
|
link.click(); |
|
|
|
|
|
|
|
// Clean up the link |
|
|
|
document.body.removeChild(link); |
|
|
|
} |
|
|
|
}); |
|
|
|
// open(UrlUtils.GEN_GFMIS_XML + "/today?online=true") |
|
|
|
} |
|
|
|
|
|
|
|
const loginContent = ( |
|
|
|
isGLDLoggedIn() ? |
|
|
|
<div id="adminContent"> |
|
|
@@ -83,7 +113,15 @@ function Header(props) { |
|
|
|
<Link className="proof" to='/proof/search'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Proof</Typography></Link> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<Link className="payment" to='/paymentPage/search'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Payment</Typography></Link> |
|
|
|
<Link className="client" ><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Payment</Typography><KeyboardArrowDownIcon /></Link> |
|
|
|
<ul className='dropdown'> |
|
|
|
<li> |
|
|
|
<Link className="payment" to='/paymentPage/search'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Payment Record</Typography></Link> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<Link className="downloadXML" onClick={getXML()} ><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Download XML</Typography></Link> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<Link className="client" ><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Client</Typography><KeyboardArrowDownIcon /></Link> |
|
|
|